Header file addons & Q_atoi -> atoi changes for WIN32

This commit is contained in:
Danne 2000-05-21 11:28:37 +00:00
parent 5f3c129314
commit 6ed6543fef
7 changed files with 43 additions and 30 deletions

View file

@ -31,6 +31,8 @@
#endif #endif
#include <windows.h> #include <windows.h>
#include "quakedef.h" #include "quakedef.h"
#include "cdaudio.h"
#include "cmd.h"
extern HWND mainwindow; extern HWND mainwindow;
/* extern cvar_t bgmvolume; /* extern cvar_t bgmvolume;
@ -271,13 +273,13 @@ static void CD_f (void)
command = Cmd_Argv (1); command = Cmd_Argv (1);
if (Q_strcasecmp(command, "on") == 0) if (strcasecmp(command, "on") == 0)
{ {
enabled = true; enabled = true;
return; return;
} }
if (Q_strcasecmp(command, "off") == 0) if (strcasecmp(command, "off") == 0)
{ {
if (playing) if (playing)
CDAudio_Stop(); CDAudio_Stop();
@ -285,7 +287,7 @@ static void CD_f (void)
return; return;
} }
if (Q_strcasecmp(command, "reset") == 0) if (strcasecmp(command, "reset") == 0)
{ {
enabled = true; enabled = true;
if (playing) if (playing)
@ -296,7 +298,7 @@ static void CD_f (void)
return; return;
} }
if (Q_strcasecmp(command, "remap") == 0) if (strcasecmp(command, "remap") == 0)
{ {
ret = Cmd_Argc() - 2; ret = Cmd_Argc() - 2;
if (ret <= 0) if (ret <= 0)
@ -307,11 +309,11 @@ static void CD_f (void)
return; return;
} }
for (n = 1; n <= ret; n++) for (n = 1; n <= ret; n++)
remap[n] = Q_atoi(Cmd_Argv (n+1)); remap[n] = atoi(Cmd_Argv (n+1));
return; return;
} }
if (Q_strcasecmp(command, "close") == 0) if (strcasecmp(command, "close") == 0)
{ {
CDAudio_CloseDoor(); CDAudio_CloseDoor();
return; 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; 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; return;
} }
if (Q_strcasecmp(command, "stop") == 0) if (strcasecmp(command, "stop") == 0)
{ {
CDAudio_Stop(); CDAudio_Stop();
return; return;
} }
if (Q_strcasecmp(command, "pause") == 0) if (strcasecmp(command, "pause") == 0)
{ {
CDAudio_Pause(); CDAudio_Pause();
return; return;
} }
if (Q_strcasecmp(command, "resume") == 0) if (strcasecmp(command, "resume") == 0)
{ {
CDAudio_Resume(); CDAudio_Resume();
return; return;
} }
if (Q_strcasecmp(command, "eject") == 0) if (strcasecmp(command, "eject") == 0)
{ {
if (playing) if (playing)
CDAudio_Stop(); CDAudio_Stop();
@ -366,7 +368,7 @@ static void CD_f (void)
return; return;
} }
if (Q_strcasecmp(command, "info") == 0) if (strcasecmp(command, "info") == 0)
{ {
Con_Printf("%u tracks\n", maxTrack); Con_Printf("%u tracks\n", maxTrack);
if (playing) if (playing)

View file

@ -36,6 +36,10 @@
#include "console.h" #include "console.h"
#include "commdef.h" #include "commdef.h"
#ifdef WIN32
#include "winquake.h"
#endif
#include <math.h> #include <math.h>
/* cvar_t cl_nopred = {"cl_nopred","0"}; /* cvar_t cl_nopred = {"cl_nopred","0"};

View file

@ -59,6 +59,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <limits.h> #include <limits.h>
#include <io.h> #include <io.h>
#include <conio.h> #include <conio.h>
#include "screen.h"
#include "qargs.h"
#include "client.h"
qboolean is_server = false; qboolean is_server = false;
@ -454,8 +457,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
if (!GetCurrentDirectory (sizeof(cwd), cwd)) if (!GetCurrentDirectory (sizeof(cwd), cwd))
Sys_Error ("Couldn't determine current directory"); Sys_Error ("Couldn't determine current directory");
if (cwd[Q_strlen(cwd)-1] == '/') if (cwd[strlen(cwd)-1] == '/')
cwd[Q_strlen(cwd)-1] = 0; cwd[strlen(cwd)-1] = 0;
parms.basedir = cwd; parms.basedir = cwd;
parms.cachedir = NULL; parms.cachedir = NULL;
@ -531,7 +534,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
t = COM_CheckParm("-heapsize") + 1; t = COM_CheckParm("-heapsize") + 1;
if (t < com_argc) if (t < com_argc)
parms.memsize = Q_atoi (com_argv[t]) * 1024; parms.memsize = atoi (com_argv[t]) * 1024;
} }
parms.membase = malloc (parms.memsize); parms.membase = malloc (parms.memsize);

View file

@ -37,7 +37,8 @@
#include "quakedef.h" #include "quakedef.h"
#include "winquake.h" #include "winquake.h"
#include <dinput.h> #include <dinput.h>
#include "client.h"
#include "keys.h"
//#include "dosisms.h" //#include "dosisms.h"
#define DINPUT_BUFFERSIZE 16 #define DINPUT_BUFFERSIZE 16
@ -1026,7 +1027,7 @@ static void Joy_AdvancedUpdate_f (void)
} }
else else
{ {
if (Q_strcmp (joy_name->string, "joystick") != 0) if (strcmp (joy_name->string, "joystick") != 0)
{ {
// notify user of advanced controller // notify user of advanced controller
Con_Printf ("\n%s configured\n\n", joy_name->string); Con_Printf ("\n%s configured\n\n", joy_name->string);

View file

@ -31,6 +31,7 @@
#endif #endif
#include "quakedef.h" #include "quakedef.h"
#include "winquake.h" #include "winquake.h"
#include "sound.h"
#define iDirectSoundCreate(a,b,c) pDirectSoundCreate(a,b,c) #define iDirectSoundCreate(a,b,c) pDirectSoundCreate(a,b,c)

View file

@ -23,12 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif #endif
#include "qwsvdef.h"
#include "winquake.h" #include "winquake.h"
#include <limits.h> #include <limits.h>
#include <direct.h> #include <direct.h>
/* /*
============== ==============
Sys_DoubleTime Sys_DoubleTime

View file

@ -30,6 +30,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
#include <stdlib.h>
#include "quakedef.h" #include "quakedef.h"
#include "winquake.h" #include "winquake.h"
#include "sys.h" #include "sys.h"
@ -39,6 +40,8 @@
#include "keys.h" #include "keys.h"
#include "screen.h" #include "screen.h"
#include "wad.h" #include "wad.h"
#include "cmd.h"
#define MINIMUM_MEMORY 0x550000 #define MINIMUM_MEMORY 0x550000
#define MAX_MODE_LIST 30 #define MAX_MODE_LIST 30
@ -2057,7 +2060,7 @@ void VID_DescribeMode_f (void)
{ {
int modenum; int modenum;
modenum = Q_atoi (Cmd_Argv(1)); modenum = atoi (Cmd_Argv(1));
Con_Printf ("%s\n", VID_GetExtModeDescription (modenum)); Con_Printf ("%s\n", VID_GetExtModeDescription (modenum));
} }
@ -2114,12 +2117,12 @@ void VID_TestMode_f (void)
if (!vid_testingmode) if (!vid_testingmode)
{ {
modenum = Q_atoi (Cmd_Argv(1)); modenum = atoi (Cmd_Argv(1));
if (VID_SetMode (modenum, vid_curpal)) if (VID_SetMode (modenum, vid_curpal))
{ {
vid_testingmode = 1; vid_testingmode = 1;
testduration = Q_atof (Cmd_Argv(2)); testduration = atof (Cmd_Argv(2));
if (testduration == 0) if (testduration == 0)
testduration = 5.0; testduration = 5.0;
vid_testendtime = realtime + testduration; vid_testendtime = realtime + testduration;
@ -2181,7 +2184,7 @@ void VID_ForceMode_f (void)
if (!vid_testingmode) if (!vid_testingmode)
{ {
modenum = Q_atoi (Cmd_Argv(1)); modenum = atoi (Cmd_Argv(1));
force_mode_set = 1; force_mode_set = 1;
VID_SetMode (modenum, vid_curpal); VID_SetMode (modenum, vid_curpal);