SDL2 backend is up-to-date.

This commit is contained in:
Scott Duensing 2022-09-16 17:58:00 -05:00
parent 43e0fe4b6e
commit a67e998c28
2 changed files with 9 additions and 16 deletions

View file

@ -2,7 +2,7 @@ JOEY = /home/scott/joey
#CONFIG += SDL12 #CONFIG += SDL12
CONFIG += SDL2 CONFIG += SDL2
BREW = /home/linuxbrew/.linuxbrew #BREW = /home/linuxbrew/.linuxbrew
TEMPLATE = app TEMPLATE = app
CONFIG += console CONFIG += console
@ -19,11 +19,11 @@ defined(BREW,var) {
-Wl,-rpath,$$STATICLIB -Wl,-rpath,$$STATICLIB
} else { } else {
# Use our libraries. # Use our libraries.
STATICLIB = $$JOEY/sdks/linux/x64/lib #STATICLIB = $$JOEY/sdks/linux/x64/lib
INCLUDEPATH += $$JOEY/sdks/linux/x64/include #INCLUDEPATH += $$JOEY/sdks/linux/x64/include
LIBS += \ #LIBS += \
-L$$STATICLIB \ # -L$$STATICLIB \
-Wl,-rpath,$$STATICLIB # -Wl,-rpath,$$STATICLIB
} }
INCLUDEPATH += $$PWD/src INCLUDEPATH += $$PWD/src

View file

@ -96,7 +96,6 @@ static jbool _jlModPlaying = jfalse;
static jlPlatformModT *_jlModCurrent = NULL; static jlPlatformModT *_jlModCurrent = NULL;
static jbyte _jlModVolume = 255; static jbyte _jlModVolume = 255;
static jlSoundPlayingT *_jlSoundList = NULL; static jlSoundPlayingT *_jlSoundList = NULL;
static jbyte _jlSoundsPlaying = 0;
static jint16 _jlWindowZoom = 2; static jint16 _jlWindowZoom = 2;
@ -250,15 +249,12 @@ static void _jlAudioCallback(void *userdata, Uint8 *buffer, int bytes) {
temp = sound; temp = sound;
sound = sound->next; sound = sound->next;
jlFree(temp); jlFree(temp);
_jlSoundsPlaying--;
} else { } else {
prev = sound; prev = sound;
sound = sound->next; sound = sound->next;
} }
} }
} }
jlUtilSay("");
} }
@ -274,7 +270,6 @@ void jlDisplayPresent(void) {
// Render 4 bit copy to proper pixel format. // Render 4 bit copy to proper pixel format.
// This extra step preserves palette effects. // This extra step preserves palette effects.
SDL_LockTexture(_jlTexture, NULL, &pixelData, &pitch); SDL_LockTexture(_jlTexture, NULL, &pixelData, &pitch);
pixels = (Uint32 *)pixelData; pixels = (Uint32 *)pixelData;
for (int y=0; y<200; y++) { for (int y=0; y<200; y++) {
@ -569,7 +564,6 @@ void jlSoundPlay(jlSoundT *sound, jlSoundChannelE channel, jbyte volume) {
sp->len = sp->sound->len; sp->len = sp->sound->len;
sp->next = _jlSoundList; sp->next = _jlSoundList;
_jlSoundList = sp; _jlSoundList = sp;
_jlSoundsPlaying++;
SDL_UnlockAudioDevice(_jlAudioDevice); SDL_UnlockAudioDevice(_jlAudioDevice);
} }
} }
@ -593,7 +587,6 @@ void jlSoundStop(jlSoundT *sound) {
temp = cur; temp = cur;
cur = cur->next; cur = cur->next;
jlFree(temp); jlFree(temp);
_jlSoundsPlaying--;
} else { } else {
prev = cur; prev = cur;
cur = cur->next; cur = cur->next;
@ -738,7 +731,7 @@ int main(int argc, char *argv[]) {
// Create a window and renderer using SDL // Create a window and renderer using SDL
_jlWindow = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (320 + BORDER_WIDTH * 2) * _jlWindowZoom, (200 + BORDER_WIDTH * 2) * _jlWindowZoom, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); _jlWindow = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (320 + BORDER_WIDTH * 2) * _jlWindowZoom, (200 + BORDER_WIDTH * 2) * _jlWindowZoom, SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
_jlRenderer = SDL_CreateRenderer(_jlWindow, -1, SDL_RENDERER_SOFTWARE); _jlRenderer = SDL_CreateRenderer(_jlWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
_jlTexture = SDL_CreateTexture(_jlRenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 320, 200); _jlTexture = SDL_CreateTexture(_jlRenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 320, 200);
_jlPixelFormat = SDL_AllocFormat(SDL_GetWindowPixelFormat(_jlWindow)); _jlPixelFormat = SDL_AllocFormat(SDL_GetWindowPixelFormat(_jlWindow));