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