Commit d1c2ee26 authored by Steven Fuller's avatar Steven Fuller

More, more cleanups

parent 0e4a1995
...@@ -5,12 +5,17 @@ ...@@ -5,12 +5,17 @@
* Audio support using OpenAL * Audio support using OpenAL
- Problem is, that SDL and OpenAL would need pthread, which with SVGAlib is - Problem is, that SDL and OpenAL would need pthread, which with SVGAlib is
a no-go... oh well. Using DGA (if possible at 320x200) would fulfill the a no-go... oh well. Using DGA (if possible at 320x200) would fulfill the
desire for full screen mode desire for full screen mode, and SVGAlib users can deal with some sort
hackish sound support.
* Add support for the Mac version, if possible * Add support for the Mac version, if possible
* Network support! * Network support!
* Fully compile with no warnings/errors using -Wall -ansi -pedantic * Fully compile with no warnings/errors using -Wall -ansi -pedantic and with
other compilers (would need to turn off warnings about unused parameters)
* Port to: Linux/SVGAlib, Linux/X (Windowed and DGA), Linux/OpenGL, * Port to: Linux/SVGAlib, Linux/X (Windowed and DGA), Linux/OpenGL,
DOS/Allegro, Win32/GDI, Win32/DX, Win32/D3D, Win32/OpenGL, BeOS?, MacOS? DOS/Allegro, Win32/GDI, Win32/DX, Win32/D3D, Win32/OpenGL, BeOS?, MacOS?
* Ease in using demos. Playing demos from files, recording to files, batch * Ease in using demos. Playing demos from files, recording to files, batch
playing, and so on. playing, and so on.
* Make Wolf3D the game it was originally planned to be... * Make Wolf3D the game it was originally planned to be... More strategy...
* Empty TODO File (TODO states a list of things which need to/should be done
regardless of future plans [IDEAS]) and no TODO/FIXME/XXXs in the source
code
CC = gcc CC = gcc
#CFLAGS = -Wall -O6 -fomit-frame-pointer -mpentiumpro -mcpu=pentiumpro -march=pentiumpro -DUSEVGA #CFLAGS = -Wall -O6 -fomit-frame-pointer -mpentiumpro -mcpu=pentiumpro -march=pentiumpro -DUSEVGA
CFLAGS = -g -Wall #CFLAGS = -g -Wall -pedantic
#CFLAGS = -Os -fwritable-strings CFLAGS = -g
#CFLAGS = -g -Wall -DUSEVGA -DDEBUG #CFLAGS = -g -Wall -DUSEVGA -DDEBUG
#CFLAGS = -g -DUSEVGA -DDEBUG #CFLAGS = -g -DUSEVGA -DDEBUG
#CFLAGS = -g -pg -DDEBUG #CFLAGS = -g -pg -DDEBUG
......
...@@ -31,8 +31,6 @@ japanese version (unless the text was removed, but then why?) ...@@ -31,8 +31,6 @@ japanese version (unless the text was removed, but then why?)
version than a spanish version version than a spanish version
* 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
* fix wolf shareware gfx
* fix status bar gfx junk, and those tiles that do not wish to be extracted
* Use either US_CheckParm or MS_CheckParm. * Use either US_CheckParm or MS_CheckParm.
* perhaps rename UPLOAD * perhaps rename UPLOAD
* TOO MANY #IFDEFs * TOO MANY #IFDEFs
...@@ -48,6 +46,7 @@ CA_FarRead hit EOF? ...@@ -48,6 +46,7 @@ CA_FarRead hit EOF?
* if possible fix/or at least add ViewMap? * if possible fix/or at least add ViewMap?
* remove the #else at the end of each header since nothing is being doubly * remove the #else at the end of each header since nothing is being doubly
included now (if ever) included now (if ever)
* fix those tiles that do not wish to be extracted (latches or whathaveyou)
* i don't like this latch nonsense. i think it was for originally storing * i don't like this latch nonsense. i think it was for originally storing
data in vga memory. so figure it out, fix it, and remove data in vga memory. so figure it out, fix it, and remove
* especially with the video functions, there are functions/defines which * especially with the video functions, there are functions/defines which
......
...@@ -754,7 +754,7 @@ void CA_CacheAudioChunk(int chunk) ...@@ -754,7 +754,7 @@ void CA_CacheAudioChunk(int chunk)
if (audiosegs[chunk]) if (audiosegs[chunk])
{ {
MM_SetPurge ((memptr)&audiosegs[chunk],0); MM_SetPurge((memptr)&audiosegs[chunk],0);
return; return;
} }
...@@ -774,6 +774,7 @@ void CA_CacheAudioChunk(int chunk) ...@@ -774,6 +774,7 @@ void CA_CacheAudioChunk(int chunk)
void CA_UnCacheAudioChunk(int chunk) void CA_UnCacheAudioChunk(int chunk)
{ {
/* TODO: For now the warning is ignorable since wl_menu.c does it */
if (audiosegs[chunk] == 0) { if (audiosegs[chunk] == 0) {
fprintf(stderr, "Trying to free null audio chunk %d!\n", chunk); fprintf(stderr, "Trying to free null audio chunk %d!\n", chunk);
return; return;
...@@ -1337,22 +1338,11 @@ void CA_CacheMarks (void) ...@@ -1337,22 +1338,11 @@ void CA_CacheMarks (void)
} }
#endif #endif
/*
=============================================================================
LOCAL VARIABLES
=============================================================================
*/
/* /*
=================== ===================
= =
= MM_Startup = MM_Startup
= =
= Grabs all space from turbo with malloc/farmalloc
= Allocates bufferseg misc buffer
=
=================== ===================
*/ */
...@@ -1365,8 +1355,6 @@ void MM_Startup (void) ...@@ -1365,8 +1355,6 @@ void MM_Startup (void)
= =
= MM_Shutdown = MM_Shutdown
= =
= Frees all conventional, EMS, and XMS allocated
=
==================== ====================
*/ */
...@@ -1379,8 +1367,6 @@ void MM_Shutdown(void) ...@@ -1379,8 +1367,6 @@ void MM_Shutdown(void)
= =
= MM_GetPtr = MM_GetPtr
= =
= Allocates an unlocked, unpurgable block
=
==================== ====================
*/ */
...@@ -1395,8 +1381,6 @@ void MM_GetPtr(memptr *baseptr, unsigned long size) ...@@ -1395,8 +1381,6 @@ void MM_GetPtr(memptr *baseptr, unsigned long size)
= =
= MM_FreePtr = MM_FreePtr
= =
= Deallocates an unlocked, purgable block
=
==================== ====================
*/ */
...@@ -1441,7 +1425,7 @@ void MM_SetLock (memptr *baseptr, boolean locked) ...@@ -1441,7 +1425,7 @@ void MM_SetLock (memptr *baseptr, boolean locked)
= =
= MM_SortMem = MM_SortMem
= =
= Throws out all purgable stuff and compresses movable blocks = Throws out all purgable stuff
= =
===================== =====================
*/ */
...@@ -1450,30 +1434,6 @@ void MM_SortMem (void) ...@@ -1450,30 +1434,6 @@ void MM_SortMem (void)
{ {
} }
/*
=====================
=
= MM_ShowMemory
=
=====================
*/
void MM_ShowMemory (void)
{
}
/*
=====================
=
= MM_DumpData
=
=====================
*/
void MM_DumpData (void)
{
}
/* /*
====================== ======================
= =
...@@ -1504,18 +1464,6 @@ long MM_TotalFree (void) ...@@ -1504,18 +1464,6 @@ long MM_TotalFree (void)
return 0; return 0;
} }
/*
=====================
=
= MM_BombOnError
=
=====================
*/
void MM_BombOnError(boolean bomb)
{
}
boolean PMStarted; boolean PMStarted;
char PageFileName[13] = {"vswap."}; char PageFileName[13] = {"vswap."};
int PageFile = -1; int PageFile = -1;
...@@ -1617,9 +1565,7 @@ void PML_ClosePageFile(void) ...@@ -1617,9 +1565,7 @@ void PML_ClosePageFile(void)
// //
// PM_GetPageAddress() - Returns the address of a given page // PM_GetPageAddress() - Returns the address of a given page
// Maps in EMS if necessary // Returns nil if block is not loaded
// Returns nil if block is not cached into Main Memory or EMS
//
// //
memptr PM_GetPageAddress(int pagenum) memptr PM_GetPageAddress(int pagenum)
{ {
...@@ -1632,9 +1578,6 @@ memptr PM_GetPageAddress(int pagenum) ...@@ -1632,9 +1578,6 @@ memptr PM_GetPageAddress(int pagenum)
// //
// PM_GetPage() - Returns the address of the page, loading it if necessary // PM_GetPage() - Returns the address of the page, loading it if necessary
// First, check if in Main Memory or EMS
// Then, check XMS
// If not in XMS, load into Main Memory or EMS
// //
memptr PM_GetPage(int pagenum) memptr PM_GetPage(int pagenum)
{ {
...@@ -1657,8 +1600,6 @@ memptr PM_GetPage(int pagenum) ...@@ -1657,8 +1600,6 @@ memptr PM_GetPage(int pagenum)
// PM_SetPageLock() - Sets the lock type on a given page // PM_SetPageLock() - Sets the lock type on a given page
// pml_Unlocked: Normal, page can be purged // pml_Unlocked: Normal, page can be purged
// pml_Locked: Cannot be purged // pml_Locked: Cannot be purged
// pml_EMS?: Same as pml_Locked, but if in EMS, use the physical page
// specified when returning the address. For sound stuff.
// //
void PM_SetPageLock(int pagenum,PMLockType lock) void PM_SetPageLock(int pagenum,PMLockType lock)
{ {
...@@ -1685,13 +1626,7 @@ void PM_Preload(boolean (*update)(word current,word total)) ...@@ -1685,13 +1626,7 @@ void PM_Preload(boolean (*update)(word current,word total))
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// PM_NextFrame() - Increments the frame counter and adjusts the thrash // PM_NextFrame() - Increments the frame counter
// avoidence variables
//
// If currently in panic mode (to avoid thrashing), check to see if the
// appropriate number of frames have passed since the last time that
// we would have thrashed. If so, take us out of panic mode.
//
// //
void PM_NextFrame(void) void PM_NextFrame(void)
{ {
......
...@@ -95,13 +95,9 @@ void MM_SetPurge (memptr *baseptr, int purge); ...@@ -95,13 +95,9 @@ void MM_SetPurge (memptr *baseptr, int purge);
void MM_SetLock (memptr *baseptr, boolean locked); void MM_SetLock (memptr *baseptr, boolean locked);
void MM_SortMem (void); void MM_SortMem (void);
void MM_ShowMemory (void);
long MM_UnusedMemory (void); long MM_UnusedMemory (void);
long MM_TotalFree (void); long MM_TotalFree (void);
void MM_BombOnError (boolean bomb);
#define PMPageSize 4096 #define PMPageSize 4096
typedef enum typedef enum
...@@ -136,8 +132,7 @@ void PM_Startup(void), ...@@ -136,8 +132,7 @@ void PM_Startup(void),
PM_SetPageLock(int pagenum,PMLockType lock), PM_SetPageLock(int pagenum,PMLockType lock),
PM_SetMainPurge(int level), PM_SetMainPurge(int level),
PM_CheckMainMem(void); PM_CheckMainMem(void);
memptr PM_GetPageAddress(int pagenum), memptr PM_GetPageAddress(int pagenum), PM_GetPage(int pagenum);
PM_GetPage(int pagenum); // Use this one to cache page
#else #else
#error "fix me TODO" #error "fix me TODO"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
typedef enum { typedef enum {
sdm_Off, sdm_Off,
sdm_PC,sdm_AdLib, sdm_PC,sdm_AdLib
} SDMode; } SDMode;
typedef enum { typedef enum {
smm_Off,smm_AdLib smm_Off,smm_AdLib
......
...@@ -348,7 +348,6 @@ void InitDoorList (void) ...@@ -348,7 +348,6 @@ void InitDoorList (void)
void SpawnDoor (int tilex, int tiley, boolean vertical, int lock) void SpawnDoor (int tilex, int tiley, boolean vertical, int lock)
{ {
int areanumber;
word *map; word *map;
if (doornum==64) if (doornum==64)
......
...@@ -39,7 +39,6 @@ void DrawScaleds (void); ...@@ -39,7 +39,6 @@ void DrawScaleds (void);
void CalcTics (void); void CalcTics (void);
void ThreeDRefresh (void); void ThreeDRefresh (void);
unsigned char crapmap[4096]; /* TODO: remove this testing code */
// //
// ray tracing variables // ray tracing variables
// //
......
...@@ -1119,17 +1119,7 @@ boolean SetViewSize (unsigned width, unsigned height) ...@@ -1119,17 +1119,7 @@ boolean SetViewSize (unsigned width, unsigned height)
// //
// build all needed compiled scalers // build all needed compiled scalers
// //
// MM_BombOnError (false);
SetupScaling (viewwidth*1.5); SetupScaling (viewwidth*1.5);
#if 0
MM_BombOnError (true);
if (mmerror)
{
Quit ("Can't build scalers!");
mmerror = false;
return false;
}
#endif
return true; return true;
} }
......
...@@ -802,13 +802,10 @@ int CP_CheckQuick(unsigned scancode) ...@@ -802,13 +802,10 @@ int CP_CheckQuick(unsigned scancode)
#ifdef SPANISH #ifdef SPANISH
if (Confirm(ENDGAMESTR)) if (Confirm(ENDGAMESTR))
#else #else
if (Confirm(endStrings[US_RndT()&0x7+(US_RndT()&1)])) if (Confirm(endStrings[(US_RndT()&0x7)+(US_RndT()&1)]))
#endif #endif
#endif #endif
{ {
int i;
VW_UpdateScreen(); VW_UpdateScreen();
SD_MusicOff(); SD_MusicOff();
SD_StopSound(); SD_StopSound();
...@@ -1553,7 +1550,7 @@ int CP_SaveGame(int quick) ...@@ -1553,7 +1550,7 @@ int CP_SaveGame(int quick)
// //
// OVERWRITE EXISTING SAVEGAME? // OVERWRITE EXISTING SAVEGAME?
// //
if (SaveGamesAvail[which]) if (SaveGamesAvail[which]) {
#ifdef JAPAN #ifdef JAPAN
if (!GetYorN(7,8,C_JAPSAVEOVERPIC)) if (!GetYorN(7,8,C_JAPSAVEOVERPIC))
#else #else
...@@ -1569,7 +1566,7 @@ int CP_SaveGame(int quick) ...@@ -1569,7 +1566,7 @@ int CP_SaveGame(int quick)
PrintLSEntry(which,HIGHLIGHT); PrintLSEntry(which,HIGHLIGHT);
VW_UpdateScreen(); VW_UpdateScreen();
} }
}
ShootSnd(); ShootSnd();
strcpy(input,&SaveGameNames[which][0]); strcpy(input,&SaveGameNames[which][0]);
...@@ -1886,6 +1883,8 @@ void MouseSensitivity(void) ...@@ -1886,6 +1883,8 @@ void MouseSensitivity(void)
WaitKeyUp(); WaitKeyUp();
} }
break; break;
default: /* ignore */
break;
} }
#ifndef SPEAR #ifndef SPEAR
...@@ -2004,9 +2003,8 @@ void DrawCtlScreen(void) ...@@ -2004,9 +2003,8 @@ void DrawCtlScreen(void)
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
enum {FIRE,STRAFE,RUN,OPEN}; enum {FIRE,STRAFE,RUN,OPEN};
char mbarray[4][3]={"b0","b1","b2","b3"}, char mbarray[4][3]={"b0","b1","b2","b3"};
order[4]={RUN,OPEN,FIRE,STRAFE}; int order[4]={RUN,OPEN,FIRE,STRAFE};
void CustomControls(void) void CustomControls(void)
{ {
...@@ -2049,7 +2047,7 @@ void CustomControls(void) ...@@ -2049,7 +2047,7 @@ void CustomControls(void)
// //
void DefineMouseBtns(void) void DefineMouseBtns(void)
{ {
CustomCtrls mouseallowed={0,1,1,1}; CustomCtrls mouseallowed={ {0,1,1,1} };
EnterCtrlData(2,&mouseallowed,DrawCustMouse,PrintCustMouse,MOUSE); EnterCtrlData(2,&mouseallowed,DrawCustMouse,PrintCustMouse,MOUSE);
} }
...@@ -2060,7 +2058,7 @@ void DefineMouseBtns(void) ...@@ -2060,7 +2058,7 @@ void DefineMouseBtns(void)
// //
void DefineJoyBtns(void) void DefineJoyBtns(void)
{ {
CustomCtrls joyallowed={1,1,1,1}; CustomCtrls joyallowed={ {1,1,1,1} };
EnterCtrlData(5,&joyallowed,DrawCustJoy,PrintCustJoy,JOYSTICK); EnterCtrlData(5,&joyallowed,DrawCustJoy,PrintCustJoy,JOYSTICK);
} }
...@@ -2071,7 +2069,7 @@ void DefineJoyBtns(void) ...@@ -2071,7 +2069,7 @@ void DefineJoyBtns(void)
// //
void DefineKeyBtns(void) void DefineKeyBtns(void)
{ {
CustomCtrls keyallowed={1,1,1,1}; CustomCtrls keyallowed={ {1,1,1,1} };
EnterCtrlData(8,&keyallowed,DrawCustKeybd,PrintCustKeybd,KEYBOARDBTNS); EnterCtrlData(8,&keyallowed,DrawCustKeybd,PrintCustKeybd,KEYBOARDBTNS);
} }
...@@ -2082,7 +2080,7 @@ void DefineKeyBtns(void) ...@@ -2082,7 +2080,7 @@ void DefineKeyBtns(void)
// //
void DefineKeyMove(void) void DefineKeyMove(void)
{ {
CustomCtrls keyallowed={1,1,1,1}; CustomCtrls keyallowed={ {1,1,1,1} };
EnterCtrlData(10,&keyallowed,DrawCustKeys,PrintCustKeys,KEYBOARDMOVE); EnterCtrlData(10,&keyallowed,DrawCustKeys,PrintCustKeys,KEYBOARDMOVE);
} }
...@@ -2099,7 +2097,6 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print ...@@ -2099,7 +2097,6 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print
int j,exit,tick,redraw,which,x,picked; int j,exit,tick,redraw,which,x,picked;
ControlInfo ci; ControlInfo ci;
ShootSnd(); ShootSnd();
PrintY=CST_Y+13*index; PrintY=CST_Y+13*index;
IN_ClearKeysDown(); IN_ClearKeysDown();
...@@ -2815,7 +2812,7 @@ void CP_Quit(void) ...@@ -2815,7 +2812,7 @@ void CP_Quit(void)
#ifdef SPANISH #ifdef SPANISH
if (Confirm(ENDGAMESTR)) if (Confirm(ENDGAMESTR))
#else #else
if (Confirm(endStrings[US_RndT()&0x7+(US_RndT()&1)])) if (Confirm(endStrings[(US_RndT()&0x7)+(US_RndT()&1)]))
#endif #endif
#endif #endif
...@@ -3561,7 +3558,7 @@ int GetYorN(int x,int y,int pic) ...@@ -3561,7 +3558,7 @@ int GetYorN(int x,int y,int pic)
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void Message(char *string) void Message(char *string)
{ {
int h=0,w=0,mw=0,i,x,y,time; int h=0,w=0,mw=0,i;
fontstruct *font; fontstruct *font;
...@@ -3578,7 +3575,7 @@ void Message(char *string) ...@@ -3578,7 +3575,7 @@ void Message(char *string)
h+=font->height; h+=font->height;
} }
else else
w+=font->width[string[i]]; w+=font->width[(int)string[i]];
if (w+10>mw) if (w+10>mw)
mw=w+10; mw=w+10;
...@@ -3605,11 +3602,10 @@ void StartCPMusic(int song) ...@@ -3605,11 +3602,10 @@ void StartCPMusic(int song)
{ {
musicnames chunk; musicnames chunk;
SD_MusicOff();
CA_UnCacheAudioChunk(STARTMUSIC + lastmusic); CA_UnCacheAudioChunk(STARTMUSIC + lastmusic);
lastmusic = song; lastmusic = song;
SD_MusicOff();
chunk = song; chunk = song;
CA_CacheAudioChunk(STARTMUSIC + chunk); CA_CacheAudioChunk(STARTMUSIC + chunk);
......
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