Commit a6d848b2 authored by Steven Fuller's avatar Steven Fuller

NOTES, TODO: Doc updates

vi_xlib.c: More keys added

wl_main.c: Reenabled ReadConfig

"goobers" (debug mode command line parameter) renamed to "debugmode"
parent d6a8fb79
CC = gcc
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro -D_REENTRANT
CFLAGS = -g -Wall -D_REENTRANT
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
CFLAGS = -g -Wall
#CFLAGS = -Os -Wall
#CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -Os -Wall -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
wl_act1.o wl_act2.o wl_agent.o wl_game.o \
wl_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \
wl_debug.o gfxsave.o sd_oss.o fmopl.o # sd_null.o
wl_debug.o gfxsave.o
ROBJS = wl_draw.o wl_scale.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
#LFLAGS = -lm
LFLAGS = -lm -lpthread
LFLAGS = -lm
#OBJS += sd_null.o
OBJS += sd_oss.o fmopl.o
CFLAGS += -D_REENTRANT
LFLAGS += -lpthread
SLFLAGS = $(LFLAGS) -lvga
XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga
......
......@@ -33,5 +33,7 @@ Wolfenstein 3D was originally planned to be a much more complex game. ...
... lots of unused code ... possibly from previous projects and incarnations
of wolf3d.
Version 1.4 of Wolfenstein 3D (full) had a Read Me! option. The text still
exists in the data files, but all the graphics are incorrect.
Version 1.4 of Wolfenstein 3D (full) did not had a Read Me! option, but the
text still exists in the data files, but all the graphics are incorrect
(wrong graphic numbers, etc).
......@@ -9,6 +9,7 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
SD_StartMusic(chunk);
General:
* convert uses of open() to fopen()
* half of these things belong in IDEAS; they are not bugs, just random
musings
* inconsistancy:
......@@ -16,7 +17,7 @@ id_ca.c has code for setting the data filenames' extension
so does wl_menu.c
* menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up
* id_ca.c cache code: fix/rewrite the "garbage collection" system?
* id_ca.c cache code: fix/readd/rewrite the "garbage collection" system?
* clean up header files, especially wl_def.h, where some declarations aren't
in the right place
* every structure that is read/written must be PACKED, with datatypes
......@@ -33,10 +34,11 @@ work the same, let the input handler do it all instead
i think its safe for now to go with the scancodes as being the "universal"
key type, and for everything not scancode-based, have a function to
translate
* wl_menu uses specific scancodes for names, config file will have to use
metaname like sc_Left etc or something
* remove GOODTIMES?
* Remove the SOD manual check?
* perhaps rename UPLOAD
* TOO MANY #IFDEFs
* verify if the sounds and graphics are correctly numbered, once again...
* add a ViewMap? (could be done similar to mac version)
* find and remove any function stubs (functions which just call another
......@@ -44,17 +46,13 @@ function with same parameters, only difference is the name)
* fix wl_debug.c, lots of junk code..
* change the current parameter handling code to something like getopt
* rename goobers to debugmode, then remove debugmode for things...
* for some reason, it feels sluggish, maybe its from having mikmod playing
at the same time... especially when you pick up items.. probably due to
calling wait vbl when doing palette stuffs
* retrace problems (esp. with svgalib).
* look for places where gfx needs to be redrawn, like back to game etc
* wl_menu uses specific scancodes for names, config file will have to use
metaname like sc_Left etc or something
* fizzlefade is hackish, stipple buf would work ok in opengl, maybe only
update once per frame or such...
and where is that stray pixel coming from (when using end game with largest
window size) in svgalib -- is that another bug with my geforce?
no idea how to do fizzlefade in 16bit X
no idea how to do fizzlefade in TrueColor X
* check filehandling (ex, file missing, bad file type, and such)
PlayDemoFromFile specifically
* make sure all infinite loops are found (looping around Keyboard)
......@@ -78,17 +76,16 @@ also, it should be able to compile without extensions
* fix up windows port
* create 'sound channels' with priority.. ie a door can only make one sound
at a time
* beos is c++ but wolf3d will need many cleanups for c++ either that or use
extern "C" { ... } in the header files
* change wl_scale to use mac wolf3d's version of scaling
wall drawing is done, just needed to fix sprite code
* check in wolftools and add mac wolftools (currently the res dumping stuff)
* cat file.c | perl -e 'while($in = <STDIN>)
{$in =~ s/\/\/(.*)$/\/\* \1\ *\//gm;print $in;}'
or
cat foo.txt |sed -e "s/\/\/\(.*\)$/\/\*\1\*\//g"
* systems with no sound should still have working WaitSoundDone.. it's
possible to calculate the sound lengths in terms of 70Hz (adlib sound len / 2,
pcm sound len / 100).
Things to try:
* Any speed gain with comparing values in screen before writing?
* Convert to a 320x200xWhatever screen first then draw all at once
* Create a native palette format instead of doing conversions each frame
......@@ -590,8 +590,6 @@ boolean SD_MusicPlaying()
return sqActive;
}
//===========================================================================
void SD_Poll()
{
}
......
......@@ -883,14 +883,22 @@ int XKeysymToScancode(unsigned int keysym)
return sc_A;
case XK_b:
return sc_B;
case XK_c:
return sc_C;
case XK_h:
return sc_H;
case XK_i:
return sc_I;
case XK_l:
return sc_L;
case XK_m:
return sc_M;
case XK_n:
return sc_N;
case XK_t:
return sc_T;
case XK_y:
return sc_Y;
case XK_Left:
case XK_KP_Left:
return sc_LeftArrow;
......@@ -919,10 +927,10 @@ int XKeysymToScancode(unsigned int keysym)
case XK_KP_Enter:
case XK_Return:
return sc_Enter;
case XK_y:
return sc_Y;
case XK_n:
return sc_N;
case XK_Tab:
return sc_Tab;
case XK_BackSpace:
return sc_BackSpace;
case XK_Pause:
return 0xE1;
default:
......
......@@ -334,7 +334,7 @@ void DrawHealth (void)
===============
*/
void TakeDamage (int points,objtype *attacker)
void TakeDamage (int points,objtype *attacker)
{
LastAttacker = attacker;
......@@ -353,12 +353,12 @@ void TakeDamage (int points,objtype *attacker)
killerobj = attacker;
}
StartDamageFlash (points);
StartDamageFlash(points);
gotgatgun=0;
DrawHealth ();
DrawFace ();
DrawHealth();
DrawFace();
//
// MAKE BJ'S EYES BUG IF MAJOR DAMAGE!
......@@ -382,15 +382,15 @@ void TakeDamage (int points,objtype *attacker)
===============
*/
void HealSelf (int points)
void HealSelf(int points)
{
gamestate.health += points;
if (gamestate.health>100)
gamestate.health = 100;
DrawHealth ();
DrawHealth();
gotgatgun = 0; // JR
DrawFace ();
DrawFace();
}
......
......@@ -153,8 +153,8 @@ int DebugKeys()
CenterWindow (12,3);
US_PrintCentered ("Free items!");
VW_UpdateScreen();
GivePoints (100000);
HealSelf (99);
GivePoints(100000);
HealSelf(99);
if (gamestate.bestweapon<wp_chaingun)
GiveWeapon (gamestate.bestweapon+1);
gamestate.ammo += 50;
......
......@@ -823,8 +823,6 @@ void FinishPaletteShifts (void);
void CenterWindow(word w,word h);
void InitActorList (void);
void GetNewActor (void);
void RemoveObj (objtype *gone);
void PollControls (void);
void StopMusic(void);
void StartMusic(void);
void PlayLoop (void);
......
......@@ -402,7 +402,7 @@ static int CalcRotate(objtype *ob)
=====================
*/
#define MAXVISABLE 50
#define MAXVISABLE 64
typedef struct {
int viewx;
......@@ -501,10 +501,10 @@ static void DrawScaleds()
if (!numvisable)
return; // no visable objects
for (i = 0; i<numvisable; i++)
for (i = 0; i < numvisable; i++)
{
least = 32000;
for (visstep=&vislist[0] ; visstep<visptr ; visstep++)
for (visstep = &vislist[0]; visstep < visptr; visstep++)
{
height = visstep->viewheight;
if (height < least)
......@@ -516,7 +516,7 @@ static void DrawScaleds()
//
// draw farthest
//
ScaleShape(farthest->viewx,farthest->shapenum,farthest->viewheight);
ScaleShape(farthest->viewx, farthest->shapenum, farthest->viewheight);
farthest->viewheight = 32000;
}
......
......@@ -20,7 +20,7 @@ boolean spearflag;
//
// ELEVATOR BACK MAPS - REMEMBER (-1)!!
//
int ElevatorBackTo[]={1,1,7,3,5,3};
static int ElevatorBackTo[]={ 1, 1, 7, 3, 5, 3};
//===========================================================================
......@@ -1066,45 +1066,45 @@ void GameLoop()
boolean died;
restartgame:
ClearMemory ();
ClearMemory();
SETFONTCOLOR(0,15);
DrawPlayScreen ();
DrawPlayScreen();
died = false;
do
{
if (!loadedgame)
gamestate.score = gamestate.oldscore;
gamestate.score = gamestate.oldscore;
DrawScore();
startgame = false;
if (loadedgame)
loadedgame = false;
else
SetupGameLevel ();
SetupGameLevel();
#ifdef SPEAR
if (gamestate.mapon == 20) // give them the key allways
{
gamestate.keys |= 1;
DrawKeys ();
DrawKeys();
}
#endif
ingame = true;
StartMusic ();
StartMusic();
if (!died)
PreloadGraphics ();
PreloadGraphics();
else
died = false;
fizzlein = true;
DrawLevel ();
DrawLevel();
#ifdef SPEAR
startplayloop:
#endif
PlayLoop ();
PlayLoop();
#ifdef SPEAR
if (spearflag)
......@@ -1137,7 +1137,7 @@ startplayloop:
}
#endif
StopMusic ();
StopMusic();
ingame = false;
if (demorecord && playstate != ex_warped)
......@@ -1224,17 +1224,17 @@ startplayloop:
break;
case ex_died:
Died ();
Died();
died = true; // don't "get psyched!"
if (gamestate.lives > -1)
break; // more lives left
break; // more lives left
VW_FadeOut ();
VW_FadeOut();
ClearMemory ();
ClearMemory();
CheckHighScore (gamestate.score,gamestate.mapon+1);
CheckHighScore(gamestate.score,gamestate.mapon+1);
strcpy(MainMenu[viewscores].string,STR_VS);
MainMenu[viewscores].routine = (void *)CP_ViewScores;
......@@ -1244,17 +1244,17 @@ startplayloop:
case ex_victorious:
#ifndef SPEAR
VW_FadeOut ();
VW_FadeOut();
#else
VL_FadeOut (0,255,0,17,17,300);
VL_FadeOut(0,255,0,17,17,300);
#endif
ClearMemory ();
ClearMemory();
Victory ();
Victory();
ClearMemory ();
ClearMemory();
CheckHighScore (gamestate.score,gamestate.mapon+1);
CheckHighScore(gamestate.score,gamestate.mapon+1);
strcpy(MainMenu[viewscores].string,STR_VS);
MainMenu[viewscores].routine = (void *)CP_ViewScores;
......@@ -1262,11 +1262,10 @@ startplayloop:
return;
default:
ClearMemory ();
ClearMemory();
break;
}
} while (1);
}
......@@ -224,7 +224,7 @@ void Victory (void)
IN_Ack();
#ifndef SPEAR
if (IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
if (IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
PicturePause();
#endif
......@@ -833,7 +833,7 @@ void LevelCompleted()
#endif
#ifndef SPEAR
if (IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
if (IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
PicturePause();
#endif
......
......@@ -119,6 +119,8 @@ void CalcTics()
}
}
/* ======================================================================== */
/*
====================
=
......@@ -133,7 +135,6 @@ void ReadConfig()
SMMode sm;
SDSMode sds;
#if 0 /* TODO */
int file;
if ((file = open(configname, O_BINARY | O_RDONLY)) != -1)
......@@ -179,13 +180,16 @@ void ReadConfig()
MainMenu[6].active=1;
MainItems.curpos=0;
}
}
else
#endif
{
//
// no config file, so select by hardware
//
/* max viewsize is 20 */
viewsize = 15;
}
if (SoundBlasterPresent || AdLibPresent)
{
sd = sdm_AdLib;
......@@ -209,15 +213,11 @@ void ReadConfig()
joypadenabled = false;
joystickport = 0;
/* max viewsize is 20 */
viewsize = 15;
mouseadjustment = 5;
}
SD_SetMusicMode (sm);
SD_SetSoundMode (sd);
SD_SetDigiDevice (sds);
SD_SetMusicMode(sm);
SD_SetSoundMode(sd);
SD_SetDigiDevice(sds);
}
......@@ -261,9 +261,6 @@ void WriteConfig()
}
}
//===========================================================================
/*
=====================
=
......@@ -290,8 +287,6 @@ void NewGame(int difficulty, int episode)
startgame = true;
}
/* ======================================================================== */
void DiskFlopAnim(int x, int y)
{
static char which=0;
......@@ -399,8 +394,6 @@ boolean SaveTheGame(int file,int x,int y)
return true;
}
//===========================================================================
/*
==================
=
......@@ -534,7 +527,7 @@ void ShutdownId()
}
//===========================================================================
/* ======================================================================== */
/*
==================
......
......@@ -1508,7 +1508,7 @@ int CalibrateJoystick(void)
if (IN_KeyDown(sc_Escape))
return 0;
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
PicturePause();
} while(!(jb&1));
......@@ -1537,7 +1537,7 @@ int CalibrateJoystick(void)
IN_CheckAck(); /* force update */
if (IN_KeyDown(sc_Escape))
return 0;
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
PicturePause();
} while(!(jb&2));
......@@ -2859,11 +2859,7 @@ int HandleMenu(CP_iteminfo *item_i,CP_itemtype *items,void (*routine)(int w))
//
// CHECK FOR SCREEN CAPTURE
//
#ifndef SPEAR
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
#else
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
#endif
PicturePause();
......@@ -3220,7 +3216,7 @@ int Confirm(char *string)
set_TimeCount(0);
}
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
PicturePause();
} while(!IN_KeyDown(sc_Y) && !IN_KeyDown(sc_N) && !IN_KeyDown(sc_Escape));
......
......@@ -10,7 +10,7 @@
=============================================================================
*/
boolean madenoise; // true when shooting or screaming
boolean madenoise; // true when shooting or screaming
exit_t playstate;
......@@ -63,13 +63,11 @@ boolean buttonstate[NUMBUTTONS];
//===========================================================================
void CenterWindow(word w,word h);
void InitObjList (void);
void RemoveObj (objtype *gone);
void PollControls (void);
void StopMusic(void);
void StartMusic(void);
void PlayLoop (void);
static void RemoveObj(objtype *gone);
static void PollControls();
void StopMusic();
void StartMusic();
void PlayLoop();
/*
=============================================================================
......@@ -79,9 +77,6 @@ void PlayLoop (void);
=============================================================================
*/
objtype dummyobj;
//
// LIST OF SONGS FOR EACH VERSION
//
......@@ -226,10 +221,6 @@ int songs[]=
#define BASEMOVE 35
#define RUNMOVE 70
#define BASETURN 35
#define RUNTURN 70
#define JOYSCALE 2
/*
===================
......@@ -239,9 +230,9 @@ int songs[]=
===================
*/
void PollKeyboardButtons (void)
void PollKeyboardButtons()
{
int i;
int i;
for (i=0;i<NUMBUTTONS;i++)
if (IN_KeyDown(buttonscan[i]))
......@@ -257,11 +248,11 @@ void PollKeyboardButtons (void)
===================
*/
void PollMouseButtons (void)
void PollMouseButtons()
{
int buttons;
buttons = IN_MouseButtons ();
buttons = IN_MouseButtons();
if (buttons&1)
buttonstate[buttonmouse[0]] = true;
......@@ -281,11 +272,11 @@ void PollMouseButtons (void)
===================
*/
void PollJoystickButtons (void)
void PollJoystickButtons()
{
int buttons;
buttons = IN_JoyButtons ();
buttons = IN_JoyButtons();
if (joystickport && !joypadenabled)
{
......@@ -354,7 +345,7 @@ void PollKeyboardMove()
===================
*/
void PollMouseMove (void)
void PollMouseMove()
{
int mousexmove = 0, mouseymove = 0;
......@@ -372,7 +363,7 @@ void PollMouseMove (void)
===================
*/
void PollJoystickMove (void)
void PollJoystickMove()
{
int joyx, joyy;
......@@ -584,7 +575,7 @@ void CenterWindow(word w,word h)
=====================
*/
void CheckKeys (void)
void CheckKeys()
{
byte scan;
......@@ -611,7 +602,7 @@ void CheckKeys (void)
IN_Ack();
godmode ^= 1;
DrawAllPlayBorderSides ();
DrawAllPlayBorderSides();
IN_ClearKeysDown();
return;
}
......@@ -655,7 +646,7 @@ void CheckKeys (void)
//
if (IN_KeyDown(sc_BackSpace) && IN_KeyDown(sc_LShift) &&
IN_KeyDown(sc_Alt) && MS_CheckParm("debugmode")) {
ClearMemory ();
ClearMemory();
CA_CacheGrChunk (STARTFONT+1);
ClearSplitVWB ();
......@@ -872,7 +863,7 @@ void GetNewActor (void)
=========================
*/
void RemoveObj(objtype *gone)
static void RemoveObj(objtype *gone)
{
if (gone == player)
Quit ("RemoveObj: Tried to remove the player!");
......@@ -917,7 +908,7 @@ void RemoveObj(objtype *gone)
=================
*/
void StopMusic(void)
void StopMusic()
{
int i;
......@@ -984,7 +975,7 @@ boolean palshifted;
=====================
*/
void InitRedShifts (void)
void InitRedShifts()
{
byte *workptr;
const byte *baseptr;
......@@ -1037,7 +1028,7 @@ void InitRedShifts (void)
=====================
*/
void ClearPaletteShifts (void)
void ClearPaletteShifts()
{
bonuscount = damagecount = 0;
}
......@@ -1051,7 +1042,7 @@ void ClearPaletteShifts (void)
=====================
*/
void StartBonusFlash (void)
void StartBonusFlash()
{
bonuscount = NUMWHITESHIFTS*WHITETICS; // white shift palette
}
......@@ -1065,7 +1056,7 @@ void StartBonusFlash (void)
=====================
*/
void StartDamageFlash (int damage)
void StartDamageFlash(int damage)
{
damagecount += damage;
}
......@@ -1079,9 +1070,9 @@ void StartDamageFlash (int damage)
=====================
*/
void UpdatePaletteShifts (void)
void UpdatePaletteShifts()
{
int red,white;
int red, white;
if (bonuscount)
{
......
......@@ -11,10 +11,10 @@
*/
dirtype opposite[9] =
static dirtype opposite[9] =
{west,southwest,south,southeast,east,northeast,north,northwest,nodir};
dirtype diagonal[9][9] =
static dirtype diagonal[9][9] =
{
/* east */ {nodir,nodir,northeast,nodir,nodir,nodir,southeast,nodir,nodir},
{nodir,nodir,nodir,nodir,nodir,nodir,nodir,nodir,nodir},
......@@ -337,7 +337,7 @@ boolean TryWalk (objtype *ob)
==================================
*/
void SelectDodgeDir (objtype *ob)
void SelectDodgeDir(objtype *ob)
{
int deltax,deltay,i;
unsigned absdx,absdy;
......
......@@ -649,7 +649,7 @@ void ShowArticle(char *article)
break;
}
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("goobers"))
if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode"))
PicturePause();
} while (LastScan != sc_Escape);
......
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