Commit cadd1aa5 authored by Steven Fuller's avatar Steven Fuller

Few misc cleanups (specifically US_CheckParm has been removed)

parent d5ae0bf8
......@@ -30,7 +30,6 @@ and right (happens at any view basically, except this version of source does
not leave any artifacts after a few screen redraws)
* remove GOODTIMES (the piracy message is somewhat worthless)
* then consider removing the SOD manual check
* Use either US_CheckParm or MS_CheckParm.
* perhaps rename UPLOAD
* TOO MANY #IFDEFs
* and upload builds with lots of wl6 code anyway (sound references were just
......@@ -70,10 +69,12 @@ PlayDemoFromFile specifically
* make sure all infinite loops are found (looping around Keyboard)
* deathcam went by too fast, and right before the fizzlefade was being done
on the border
same with the spear of destiny animation part of ending
* move all references to gfxbuf to vi_* only (gl will need this anyway,
since it deprecates: id_vh, wl_draw, wl_scale)
by putting in code from id_vh (either by using Plot or just copying it in)
we can stop the large conversion before each UpdateScreen
but palette fades will still need it!
* pause key
* what are special keys... ?
* no fizzlefade in 15-24bit
......
......@@ -1535,7 +1535,7 @@ void PML_ClosePageFile(void)
//
// PM_GetPageAddress() - Returns the address of a given page
// Returns nil if block is not loaded
// Returns NULL if block is not loaded
//
memptr PM_GetPageAddress(int pagenum)
{
......
......@@ -24,8 +24,6 @@
#define O_BINARY 0
#endif
int WolfMain(int argc, char *argv[]);
/* ------------------------------------------------------------------------ */
#ifndef SPEAR
......@@ -54,9 +52,8 @@ int WolfMain(int argc, char *argv[]);
typedef enum {false,true} boolean;
typedef unsigned char byte;
typedef unsigned short int word;
typedef unsigned short int word;
typedef unsigned long longword;
typedef byte * Ptr;
typedef void * memptr;
......@@ -69,8 +66,6 @@ typedef struct
Point ul,lr;
} Rect;
#define nil ((void *)0)
#include "vi_comm.h"
#include "id_ca.h"
......@@ -82,7 +77,9 @@ extern byte signon[];
#define introscn signon
void Quit (char *error); // defined in user program
int MS_CheckParm(char *string);
int WolfMain(int argc, char *argv[]);
void Quit(char *error);
#define MAXTICS 10
#define DEMOTICS 4
......
......@@ -9,7 +9,6 @@ word WindowX,WindowY,WindowW,WindowH;
// Internal variables
static char *ParmStrings[] = {"nowait"};
static boolean US_Started;
void (*USL_MeasureString)(char *,word *,word *) = VW_MeasurePropString,
......@@ -32,25 +31,17 @@ HighScore Scores[MaxScores] = {
// US_Startup() - Starts the User Mgr
//
///////////////////////////////////////////////////////////////////////////
void US_Startup(void)
void US_Startup()
{
int i,n;
if (US_Started)
return;
US_InitRndT(true); // Initialize the random number generator
US_InitRndT(true);
for (i = 1;i < _argc;i++)
{
n = US_CheckParm(_argv[i],ParmStrings);
switch(n)
{
case 0:
NoWait = true;
break;
}
}
if (MS_CheckParm("nowait"))
NoWait = true;
US_Started = true;
}
......@@ -69,40 +60,6 @@ void US_Shutdown(void)
US_Started = false;
}
///////////////////////////////////////////////////////////////////////////
//
// US_CheckParm() - checks to see if a string matches one of a set of
// strings. The check is case insensitive. The routine returns the
// index of the string that matched, or -1 if no matches were found
//
///////////////////////////////////////////////////////////////////////////
int US_CheckParm(char *parm,char **strings)
{
char cp,cs,
*p,*s;
int i;
while (!isalpha(*parm)) // Skip non-alphas
parm++;
for (i = 0;*strings && **strings;i++)
{
for (s = *strings++,p = parm,cs = cp = 0;cs == cp;)
{
cs = *s++;
if (!cs)
return(i);
cp = *p++;
if (isupper(cs))
cs = tolower(cs);
if (isupper(cp))
cp = tolower(cp);
}
}
return -1;
}
// Window/Printing routines
///////////////////////////////////////////////////////////////////////////
......
......@@ -38,10 +38,9 @@ void US_Startup(void),
US_PrintUnsigned(longword n);
boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok,
int maxchars,int maxwidth);
int US_CheckParm(char *parm,char **strings),
US_RndT(void);
int US_RndT();
void USL_PrintInCenter(char *s,Rect r);
void USL_PrintInCenter(char *s,Rect r);
#else
#error "fix me: TODO"
......
......@@ -6,7 +6,7 @@
/* SDM = 2 */
/* SOD = 3 */
#ifndef WMODE
#define WMODE 3
#define WMODE 0
#endif
#if WMODE == 0
......
......@@ -478,8 +478,6 @@ static Direction DirTable[] = // Quick lookup for total direction
dir_SouthWest, dir_South, dir_SouthEast
};
static char *ParmStrings[] = {"nojoys","nomouse",nil};
// Internal routines
int XKeysymToScancode(unsigned int keysym)
......@@ -722,19 +720,12 @@ void IN_Startup(void)
checkjoys = true;
checkmouse = true;
for (i = 1;i < _argc;i++)
{
switch (US_CheckParm(_argv[i],ParmStrings))
{
case 0:
checkjoys = false;
break;
case 1:
checkmouse = false;
break;
}
}
if (MS_CheckParm("nojoy"))
checkjoys = false;
if (MS_CheckParm("nomouse"))
checkmouse = false;
INL_StartKbd();
MousePresent = checkmouse ? INL_StartMouse() : false;
......
......@@ -347,8 +347,6 @@ static Direction DirTable[] = // Quick lookup for total direction
dir_SouthWest, dir_South, dir_SouthEast
};
static char *ParmStrings[] = {"nojoys","nomouse",nil};
// Internal routines
void keyboard_handler(int code, int press)
......@@ -552,19 +550,12 @@ void IN_Startup(void)
checkjoys = true;
checkmouse = true;
for (i = 1;i < _argc;i++)
{
switch (US_CheckParm(_argv[i],ParmStrings))
{
case 0:
checkjoys = false;
break;
case 1:
checkmouse = false;
break;
}
}
if (MS_CheckParm("nojoy"))
checkjoys = false;
if (MS_CheckParm("nomouse"))
checkmouse = false;
INL_StartKbd();
MousePresent = checkmouse ? INL_StartMouse() : false;
......
......@@ -723,8 +723,6 @@ static Direction DirTable[] = // Quick lookup for total direction
dir_SouthWest, dir_South, dir_SouthEast
};
static char *ParmStrings[] = {"nojoys","nomouse",nil};
// Internal routines
int XKeysymToScancode(unsigned int keysym)
......@@ -967,19 +965,12 @@ void IN_Startup(void)
checkjoys = true;
checkmouse = true;
for (i = 1;i < _argc;i++)
{
switch (US_CheckParm(_argv[i],ParmStrings))
{
case 0:
checkjoys = false;
break;
case 1:
checkmouse = false;
break;
}
}
if (MS_CheckParm("nojoy"))
checkjoys = false;
if (MS_CheckParm("nomouse"))
checkmouse = false;
INL_StartKbd();
MousePresent = checkmouse ? INL_StartMouse() : false;
......
......@@ -702,8 +702,6 @@ typedef enum {
=============================================================================
*/
int MS_CheckParm(char *string);
extern char str[80],str2[20];
extern fixed focallength;
......
......@@ -1119,7 +1119,7 @@ void CheckHighScore (long score,word other)
PrintX = 4*8;
backcolor = BORDCOLOR;
fontcolor = 15;
US_LineInput(PrintX,PrintY,Scores[n].name,nil,true,MaxHighName,100);
US_LineInput(PrintX,PrintY,Scores[n].name,NULL,true,MaxHighName,100);
#else
PrintX = 16;
fontnumber = 1;
......@@ -1127,7 +1127,7 @@ void CheckHighScore (long score,word other)
VW_UpdateScreen ();
backcolor = 0x9c;
fontcolor = 15;
US_LineInput(PrintX,PrintY,Scores[n].name,nil,true,MaxHighName,130);
US_LineInput(PrintX,PrintY,Scores[n].name,NULL,true,MaxHighName,130);
#endif
}
else
......@@ -1376,7 +1376,7 @@ void CopyProtection(void)
inputbuffer[0] = 0;
PrintY = TYPEBOX_Y;
fontnumber = 1;
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,20,100);
US_LineInput(PrintX,PrintY,inputbuffer,NULL,true,20,100);
match = 0;
for (i=0;i<strlen(bossstrs[whichboss]);i++)
......@@ -1410,7 +1410,7 @@ void CopyProtection(void)
backcolor = TYPEBOX_BKGD;
inputbuffer[0] = 0;
PrintY = TYPEBOX_Y;
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100);
US_LineInput(PrintX,PrintY,inputbuffer,NULL,true,6,100);
strlwr(inputbuffer);
match = 1-(strcmp(inputbuffer,WordCorrect[whichword])!=0);
......@@ -1436,7 +1436,7 @@ void CopyProtection(void)
backcolor = TYPEBOX_BKGD;
inputbuffer[0] = 0;
PrintY = TYPEBOX_Y;
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,20,120);
US_LineInput(PrintX,PrintY,inputbuffer,NULL,true,20,120);
strlwr(inputbuffer);
match = 0;
......@@ -1467,7 +1467,7 @@ void CopyProtection(void)
backcolor = TYPEBOX_BKGD;
inputbuffer[0] = 0;
PrintY = TYPEBOX_Y;
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100);
US_LineInput(PrintX,PrintY,inputbuffer,NULL,true,6,100);
strlwr(inputbuffer);
match = 1-(strcmp(inputbuffer,MiscCorrect[whichone])!=0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment