From 6ed6543fef441e2e1922eab99ec49b93c2cf0d74 Mon Sep 17 00:00:00 2001 From: Danne Date: Sun, 21 May 2000 11:28:37 +0000 Subject: [PATCH] Header file addons & Q_atoi -> atoi changes for WIN32 --- source/cd_win.c | 32 +++++++++++++++++--------------- source/cl_pred.c | 4 ++++ source/cl_sys_win.c | 11 +++++++---- source/in_win.c | 11 ++++++----- source/snd_win.c | 1 + source/sys_win.c | 3 +-- source/vid_mgl.c | 11 +++++++---- 7 files changed, 43 insertions(+), 30 deletions(-) diff --git a/source/cd_win.c b/source/cd_win.c index 8ac5cc8..719074e 100644 --- a/source/cd_win.c +++ b/source/cd_win.c @@ -31,6 +31,8 @@ #endif #include #include "quakedef.h" +#include "cdaudio.h" +#include "cmd.h" extern HWND mainwindow; /* extern cvar_t bgmvolume; @@ -271,13 +273,13 @@ static void CD_f (void) command = Cmd_Argv (1); - if (Q_strcasecmp(command, "on") == 0) + if (strcasecmp(command, "on") == 0) { enabled = true; return; } - if (Q_strcasecmp(command, "off") == 0) + if (strcasecmp(command, "off") == 0) { if (playing) CDAudio_Stop(); @@ -285,7 +287,7 @@ static void CD_f (void) return; } - if (Q_strcasecmp(command, "reset") == 0) + if (strcasecmp(command, "reset") == 0) { enabled = true; if (playing) @@ -296,7 +298,7 @@ static void CD_f (void) return; } - if (Q_strcasecmp(command, "remap") == 0) + if (strcasecmp(command, "remap") == 0) { ret = Cmd_Argc() - 2; if (ret <= 0) @@ -307,11 +309,11 @@ static void CD_f (void) return; } for (n = 1; n <= ret; n++) - remap[n] = Q_atoi(Cmd_Argv (n+1)); + remap[n] = atoi(Cmd_Argv (n+1)); return; } - if (Q_strcasecmp(command, "close") == 0) + if (strcasecmp(command, "close") == 0) { CDAudio_CloseDoor(); return; @@ -327,37 +329,37 @@ static void CD_f (void) } } - if (Q_strcasecmp(command, "play") == 0) + if (strcasecmp(command, "play") == 0) { - CDAudio_Play((byte)Q_atoi(Cmd_Argv (2)), false); + CDAudio_Play((byte)atoi(Cmd_Argv (2)), false); return; } - if (Q_strcasecmp(command, "loop") == 0) + if (strcasecmp(command, "loop") == 0) { - CDAudio_Play((byte)Q_atoi(Cmd_Argv (2)), true); + CDAudio_Play((byte)atoi(Cmd_Argv (2)), true); return; } - if (Q_strcasecmp(command, "stop") == 0) + if (strcasecmp(command, "stop") == 0) { CDAudio_Stop(); return; } - if (Q_strcasecmp(command, "pause") == 0) + if (strcasecmp(command, "pause") == 0) { CDAudio_Pause(); return; } - if (Q_strcasecmp(command, "resume") == 0) + if (strcasecmp(command, "resume") == 0) { CDAudio_Resume(); return; } - if (Q_strcasecmp(command, "eject") == 0) + if (strcasecmp(command, "eject") == 0) { if (playing) CDAudio_Stop(); @@ -366,7 +368,7 @@ static void CD_f (void) return; } - if (Q_strcasecmp(command, "info") == 0) + if (strcasecmp(command, "info") == 0) { Con_Printf("%u tracks\n", maxTrack); if (playing) diff --git a/source/cl_pred.c b/source/cl_pred.c index 0b71f52..7872ed7 100644 --- a/source/cl_pred.c +++ b/source/cl_pred.c @@ -36,6 +36,10 @@ #include "console.h" #include "commdef.h" +#ifdef WIN32 +#include "winquake.h" +#endif + #include /* cvar_t cl_nopred = {"cl_nopred","0"}; diff --git a/source/cl_sys_win.c b/source/cl_sys_win.c index ebc8296..94f2a86 100644 --- a/source/cl_sys_win.c +++ b/source/cl_sys_win.c @@ -59,6 +59,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include "screen.h" +#include "qargs.h" +#include "client.h" qboolean is_server = false; @@ -454,8 +457,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin if (!GetCurrentDirectory (sizeof(cwd), cwd)) Sys_Error ("Couldn't determine current directory"); - if (cwd[Q_strlen(cwd)-1] == '/') - cwd[Q_strlen(cwd)-1] = 0; + if (cwd[strlen(cwd)-1] == '/') + cwd[strlen(cwd)-1] = 0; parms.basedir = cwd; parms.cachedir = NULL; @@ -481,7 +484,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin *lpCmdLine = 0; lpCmdLine++; } - + } } @@ -531,7 +534,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin t = COM_CheckParm("-heapsize") + 1; if (t < com_argc) - parms.memsize = Q_atoi (com_argv[t]) * 1024; + parms.memsize = atoi (com_argv[t]) * 1024; } parms.membase = malloc (parms.memsize); diff --git a/source/in_win.c b/source/in_win.c index c1e03f6..4cdb654 100644 --- a/source/in_win.c +++ b/source/in_win.c @@ -37,7 +37,8 @@ #include "quakedef.h" #include "winquake.h" #include - +#include "client.h" +#include "keys.h" //#include "dosisms.h" #define DINPUT_BUFFERSIZE 16 @@ -913,7 +914,7 @@ static void IN_StartupJoystick (void) joy_avail = false; // abort startup if user requests no joystick - if ( COM_CheckParm ("-nojoy") ) + if ( COM_CheckParm ("-nojoy") ) return; // verify joystick driver is present @@ -946,7 +947,7 @@ static void IN_StartupJoystick (void) memset (&jc, 0, sizeof(jc)); if ((mmr = joyGetDevCaps (joy_id, &jc, sizeof(jc))) != JOYERR_NOERROR) { - Con_Printf ("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr); + Con_Printf ("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr); return; } @@ -963,7 +964,7 @@ static void IN_StartupJoystick (void) joy_avail = true; joy_advancedinit = false; - Con_Printf ("\njoystick detected\n\n"); + Con_Printf ("\njoystick detected\n\n"); } @@ -1026,7 +1027,7 @@ static void Joy_AdvancedUpdate_f (void) } else { - if (Q_strcmp (joy_name->string, "joystick") != 0) + if (strcmp (joy_name->string, "joystick") != 0) { // notify user of advanced controller Con_Printf ("\n%s configured\n\n", joy_name->string); diff --git a/source/snd_win.c b/source/snd_win.c index 4b61279..32f78b4 100644 --- a/source/snd_win.c +++ b/source/snd_win.c @@ -31,6 +31,7 @@ #endif #include "quakedef.h" #include "winquake.h" +#include "sound.h" #define iDirectSoundCreate(a,b,c) pDirectSoundCreate(a,b,c) diff --git a/source/sys_win.c b/source/sys_win.c index e50bc45..647152b 100644 --- a/source/sys_win.c +++ b/source/sys_win.c @@ -23,12 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef HAVE_CONFIG_H # include #endif -#include "qwsvdef.h" + #include "winquake.h" #include #include - /* ============== Sys_DoubleTime diff --git a/source/vid_mgl.c b/source/vid_mgl.c index a0b9f0c..403e30c 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -30,6 +30,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include #include "quakedef.h" #include "winquake.h" #include "sys.h" @@ -39,6 +40,8 @@ #include "keys.h" #include "screen.h" #include "wad.h" +#include "cmd.h" + #define MINIMUM_MEMORY 0x550000 #define MAX_MODE_LIST 30 @@ -2057,7 +2060,7 @@ void VID_DescribeMode_f (void) { int modenum; - modenum = Q_atoi (Cmd_Argv(1)); + modenum = atoi (Cmd_Argv(1)); Con_Printf ("%s\n", VID_GetExtModeDescription (modenum)); } @@ -2114,12 +2117,12 @@ void VID_TestMode_f (void) if (!vid_testingmode) { - modenum = Q_atoi (Cmd_Argv(1)); + modenum = atoi (Cmd_Argv(1)); if (VID_SetMode (modenum, vid_curpal)) { vid_testingmode = 1; - testduration = Q_atof (Cmd_Argv(2)); + testduration = atof (Cmd_Argv(2)); if (testduration == 0) testduration = 5.0; vid_testendtime = realtime + testduration; @@ -2181,7 +2184,7 @@ void VID_ForceMode_f (void) if (!vid_testingmode) { - modenum = Q_atoi (Cmd_Argv(1)); + modenum = atoi (Cmd_Argv(1)); force_mode_set = 1; VID_SetMode (modenum, vid_curpal);