Commit 29eca737 authored by Steven Fuller's avatar Steven Fuller

Even more things made static.

Doc updates...

Even more small formatting changes.
parent 6fe38b42
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* A key to change viewsize while playing (note: max == 20, min == 5 or so...) * A key to change viewsize while playing (note: max == 20, min == 5 or so...)
* Game able to cope at any virtual resolution in software mode. OpenGL * Game able to cope at any virtual resolution in software mode. OpenGL
handles this transparently (after setting correct glViewport) handles this transparently (after setting correct glViewport)
* Audio support using OpenAL (somewhat decently supported at the moment) * Audio support using OpenAL
* 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 and with * Fully compile with no warnings/errors using -Wall -ansi -pedantic and with
......
...@@ -4,3 +4,7 @@ Someone is actually reading the README... ...@@ -4,3 +4,7 @@ Someone is actually reading the README...
http://rinkworks.com/apogee/s/2.4.5.shtml http://rinkworks.com/apogee/s/2.4.5.shtml
http://www.3dportal.com/hideout/stuff/odd.html http://www.3dportal.com/hideout/stuff/odd.html
http://www.maccentral.com/news/0001/24.wolf3d.shtml http://www.maccentral.com/news/0001/24.wolf3d.shtml
-----
Steven Fuller
relnev@atdot.org
------------- Please Disregard the Following Outdated Text: ---------------- ------------- Please Disregard the Following Outdated Text: ----------------
*
SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
=>
SD_StartMusic(chunk);
General: General:
* half of these things belong in IDEAS; they are not bugs, just random
musings
* inconsistancy: * inconsistancy:
id_ca.c has code for setting the data filenames' extension id_ca.c has code for setting the data filenames' extension
so does wl_menu.c so does wl_menu.c
* menu code is a mess, always does things differently than the rest of the * menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up code, it really needs to be cleaned up
* id_ca.c cache code: nice idea but messy and maybe can be fixed * id_ca.c cache code: fix/rewrite the "garbage collection" system?
in an effort to not allocate everything to memory and forget about it
some sort of garbage collection
* clean up header files, especially wl_def.h, where some declarations aren't * clean up header files, especially wl_def.h, where some declarations aren't
in the right place in the right place
* every structure that is read/written must be PACKED, with datatypes * every structure that is read/written must be PACKED, with datatypes
specifically set! (ie, no int, but short or long int) specifially set to correct size!
* or at least have PACKED versions of read/write structures, and transfer * or at least have PACKED versions of read/write structures, and transfer
to/from just for reading, so only not-packed structures are used during to/from just for reading, so only not-packed structures are used during
actual gameplay/etc. actual gameplay/etc.
...@@ -22,23 +28,17 @@ actual gameplay/etc. ...@@ -22,23 +28,17 @@ actual gameplay/etc.
would be nice to show what version is loaded, but doom just printed text would be nice to show what version is loaded, but doom just printed text
and the intro screen which came with wolf3d has copyrighted/trademarked images and the intro screen which came with wolf3d has copyrighted/trademarked images
maybe make a new intro screen... maybe make a new intro screen...
* then, what about PG13? OH NO!!!! -- people would probably want the first
two screens for nostalga
* fix the input code, everything is spread out... ideally everything should * fix the input code, everything is spread out... ideally everything should
work the same, let the input handler do it all instead 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" 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 key type, and for everything not scancode-based, have a function to
translate translate
* remove GOODTIMES? * remove GOODTIMES?
* Consider removing the SOD manual check * Remove the SOD manual check?
* perhaps rename UPLOAD * perhaps rename UPLOAD
* TOO MANY #IFDEFs * TOO MANY #IFDEFs
* and upload builds with lots of wl6 code anyway (sound references were just
ifndefed out)
* verify if the sounds and graphics are correctly numbered, once again... * verify if the sounds and graphics are correctly numbered, once again...
* add a ViewMap? * add a ViewMap? (could be done similar to mac version)
* remove the #else at the end of each header since nothing is being doubly
included now (if ever)
* find and remove any function stubs (functions which just call another * find and remove any function stubs (functions which just call another
function with same parameters, only difference is the name) function with same parameters, only difference is the name)
* fix wl_debug.c, lots of junk code.. * fix wl_debug.c, lots of junk code..
...@@ -51,14 +51,10 @@ calling wait vbl when doing palette stuffs ...@@ -51,14 +51,10 @@ calling wait vbl when doing palette stuffs
* wl_menu uses specific scancodes for names, config file will have to use * wl_menu uses specific scancodes for names, config file will have to use
metaname like sc_Left etc or something metaname like sc_Left etc or something
* fizzlefade is hackish, stipple buf would work ok in opengl, maybe only * fizzlefade is hackish, stipple buf would work ok in opengl, maybe only
update once per frame or such.. hm update once per frame or such...
and where is that stray pixel coming from (when using end game with largest and where is that stray pixel coming from (when using end game with largest
window size) in svgalib 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 16bit X
* change id_sd to sd_oss, sd_win, sd_dos, sd_oal, etc
idea is that different <outputs> can share some drivers, unlike video
although glx and x11 share a lot of code (i guess since gl will be a great
undertaking, better to keep them seperated)
* check filehandling (ex, file missing, bad file type, and such) * check filehandling (ex, file missing, bad file type, and such)
PlayDemoFromFile specifically PlayDemoFromFile specifically
* make sure all infinite loops are found (looping around Keyboard) * make sure all infinite loops are found (looping around Keyboard)
...@@ -69,38 +65,28 @@ same with the spear of destiny animation part of ending ...@@ -69,38 +65,28 @@ same with the spear of destiny animation part of ending
since it deprecates: id_vh, (parts of) wl_draw, wl_scale) since it deprecates: id_vh, (parts of) wl_draw, wl_scale)
by putting in code from id_vh (either by using Plot or just copying it in) by putting in code from id_vh (either by using Plot or just copying it in)
we can stop the large conversion before each UpdateScreen we can stop the large conversion before each UpdateScreen
but palette fades will still need it! damnit but palette fades will still need it!
* what are special keys... ?
* the higher depths are a hack since a palette lookup has to be done * the higher depths are a hack since a palette lookup has to be done
for every byte when transferring to the pixmap, palette fades require a for every byte when transferring to the pixmap, palette fades require a
screen update screen update
* make sure none of the code tries to handle gfx/sound data directly * make sure none of the code tries to handle gfx/sound data directly
* GL_EXT_shared_texture_palette for opengl * if window loses focus, should it clear the keys? most likely
* if window looses focus, should it clear the keys ?
* clean up vi_xlib.c: fix vid mode changing, fix dga for non8bit modes and * clean up vi_xlib.c: fix vid mode changing, fix dga for non8bit modes and
the nonpalette setting stuff... lots of if statements the nonpalette setting stuff... lots of if statements
* fix broken opengl.. argh wolf3d updates lots of stuff used in other parts also, it should be able to compile without extensions
of the game (namely stuff used for hit testing when firing weapon) in the
draw loop.. start by cp wl_draw.c vi_ogl.c and just take out the actual
drawing bits and replace with opengl.
* rename visable to visible * rename visable to visible
* fix up windows port * fix up windows port
* create 'sound channels' with priority.. ie a door can only make one sound * create 'sound channels' with priority.. ie a door can only make one sound
at a time at a time
* beos is c++ (and uses gcc as a compiler i think) but wolf3d will need many * beos is c++ but wolf3d will need many cleanups for c++ either that or use
cleanups for c++ extern "C" { ... } in the header files
either that or use extern "C" { ... } in the header files
* change wl_scale to use mac wolf3d's version of scaling * change wl_scale to use mac wolf3d's version of scaling
wall drawing is done, just needed to fix sprite code wall drawing is done, just needed to fix sprite code
* check in wolftools and add mac wolftools (currently the res dumping stuff) * check in wolftools and add mac wolftools (currently the res dumping stuff)
* have vi_xlib.c compile without the extensions
* cat file.c | perl -e 'while($in = <STDIN>) * cat file.c | perl -e 'while($in = <STDIN>)
{$in =~ s/\/\/(.*)$/\/\* \1\ *\//gm;print $in;}' {$in =~ s/\/\/(.*)$/\/\* \1\ *\//gm;print $in;}'
or or
cat foo.txt |sed -e "s/\/\/\(.*\)$/\/\*\1\*\//g" cat foo.txt |sed -e "s/\/\/\(.*\)$/\/\*\1\*\//g"
* oal version locks up at end of level (hit switch but before the ratios)
the api is a bit unstable at the moment so wait for 1.0 of linux version to
be released before fixing it, although that lame sampling bug got fixed
Things to try: Things to try:
* Any speed gain with comparing values in screen before writing? * Any speed gain with comparing values in screen before writing?
......
...@@ -30,16 +30,16 @@ typedef struct ...@@ -30,16 +30,16 @@ typedef struct
============================================================================= =============================================================================
*/ */
byte *tinf; static byte *tinf;
int mapon; int mapon;
word *mapsegs[MAPPLANES]; word *mapsegs[MAPPLANES];
maptype *mapheaderseg[NUMMAPS]; maptype *mapheaderseg[NUMMAPS];
byte *audiosegs[NUMSNDCHUNKS]; byte *audiosegs[NUMSNDCHUNKS];
byte *grsegs[NUMCHUNKS]; byte *grsegs[NUMCHUNKS];
byte grneeded[NUMCHUNKS]; static byte grneeded[NUMCHUNKS];
byte ca_levelbit,ca_levelnum; static byte ca_levelbit, ca_levelnum;
/* /*
============================================================================= =============================================================================
...@@ -56,21 +56,22 @@ char extension[5], ...@@ -56,21 +56,22 @@ char extension[5],
mheadname[10] = "maphead.", mheadname[10] = "maphead.",
gmapsname[10] = "gamemaps.", gmapsname[10] = "gamemaps.",
aheadname[10] = "audiohed.", aheadname[10] = "audiohed.",
afilename[10] = "audiot."; afilename[10] = "audiot.",
pfilename[10] = "vswap.";
long *grstarts; /* array of offsets in vgagraph, -1 for sparse */ static long *grstarts; /* array of offsets in vgagraph, -1 for sparse */
long *audiostarts; /* array of offsets in audio / audiot */ static long *audiostarts; /* array of offsets in audio / audiot */
huffnode grhuffman[255]; static huffnode grhuffman[255];
int grhandle; /* handle to VGAGRAPH */ static int grhandle; /* handle to VGAGRAPH */
int maphandle; /* handle to MAPTEMP / GAMEMAPS */ static int maphandle; /* handle to MAPTEMP / GAMEMAPS */
int audiohandle; /* handle to AUDIOT / AUDIO */ static int audiohandle; /* handle to AUDIOT / AUDIO */
SDMode oldsoundmode; SDMode oldsoundmode;
#define FILEPOSSIZE 3 #define FILEPOSSIZE 3
long GRFILEPOS(int c) static long GRFILEPOS(int c)
{ {
long value; long value;
int offset; int offset;
...@@ -471,7 +472,7 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag) ...@@ -471,7 +472,7 @@ void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag)
============================ ============================
*/ */
long CAL_GetGrChunkLength(int chunk) static long CAL_GetGrChunkLength(int chunk)
{ {
long chunkexplen; long chunkexplen;
...@@ -488,7 +489,7 @@ long CAL_GetGrChunkLength(int chunk) ...@@ -488,7 +489,7 @@ long CAL_GetGrChunkLength(int chunk)
====================== ======================
*/ */
void CAL_SetupGrFile() static void CAL_SetupGrFile()
{ {
char fname[13]; char fname[13];
int handle; int handle;
...@@ -555,9 +556,9 @@ void CAL_SetupGrFile() ...@@ -555,9 +556,9 @@ void CAL_SetupGrFile()
====================== ======================
*/ */
void CAL_SetupMapFile() static void CAL_SetupMapFile()
{ {
int i; int i;
int handle; int handle;
long length,pos; long length,pos;
char fname[13]; char fname[13];
...@@ -565,8 +566,8 @@ void CAL_SetupMapFile() ...@@ -565,8 +566,8 @@ void CAL_SetupMapFile()
// //
// load maphead.ext (offsets and tileinfo for map file) // load maphead.ext (offsets and tileinfo for map file)
// //
strcpy(fname,mheadname); strcpy(fname, mheadname);
strcat(fname,extension); strcat(fname, extension);
if ((handle = open(fname, O_RDONLY | O_BINARY)) == -1) if ((handle = open(fname, O_RDONLY | O_BINARY)) == -1)
CA_CannotOpen(fname); CA_CannotOpen(fname);
...@@ -622,7 +623,7 @@ void CAL_SetupMapFile() ...@@ -622,7 +623,7 @@ void CAL_SetupMapFile()
====================== ======================
*/ */
void CAL_SetupAudioFile() static void CAL_SetupAudioFile()
{ {
int handle; int handle;
long length; long length;
...@@ -663,7 +664,7 @@ void CAL_SetupAudioFile() ...@@ -663,7 +664,7 @@ void CAL_SetupAudioFile()
====================== ======================
*/ */
void CA_Startup(void) void CA_Startup()
{ {
CAL_SetupMapFile(); CAL_SetupMapFile();
CAL_SetupGrFile(); CAL_SetupGrFile();
...@@ -806,7 +807,7 @@ cachein: ...@@ -806,7 +807,7 @@ cachein:
====================== ======================
*/ */
void CAL_ExpandGrChunk(int chunk, byte *source) static void CAL_ExpandGrChunk(int chunk, byte *source)
{ {
int tilecount = 0, i; int tilecount = 0, i;
long expanded; long expanded;
...@@ -1383,11 +1384,11 @@ void MM_SortMem() ...@@ -1383,11 +1384,11 @@ void MM_SortMem()
{ {
} }
boolean PMStarted; static boolean PMStarted;
char PageFileName[13] = {"vswap."};
int PageFile = -1; static int PageFile = -1;
word ChunksInFile; static word ChunksInFile;
word PMSpriteStart,PMSoundStart; word PMSpriteStart, PMSoundStart;
word PMNumBlocks; word PMNumBlocks;
long PMFrameCount; long PMFrameCount;
...@@ -1419,14 +1420,18 @@ static void PML_ReadFromFile(byte *buf, long offset, word length) ...@@ -1419,14 +1420,18 @@ static void PML_ReadFromFile(byte *buf, long offset, word length)
// //
static void PML_OpenPageFile() static void PML_OpenPageFile()
{ {
int i; int i;
long size; long size;
void *buf; void *buf;
longword *offsetptr; longword *offsetptr;
word *lengthptr; word *lengthptr;
PageListStruct *page; PageListStruct *page;
char fname[13];
PageFile = open(PageFileName, O_RDONLY | O_BINARY);
strcpy(fname, pfilename);
strcat(fname, extension);
PageFile = open(fname, O_RDONLY | O_BINARY);
if (PageFile == -1) if (PageFile == -1)
Quit("PML_OpenPageFile: Unable to open page file"); Quit("PML_OpenPageFile: Unable to open page file");
......
...@@ -18,7 +18,6 @@ typedef struct ...@@ -18,7 +18,6 @@ typedef struct
//=========================================================================== //===========================================================================
extern byte *tinf;
extern int mapon; extern int mapon;
extern word *mapsegs[MAPPLANES]; extern word *mapsegs[MAPPLANES];
...@@ -26,9 +25,6 @@ extern maptype *mapheaderseg[NUMMAPS]; ...@@ -26,9 +25,6 @@ extern maptype *mapheaderseg[NUMMAPS];
extern byte *audiosegs[NUMSNDCHUNKS]; extern byte *audiosegs[NUMSNDCHUNKS];
extern byte *grsegs[NUMCHUNKS]; extern byte *grsegs[NUMCHUNKS];
extern byte grneeded[NUMCHUNKS];
extern byte ca_levelbit,ca_levelnum;
extern char extension[5], extern char extension[5],
gheadname[10], gheadname[10],
gfilename[10], gfilename[10],
...@@ -37,9 +33,6 @@ extern char extension[5], ...@@ -37,9 +33,6 @@ extern char extension[5],
aheadname[10], aheadname[10],
afilename[10]; afilename[10];
extern long *grstarts; // array of offsets in vgagraph, -1 for sparse
extern long *audiostarts; // array of offsets in audio / audiot
//=========================================================================== //===========================================================================
boolean CA_FarRead(int handle, byte *dest, long length); boolean CA_FarRead(int handle, byte *dest, long length);
...@@ -50,25 +43,25 @@ boolean CA_WriteFile(char *filename, void *ptr, long length); ...@@ -50,25 +43,25 @@ boolean CA_WriteFile(char *filename, void *ptr, long length);
void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag); void CA_RLEWexpand(word *source, word *dest, long length, word rlewtag);
void CA_Startup (void); void CA_Startup();
void CA_Shutdown (void); void CA_Shutdown();
void CA_SetGrPurge (void); void CA_SetGrPurge();
void CA_CacheAudioChunk(int chunk); void CA_CacheAudioChunk(int chunk);
void CA_UnCacheAudioChunk(int chunk); void CA_UnCacheAudioChunk(int chunk);
void CA_LoadAllSounds (void); void CA_LoadAllSounds();
void CA_CacheMap (int mapnum); void CA_CacheMap(int mapnum);
void CA_CacheGrChunk(int chunk); void CA_CacheGrChunk(int chunk);
void CA_UnCacheGrChunk(int chunk); void CA_UnCacheGrChunk(int chunk);
void CA_UpLevel (void); void CA_UpLevel();
void CA_DownLevel (void); void CA_DownLevel();
/* /*
void CA_SetAllPurge (void); void CA_SetAllPurge();
void CA_ClearMarks (void); void CA_ClearMarks();
void CA_ClearAllMarks (void); void CA_ClearAllMarks();
#define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit #define CA_MarkGrChunk(chunk) grneeded[chunk]|=ca_levelbit
...@@ -105,15 +98,13 @@ extern PageListStruct *PMPages; ...@@ -105,15 +98,13 @@ extern PageListStruct *PMPages;
#define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v)) #define PM_GetSoundPage(v) PM_GetPage(PMSoundStart + (v))
#define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v)) #define PM_GetSpritePage(v) PM_GetPage(PMSpriteStart + (v))
extern char PageFileName[13];
void PM_Startup(void), void PM_Startup(void),
PM_Shutdown(void), PM_Shutdown(void),
PM_Reset(void), PM_Reset(void),
PM_Preload(boolean (*update)(word current,word total)), PM_Preload(boolean (*update)(word current,word total)),
PM_NextFrame(void), PM_NextFrame(void),
PM_SetMainPurge(int level); PM_SetMainPurge(int level);
memptr PM_GetPageAddress(int pagenum), PM_GetPage(int pagenum); memptr PM_GetPageAddress(int pagenum), PM_GetPage(int pagenum);
#endif #endif
...@@ -3428,7 +3428,6 @@ void CheckForEpisodes() ...@@ -3428,7 +3428,6 @@ void CheckForEpisodes()
strcat(configname, extension); strcat(configname, extension);
strcat(SaveName, extension); strcat(SaveName, extension);
strcat(PageFileName, extension);
#else #else
...@@ -3485,7 +3484,6 @@ void CheckForEpisodes() ...@@ -3485,7 +3484,6 @@ void CheckForEpisodes()
strcat(configname, extension); strcat(configname, extension);
strcat(SaveName, extension); strcat(SaveName, extension);
strcat(PageFileName, extension);
#endif #endif
#else #else
...@@ -3539,8 +3537,6 @@ void CheckForEpisodes() ...@@ -3539,8 +3537,6 @@ void CheckForEpisodes()
strcat(configname, extension); strcat(configname, extension);
strcat(SaveName, extension); strcat(SaveName, extension);
strcat(PageFileName, extension);
#endif #endif
} }
...@@ -941,16 +941,13 @@ void StopMusic(void) ...@@ -941,16 +941,13 @@ void StopMusic(void)
================= =================
*/ */
void StartMusic(void) void StartMusic()
{ {
musicnames chunk; musicnames chunk;
SD_MusicOff(); SD_MusicOff();
chunk = songs[gamestate.mapon+gamestate.episode*10]; chunk = songs[gamestate.mapon+gamestate.episode*10];
// if ((chunk == -1) || (MusicMode != smm_AdLib))
//DEBUG control panel return;
CA_CacheAudioChunk(STARTMUSIC + chunk); CA_CacheAudioChunk(STARTMUSIC + chunk);
MM_SetLock((memptr)&(audiosegs[STARTMUSIC + chunk]),true); MM_SetLock((memptr)&(audiosegs[STARTMUSIC + chunk]),true);
SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]); SD_StartMusic((MusicGroup *)audiosegs[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