Update to v094r28 release.

byuu says:

This WIP substantially restructures the ruby API for the first time
since that project started.

It is my hope that with this restructuring, destruction of the ruby
objects should now be deterministic, which should fix the crashing on
closing the emulator on Linux. We'll see I guess ... either way, it
removed two layers of wrappers from ruby, so it's a pretty nice code
cleanup.

It won't compile on Windows due to a few issues I didn't see until
uploading the WIP, too lazy to upload another. But I fixed all the
compilation issues locally, so it'll work on Windows again with the next
WIP (unless I break something else.)

(Kind of annoying that Linux defines glActiveTexture but Windows
doesn't.)
This commit is contained in:
Tim Allen
2015-06-20 15:44:05 +10:00
parent 20cc6148cb
commit e0815b55b9
58 changed files with 485 additions and 890 deletions

View File

@@ -1,8 +1,8 @@
#include <ao/ao.h>
namespace ruby {
struct AudioAO : Audio {
~AudioAO() { term(); }
struct pAudioAO {
int driver_id;
ao_sample_format driver_format;
ao_device* audio_device = nullptr;
@@ -11,15 +11,6 @@ struct pAudioAO {
unsigned frequency = 22050;
} settings;
pAudioAO() {
ao_initialize();
}
~pAudioAO() {
term();
//ao_shutdown(); //FIXME: this is causing a segfault for some reason when called ...
}
auto cap(const string& name) -> bool {
if(name == Audio::Frequency) return true;
return false;
@@ -49,7 +40,7 @@ struct pAudioAO {
}
auto init() -> bool {
term();
ao_initialize();
driver_id = ao_default_driver_id(); //ao_driver_id((const char*)driver)
if(driver_id < 0) return false;
@@ -77,9 +68,6 @@ struct pAudioAO {
ao_close(audio_device);
audio_device = nullptr;
}
ao_shutdown();
}
};
DeclareAudio(AO)
};