SDL1 no longer compiles
Posted: Mon Dec 12, 2016 11:20 am
Whenever I pull new changes from you, I always make SDL1 and SDL2 binaries. Today's pull has broken SDL1 builds:
This exercise also reminds me that every pull, I have to reapply this small patch which (I think) I sent you but was never applied:
-- which causes the ctrl-# debug speed toggles to toggle between frame_delay and your setup saved speed, rather than an irrelevant constant.
Code: Select all
$ make sdl RO_GAME_DIR=/usr/share/games/rocksndiamonds RW_GAME_DIR=/var/games/rocksndiamonds
gcc -DDEBUG -g -Wall -DTARGET_SDL -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DRO_GAME_DIR="\"/usr/share/games/rocksndiamonds\"" -DRW_GAME_DIR="\"/var/games/rocksndiamonds\"" -c system.c
system.c: In function 'InitVideoDisplay':
system.c:382:3: warning: implicit declaration of function 'SDLSetDisplaySize' [-Wimplicit-function-declaration]
gcc -DDEBUG -g -Wall -DTARGET_SDL -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DRO_GAME_DIR="\"/usr/share/games/rocksndiamonds\"" -DRW_GAME_DIR="\"/var/games/rocksndiamonds\"" -c sdl.c
sdl.c: In function 'SDLCreateScreen':
sdl.c:571:3: warning: implicit declaration of function 'SDLSetScreenSizeAndOffsets' [-Wimplicit-function-declaration]
sdl.c: At top level:
sdl.c:2688:13: warning: 'DrawTouchInputOverlay' defined but not used [-Wunused-function]
gcc main.o conf_gfx.o conf_snd.o conf_mus.o conf_hlp.o init.o config.o events.o tools.o screens.o game.o editor.o files.o tape.o anim.o network.o netserv.o libgame/libgame.a game_em/game_em.a game_sp/game_sp.a -lSDL_image -lSDL_mixer -lSDL_net -L/usr/lib/x86_64-linux-gnu -lSDL -lm -o ../rocksndiamonds
libgame/libgame.a(system.o): In function `InitVideoDisplay':
/usr/share/games/rocksndiamonds/downloads/src/rocksndiamonds-git/rocksndiamonds/src/libgame/system.c:382: undefined reference to `SDLSetDisplaySize'
libgame/libgame.a(sdl.o): In function `SDLCreateScreen':
/usr/share/games/rocksndiamonds/downloads/src/rocksndiamonds-git/rocksndiamonds/src/libgame/sdl.c:571: undefined reference to `SDLSetScreenSizeAndOffsets'
collect2: ld returned 1 exit status
make[1]: *** [../rocksndiamonds] Error 1
make[1]: Leaving directory `/usr/share/games/rocksndiamonds/downloads/src/rocksndiamonds-git/rocksndiamonds/src'
make: *** [sdl] Error 2
Code: Select all
$ git diff
diff --git a/src/events.c b/src/events.c
index 0aa4185a..46cb5970 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1418,7 +1418,7 @@ void HandleKeysDebug(Key key)
(mod_key_pressed == setup.debug.frame_delay_use_mod_key))
{
GameFrameDelay = (GameFrameDelay != setup.debug.frame_delay[i] ?
- setup.debug.frame_delay[i] : GAME_FRAME_DELAY);
+ setup.debug.frame_delay[i] : setup.game_frame_delay);
if (!setup.debug.frame_delay_game_only)
MenuFrameDelay = GameFrameDelay;