Skip to content

Commit

Permalink
Merge pull request #328 from libretro/dev
Browse files Browse the repository at this point in the history
0.28.0
  • Loading branch information
RobLoach authored Oct 7, 2018
2 parents 9591896 + f9d414f commit bcbe88c
Show file tree
Hide file tree
Showing 30 changed files with 236 additions and 182 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
22 changes: 11 additions & 11 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.27.0"
PROJECT_NUMBER = "0.28.0"

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1036,15 +1036,15 @@ 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
# this value, doxygen will try to truncate the graph, so that it fits within
# 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
Expand Down
2 changes: 1 addition & 1 deletion examples/snake/Snake.chai
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ global T
def conf(t) {
t.window.width = WIDTH * gridScale
t.window.height = HEIGHT * gridScale
t.version = "0.27.0"
t.version = "0.28.0"
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ChaiLove.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
#define SRC_CHAILOVE_H_

#define CHAILOVE_VERSION_MAJOR 0
#define CHAILOVE_VERSION_MINOR 27
#define CHAILOVE_VERSION_MINOR 28
#define CHAILOVE_VERSION_PATCH 0
#define CHAILOVE_VERSION_STRING "0.27.0"
#define CHAILOVE_VERSION_STRING "0.28.0"

#include "SDL.h"
#include "libretro.h"
Expand Down
29 changes: 29 additions & 0 deletions src/docs/List.h → src/docs/Globals.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#ifndef SRC_CHAILOVEDOCS_H_
#define SRC_CHAILOVEDOCS_H_

/**
* @file Globals.h
* @page globals Globals
*
* This provides documentation about globals available through ChaiLove.
*/

#include <string>

/**
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions src/love/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class filesystem {
/**
* Read the contents of a file.
*
* @param file The name (and path) of the file.
* @param filename The name (and path) of the file.
*
* @return The contents of the file.
*
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -105,7 +105,7 @@ class filesystem {
/**
* Creates a new FileData from a file on the storage device.
*
* @param path Path to the file.
* @param filepath Path to the file.
*
* @return The new FileData, or nil if an error occurred.
*
Expand Down
2 changes: 1 addition & 1 deletion src/love/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions src/love/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/love/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
18 changes: 18 additions & 0 deletions src/love/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/love/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand All @@ -20,6 +20,8 @@ void timer::step(float delta) {
m_frameCounter = 0;
m_deltaCounter = 0;
}

return m_delta;
}

int timer::getFPS() {
Expand Down
2 changes: 1 addition & 1 deletion src/love/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/love/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ window& window::showMessageBox(const std::string& msg, int frames) {
}

window& window::showMessageBox(const std::string& msg) {
showMessageBox(msg, 2800);
showMessageBox(msg, 1000);
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion test/cheat.chai
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Cheat Test
*
* retroarch -L chailove_libretro.so test/sound.chai
* retroarch -L chailove_libretro.so test/cheats.chai
*/

global lastcheatcode
Expand Down
23 changes: 0 additions & 23 deletions test/graphics_draw.chai

This file was deleted.

19 changes: 0 additions & 19 deletions test/graphics_point.chai

This file was deleted.

22 changes: 0 additions & 22 deletions test/graphics_print.chai

This file was deleted.

19 changes: 19 additions & 0 deletions test/love.audio.play.chai
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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)
}
}
};
Loading

0 comments on commit bcbe88c

Please sign in to comment.