Commit d1c2ee26 authored by Steven Fuller's avatar Steven Fuller

More, more cleanups

parent 0e4a1995
......@@ -5,12 +5,17 @@
* Audio support using OpenAL
- 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
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
* 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,
DOS/Allegro, Win32/GDI, Win32/DX, Win32/D3D, Win32/OpenGL, BeOS?, MacOS?
* Ease in using demos. Playing demos from files, recording to files, batch
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
#CFLAGS = -Wall -O6 -fomit-frame-pointer -mpentiumpro -mcpu=pentiumpro -march=pentiumpro -DUSEVGA
CFLAGS = -g -Wall
#CFLAGS = -Os -fwritable-strings
#CFLAGS = -g -Wall -pedantic
CFLAGS = -g
#CFLAGS = -g -Wall -DUSEVGA -DDEBUG
#CFLAGS = -g -DUSEVGA -DDEBUG
#CFLAGS = -g -pg -DDEBUG
......
......@@ -31,8 +31,6 @@ japanese version (unless the text was removed, but then why?)
version than a spanish version
* remove GOODTIMES (the piracy message is somewhat worthless)
* 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.
* perhaps rename UPLOAD
* TOO MANY #IFDEFs
......@@ -48,6 +46,7 @@ CA_FarRead hit EOF?
* if possible fix/or at least add ViewMap?
* remove the #else at the end of each header since nothing is being doubly
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
data in vga memory. so figure it out, fix it, and remove
* especially with the video functions, there are functions/defines which
......
......@@ -754,7 +754,7 @@ void CA_CacheAudioChunk(int chunk)
if (audiosegs[chunk])
{
MM_SetPurge ((memptr)&audiosegs[chunk],0);
MM_SetPurge((memptr)&audiosegs[chunk],0);
return;
}
......@@ -774,6 +774,7 @@ void CA_CacheAudioChunk(int chunk)
void CA_UnCacheAudioChunk(int chunk)
{
/* TODO: For now the warning is ignorable since wl_menu.c does it */
if (audiosegs[chunk] == 0) {
fprintf(stderr, "Trying to free null audio chunk %d!\n", chunk);
return;
......@@ -1337,22 +1338,11 @@ void CA_CacheMarks (void)
}
#endif
/*
=============================================================================
LOCAL VARIABLES
=============================================================================
*/
/*
===================
=
= MM_Startup
=
= Grabs all space from turbo with malloc/farmalloc
= Allocates bufferseg misc buffer
=
===================
*/
......@@ -1365,8 +1355,6 @@ void MM_Startup (void)
=
= MM_Shutdown
=
= Frees all conventional, EMS, and XMS allocated
=
====================
*/
......@@ -1379,8 +1367,6 @@ void MM_Shutdown(void)
=
= MM_GetPtr
=
= Allocates an unlocked, unpurgable block
=
====================
*/
......@@ -1395,8 +1381,6 @@ void MM_GetPtr(memptr *baseptr, unsigned long size)
=
= MM_FreePtr
=
= Deallocates an unlocked, purgable block
=
====================
*/
......@@ -1441,7 +1425,7 @@ void MM_SetLock (memptr *baseptr, boolean locked)
=
= MM_SortMem
=
= Throws out all purgable stuff and compresses movable blocks
= Throws out all purgable stuff
=
=====================
*/
......@@ -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)
return 0;
}
/*
=====================
=
= MM_BombOnError
=
=====================
*/
void MM_BombOnError(boolean bomb)
{
}
boolean PMStarted;
char PageFileName[13] = {"vswap."};
int PageFile = -1;
......@@ -1617,9 +1565,7 @@ void PML_ClosePageFile(void)
//
// PM_GetPageAddress() - Returns the address of a given page
// Maps in EMS if necessary
// Returns nil if block is not cached into Main Memory or EMS
//
// Returns nil if block is not loaded
//
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
// 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)
{
......@@ -1657,8 +1600,6 @@ memptr PM_GetPage(int pagenum)
// PM_SetPageLock() - Sets the lock type on a given page
// pml_Unlocked: Normal, page can 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)
{
......@@ -1685,13 +1626,7 @@ void PM_Preload(boolean (*update)(word current,word total))
/////////////////////////////////////////////////////////////////////////////
//
// PM_NextFrame() - Increments the frame counter and adjusts the thrash
// 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.
//
// PM_NextFrame() - Increments the frame counter
//
void PM_NextFrame(void)
{
......
......@@ -95,13 +95,9 @@ void MM_SetPurge (memptr *baseptr, int purge);
void MM_SetLock (memptr *baseptr, boolean locked);
void MM_SortMem (void);
void MM_ShowMemory (void);
long MM_UnusedMemory (void);
long MM_TotalFree (void);
void MM_BombOnError (boolean bomb);
#define PMPageSize 4096
typedef enum
......@@ -136,8 +132,7 @@ void PM_Startup(void),
PM_SetPageLock(int pagenum,PMLockType lock),
PM_SetMainPurge(int level),
PM_CheckMainMem(void);
memptr PM_GetPageAddress(int pagenum),
PM_GetPage(int pagenum); // Use this one to cache page
memptr PM_GetPageAddress(int pagenum), PM_GetPage(int pagenum);
#else
#error "fix me TODO"
......
......@@ -5,7 +5,7 @@
typedef enum {
sdm_Off,
sdm_PC,sdm_AdLib,
sdm_PC,sdm_AdLib
} SDMode;
typedef enum {
smm_Off,smm_AdLib
......
......@@ -348,7 +348,6 @@ void InitDoorList (void)
void SpawnDoor (int tilex, int tiley, boolean vertical, int lock)
{
int areanumber;
word *map;
if (doornum==64)
......
......@@ -39,7 +39,6 @@ void DrawScaleds (void);
void CalcTics (void);
void ThreeDRefresh (void);
unsigned char crapmap[4096]; /* TODO: remove this testing code */
//
// ray tracing variables
//
......
......@@ -1119,17 +1119,7 @@ boolean SetViewSize (unsigned width, unsigned height)
//
// build all needed compiled scalers
//
// MM_BombOnError (false);
SetupScaling (viewwidth*1.5);
#if 0
MM_BombOnError (true);
if (mmerror)
{
Quit ("Can't build scalers!");
mmerror = false;
return false;
}
#endif
return true;
}
......
......@@ -802,13 +802,10 @@ int CP_CheckQuick(unsigned scancode)
#ifdef SPANISH
if (Confirm(ENDGAMESTR))
#else
if (Confirm(endStrings[US_RndT()&0x7+(US_RndT()&1)]))
if (Confirm(endStrings[(US_RndT()&0x7)+(US_RndT()&1)]))
#endif
#endif
{
int i;
VW_UpdateScreen();
SD_MusicOff();
SD_StopSound();
......@@ -1553,7 +1550,7 @@ int CP_SaveGame(int quick)
//
// OVERWRITE EXISTING SAVEGAME?
//
if (SaveGamesAvail[which])
if (SaveGamesAvail[which]) {
#ifdef JAPAN
if (!GetYorN(7,8,C_JAPSAVEOVERPIC))
#else
......@@ -1569,7 +1566,7 @@ int CP_SaveGame(int quick)
PrintLSEntry(which,HIGHLIGHT);
VW_UpdateScreen();
}
}
ShootSnd();
strcpy(input,&SaveGameNames[which][0]);
......@@ -1886,6 +1883,8 @@ void MouseSensitivity(void)
WaitKeyUp();
}
break;
default: /* ignore */
break;
}
#ifndef SPEAR
......@@ -2004,9 +2003,8 @@ void DrawCtlScreen(void)
//
////////////////////////////////////////////////////////////////////
enum {FIRE,STRAFE,RUN,OPEN};
char mbarray[4][3]={"b0","b1","b2","b3"},
order[4]={RUN,OPEN,FIRE,STRAFE};
char mbarray[4][3]={"b0","b1","b2","b3"};
int order[4]={RUN,OPEN,FIRE,STRAFE};
void CustomControls(void)
{
......@@ -2049,7 +2047,7 @@ void CustomControls(void)
//
void DefineMouseBtns(void)
{
CustomCtrls mouseallowed={0,1,1,1};
CustomCtrls mouseallowed={ {0,1,1,1} };
EnterCtrlData(2,&mouseallowed,DrawCustMouse,PrintCustMouse,MOUSE);
}
......@@ -2060,7 +2058,7 @@ void DefineMouseBtns(void)
//
void DefineJoyBtns(void)
{
CustomCtrls joyallowed={1,1,1,1};
CustomCtrls joyallowed={ {1,1,1,1} };
EnterCtrlData(5,&joyallowed,DrawCustJoy,PrintCustJoy,JOYSTICK);
}
......@@ -2071,7 +2069,7 @@ void DefineJoyBtns(void)
//
void DefineKeyBtns(void)
{
CustomCtrls keyallowed={1,1,1,1};
CustomCtrls keyallowed={ {1,1,1,1} };
EnterCtrlData(8,&keyallowed,DrawCustKeybd,PrintCustKeybd,KEYBOARDBTNS);
}
......@@ -2082,7 +2080,7 @@ void DefineKeyBtns(void)
//
void DefineKeyMove(void)
{
CustomCtrls keyallowed={1,1,1,1};
CustomCtrls keyallowed={ {1,1,1,1} };
EnterCtrlData(10,&keyallowed,DrawCustKeys,PrintCustKeys,KEYBOARDMOVE);
}
......@@ -2099,7 +2097,6 @@ void EnterCtrlData(int index,CustomCtrls *cust,void (*DrawRtn)(int),void (*Print
int j,exit,tick,redraw,which,x,picked;
ControlInfo ci;
ShootSnd();
PrintY=CST_Y+13*index;
IN_ClearKeysDown();
......@@ -2815,7 +2812,7 @@ void CP_Quit(void)
#ifdef SPANISH
if (Confirm(ENDGAMESTR))
#else
if (Confirm(endStrings[US_RndT()&0x7+(US_RndT()&1)]))
if (Confirm(endStrings[(US_RndT()&0x7)+(US_RndT()&1)]))
#endif
#endif
......@@ -3561,7 +3558,7 @@ int GetYorN(int x,int y,int pic)
////////////////////////////////////////////////////////////////////
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;
......@@ -3578,7 +3575,7 @@ void Message(char *string)
h+=font->height;
}
else
w+=font->width[string[i]];
w+=font->width[(int)string[i]];
if (w+10>mw)
mw=w+10;
......@@ -3605,11 +3602,10 @@ void StartCPMusic(int song)
{
musicnames chunk;
SD_MusicOff();
CA_UnCacheAudioChunk(STARTMUSIC + lastmusic);
lastmusic = song;
SD_MusicOff();
chunk = song;
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