Commit 3be1f771 authored by Steven Fuller's avatar Steven Fuller

More code reformatting.

Made some functions/variables static.
parent 46f35dd2
...@@ -1379,19 +1379,19 @@ void MM_SetLock (memptr *baseptr, boolean locked) ...@@ -1379,19 +1379,19 @@ void MM_SetLock (memptr *baseptr, boolean locked)
===================== =====================
*/ */
void MM_SortMem (void) void MM_SortMem()
{ {
} }
boolean PMStarted; boolean PMStarted;
char PageFileName[13] = {"vswap."}; char PageFileName[13] = {"vswap."};
int PageFile = -1; int PageFile = -1;
word ChunksInFile; word ChunksInFile;
word PMSpriteStart,PMSoundStart; word PMSpriteStart,PMSoundStart;
word PMNumBlocks; word PMNumBlocks;
long PMFrameCount; long PMFrameCount;
PageListStruct *PMPages, *PMSegPages; PageListStruct *PMPages, *PMSegPages;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
...@@ -1402,13 +1402,13 @@ void MM_SortMem (void) ...@@ -1402,13 +1402,13 @@ void MM_SortMem (void)
// //
// PML_ReadFromFile() - Reads some data in from the page file // PML_ReadFromFile() - Reads some data in from the page file
// //
void PML_ReadFromFile(byte *buf, long offset, word length) static void PML_ReadFromFile(byte *buf, long offset, word length)
{ {
if (!buf) if (!buf)
Quit("PML_ReadFromFile: Null pointer"); Quit("PML_ReadFromFile: Null pointer");
if (!offset) if (!offset)
Quit("PML_ReadFromFile: Zero offset"); Quit("PML_ReadFromFile: Zero offset");
if (lseek(PageFile,offset,SEEK_SET) != offset) if (lseek(PageFile, offset, SEEK_SET) != offset)
Quit("PML_ReadFromFile: Seek failed"); Quit("PML_ReadFromFile: Seek failed");
if (!CA_FarRead(PageFile,buf,length)) if (!CA_FarRead(PageFile,buf,length))
Quit("PML_ReadFromFile: Read failed"); Quit("PML_ReadFromFile: Read failed");
...@@ -1417,7 +1417,7 @@ void PML_ReadFromFile(byte *buf, long offset, word length) ...@@ -1417,7 +1417,7 @@ void PML_ReadFromFile(byte *buf, long offset, word length)
// //
// PML_OpenPageFile() - Opens the page file and sets up the page info // PML_OpenPageFile() - Opens the page file and sets up the page info
// //
void PML_OpenPageFile(void) static void PML_OpenPageFile()
{ {
int i; int i;
long size; long size;
...@@ -1465,7 +1465,7 @@ void PML_OpenPageFile(void) ...@@ -1465,7 +1465,7 @@ void PML_OpenPageFile(void)
// //
// PML_ClosePageFile() - Closes the page file // PML_ClosePageFile() - Closes the page file
// //
void PML_ClosePageFile(void) static void PML_ClosePageFile()
{ {
if (PageFile != -1) if (PageFile != -1)
close(PageFile); close(PageFile);
...@@ -1534,7 +1534,7 @@ void PM_Preload(boolean (*update)(word current,word total)) ...@@ -1534,7 +1534,7 @@ void PM_Preload(boolean (*update)(word current,word total))
// //
// PM_NextFrame() - Increments the frame counter // PM_NextFrame() - Increments the frame counter
// //
void PM_NextFrame(void) void PM_NextFrame()
{ {
int i; int i;
...@@ -1566,7 +1566,7 @@ void PM_Reset() ...@@ -1566,7 +1566,7 @@ void PM_Reset()
// //
// PM_Startup() - Start up the Page Mgr // PM_Startup() - Start up the Page Mgr
// //
void PM_Startup(void) void PM_Startup()
{ {
if (PMStarted) if (PMStarted)
return; return;
...@@ -1581,7 +1581,7 @@ void PM_Startup(void) ...@@ -1581,7 +1581,7 @@ void PM_Startup(void)
// //
// PM_Shutdown() - Shut down the Page Mgr // PM_Shutdown() - Shut down the Page Mgr
// //
void PM_Shutdown(void) void PM_Shutdown()
{ {
if (!PMStarted) if (!PMStarted)
return; return;
......
...@@ -94,7 +94,7 @@ void PicturePause (void) ...@@ -94,7 +94,7 @@ void PicturePause (void)
================ ================
*/ */
void ShapeTest (void) void ShapeTest()
{ {
#if 0 /* TODO: this code want to access the raycasting renderer directly */ #if 0 /* TODO: this code want to access the raycasting renderer directly */
extern word NumDigi; extern word NumDigi;
......
...@@ -898,10 +898,7 @@ extern unsigned pwallpos; ...@@ -898,10 +898,7 @@ extern unsigned pwallpos;
fixed FixedByFrac (fixed a, fixed b); fixed FixedByFrac (fixed a, fixed b);
void TransformActor (objtype *ob);
void BuildTables (void); void BuildTables (void);
int CalcRotate (objtype *ob);
void DrawScaleds (void);
void CalcTics (void); void CalcTics (void);
void ThreeDRefresh (void); void ThreeDRefresh (void);
......
This diff is collapsed.
...@@ -14,7 +14,7 @@ boolean madenoise; // true when shooting or screaming ...@@ -14,7 +14,7 @@ boolean madenoise; // true when shooting or screaming
exit_t playstate; exit_t playstate;
int DebugOk; int DebugOk;
objtype objlist[MAXACTORS],*new,*obj,*player,*lastobj, objtype objlist[MAXACTORS],*new,*obj,*player,*lastobj,
*objfreelist,*killerobj; *objfreelist,*killerobj;
...@@ -418,41 +418,47 @@ void PollJoystickMove (void) ...@@ -418,41 +418,47 @@ void PollJoystickMove (void)
=================== ===================
*/ */
void PollControls (void) void PollControls()
{ {
int max,min,i; int max, min, i;
byte buttonbits; byte buttonbits;
// //
// get timing info for last frame // get timing info for last frame
// //
if (demoplayback) if (demoplayback) {
{ #if 0
while ( get_TimeCount() < (lasttimecount+DEMOTICS) ) ; if (1 /* (TEMP) TODO: TimeDemo */) {
set_TimeCount(lasttimecount + DEMOTICS); set_TimeCount(lasttimecount + DEMOTICS);
lasttimecount += DEMOTICS; lasttimecount += DEMOTICS;
tics = DEMOTICS; tics = DEMOTICS;
} } else
else if (demorecord) // demo recording and playback needs #endif
{ // to be constant {
while ( get_TimeCount() < (lasttimecount+DEMOTICS) ) ;
set_TimeCount(lasttimecount + DEMOTICS);
lasttimecount += DEMOTICS;
tics = DEMOTICS;
}
} else if (demorecord) {
// demo recording and playback needs
// to be constant
// //
// take DEMOTICS or more tics, and modify Timecount to reflect time taken // take DEMOTICS or more tics, and modify Timecount to reflect time taken
// //
while ( get_TimeCount() < (lasttimecount+DEMOTICS) ) ; while (get_TimeCount() < (lasttimecount+DEMOTICS)) ;
set_TimeCount(lasttimecount + DEMOTICS); set_TimeCount(lasttimecount + DEMOTICS);
lasttimecount += DEMOTICS; lasttimecount += DEMOTICS;
tics = DEMOTICS; tics = DEMOTICS;
} } else
else
CalcTics (); CalcTics ();
controlx = 0; controlx = 0;
controly = 0; controly = 0;
memcpy (buttonheld,buttonstate,sizeof(buttonstate)); memcpy(buttonheld, buttonstate, sizeof(buttonstate));
memset (buttonstate,0,sizeof(buttonstate)); memset(buttonstate, 0, sizeof(buttonstate));
if (demoplayback) if (demoplayback) {
{
// //
// read commands from demo buffer // read commands from demo buffer
// //
...@@ -481,26 +487,26 @@ void PollControls (void) ...@@ -481,26 +487,26 @@ void PollControls (void)
// //
/* Update keys */ /* Update keys */
IN_CheckAck(); /* TODO: better name */ IN_CheckAck();
PollKeyboardButtons (); PollKeyboardButtons();
if (mouseenabled) if (mouseenabled)
PollMouseButtons (); PollMouseButtons();
if (joystickenabled) if (joystickenabled)
PollJoystickButtons (); PollJoystickButtons();
// //
// get movements // get movements
// //
PollKeyboardMove (); PollKeyboardMove();
if (mouseenabled) if (mouseenabled)
PollMouseMove (); PollMouseMove();
if (joystickenabled) if (joystickenabled)
PollJoystickMove (); PollJoystickMove();
// //
// bound movement to a maximum // bound movement to a maximum
......
...@@ -20,11 +20,10 @@ typedef struct { ...@@ -20,11 +20,10 @@ typedef struct {
short desty [65]; short desty [65];
} t_scaledata; } t_scaledata;
t_scaledata scaledata [MAXSCALEHEIGHT+1]; static t_scaledata scaledata[MAXSCALEHEIGHT+1];
static int maxscale;
int maxscale; static void BuildCompScale(int height)
void BuildCompScale(int height)
{ {
long fix,step; long fix,step;
unsigned src; unsigned src;
...@@ -79,7 +78,7 @@ void SetupScaling(int maxscaleheight) ...@@ -79,7 +78,7 @@ void SetupScaling(int maxscaleheight)
// //
for (i=1;i<=maxscaleheight;i++) for (i=1;i<=maxscaleheight;i++)
{ {
BuildCompScale (i); BuildCompScale(i);
} }
} }
...@@ -141,10 +140,10 @@ void xBuildCompScale(unsigned int height, byte *source, int x) ...@@ -141,10 +140,10 @@ void xBuildCompScale(unsigned int height, byte *source, int x)
======================= =======================
*/ */
int slinex, slinewidth; static int slinex, slinewidth;
short *linecmds; static short *linecmds;
int linescale; static int linescale;
t_compshape *shapeptr; static t_compshape *shapeptr;
/* /*
linecmds - points to line segment data linecmds - points to line segment data
...@@ -152,7 +151,7 @@ t_compshape *shapeptr; ...@@ -152,7 +151,7 @@ t_compshape *shapeptr;
slinex - screen coord of first column slinex - screen coord of first column
*/ */
void ScaleLine() static void ScaleLine()
{ {
int x, y, ys; int x, y, ys;
int n, ny; int n, ny;
...@@ -445,7 +444,7 @@ void SimpleScaleShape(int xcenter, int shapenum, unsigned height) ...@@ -445,7 +444,7 @@ void SimpleScaleShape(int xcenter, int shapenum, unsigned height)
if ( !(slinewidth = scaledata[scale].count[srcx]) ) if ( !(slinewidth = scaledata[scale].count[srcx]) )
continue; continue;
ScaleLine (); ScaleLine();
slinex+=slinewidth; slinex += slinewidth;
} }
} }
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