From 7f20ae7ce0c3a8197c48ce11fb0e99eb923c6fbb Mon Sep 17 00:00:00 2001 From: Timo Korvola Date: Thu, 1 Mar 2018 22:05:36 +0200 Subject: [PATCH] sfrotz now links. Dies of SEGV though. --- .gitignore | 2 ++ Makefile | 2 ++ src/sdl/Makefile | 3 +-- src/sdl/sf_sound.c | 7 +++++++ src/sdl/sf_video.c | 8 ++++++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 072e496..365d93c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ frotz dfrotz +sfrotz +*.d *.o *.O *.OBJ diff --git a/Makefile b/Makefile index 1211d24..66bbc79 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ else GIT_TAG = $(VERSION) endif +export CFLAGS + # Enable compiler warnings. This is an absolute minimum. CFLAGS += -Wall -Wextra -std=gnu99 diff --git a/src/sdl/Makefile b/src/sdl/Makefile index acaf66b..c8a897f 100644 --- a/src/sdl/Makefile +++ b/src/sdl/Makefile @@ -2,13 +2,12 @@ SDL_PKGS ?= libpng libjpeg libsdl SDL_mixer freetype2 zlib -CC = gcc CFLAGS += `pkg-config $(SDL_PKGS) --cflags` ARFLAGS = rvU SOURCES = sf_aiffwav.c sf_fonts.c sf_msg_en.c sf_resource.c sf_util.c \ sf_deffont.c sf_ftype.c sf_osfdlg.c sf_sig.c sf_video.c \ - sf_font3.c sf_images.c sf_resample.c sf_sound.c + sf_font3.c sf_images.c sf_resample.c sf_sound.c generic.c HEADERS = samplerate.h sf_frotz.h diff --git a/src/sdl/sf_sound.c b/src/sdl/sf_sound.c index 63d19df..dea4d99 100644 --- a/src/sdl/sf_sound.c +++ b/src/sdl/sf_sound.c @@ -67,6 +67,13 @@ static void finishaudio() static void music_finished(void); static void channel_finished(int channel); +/* + * This interface is broken. The function gets called regardless of + * whether sound is desired and has no means for indicating whether sound is + * available. See sf_initsound for the real init. + */ +void os_init_sound() {} + int sf_initsound() { if (SFaudiorunning) return 1; diff --git a/src/sdl/sf_video.c b/src/sdl/sf_video.c index a5f4d28..a21ef10 100644 --- a/src/sdl/sf_video.c +++ b/src/sdl/sf_video.c @@ -375,6 +375,14 @@ void os_scroll_area(int top, int left, int bottom, int right, int units) // theWnd->FlushDisplay(); } +bool os_repaint_window(int win, int ypos_old, int ypos_new, int xpos, + int ysize, int xsize) +{ + //TODO + return FALSE; +} + + int SFdticks = 200; volatile bool SFticked = 0; static SDL_TimerID timerid = 0; -- 2.34.1