From e4070e69e09482ecfa633b05c73ad6fd600631df Mon Sep 17 00:00:00 2001 From: turbocat Date: Mon, 4 Oct 2021 17:21:33 +0000 Subject: [PATCH] Wolf3D: uSDL is no longer needed. git-svn-id: svn://kolibrios.org@9213 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/games/wolf3d/SDL_mixer/mixer.c | 9 ++------- contrib/games/wolf3d/SDL_mixer/music.c | 10 +++------- contrib/games/wolf3d/Tupfile.lua | 2 +- contrib/games/wolf3d/wl_def.h | 11 ++--------- contrib/games/wolf3d/wl_main.cpp | 10 ++-------- 5 files changed, 10 insertions(+), 32 deletions(-) diff --git a/contrib/games/wolf3d/SDL_mixer/mixer.c b/contrib/games/wolf3d/SDL_mixer/mixer.c index cc03c37c68..89937bb57f 100644 --- a/contrib/games/wolf3d/SDL_mixer/mixer.c +++ b/contrib/games/wolf3d/SDL_mixer/mixer.c @@ -42,13 +42,8 @@ #define __MIX_INTERNAL_EFFECT__ #include "effects_internal.h" -#ifdef _KOLIBRI - void uSDL_Delay(unsigned int time); - unsigned uSDL_GetTicks(); -#else - #define uSDL_Delay SDL_Delay - #define uSDL_GetTicks SDL_GetTicks -#endif +#define uSDL_Delay SDL_Delay +#define uSDL_GetTicks SDL_GetTicks /* Magic numbers for various audio file formats */ #define RIFF 0x46464952 /* "RIFF" */ diff --git a/contrib/games/wolf3d/SDL_mixer/music.c b/contrib/games/wolf3d/SDL_mixer/music.c index bbc7700d16..e172dc44f4 100644 --- a/contrib/games/wolf3d/SDL_mixer/music.c +++ b/contrib/games/wolf3d/SDL_mixer/music.c @@ -70,14 +70,10 @@ #if defined(MP3_MUSIC) || defined(MP3_MAD_MUSIC) static SDL_AudioSpec used_mixer; #endif +unsigned uSDL_GetTicks(); -#ifdef _KOLIBRI - extern void uSDL_Delay(unsigned int time); - extern unsigned uSDL_GetTicks(); -#else - #define uSDL_Delay SDL_Delay - #define uSDL_GetTicks SDL_GetTicks -#endif +#define uSDL_Delay SDL_Delay +#define uSDL_GetTicks SDL_GetTicks int volatile music_active = 1; static int volatile music_stopped = 0; diff --git a/contrib/games/wolf3d/Tupfile.lua b/contrib/games/wolf3d/Tupfile.lua index cee849460c..53f12176b7 100644 --- a/contrib/games/wolf3d/Tupfile.lua +++ b/contrib/games/wolf3d/Tupfile.lua @@ -23,7 +23,7 @@ compile_gcc{ -- SDL and SDL_mixer -- compile_gcc{ "SDL/SDL_wave.c", "SDL/SDL_audiocvt.c", "SDL/SDL_mixer.c", "SDL_mixer/mixer.c", "SDL_mixer/music.c", - "SDL_mixer/load_aiff.c", "SDL_mixer/load_voc.c", "SDL/uSDL.c", + "SDL_mixer/load_aiff.c", "SDL_mixer/load_voc.c", "SDL_mixer/effects_internal.c", "SDL_mixer/effect_position.c", } diff --git a/contrib/games/wolf3d/wl_def.h b/contrib/games/wolf3d/wl_def.h index 421dcfacba..b468029781 100755 --- a/contrib/games/wolf3d/wl_def.h +++ b/contrib/games/wolf3d/wl_def.h @@ -24,15 +24,8 @@ # define O_BINARY 0 #endif -#ifdef _KOLIBRI -extern "C"{ - extern void uSDL_Delay(unsigned int time); - extern unsigned uSDL_GetTicks(); -} -#else - #define uSDL_Delay SDL_Delay - #define uSDL_GetTicks SDL_GetTicks -#endif +#define uSDL_Delay SDL_Delay +#define uSDL_GetTicks SDL_GetTicks #pragma pack(1) diff --git a/contrib/games/wolf3d/wl_main.cpp b/contrib/games/wolf3d/wl_main.cpp index d07154e242..be108f23f1 100755 --- a/contrib/games/wolf3d/wl_main.cpp +++ b/contrib/games/wolf3d/wl_main.cpp @@ -27,9 +27,7 @@ extern byte signon[]; extern void kolibri_set_win_center(); extern char* dirname(char* path); extern void setcwd(char* path); -extern "C"{ - extern void uSDL_StartTicks(void); -} + extern boolean SD_Started; /* ============================================================================= @@ -1216,11 +1214,7 @@ static void InitGame() #if defined _WIN32 putenv("SDL_VIDEODRIVER=directx"); #endif - -#ifdef _KOLIBRI - uSDL_StartTicks(); -#endif - + if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { printf("Unable to init SDL: %s\n", SDL_GetError());