Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-chailove
Commits
bcbe88c6
Unverified
Commit
bcbe88c6
authored
Oct 07, 2018
by
RobLoach
Committed by
GitHub
Oct 07, 2018
Browse files
Merge pull request #328 from libretro/dev
0.28.0
parents
95918963
f9d414fb
Changes
28
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
bcbe88c6
...
...
@@ -4,6 +4,22 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
The format is based on
[
Keep a Changelog
](
http://keepachangelog.com/en/1.0.0/
)
and this project adheres to
[
Semantic Versioning
](
http://semver.org/spec/v2.0.0.html
)
.
## 0.28.0 - 2018-10-07
### Features
-
`love.timer.step()`
now returns
`dt`
-
Adds
`string::replace(search, replace)`
to replace all instances of a string
### Fixes
-
Fixes undefined reference to
`process_sinc_neon_asm()`
-
[
#322
](
https://github.com/libretro/libretro-chailove/issues/322
)
found by
[
@ToKe79
](
https://github.com/ToKe79
)
-
Fixes
`love.graphics.draw(image)`
with no x and y parameter
### Chores
-
Update libretro-common
-
Update PhysFS
-
Rework the testing framework
-
Fix Doxygen warnings
## 0.27.0 - 2018-09-25
### Features
-
Live updating of core options
...
...
README.md
View file @
bcbe88c6
...
...
@@ -115,4 +115,5 @@ The following individuals contributed to ChaiLove in some way:
-
[
@fetzerch
](
http://github.com/fetzerch
)
-
[
@bparker06
](
https://github.com/bparker06
)
-
[
@twinaphex
](
http://github.com/twinaphex
)
-
[
@ToKe79
](
https://github.com/ToKe79
)
-
[
@baxysquare
](
https://github.com/baxysquare
)
for the
[
Logo
](
docs/chailove.png
)
docs/Doxyfile
View file @
bcbe88c6
...
...
@@ -23,7 +23,7 @@ PROJECT_NAME = "ChaiLove API"
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = "0.2
7
.0"
PROJECT_NUMBER = "0.2
8
.0"
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
...
...
@@ -51,7 +51,7 @@ OUTPUT_LANGUAGE = English
# whereas setting the tag to NO uses a Unix-style encoding (the default for
# all platforms other than Windows).
USE_WINDOWS_ENCODING = NO
#
USE_WINDOWS_ENCODING = NO
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
...
...
@@ -120,7 +120,7 @@ MULTILINE_CPP_IS_BRIEF = NO
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
#
DETAILS_AT_TOP = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
...
...
@@ -270,7 +270,7 @@ SORT_MEMBER_DOCS = YES
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST =
YES
GENERATE_TODOLIST =
NO
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
...
...
@@ -288,7 +288,7 @@ GENERATE_BUGLIST = YES
# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST=
YES
GENERATE_DEPRECATEDLIST=
NO
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
...
...
@@ -483,7 +483,7 @@ VERBATIM_HEADERS = YES
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX =
NO
ALPHABETICAL_INDEX =
YES
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
...
...
@@ -542,7 +542,7 @@ HTML_STYLESHEET =
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
#
HTML_ALIGN_MEMBERS = YES
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
...
...
@@ -776,13 +776,13 @@ XML_OUTPUT = xml
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
#
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
#
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
...
...
@@ -1036,7 +1036,7 @@ DOTFILE_DIRS =
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_WIDTH = 1024
#
MAX_DOT_GRAPH_WIDTH = 1024
# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
# (in pixels) of the graphs generated by dot. If a graph becomes larger than
...
...
@@ -1044,7 +1044,7 @@ MAX_DOT_GRAPH_WIDTH = 1024
# the specified constraint. Beware that most browsers cannot cope with very
# large images.
MAX_DOT_GRAPH_HEIGHT = 1024
#
MAX_DOT_GRAPH_HEIGHT = 1024
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
...
...
examples/snake/Snake.chai
View file @
bcbe88c6
...
...
@@ -47,7 +47,7 @@ global T
def conf(t) {
t.window.width = WIDTH * gridScale
t.window.height = HEIGHT * gridScale
t.version = "0.2
7
.0"
t.version = "0.2
8
.0"
}
/**
...
...
src/ChaiLove.h
View file @
bcbe88c6
...
...
@@ -47,9 +47,9 @@
#define SRC_CHAILOVE_H_
#define CHAILOVE_VERSION_MAJOR 0
#define CHAILOVE_VERSION_MINOR 2
7
#define CHAILOVE_VERSION_MINOR 2
8
#define CHAILOVE_VERSION_PATCH 0
#define CHAILOVE_VERSION_STRING "0.2
7
.0"
#define CHAILOVE_VERSION_STRING "0.2
8
.0"
#include "SDL.h"
#include "libretro.h"
...
...
src/docs/
List
.h
→
src/docs/
Globals
.h
View file @
bcbe88c6
#ifndef SRC_CHAILOVEDOCS_H_
#define SRC_CHAILOVEDOCS_H_
/**
* @file Globals.h
* @page globals Globals
*
* This provides documentation about globals available through ChaiLove.
*/
#include <string>
/**
...
...
@@ -73,4 +80,26 @@ class List {
*/
bool
require
(
const
std
::
string
&
module
);
/**
* Provides some additional functionality to the basic string object.
*/
class
String
{
public:
/**
* Replaces all instances of the search string with the given replace string.
*
* @param search The string to search for that should be replaced.
* @param replace The string that will replace the found string.
*
* @return The new string with the replaced strings.
*
* @code
* var hello = "Hello World!"
* var goodbye = hello.replace("Hello", "Goodbye")
* // => "Goodbye World!"
* @endcode
*/
std
::
string
replace
(
const
std
::
string
&
search
,
const
std
::
string
&
replace
);
};
#endif // SRC_CHAILOVEDOCS_H_
src/love/filesystem.h
View file @
bcbe88c6
...
...
@@ -43,7 +43,7 @@ class filesystem {
/**
* Read the contents of a file.
*
* @param file The name (and path) of the file.
* @param file
name
The name (and path) of the file.
*
* @return The contents of the file.
*
...
...
@@ -72,7 +72,7 @@ class filesystem {
/**
* Get the size in bytes of a file.
*
* @param The file to get the size of.
* @param
file
The file to get the size of.
*
* @return The size of the given file.
*/
...
...
@@ -105,7 +105,7 @@ class filesystem {
/**
* Creates a new FileData from a file on the storage device.
*
* @param path Path to the file.
* @param
file
path Path to the file.
*
* @return The new FileData, or nil if an error occurred.
*
...
...
src/love/graphics.cpp
View file @
bcbe88c6
...
...
@@ -97,7 +97,7 @@ graphics& graphics::line(int x1, int y1, int x2, int y2) {
}
graphics
&
graphics
::
draw
(
Image
*
image
)
{
return
draw
(
image
);
return
draw
(
image
,
0
,
0
);
}
graphics
&
graphics
::
draw
(
Image
*
image
,
int
x
,
int
y
)
{
...
...
src/love/graphics.h
View file @
bcbe88c6
...
...
@@ -295,6 +295,9 @@ class graphics {
* @param drawmode How to draw the arc. Can be "fill" or "line".
* @param x The position to draw the object (x-axis).
* @param y The position to draw the object (y-axis).
* @param radius The radius of the arc.
* @param angle1 The angle of the first
* @param angle2 The angle of the second.
*/
graphics
&
arc
(
const
std
::
string
&
drawmode
,
int
x
,
int
y
,
int
radius
,
int
angle1
,
int
angle2
);
...
...
src/love/math.h
View file @
bcbe88c6
...
...
@@ -37,7 +37,7 @@ class math {
* Sets the random seed to a random seed between the given min and max values.
*
* @param min The lower 32 bits of the seed value.
* @param
high
The higher 32 bits of the seed value.
* @param
max
The higher 32 bits of the seed value.
*
* @return The math module, to allow for method chaining.
*
...
...
src/love/script.cpp
View file @
bcbe88c6
...
...
@@ -91,6 +91,24 @@ script::script(const std::string& file) {
chai
.
add
(
bootstrap
::
standard_library
::
vector_type
<
std
::
vector
<
std
::
string
>>
(
"StringVector"
));
chai
.
add
(
bootstrap
::
standard_library
::
map_type
<
std
::
map
<
std
::
string
,
bool
>>
(
"StringBoolMap"
));
// Global Helpers
// string::replace(std::string search, std::string replace)
chai
.
add
(
fun
([](
const
std
::
string
&
subject
,
const
std
::
string
&
search
,
const
std
::
string
&
replace
)
{
std
::
string
newSubject
(
subject
);
size_t
pos
=
0
;
while
((
pos
=
newSubject
.
find
(
search
,
pos
))
!=
std
::
string
::
npos
)
{
newSubject
.
replace
(
pos
,
search
.
length
(),
replace
);
pos
+=
replace
.
length
();
}
return
newSubject
;
}),
"replace"
);
// string::replace(char search, char replace)
chai
.
add
(
fun
([](
const
std
::
string
&
subject
,
char
search
,
char
replace
)
{
std
::
string
newSubject
(
subject
);
std
::
replace
(
newSubject
.
begin
(),
newSubject
.
end
(),
search
,
replace
);
return
newSubject
;
}),
"replace"
);
// List
auto
listModule
=
std
::
make_shared
<
chaiscript
::
Module
>
();
chaiscript
::
bootstrap
::
standard_library
::
list_type
<
std
::
list
<
chaiscript
::
Boxed_Value
>
>
(
"List"
,
*
listModule
);
...
...
src/love/timer.cpp
View file @
bcbe88c6
...
...
@@ -10,7 +10,7 @@ float timer::getDelta() {
return
m_delta
;
}
void
timer
::
step
(
float
delta
)
{
float
timer
::
step
(
float
delta
)
{
m_delta
=
delta
;
m_deltaCounter
+=
delta
;
m_frameCounter
++
;
...
...
@@ -20,6 +20,8 @@ void timer::step(float delta) {
m_frameCounter
=
0
;
m_deltaCounter
=
0
;
}
return
m_delta
;
}
int
timer
::
getFPS
()
{
...
...
src/love/timer.h
View file @
bcbe88c6
...
...
@@ -9,7 +9,7 @@ namespace love {
class
timer
{
public:
timer
();
void
step
(
float
delta
);
float
step
(
float
delta
);
/**
* Returns the time between the last two frames.
...
...
src/love/window.cpp
View file @
bcbe88c6
...
...
@@ -93,7 +93,7 @@ window& window::showMessageBox(const std::string& msg, int frames) {
}
window
&
window
::
showMessageBox
(
const
std
::
string
&
msg
)
{
showMessageBox
(
msg
,
28
00
);
showMessageBox
(
msg
,
10
00
);
return
*
this
;
}
...
...
test/cheat.chai
View file @
bcbe88c6
/**
* Cheat Test
*
* retroarch -L chailove_libretro.so test/
sound
.chai
* retroarch -L chailove_libretro.so test/
cheats
.chai
*/
global lastcheatcode
...
...
test/graphics_draw.chai
deleted
100644 → 0
View file @
95918963
class graphics_draw {
var name;
var x;
var y;
var image;
def graphics_draw() {
this.name = "graphics.draw()";
}
def load() {
this.image = love.graphics.newImage("assets/graphics_draw.png");
this.x = love.graphics.getWidth() / 2.0f - this.image.getWidth() / 2.0f;
this.y = love.graphics.getHeight() / 2.0f - this.image.getHeight() / 2.0f;
}
def draw() {
love.graphics.draw(this.image, this.x, this.y);
}
def update(delta) {
}
};
test/love.audio.play.chai
0 → 100644
View file @
bcbe88c6
class love_audio_play {
def love_audio_play() {
// Nothing.
}
def load() {
this.chailovesound = love.audio.newSource("unittests/assets/chailove.ogg")
}
def draw() {
love.graphics.print("Press the X key", 100, 200)
}
def update(delta) {
if (love.keyboard.isDown("x")) {
love.audio.play(this.chailovesound)
}
}
};
test/love.graphics.draw.chai
View file @
bcbe88c6
/**
* love.graphics.draw testing
*
* An alternative test with a different file name.
*
* retroarch -L chailove_libretro.so test/love.graphics.draw.chai
*/
class love_graphics_draw {
global keyPressed = "a";
global keyReleased = "b";
global logo
global angle = 0.0f
global scale = 1.0f
def load() {
logo = love.image.newImageData("assets/graphics_draw.png")
love.graphics.setBackgroundColor(50, 50, 100)
}
def update(dt) {
angle = angle - dt * 180.0f
if (keyPressed == "up") {
scale = scale + dt * 1.0f
}
else if (keyPressed == "down") {
scale = scale - dt * 1.0f
def love_graphics_draw() {
// Nothing.
}
}
def draw() {
love.graphics.print("Key Pressed: " + keyPressed, 5, 20)
love.graphics.print("Key Released: " + keyReleased, 5, 100)
love.graphics.setColor(255, 0, 0)
//love.graphics.draw(logo, graphics.getWidth() / 2, graphics.getHeight() / 2, math.rad(angle), 2, 2, 64/2, 64/2)
love.graphics.point(love.graphics.getWidth() / 2.0f, love.graphics.getHeight() / 2.0f)
love.graphics.draw(logo, love.graphics.getWidth() / 2.0f, love.graphics.getHeight() / 2.0f, love.math.rad(angle), scale, scale, logo.getWidth() / 2.0f, logo.getHeight() / 2.0f)
love.graphics.point(love.graphics.getWidth() / 2.0f, love.graphics.getHeight() / 2.0f)
//love.graphics.point(graphics.getWidth() / 2
}
def load() {
this.image = love.graphics.newImage("assets/graphics_draw.png");
this.x = love.graphics.getWidth() / 2.0f - this.image.getWidth() / 2.0f;
this.y = love.graphics.getHeight() / 2.0f - this.image.getHeight() / 2.0f;
}
def
keypressed(key, scancode
) {
keyPressed = key
}
def
draw(
) {
love.graphics.draw(this.image, this.x, this.y);
}
def keyreleased(key, scancode) {
keyReleased = key
}
def update(delta) {
// Nothing.
}
};
test/love.graphics.draw.scaling.chai
0 → 100644
View file @
bcbe88c6
class love_graphics_draw_scaling {
def love_graphics_draw_scaling() {
// Nothing.
}
def load() {
this.logo = love.image.newImageData("assets/graphics_draw.png")
this.angle = 0.0f
this.scale = 1.0f
}
def draw() {
love.graphics.setColor(255, 0, 0)
//love.graphics.draw(logo, graphics.getWidth() / 2, graphics.getHeight() / 2, math.rad(angle), 2, 2, 64/2, 64/2)
love.graphics.point(love.graphics.getWidth() / 2.0f, love.graphics.getHeight() / 2.0f)
love.graphics.draw(this.logo, love.graphics.getWidth() / 2.0f, love.graphics.getHeight() / 2.0f, love.math.rad(this.angle), this.scale, this.scale, this.logo.getWidth() / 2.0f, this.logo.getHeight() / 2.0f)
love.graphics.point(love.graphics.getWidth() / 2.0f, love.graphics.getHeight() / 2.0f)
//love.graphics.point(graphics.getWidth() / 2
love.graphics.print("Press x/z", 100, 100)
}
def update(dt) {
this.angle = this.angle - dt * 180.0f
if (love.keyboard.isDown("x")) {
this.scale = this.scale + dt * 1.0f
}
else if (love.keyboard.isDown("z")) {
this.scale = this.scale - dt * 1.0f
}
}
};
test/graphics
_
point.chai
→
test/
love.
graphics
.
point.chai
View file @
bcbe88c6
class graphics_point {
var name;
def graphics_point() {
this.name = "graphics.point()";
}
class love_graphics_point {
def love_graphics_point() {}
def load() {
//
graphics.setBackgroundColor(255,200,100)
//
Nothing.
}
def draw() {
//graphics.setColor(0, 255, 0)
//
graphics.setColor(0, 255, 0)
love.graphics.point(100, 200).point(200, 300)
}
def update(delta) {
// Nothing.
}
};
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment