Commit 2419d4f9 authored by Steven Fuller's avatar Steven Fuller

Cleanups (wl_game.c)

parent 9fb3c204
......@@ -3,38 +3,31 @@
#include "id_heads.h"
// Global variables
char *abortprogram;
boolean NoWait;
word PrintX,PrintY;
word WindowX,WindowY,WindowW,WindowH;
boolean NoWait;
word PrintX,PrintY;
word WindowX,WindowY,WindowW,WindowH;
// Internal variables
#define ConfigVersion 1
static char *ParmStrings[] = {"TEDLEVEL","NOWAIT"},
*ParmStrings2[] = {"COMP","NOCOMP"};
static boolean US_Started;
boolean Button0,Button1,
CursorBad;
int CursorX,CursorY;
int CursorX,CursorY;
void (*USL_MeasureString)(char *,word *,word *) = VW_MeasurePropString,
(*USL_DrawString)(char *) = VWB_DrawPropString;
void (*USL_MeasureString)(char *,word *,word *) = VW_MeasurePropString,
(*USL_DrawString)(char *) = VWB_DrawPropString;
SaveGame Games[MaxSaveGames];
HighScore Scores[MaxScores] =
{
{"id software-'92",10000,1},
{"Adrian Carmack",10000,1},
{"John Carmack",10000,1},
{"Kevin Cloud",10000,1},
{"Tom Hall",10000,1},
{"John Romero",10000,1},
{"Jay Wilbur",10000,1},
};
// Internal routines
SaveGame Games[MaxSaveGames];
HighScore Scores[MaxScores] = {
{"id software-'92",10000,1},
{"Adrian Carmack",10000,1},
{"John Carmack",10000,1},
{"Kevin Cloud",10000,1},
{"Tom Hall",10000,1},
{"John Romero",10000,1},
{"Jay Wilbur",10000,1},
};
// Public routines
......@@ -94,8 +87,7 @@ void US_Shutdown(void)
// index of the string that matched, or -1 if no matches were found
//
///////////////////////////////////////////////////////////////////////////
int
US_CheckParm(char *parm,char **strings)
int US_CheckParm(char *parm,char **strings)
{
char cp,cs,
*p,*s;
......@@ -132,8 +124,7 @@ US_CheckParm(char *parm,char **strings)
// between masked and non-masked fonts
//
///////////////////////////////////////////////////////////////////////////
void
US_SetPrintRoutines(void (*measure)(char *,word *,word *),void (*print)(char *))
void US_SetPrintRoutines(void (*measure)(char *,word *,word *),void (*print)(char *))
{
USL_MeasureString = measure;
USL_DrawString = print;
......@@ -224,8 +215,7 @@ void USL_PrintInCenter(char *s, Rect r)
// US_PrintCentered() - Prints a string centered in the current window.
//
///////////////////////////////////////////////////////////////////////////
void
US_PrintCentered(char *s)
void US_PrintCentered(char *s)
{
Rect r;
......
......@@ -50,14 +50,11 @@ extern boolean ingame, // Set by game code if a game is in progress
loadedgame, // Set if the current game was loaded
NoWait,
HighScoresDirty;
extern char *abortprogram; // Set to error msg if program is dying
extern GameDiff restartgame; // Normally gd_Continue, else starts game
extern word PrintX,PrintY; // Current printing location in the window
extern word WindowX,WindowY,// Current location of window
WindowW,WindowH;// Current size of window
extern boolean Button0,Button1,
CursorBad;
extern int CursorX,CursorY;
extern void (*USL_MeasureString)(char *,word *,word *),
......@@ -68,9 +65,7 @@ extern void (*USL_ResetGame)(void);
extern SaveGame Games[MaxSaveGames];
extern HighScore Scores[];
#define US_HomeWindow() {PrintX = WindowX; PrintY = WindowY;}
extern void US_Startup(void),
void US_Startup(void),
US_Setup(void),
US_Shutdown(void),
US_InitRndT(boolean randomize),
......@@ -97,10 +92,10 @@ extern void US_Startup(void),
US_ShutCursor(void),
US_CheckHighScore(long score,word other),
US_DisplayHighScores(int which);
extern boolean US_UpdateCursor(void),
boolean US_UpdateCursor(void),
US_LineInput(int x,int y,char *buf,char *def,boolean escok,
int maxchars,int maxwidth);
extern int US_CheckParm(char *parm,char **strings),
int US_CheckParm(char *parm,char **strings),
US_RndT(void);
void USL_PrintInCenter(char *s,Rect r);
......
......@@ -208,7 +208,7 @@ void ScanInfoPlane (void)
{
unsigned x,y,i,j;
int tile;
unsigned far *start;
word *start;
start = mapsegs[1];
for (y=0;y<mapheight;y++)
......@@ -611,7 +611,7 @@ void ScanInfoPlane (void)
void SetupGameLevel (void)
{
int x,y,i;
unsigned far *map,tile,spot;
word *map,tile,spot;
if (!loadedgame)
......@@ -896,7 +896,7 @@ void StartDemoRecord (int levelnumber)
{
MM_GetPtr (&demobuffer,MAXDEMOSIZE);
MM_SetLock (&demobuffer,true);
demoptr = (char far *)demobuffer;
demoptr = (char *)demobuffer;
lastdemoptr = demoptr+MAXDEMOSIZE;
*demoptr = levelnumber;
......@@ -921,10 +921,10 @@ void FinishDemoRecord (void)
demorecord = false;
length = demoptr - (char far *)demobuffer;
length = demoptr - (char *)demobuffer;
demoptr = ((char far *)demobuffer)+1;
*(unsigned far *)demoptr = length;
demoptr = ((char *)demobuffer)+1;
*(word *)demoptr = length;
CenterWindow(24,3);
PrintY+=6;
......@@ -937,7 +937,7 @@ void FinishDemoRecord (void)
if (level>=0 && level<=9)
{
demoname[4] = '0'+level;
CA_WriteFile (demoname,(void far *)demobuffer,length);
CA_WriteFile (demoname,(void *)demobuffer,length);
}
}
......@@ -1041,13 +1041,13 @@ void PlayDemo (int demonumber)
demoname[4] = '0'+demonumber;
CA_LoadFile (demoname,&demobuffer);
MM_SetLock (&demobuffer,true);
demoptr = (char far *)demobuffer;
demoptr = (char *)demobuffer;
#endif
NewGame (1,0);
gamestate.mapon = *demoptr++;
gamestate.difficulty = gd_hard;
length = *((unsigned far *)demoptr)++;
length = *((word *)demoptr)++;
demoptr++;
lastdemoptr = demoptr-4+length;
......@@ -1324,12 +1324,10 @@ startplayloop:
CheckHighScore (gamestate.score,gamestate.mapon+1);
#pragma warn -sus
#ifndef JAPAN
_fstrcpy(MainMenu[viewscores].string,STR_VS);
#endif
MainMenu[viewscores].routine = CP_ViewScores;
#pragma warn +sus
return;
}
......@@ -1416,12 +1414,10 @@ startplayloop:
CheckHighScore (gamestate.score,gamestate.mapon+1);
#pragma warn -sus
#ifndef JAPAN
_fstrcpy(MainMenu[viewscores].string,STR_VS);
strcpy(MainMenu[viewscores].string,STR_VS);
#endif
MainMenu[viewscores].routine = CP_ViewScores;
#pragma warn +sus
return;
......@@ -1440,12 +1436,10 @@ startplayloop:
CheckHighScore (gamestate.score,gamestate.mapon+1);
#pragma warn -sus
#ifndef JAPAN
_fstrcpy(MainMenu[viewscores].string,STR_VS);
strcpy(MainMenu[viewscores].string,STR_VS);
#endif
MainMenu[viewscores].routine = CP_ViewScores;
#pragma warn +sus
return;
......
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