Libretro: Static link runtime and fixed some mingw compilation issues
* [libretro] use audio_batch_cb * [libretro] mingw static libs * [libretro] mingw xp support
This commit is contained in:
parent
76d5f2a5b3
commit
e745388206
4 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
|||
class LibretroSoundManager : public IAudioDevice
|
||||
{
|
||||
private:
|
||||
retro_audio_sample_t _sendAudioSample = nullptr;
|
||||
retro_audio_sample_batch_t _sendAudioSample = nullptr;
|
||||
bool _skipMode = false;
|
||||
shared_ptr<Console> _console;
|
||||
|
||||
|
@ -26,13 +26,13 @@ public:
|
|||
virtual void PlayBuffer(int16_t *soundBuffer, uint32_t sampleCount, uint32_t sampleRate, bool isStereo) override
|
||||
{
|
||||
if(!_skipMode && _sendAudioSample) {
|
||||
for(uint32_t i = 0; i < sampleCount; i++) {
|
||||
_sendAudioSample(soundBuffer[i*2], soundBuffer[i*2+1]);
|
||||
for(uint32_t total = 0; total < sampleCount; ) {
|
||||
total += _sendAudioSample(soundBuffer + total*2, sampleCount - total);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetSendAudioSample(retro_audio_sample_t sendAudioSample)
|
||||
void SetSendAudioSample(retro_audio_sample_batch_t sendAudioSample)
|
||||
{
|
||||
_sendAudioSample = sendAudioSample;
|
||||
}
|
||||
|
|
|
@ -243,7 +243,7 @@ else
|
|||
CC ?= gcc
|
||||
CXX ?= g++
|
||||
TARGET := $(TARGET_NAME)_libretro.dll
|
||||
SHARED := -shared -s -Wl,--version-script=$(LIBRETRO_DIR)/link.T -Wl,--no-undefined
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=$(LIBRETRO_DIR)/link.T -Wl,--no-undefined
|
||||
endif
|
||||
|
||||
LDFLAGS += $(LIBM)
|
||||
|
|
|
@ -169,11 +169,11 @@ extern "C" {
|
|||
|
||||
RETRO_API void retro_set_audio_sample(retro_audio_sample_t sendAudioSample)
|
||||
{
|
||||
_soundManager->SetSendAudioSample(sendAudioSample);
|
||||
}
|
||||
|
||||
RETRO_API void retro_set_audio_sample_batch(retro_audio_sample_batch_t audioSampleBatch)
|
||||
{
|
||||
_soundManager->SetSendAudioSample(audioSampleBatch);
|
||||
}
|
||||
|
||||
RETRO_API void retro_set_input_poll(retro_input_poll_t pollInput)
|
||||
|
|
|
@ -4621,7 +4621,7 @@ stb_vorbis * stb_vorbis_open_file(FILE *file, int close_on_free, int *error, con
|
|||
stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, const stb_vorbis_alloc *alloc)
|
||||
{
|
||||
FILE *f;
|
||||
#if _WIN32 || _WIN64
|
||||
#if defined(_MSC_VER) || defined(__MINGW64__)
|
||||
fopen_s(&f, filename, "rb");
|
||||
#else
|
||||
f = fopen(filename, "rb");
|
||||
|
|
Loading…
Add table
Reference in a new issue