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