Skip to content

Commit 67e775e

Browse files
authored
Merge pull request #356 from libretro/dev
0.31.0
2 parents 73baade + d40121e commit 67e775e

File tree

9 files changed

+42
-20
lines changed

9 files changed

+42
-20
lines changed

.travis.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ matrix:
66
- os: linux
77
dist: trusty
88
sudo: required
9+
before_install:
10+
- sudo apt-get -qq update
11+
- sudo apt-get install g++-7 binutils-2.26
12+
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
13+
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
14+
- export PATH=/usr/lib/binutils-2.26/bin:${PATH}
15+
916
- os: osx
1017
osx_image: xcode8.3
1118

12-
before_install:
13-
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo apt-get -qq update ; fi
14-
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo apt-get install g++-7 binutils-2.26 ; fi
15-
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90 ; fi
16-
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 ; fi
17-
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then export PATH=/usr/lib/binutils-2.26/bin:${PATH} ; fi
18-
1919
addons:
2020
apt:
2121
sources:

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## 0.31.0 - 2018-12-24
8+
### Chores
9+
- Update to use the libretro audio callback
10+
- Updated cppcodec
11+
- Updated PhysFS
12+
- Updated libretro-common
13+
714
## 0.30.0 - 2018-11-14
815
### Features
916
- Added support for classic_armv7_a7

docs/Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PROJECT_NAME = "ChaiLove API"
2323
# This could be handy for archiving the generated documentation or
2424
# if some version control system is used.
2525

26-
PROJECT_NUMBER = "0.30.0"
26+
PROJECT_NUMBER = "0.31.0"
2727

2828
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
2929
# base path where the generated documentation will be put.

src/ChaiLove.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ std::string ChaiLove::demo() {
169169
}
170170

171171
void ChaiLove::update() {
172-
// Update the sound system.
173-
sound.update();
174-
175172
// Update and poll all the events.
176173
event.update();
177174

src/ChaiLove.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323
* 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.
2424
*
2525
* @code
26-
* global logo
27-
* global x = 10.0f
28-
*
2926
* def load() {
30-
* logo = love.graphics.newImage("logo.png")
27+
* global logo = love.graphics.newImage("logo.png")
28+
* global x = 10.0f
3129
* }
3230
*
3331
* def draw() {
@@ -47,9 +45,9 @@
4745
#define SRC_CHAILOVE_H_
4846

4947
#define CHAILOVE_VERSION_MAJOR 0
50-
#define CHAILOVE_VERSION_MINOR 30
48+
#define CHAILOVE_VERSION_MINOR 31
5149
#define CHAILOVE_VERSION_PATCH 0
52-
#define CHAILOVE_VERSION_STRING "0.30.0"
50+
#define CHAILOVE_VERSION_STRING "0.31.0"
5351

5452
#include "SDL.h"
5553
#include "libretro.h"

src/libretro.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,22 @@ void frame_time_cb(retro_usec_t usec) {
309309
}
310310
}
311311

312+
/**
313+
* libretro callback; Step the audio forwards a step.
314+
*/
315+
void retro_audio_cb() {
316+
// Update the sound system.
317+
ChaiLove::getInstance()->sound.update();
318+
}
319+
320+
/**
321+
* libretro callback; Set the current state of the audio.
322+
*/
323+
void audio_set_state(bool enabled) {
324+
// TODO(RobLoach): Act on whether or not audio is enabled/disabled?
325+
std::cout << "[ChaiLove] audio_set_state(" << (enabled ? "true" : "false") << ")" << std::endl;
326+
}
327+
312328
/**
313329
* libretro callback; Load the given game.
314330
*/
@@ -323,6 +339,10 @@ bool retro_load_game(const struct retro_game_info *info) {
323339
struct retro_frame_time_callback frame_cb = { frame_time_cb, 1000000 / 60 };
324340
ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK, &frame_cb);
325341

342+
// Set the audio callback.
343+
struct retro_audio_callback retro_audio = { retro_audio_cb, audio_set_state };
344+
ChaiLove::environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_CALLBACK, &retro_audio);
345+
326346
// Find the game path.
327347
std::string gamePath(info ? info->path : "");
328348
if (gamePath == ".") {

vendor/didstopia-physfs

0 commit comments

Comments
 (0)