Skip to content

Commit

Permalink
Merge pull request #356 from libretro/dev
Browse files Browse the repository at this point in the history
0.31.0
  • Loading branch information
RobLoach authored Dec 24, 2018
2 parents 73baade + d40121e commit 67e775e
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 20 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ matrix:
- os: linux
dist: trusty
sudo: required
before_install:
- sudo apt-get -qq update
- sudo apt-get install g++-7 binutils-2.26
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
- export PATH=/usr/lib/binutils-2.26/bin:${PATH}

- os: osx
osx_image: xcode8.3

before_install:
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo apt-get -qq update ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo apt-get install g++-7 binutils-2.26 ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90 ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 ; fi
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then export PATH=/usr/lib/binutils-2.26/bin:${PATH} ; fi

addons:
apt:
sources:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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.31.0 - 2018-12-24
### Chores
- Update to use the libretro audio callback
- Updated cppcodec
- Updated PhysFS
- Updated libretro-common

## 0.30.0 - 2018-11-14
### Features
- Added support for classic_armv7_a7
Expand Down
2 changes: 1 addition & 1 deletion 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.30.0"
PROJECT_NUMBER = "0.31.0"

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Expand Down
3 changes: 0 additions & 3 deletions src/ChaiLove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ std::string ChaiLove::demo() {
}

void ChaiLove::update() {
// Update the sound system.
sound.update();

// Update and poll all the events.
event.update();

Expand Down
10 changes: 4 additions & 6 deletions src/ChaiLove.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
* 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")
* global logo = love.graphics.newImage("logo.png")
* global x = 10.0f
* }
*
* def draw() {
Expand All @@ -47,9 +45,9 @@
#define SRC_CHAILOVE_H_

#define CHAILOVE_VERSION_MAJOR 0
#define CHAILOVE_VERSION_MINOR 30
#define CHAILOVE_VERSION_MINOR 31
#define CHAILOVE_VERSION_PATCH 0
#define CHAILOVE_VERSION_STRING "0.30.0"
#define CHAILOVE_VERSION_STRING "0.31.0"

#include "SDL.h"
#include "libretro.h"
Expand Down
20 changes: 20 additions & 0 deletions src/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,22 @@ void frame_time_cb(retro_usec_t usec) {
}
}

/**
* libretro callback; Step the audio forwards a step.
*/
void retro_audio_cb() {
// Update the sound system.
ChaiLove::getInstance()->sound.update();
}

/**
* libretro callback; Set the current state of the audio.
*/
void audio_set_state(bool enabled) {
// TODO(RobLoach): Act on whether or not audio is enabled/disabled?
std::cout << "[ChaiLove] audio_set_state(" << (enabled ? "true" : "false") << ")" << std::endl;
}

/**
* libretro callback; Load the given game.
*/
Expand All @@ -323,6 +339,10 @@ bool retro_load_game(const struct retro_game_info *info) {
struct retro_frame_time_callback frame_cb = { frame_time_cb, 1000000 / 60 };
ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK, &frame_cb);

// Set the audio callback.
struct retro_audio_callback retro_audio = { retro_audio_cb, audio_set_state };
ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK, &retro_audio);

// Find the game path.
std::string gamePath(info ? info->path : "");
if (gamePath == ".") {
Expand Down
2 changes: 1 addition & 1 deletion vendor/cppcodec
2 changes: 1 addition & 1 deletion vendor/didstopia-physfs
Submodule didstopia-physfs updated 1 files
+11 −6 src/physfs.c
2 changes: 1 addition & 1 deletion vendor/libretro-common

0 comments on commit 67e775e

Please sign in to comment.