Rev 9124 | Rev 9213 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9124 | Rev 9133 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | extern char* dirname(char* path); |
28 | extern char* dirname(char* path); |
29 | extern void setcwd(char* path); |
29 | extern void setcwd(char* path); |
30 | extern "C"{ |
30 | extern "C"{ |
31 | extern void uSDL_StartTicks(void); |
31 | extern void uSDL_StartTicks(void); |
32 | } |
32 | } |
- | 33 | extern boolean SD_Started; |
|
33 | /* |
34 | /* |
34 | ============================================================================= |
35 | ============================================================================= |
Line 35... | Line 36... | ||
35 | 36 | ||
Line 1213... | Line 1214... | ||
1213 | 1214 | ||
1214 | // initialize SDL |
1215 | // initialize SDL |
1215 | #if defined _WIN32 |
1216 | #if defined _WIN32 |
1216 | putenv("SDL_VIDEODRIVER=directx"); |
1217 | putenv("SDL_VIDEODRIVER=directx"); |
- | 1218 | #endif |
|
- | 1219 | ||
- | 1220 | #ifdef _KOLIBRI |
|
- | 1221 | uSDL_StartTicks(); |
|
- | 1222 | #endif |
|
1217 | #endif |
1223 | |
1218 | if(SDL_Init(SDL_INIT_VIDEO) < 0) |
1224 | if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) |
1219 | { |
1225 | { |
1220 | printf("Unable to init SDL: %s\n", SDL_GetError()); |
1226 | printf("Unable to init SDL: %s\n", SDL_GetError()); |
1221 | exit(1); |
1227 | exit(1); |
1222 | } |
- | |
1223 | #ifdef _KOLIBRI |
- | |
1224 | uSDL_StartTicks(); |
- | |
1225 | #endif |
- | |
1226 | SDL_AudioInit(NULL); |
- | |
Line -... | Line 1228... | ||
- | 1228 | } |
|
1227 | atexit(SDL_Quit); |
1229 | |
1228 | 1230 | #if 0 |
|
1229 | int numJoysticks = SDL_NumJoysticks(); |
1231 | int numJoysticks = SDL_NumJoysticks(); |
1230 | if(param_joystickindex && (param_joystickindex < -1 || param_joystickindex >= numJoysticks)) |
1232 | if(param_joystickindex && (param_joystickindex < -1 || param_joystickindex >= numJoysticks)) |
1231 | { |
1233 | { |
1232 | if(!numJoysticks) |
1234 | if(!numJoysticks) |
1233 | printf("No joysticks are available to SDL!\n"); |
1235 | printf("No joysticks are available to SDL!\n"); |
1234 | else |
1236 | else |
1235 | printf("The joystick index must be between -1 and %i!\n", numJoysticks - 1); |
1237 | printf("The joystick index must be between -1 and %i!\n", numJoysticks - 1); |
Line -... | Line 1238... | ||
- | 1238 | exit(1); |
|
- | 1239 | } |
|
1236 | exit(1); |
1240 | |
1237 | } |
1241 | #endif |
1238 | 1242 | ||
Line 1239... | Line 1243... | ||
1239 | #if defined(GP2X_940) |
1243 | #if defined(GP2X_940) |
Line 1290... | Line 1294... | ||
1290 | 1294 | ||
1291 | 1295 | ||
1292 | // |
1296 | // |
- | 1297 | // build some tables |
|
1293 | // build some tables |
1298 | // |
- | 1299 | if(AdLibPresent || SoundBlasterPresent){ |
|
Line 1294... | Line 1300... | ||
1294 | // |
1300 | InitDigiMap (); |
Line 1295... | Line 1301... | ||
1295 | InitDigiMap (); |
1301 | } |
Line 1719... | Line 1725... | ||
1719 | printf("The tedlevel option is missing the level argument!\n"); |
1725 | printf("The tedlevel option is missing the level argument!\n"); |
1720 | hasError = true; |
1726 | hasError = true; |
1721 | } |
1727 | } |
1722 | else param_tedlevel = atoi(argv[i]); |
1728 | else param_tedlevel = atoi(argv[i]); |
1723 | } |
1729 | } |
- | 1730 | else IFARG("--nosound") |
|
- | 1731 | SD_Started=true; |
|
- | 1732 | #ifndef _KOLIBRI |
|
1724 | else IFARG("--windowed") |
1733 | else IFARG("--windowed") |
1725 | fullscreen = false; |
1734 | fullscreen = false; |
1726 | else IFARG("--windowed-mouse") |
1735 | else IFARG("--windowed-mouse") |
1727 | { |
1736 | { |
1728 | fullscreen = false; |
1737 | fullscreen = false; |
1729 | forcegrabmouse = true; |
1738 | forcegrabmouse = true; |
1730 | } |
1739 | } |
- | 1740 | #endif |
|
1731 | else IFARG("--res") |
1741 | else IFARG("--res") |
1732 | { |
1742 | { |
1733 | if(i + 2 >= argc) |
1743 | if(i + 2 >= argc) |
1734 | { |
1744 | { |
1735 | printf("The res option needs the width and/or the height argument!\n"); |
1745 | printf("The res option needs the width and/or the height argument!\n"); |
Line 1803... | Line 1813... | ||
1803 | printf("Extravbls must be positive!\n"); |
1813 | printf("Extravbls must be positive!\n"); |
1804 | hasError = true; |
1814 | hasError = true; |
1805 | } |
1815 | } |
1806 | } |
1816 | } |
1807 | } |
1817 | } |
- | 1818 | #ifndef _KOLIBRI |
|
1808 | else IFARG("--joystick") |
1819 | else IFARG("--joystick") |
1809 | { |
1820 | { |
1810 | if(++i >= argc) |
1821 | if(++i >= argc) |
1811 | { |
1822 | { |
1812 | printf("The joystick option is missing the index argument!\n"); |
1823 | printf("The joystick option is missing the index argument!\n"); |
Line 1831... | Line 1842... | ||
1831 | hasError = true; |
1842 | hasError = true; |
1832 | } |
1843 | } |
1833 | else param_samplerate = atoi(argv[i]); |
1844 | else param_samplerate = atoi(argv[i]); |
1834 | sampleRateGiven = true; |
1845 | sampleRateGiven = true; |
1835 | } |
1846 | } |
- | 1847 | #endif |
|
1836 | else IFARG("--audiobuffer") |
1848 | else IFARG("--audiobuffer") |
1837 | { |
1849 | { |
1838 | if(++i >= argc) |
1850 | if(++i >= argc) |
1839 | { |
1851 | { |
1840 | printf("The audiobuffer option is missing the size argument!\n"); |
1852 | printf("The audiobuffer option is missing the size argument!\n"); |
Line 1902... | Line 1914... | ||
1902 | #endif |
1914 | #endif |
1903 | "Original Wolfenstein 3D by id Software\n\n" |
1915 | "Original Wolfenstein 3D by id Software\n\n" |
1904 | "Usage: Wolf4SDL [options]\n" |
1916 | "Usage: Wolf4SDL [options]\n" |
1905 | "Options:\n" |
1917 | "Options:\n" |
1906 | " --help This help page\n" |
1918 | " --help This help page\n" |
- | 1919 | " --goobers Run in debug mode\n" |
|
1907 | " --tedlevel |
1920 | " --tedlevel |
1908 | " --baby Sets the difficulty to baby for tedlevel\n" |
1921 | " --baby Sets the difficulty to baby for tedlevel\n" |
1909 | " --easy Sets the difficulty to easy for tedlevel\n" |
1922 | " --easy Sets the difficulty to easy for tedlevel\n" |
1910 | " --normal Sets the difficulty to normal for tedlevel\n" |
1923 | " --normal Sets the difficulty to normal for tedlevel\n" |
1911 | " --hard Sets the difficulty to hard for tedlevel\n" |
1924 | " --hard Sets the difficulty to hard for tedlevel\n" |
1912 | " --nowait Skips intro screens\n" |
1925 | " --nowait Skips intro screens\n" |
- | 1926 | " --nosound Don't use sound\n" |
|
1913 | #ifndef _KOLIBRI |
1927 | #ifndef _KOLIBRI |
1914 | " --windowed[-mouse] Starts the game in a window [and grabs mouse]\n" |
1928 | " --windowed[-mouse] Starts the game in a window [and grabs mouse]\n" |
1915 | #endif |
1929 | #endif |
1916 | " --res |
1930 | " --res |
1917 | " (must be multiple of 320x200 or 320x240)\n" |
1931 | " (must be multiple of 320x200 or 320x240)\n" |
Line 1925... | Line 1939... | ||
1925 | " reduce flickering (unit is currently 8 ms, default: 2)\n" |
1939 | " reduce flickering (unit is currently 8 ms, default: 2)\n" |
1926 | #ifndef _KOLIBRI |
1940 | #ifndef _KOLIBRI |
1927 | " --joystick |
1941 | " --joystick |
1928 | " (-1 to disable joystick, default: 0)\n" |
1942 | " (-1 to disable joystick, default: 0)\n" |
1929 | " --joystickhat |
1943 | " --joystickhat |
1930 | #endif |
- | |
1931 | " --samplerate |
1944 | " --samplerate |
- | 1945 | #endif |
|
1932 | " --audiobuffer |
1946 | " --audiobuffer |
1933 | " (given in bytes, default: 2048 / (44100 / samplerate))\n" |
1947 | " (given in bytes, default: 2048 / (44100 / samplerate))\n" |
1934 | " --ignorenumchunks Ignores the number of chunks in VGAHEAD.*\n" |
1948 | " --ignorenumchunks Ignores the number of chunks in VGAHEAD.*\n" |
1935 | " (may be useful for some broken mods)\n" |
1949 | " (may be useful for some broken mods)\n" |
1936 | " --configdir |
1950 | " --configdir |