mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 04:01:17 +00:00
Header file addons & Q_atoi -> atoi changes for WIN32
This commit is contained in:
parent
5f3c129314
commit
6ed6543fef
7 changed files with 43 additions and 30 deletions
|
@ -31,6 +31,8 @@
|
|||
#endif
|
||||
#include <windows.h>
|
||||
#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)
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
#include "console.h"
|
||||
#include "commdef.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include "winquake.h"
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* cvar_t cl_nopred = {"cl_nopred","0"};
|
||||
|
|
|
@ -59,6 +59,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <limits.h>
|
||||
#include <io.h>
|
||||
#include <conio.h>
|
||||
#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);
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
#include "quakedef.h"
|
||||
#include "winquake.h"
|
||||
#include <dinput.h>
|
||||
|
||||
#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);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#endif
|
||||
#include "quakedef.h"
|
||||
#include "winquake.h"
|
||||
#include "sound.h"
|
||||
|
||||
#define iDirectSoundCreate(a,b,c) pDirectSoundCreate(a,b,c)
|
||||
|
||||
|
|
|
@ -23,12 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#include "winquake.h"
|
||||
#include <limits.h>
|
||||
#include <direct.h>
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
Sys_DoubleTime
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#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);
|
||||
|
|
Loading…
Reference in a new issue