diff options
author | Vencislav Atanasov <user890104@freemyipod.org> | 2019-07-28 23:31:50 +0300 |
---|---|---|
committer | Vencislav Atanasov <user890104@freemyipod.org> | 2019-07-29 01:59:40 +0300 |
commit | 183e45e8d0b4425bbd41fab37f2a4dc143e1e27c (patch) | |
tree | 5e25c211f6a3bd46dc594123451af00c1bf7ef9c /apps/plugins/sdl/progs/duke3d/Game/src/game.c | |
parent | e19857e712ff54cec08d5a6342a32dae2788cb50 (diff) | |
download | rockbox-183e45e8d0b4425bbd41fab37f2a4dc143e1e27c.tar.gz rockbox-183e45e8d0b4425bbd41fab37f2a4dc143e1e27c.zip |
sdl: Remove platform-specific code
Also nuke the Makefiles of Duke Nukem 3D (pun intended).
Change-Id: If2707cf079bfb9299347f9c5f980780134b6ecda
Diffstat (limited to 'apps/plugins/sdl/progs/duke3d/Game/src/game.c')
-rw-r--r-- | apps/plugins/sdl/progs/duke3d/Game/src/game.c | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/apps/plugins/sdl/progs/duke3d/Game/src/game.c b/apps/plugins/sdl/progs/duke3d/Game/src/game.c index 0cb1d95b86..8b2c0e959f 100644 --- a/apps/plugins/sdl/progs/duke3d/Game/src/game.c +++ b/apps/plugins/sdl/progs/duke3d/Game/src/game.c | |||
@@ -24,11 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | //------------------------------------------------------------------------- | 25 | //------------------------------------------------------------------------- |
26 | 26 | ||
27 | #ifdef _WIN32 | ||
28 | #include <windows.h> | ||
29 | #else | ||
30 | #include "SDL.h" | 27 | #include "SDL.h" |
31 | #endif | ||
32 | 28 | ||
33 | #include "types.h" | 29 | #include "types.h" |
34 | 30 | ||
@@ -113,38 +109,12 @@ void pitch_test( void ); | |||
113 | uint8_t restorepalette,screencapt,nomorelogohack; | 109 | uint8_t restorepalette,screencapt,nomorelogohack; |
114 | int sendmessagecommand = -1; | 110 | int sendmessagecommand = -1; |
115 | 111 | ||
116 | #if PLATFORM_DOS | ||
117 | task *TimerPtr=NULL; | ||
118 | #endif | ||
119 | |||
120 | extern int32_t lastvisinc; | 112 | extern int32_t lastvisinc; |
121 | 113 | ||
122 | // Build Engine port implements this. --ryan. | ||
123 | #if PLATFORM_DOS | ||
124 | static void timerhandler(task *unused) | ||
125 | { | ||
126 | totalclock++; | ||
127 | } | ||
128 | |||
129 | void inittimer() | ||
130 | { | ||
131 | TimerPtr = TS_ScheduleTask( timerhandler,TICRATE, 1, NULL ); | ||
132 | TS_Dispatch(); | ||
133 | } | ||
134 | |||
135 | void uninittimer(void) | ||
136 | { | ||
137 | if (TimerPtr) | ||
138 | TS_Terminate( TimerPtr ); | ||
139 | TimerPtr = NULL; | ||
140 | TS_Shutdown(); | ||
141 | } | ||
142 | #else | ||
143 | void timerhandler(void) | 114 | void timerhandler(void) |
144 | { | 115 | { |
145 | totalclock++; | 116 | totalclock++; |
146 | } | 117 | } |
147 | #endif | ||
148 | 118 | ||
149 | int gametext(int x,int y,char *t,uint8_t s,short dabits) | 119 | int gametext(int x,int y,char *t,uint8_t s,short dabits) |
150 | { | 120 | { |
@@ -2471,11 +2441,7 @@ GOTOHERE: | |||
2471 | if(true) | 2441 | if(true) |
2472 | { | 2442 | { |
2473 | if(*t == ' ' && *(t+1) == 0) *t = 0; | 2443 | if(*t == ' ' && *(t+1) == 0) *t = 0; |
2474 | #if PLATFORM_DOS // Is there a good reason for this? --ryan. | ||
2475 | printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); | ||
2476 | #else | ||
2477 | printf("\n%s\n",t); | 2444 | printf("\n%s\n",t); |
2478 | #endif | ||
2479 | } | 2445 | } |
2480 | // CTW END - MODIFICATION | 2446 | // CTW END - MODIFICATION |
2481 | } | 2447 | } |
@@ -7818,18 +7784,11 @@ void Startup(void) | |||
7818 | if(networkmode == 255) | 7784 | if(networkmode == 255) |
7819 | networkmode = 1; | 7785 | networkmode = 1; |
7820 | 7786 | ||
7821 | #ifdef PLATFORM_DOS | ||
7822 | puts("Checking music inits."); | ||
7823 | MusicStartup(); | ||
7824 | puts("Checking sound inits."); | ||
7825 | SoundStartup(); | ||
7826 | #else | ||
7827 | /* SBF - wasn't sure if swapping them would harm anything. */ | 7787 | /* SBF - wasn't sure if swapping them would harm anything. */ |
7828 | puts("Checking sound inits."); | 7788 | puts("Checking sound inits."); |
7829 | SoundStartup(); | 7789 | SoundStartup(); |
7830 | puts("Checking music inits."); | 7790 | puts("Checking music inits."); |
7831 | MusicStartup(); | 7791 | MusicStartup(); |
7832 | #endif | ||
7833 | 7792 | ||
7834 | // AutoAim | 7793 | // AutoAim |
7835 | if(nHostForceDisableAutoaim) | 7794 | if(nHostForceDisableAutoaim) |
@@ -8019,64 +7978,6 @@ void getnames(void) | |||
8019 | 7978 | ||
8020 | 7979 | ||
8021 | const char* const baseDir="duke3d*.grp"; | 7980 | const char* const baseDir="duke3d*.grp"; |
8022 | #ifdef _WIN32 | ||
8023 | |||
8024 | void findGRPToUse(uint8_t * groupfilefullpath) | ||
8025 | { | ||
8026 | WIN32_FIND_DATA FindFileData; | ||
8027 | HANDLE hFind = INVALID_HANDLE_VALUE; | ||
8028 | int i=0,kbdKey ; | ||
8029 | char groupfile[9][512]; | ||
8030 | int grpID ; | ||
8031 | |||
8032 | if(getGameDir()[0] != '\0') | ||
8033 | { | ||
8034 | sprintf(groupfilefullpath, "%s\\%s", getGameDir(), baseDir); | ||
8035 | hFind = FindFirstFile(groupfilefullpath, &FindFileData); | ||
8036 | if (hFind == INVALID_HANDLE_VALUE) | ||
8037 | { | ||
8038 | sprintf(groupfilefullpath, "%s", baseDir); | ||
8039 | } | ||
8040 | else | ||
8041 | FindClose(hFind); | ||
8042 | } | ||
8043 | else | ||
8044 | sprintf(groupfilefullpath, "%s", baseDir); | ||
8045 | |||
8046 | printf("Searching '%d':\n\n",groupfilefullpath); | ||
8047 | hFind = FindFirstFile(groupfilefullpath,&FindFileData); | ||
8048 | |||
8049 | if ( hFind==INVALID_HANDLE_VALUE ) | ||
8050 | Error(EXIT_SUCCESS, "Can't find '%s'\n", groupfilefullpath); | ||
8051 | |||
8052 | do | ||
8053 | { | ||
8054 | i++; | ||
8055 | sprintf(groupfile[i-1], "%s", FindFileData.cFileName); | ||
8056 | printf("Found GRP #%d:\t%d Bytes\t %s \n", i, FindFileData.nFileSizeLow, groupfile[i-1]); | ||
8057 | } while ( FindNextFile(hFind, &FindFileData) && i < 9 ); | ||
8058 | |||
8059 | if(i==1) | ||
8060 | grpID = 0; | ||
8061 | else | ||
8062 | { | ||
8063 | printf("\n-> Choose a base GRP file from 1 to %c: ",'0' + i); | ||
8064 | do | ||
8065 | kbdKey = getch(); | ||
8066 | while(kbdKey < '1' || kbdKey > ('0' + i)); | ||
8067 | printf("%c\n", kbdKey); | ||
8068 | grpID = groupfile[kbdKey-'1']; | ||
8069 | |||
8070 | } | ||
8071 | |||
8072 | FindClose(hFind); | ||
8073 | if (strlen(getGameDir()) == 0) | ||
8074 | sprintf(groupfilefullpath, "./%s", groupfile[grpID]); | ||
8075 | else | ||
8076 | sprintf(groupfilefullpath, "%s//%s", getGameDir(), groupfile[grpID]); | ||
8077 | } | ||
8078 | |||
8079 | #else | ||
8080 | 7981 | ||
8081 | int dukeGRP_Match(char* filename,int length) | 7982 | int dukeGRP_Match(char* filename,int length) |
8082 | { | 7983 | { |
@@ -8126,8 +8027,6 @@ void findGRPToUse(char * groupfilefullpath){ | |||
8126 | } | 8027 | } |
8127 | } | 8028 | } |
8128 | 8029 | ||
8129 | #endif | ||
8130 | |||
8131 | static int load_duke3d_groupfile(void) | 8030 | static int load_duke3d_groupfile(void) |
8132 | { | 8031 | { |
8133 | // FIX_00032: Added multi base GRP manager. Use duke3d*.grp to handle multiple grp. | 8032 | // FIX_00032: Added multi base GRP manager. Use duke3d*.grp to handle multiple grp. |