Unverified Commit 334e08af authored by Rob Loach's avatar Rob Loach Committed by GitHub
Browse files

0.21.0 (#243)

### Chores
- Switched to [libretro-deps](https://github.com/libretro/libretro-deps) for freetype and zlib
- Clean up of image and audio memory allocation
- Updated documentation

### Features
- `love.system.execute()` to execute a operating system shell command
- `love.audio.newSource()` now has an optional `type` parameter
- `love.joystick` comes with a cleaner API
- `exit()` callback, which is called when is quitting the game
- `love.filesystem` now mounts `libretro/assets`, `libretro/system` and `libretro/saves`
parent e19269c2
......@@ -24,9 +24,6 @@
[submodule "vendor/Snippets"]
path = vendor/Snippets
url = https://github.com/DanielGibson/Snippets.git
[submodule "vendor/zlib"]
path = vendor/zlib
url = https://github.com/madler/zlib.git
[submodule "vendor/libretro-deps"]
path = vendor/libretro-deps
url = https://github.com/libretro/libretro-deps.git
......@@ -43,10 +40,6 @@
[submodule "vendor/random"]
path = vendor/random
url = https://github.com/effolkronium/random.git
[submodule "vendor/freetype2"]
path = vendor/freetype2
url = https://git.savannah.gnu.org/git/freetype/freetype2.git
ignore = dirty
[submodule "vendor/semver"]
path = vendor/semver
url = https://github.com/h2non/semver.c.git
......
......@@ -4,38 +4,51 @@ 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.21.0 - 2018-05-02
### Chores
- Switched to [libretro-deps](https://github.com/libretro/libretro-deps) for freetype and zlib
- Clean up of image and audio memory allocation
- Updated documentation
### Features
- `love.system.execute()` to execute a operating system shell command
- `love.audio.newSource()` now has an optional `type` parameter
- `love.joystick` comes with a cleaner API
- `exit()` callback, which is called when is quitting the game
- `love.filesystem` now mounts `libretro/assets`, `libretro/system` and `libretro/saves`
## 0.20.1 - 2018-04-24
### Fixed
### Bug Fixes
- Better memory usage
- Compilation warnings
## 0.20.0 - 2018-04-22
### Added
### Features
- No Game demo when ChaiLove is loaded without content
- Version mismatch warning when content's ChaiLove version doesn't match core's
- `love.data.hash()` `sha1` support
- `love.system.getUsername()`
## 0.19.0 - 2018-04-13
### Added
### Features
- Android build
- By [@webgeek1234](https://github.com/webgeek1234)
- `love.data.hash()` to retrieve MD5 hashes from content
- Windows automated testing with [Appveyor](https://ci.appveyor.com/project/RobLoach/libretro-chailove)
## 0.18.1 - 2018-04-09
### Added
### Chores
- Documentation
## 0.18.0 - 2018-04-03
### Added
### Features
- [Semantic Versioning](https://semver.org/) checks
- Use `t.version = "0.18.0"` in `conf(t)` to specify which ChaiLove version you're targeting
- `love.graphics.getDimensions()`
- `love.filesystem.getInfo()`
- `love.filesystem.isSymlink()`
### Updated
### Breaking Changes
- `love.math.compress()` is now `love.data.compress()`
- Documentation
......
......@@ -10,7 +10,7 @@ SOURCES_CXX := $(wildcard \
)
# semver
FLAGS := -I$(CORE_DIR)/vendor/semver
FLAGS += -I$(CORE_DIR)/vendor/semver
SOURCES_C := $(CORE_DIR)/vendor/semver/semver.c
# random
......@@ -24,21 +24,22 @@ FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
# zlib
SOURCES_C += \
$(CORE_DIR)/vendor/zlib/zutil.c \
$(CORE_DIR)/vendor/zlib/adler32.c \
$(CORE_DIR)/vendor/zlib/crc32.c \
$(CORE_DIR)/vendor/zlib/compress.c \
$(CORE_DIR)/vendor/zlib/deflate.c \
$(CORE_DIR)/vendor/zlib/gzclose.c \
$(CORE_DIR)/vendor/zlib/gzlib.c \
$(CORE_DIR)/vendor/zlib/gzread.c \
$(CORE_DIR)/vendor/zlib/gzwrite.c \
$(CORE_DIR)/vendor/zlib/infback.c \
$(CORE_DIR)/vendor/zlib/inffast.c \
$(CORE_DIR)/vendor/zlib/inftrees.c \
$(CORE_DIR)/vendor/zlib/inflate.c \
$(CORE_DIR)/vendor/zlib/trees.c
FLAGS += -I$(CORE_DIR)/vendor/zlib
$(CORE_DIR)/vendor/libretro-deps/libz/zutil.c \
$(CORE_DIR)/vendor/libretro-deps/libz/adler32.c \
$(CORE_DIR)/vendor/libretro-deps/libz/crc32.c \
$(CORE_DIR)/vendor/libretro-deps/libz/compress.c \
$(CORE_DIR)/vendor/libretro-deps/libz/deflate.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzclose.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzlib.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzread.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzwrite.c \
$(CORE_DIR)/vendor/libretro-deps/libz/infback.c \
$(CORE_DIR)/vendor/libretro-deps/libz/inffast.c \
$(CORE_DIR)/vendor/libretro-deps/libz/inftrees.c \
$(CORE_DIR)/vendor/libretro-deps/libz/inflate.c \
$(CORE_DIR)/vendor/libretro-deps/libz/trees.c
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps/libz
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/compat
FLAGS += -DWANT_ZLIB
# PhysFS
......@@ -71,7 +72,7 @@ SOURCES_C += $(wildcard \
# FreeType2
# See https://github.com/emscripten-ports/FreeType/blob/master/builds/amiga/makefile
FLAGS += -I$(CORE_DIR)/vendor/freetype2/include
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps/freetype/include
FLAGS += -DFT2_BUILD_LIBRARY \
-DFT_USE_AUTOFIT \
-DFT_USE_RASTER \
......@@ -85,48 +86,48 @@ FLAGS += -DFT2_BUILD_LIBRARY \
-DFT_USE_GXV
SOURCES_C += \
$(CORE_DIR)/vendor/freetype2/src/base/ftbase.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftinit.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftsystem.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftdebug.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftbbox.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftbdf.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftstroke.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftbitmap.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftcid.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftfntfmt.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftfstype.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftgasp.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftglyph.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftgxval.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftlcdfil.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftmm.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftotval.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftpatent.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftpfr.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftsynth.c \
$(CORE_DIR)/vendor/freetype2/src/base/fttype1.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftwinfnt.c \
$(CORE_DIR)/vendor/freetype2/src/autofit/autofit.c \
$(CORE_DIR)/vendor/freetype2/src/pshinter/pshinter.c \
$(CORE_DIR)/vendor/freetype2/src/psaux/psaux.c \
$(CORE_DIR)/vendor/freetype2/src/psnames/psnames.c \
$(CORE_DIR)/vendor/freetype2/src/raster/raster.c \
$(CORE_DIR)/vendor/freetype2/src/smooth/smooth.c \
$(CORE_DIR)/vendor/freetype2/src/cache/ftcache.c \
$(CORE_DIR)/vendor/freetype2/src/bdf/bdf.c \
$(CORE_DIR)/vendor/freetype2/src/cff/cff.c \
$(CORE_DIR)/vendor/freetype2/src/pcf/pcf.c \
$(CORE_DIR)/vendor/freetype2/src/winfonts/winfnt.c \
$(CORE_DIR)/vendor/freetype2/src/sfnt/sfnt.c \
$(CORE_DIR)/vendor/freetype2/src/pfr/pfr.c \
$(CORE_DIR)/vendor/freetype2/src/truetype/truetype.c \
$(CORE_DIR)/vendor/freetype2/src/type1/type1.c \
$(CORE_DIR)/vendor/freetype2/src/type42/type42.c \
$(CORE_DIR)/vendor/freetype2/src/cid/type1cid.c \
$(CORE_DIR)/vendor/freetype2/src/gzip/ftgzip.c \
$(CORE_DIR)/vendor/freetype2/src/bzip2/ftbzip2.c \
$(CORE_DIR)/vendor/freetype2/src/lzw/ftlzw.c
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbase.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftinit.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftsystem.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftdebug.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbbox.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbdf.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftstroke.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbitmap.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftcid.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftfntfmt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftfstype.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftgasp.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftglyph.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftgxval.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftlcdfil.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftmm.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftotval.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftpatent.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftpfr.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftsynth.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/fttype1.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftwinfnt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/autofit/autofit.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/pshinter/pshinter.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/psaux/psaux.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/psnames/psnames.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/raster/raster.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/smooth/smooth.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/cache/ftcache.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/bdf/bdf.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/cff/cff.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/pcf/pcf.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/winfonts/winfnt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/sfnt/sfnt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/pfr/pfr.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/truetype/truetype.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/type1/type1.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/type42/type42.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/cid/type1cid.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/gzip/ftgzip.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/bzip2/ftbzip2.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/lzw/ftlzw.c
# SDL_ttf
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include
......
......@@ -4,7 +4,7 @@
[![platform libretro](https://img.shields.io/badge/platform-libretro-brightgreen.svg)](http://buildbot.fiveforty.net/admin/buildbot/build/?name=chailove)
[![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](https://rawgit.com/libretro/libretro-chailove/docs/)
ChaiLove is an awesome framework you can use to make 2D games in [ChaiScript](http://chaiscript.com/). It's free, open-source, and works on Windows, Mac OS X, Linux, and ARM through [libretro](https://www.libretro.com)/[RetroArch](http://retroarch.com).
ChaiLove is an awesome framework you can use to make 2D games in [ChaiScript](http://chaiscript.com/). It's free, open-source, and works on Windows, Mac OS X, Linux, Android, and ARM through [libretro](https://www.libretro.com)/[RetroArch](http://retroarch.com).
[![Floppy Bird Gameplay](docs/screenshot.png)](https://www.youtube.com/watch?v=RLVwTh6qDFI&hd=1)
......@@ -66,7 +66,7 @@ Behind ChaiLove, there's the documentation, compiling it, along with testing.
### Compiling
Use the following command to compile the core:
Use the following command to compile the core, with at least `g++ >=5.2`:
```
make
......
#!/bin/sh
# ChaiLove configure
# This ./configure file is set up to allow use of the standard make build practices.
#
# Here be dragons.
PACKAGE_NAME=libretro-chailove
......@@ -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.20.1"
PROJECT_NUMBER = "0.21.0"
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
......
......@@ -37,12 +37,17 @@ ChaiLove::~ChaiLove() {
}
void ChaiLove::quit(void) {
// Enforce the should close flag.
event.m_shouldclose = true;
// Destroy all the subsystems.
// Disengage the scripting language.
if (script) {
script->exit();
delete script;
script = NULL;
}
// Unload all the other sub-systems.
joystick.unload();
font.unload();
image.unload();
......@@ -66,6 +71,8 @@ bool ChaiLove::load(const std::string& file) {
return false;
}
filesystem.mountlibretro();
// Initialize the scripting system.
script = new love::script(file);
if (!script->mainLoaded) {
......
......@@ -23,8 +23,20 @@
* This is the full source for "hello world" in ChaiLove, using a `main.chai` file. Running this code will cause an 640 by 480 window to appear, and display white text on a black background.
*
* @code
* global logo
* global x = 10.0f
*
* def load() {
* logo = love.graphics.newImage("logo.png")
* }
*
* def draw() {
* love.graphics.print("Hello World!", 200, 250)
* love.graphics.print("Hello World!", 400, 300)
* love.graphics.draw(logo, x, 100)
* }
*
* def update(dt) {
* x = x + 20.0f * dt
* }
* @endcode
*
......@@ -35,9 +47,9 @@
#define SRC_CHAILOVE_H_
#define CHAILOVE_VERSION_MAJOR 0
#define CHAILOVE_VERSION_MINOR 20
#define CHAILOVE_VERSION_PATCH 1
#define CHAILOVE_VERSION_STRING "0.20.1"
#define CHAILOVE_VERSION_MINOR 21
#define CHAILOVE_VERSION_PATCH 0
#define CHAILOVE_VERSION_STRING "0.21.0"
#include "SDL.h"
#include "libretro.h"
......
......@@ -6,9 +6,6 @@
#include "libretro.h"
#include "ChaiLove.h"
const char *retro_save_directory;
const char *retro_system_directory;
const char *retro_content_directory;
static bool use_audio_cb;
int16_t audio_buffer[2 * (44100 / 60)];
static retro_video_refresh_t video_cb;
......@@ -94,28 +91,7 @@ void retro_set_environment(retro_environment_t cb) {
* libretro callback; Updates the core option variables.
*/
static void update_variables(void) {
ChaiLove* game = ChaiLove::getInstance();
struct retro_variable var = {0};
// Alpha Blending
var.key = "chailove_alphablending";
var.value = NULL;
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
std::string varvalue(var.value);
if (varvalue == "disabled") {
game->config.options["alphablending"] = false;
}
}
// High Quality
var.key = "chailove_highquality";
var.value = NULL;
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
std::string varvalue(var.value);
if (varvalue == "disabled") {
game->config.options["highquality"] = false;
}
}
std::cout << "[ChaiLove] [libretro] update_variables()" << std::endl;
}
#ifdef __cplusplus
......@@ -421,28 +397,6 @@ size_t retro_get_memory_size(unsigned id) {
* libretro callback; Initialize the core.
*/
void retro_init(void) {
const char *system_dir = NULL;
// System Directory
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_dir) && system_dir) {
retro_system_directory = system_dir;
}
// Content Directory
const char *content_dir = NULL;
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY, &content_dir) && content_dir) {
retro_content_directory = content_dir;
}
// Save Directory
const char *save_dir = NULL;
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_dir) && save_dir) {
// If save directory is defined use it, otherwise use system directory
retro_save_directory = *save_dir ? save_dir : retro_system_directory;
} else {
retro_save_directory = retro_system_directory;
}
// Pixel Format
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
if (!ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
......
......@@ -86,7 +86,7 @@ bool SoundData::stop() {
}
bool SoundData::isLoaded() {
return sndta.fp != NULL && ChaiLove::hasInstance();
return sndta.fp != NULL;
}
bool SoundData::isPlaying() {
......
......@@ -23,7 +23,7 @@ bool Image::loaded() {
bool Image::loadFromRW(SDL_RWops* rw) {
surface = STBIMG_Load_RW(rw, 1);
if (!surface) {
if (!loaded()) {
const char* errorChar = SDL_GetError();
std::string errString("");
if (errorChar != NULL) {
......@@ -44,8 +44,8 @@ bool Image::loadFromRW(SDL_RWops* rw) {
optimizedImage = SDL_DisplayFormat(surface);
}
if (!optimizedImage) {
std::cout << "[ChaiLove] [graphics] SDL_DisplayFormat failed to optimize the image." << std::endl;
if (optimizedImage == NULL) {
std::cout << "[ChaiLove] [graphics] Warning: SDL_DisplayFormat failed to optimize the image." << std::endl;
} else {
SDL_FreeSurface(surface);
surface = optimizedImage;
......@@ -54,7 +54,7 @@ bool Image::loadFromRW(SDL_RWops* rw) {
}
bool Image::destroy() {
if (!surface) {
if (loaded()) {
SDL_FreeSurface(surface);
surface = NULL;
}
......@@ -71,14 +71,14 @@ Image::Image(const std::string& filename) {
}
int Image::getWidth() {
if (surface != NULL) {
if (loaded()) {
return surface->w;
}
return 0;
}
int Image::getHeight() {
if (surface != NULL) {
if (loaded()) {
return surface->h;
}
return 0;
......
......@@ -11,35 +11,22 @@ std::string Joystick::getName() {
return name;
}
/*
Joystick::Joystick(SDL_Joystick* joystick) {
joy = joystick;
}
*/
/*
Joystick::Joystick(int num, SDL_Joystick* joystick) {
index = index;
joy = joystick;
}
*/
bool Joystick::isOpen() {
return true;
Joystick::Joystick() {
clearStates();
}
Joystick::Joystick() {
name = "RetroPad";
index = 0;
Joystick::Joystick(int i) : m_index(i) {
clearStates();
}
Joystick::Joystick(int i) {
index = i;
name = "RetroPad";
void Joystick::clearStates() {
for (int i = 0; i < 14; i++) {
m_state[i] = 0;
}
}
bool Joystick::isDown(int button) {
return static_cast<bool>(ChaiLove::getInstance()->joystick.joystick_cache[index][button]);
return static_cast<bool>(m_state[button]);
}
bool Joystick::isDown(const std::string& button) {
......@@ -47,8 +34,37 @@ bool Joystick::isDown(const std::string& button) {
return isDown(key);
}
void Joystick::close() {
// Nothing.
bool Joystick::isConnected() {
return m_connected;
}
int Joystick::getID() {
return m_index;
}
void Joystick::update() {
if (!isConnected()) {
return;
}
int16_t state;
// Loop through each button.
for (int u = 0; u < 14; u++) {
// Retrieve the state of the button.
state = ChaiLove::input_state_cb(m_index, RETRO_DEVICE_JOYPAD, 0, u);
// Check if there's a change of state.
if (m_state[u] != state) {
m_state[u] = state;
std::string name = ChaiLove::getInstance()->joystick.getButtonName(u);
if (state == 1) {
ChaiLove::getInstance()->script->joystickpressed(m_index, name);
} else if (state == 0) {
ChaiLove::getInstance()->script->joystickreleased(m_index, name);
}
}
}
}
} // namespace Input
......
......@@ -21,8 +21,8 @@ class Joystick {
* @return string The name of the Joystick.
*/
std::string getName();
bool isOpen();
void close();
void clearStates();
/**
* Checks if a button on the Joystick is pressed.
......@@ -42,10 +42,23 @@ class Joystick {
*/
bool isDown(const std::string& button);
int index = 0;
std::string name;
int xaxis;
int yaxis;
void update();
/**
* Gets whether the Joystick is connected.
*/
bool isConnected();
/**
* Gets the joystick's unique identifier.
*/
int getID();
private:
int m_index = 0;
std::string name = "RetroPad";
int16_t m_state[14];
bool m_connected = true;
};
} // namespace Input
......
......@@ -26,6 +26,10 @@ SoundData* audio::newSource(const std::string& filename) {
return NULL;
}
SoundData* audio::newSource(const std::string& filename, const std::string& type) {
return newSource(filename);
}
float audio::getVolume() {
return m_volume;
}
......
......@@ -24,7 +24,11 @@ class audio {
* Creates a new audio source from a file.
*
* @param filename The .wav file to load.
* @param type ("static") The type of audio source to load ("static", "stream"). Optional.
*
* @return The new SoundData if it loaded correctly, NULL otherwise.
*/
SoundData* newSource(const std::string& filename, const std::string& type);
SoundData* newSource(const std::string& filename);
void mixer_render(int16_t *buffer);
......@@ -44,6 +48,8 @@ class audio {
* Set the master volume.
*
* @param volume 1.0f is max and 0.0f is off.
*
* @return The audio module, to allow method chaining.
*/
audio& setVolume(float volume);
};
......
......@@ -19,7 +19,7 @@ namespace love {
*
* @code
* def conf(t) {
* t.version = "0.20.1" // Version of ChaiLove
* t.version = "0.21.0" // Version of ChaiLove
* t.identity = "mygame" // Machine name of your game
* t.window.title = "My Game" // Human-readable name
* t.window.width = 1024 // Game width
......@@ -34,14 +34,14 @@ class config {
/**
* The machine name of the project.
*
* This should represent a machine name of your game.
*
* ## Example
*
* @code
* t.identity = "mygame"
* @endcode
*
* This should represent a machine name of your game.
*
* ## Example
*
* @code
* t.identity = "myg