Commit b76bc11f authored by Steven Fuller's avatar Steven Fuller

sd_comm.c, wl_main.c: Moved InitDigiList to its own file.

wl_inter.c, id_ca.c: Removed PM_Preload, PreloadGraphics can do it itself.

id_ca.c: Added a PM_FreePage

sd_oal.c: Working OpenAL implementation. (no adlib sound yet)
parent 04cd0215
...@@ -10,7 +10,7 @@ CFLAGS = -g -Wall -pedantic ...@@ -10,7 +10,7 @@ CFLAGS = -g -Wall -pedantic
OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \ OBJS = objs.o misc.o id_ca.o id_vh.o id_us.o \
wl_act1.o wl_act2.o wl_act3.o wl_agent.o wl_game.o \ wl_act1.o wl_act2.o wl_act3.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_inter.o wl_menu.o wl_play.o wl_state.o wl_text.o wl_main.o \
wl_debug.o vi_comm.o wl_debug.o vi_comm.o sd_comm.o
ROBJS = wl_draw.o ROBJS = wl_draw.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
...@@ -23,8 +23,10 @@ OBJS += sd_null.o ...@@ -23,8 +23,10 @@ OBJS += sd_null.o
#CFLAGS += -D_REENTRANT #CFLAGS += -D_REENTRANT
#LFLAGS += -lpthread #LFLAGS += -lpthread
#OBJS += sd_oal.o #OBJS += sd_oal.o
#CFLAGS += -D_REENTRANT #CFLAGS += -D_REENTRANT -I/home/relnev/cvs/oal/include/
#LFLAGS += -lpthread #-lopenal #LFLAGS += -lpthread -ldl -L/home/relnev/cvs/oal/linux/src/ -lopenal # /home/relnev/cvs/oal/linux/src/libopenal.a
#LFLAGS += -lpthread /home/relnev/ElectricFence-2.2.2/libefence.a
CFLAGS += `sdl-config --cflags` CFLAGS += `sdl-config --cflags`
......
...@@ -6,7 +6,7 @@ Just some random facts/thoughts/ideas/musings: ...@@ -6,7 +6,7 @@ Just some random facts/thoughts/ideas/musings:
- SNES - SNES
- Macintosh - Macintosh
- Jaguar - Jaguar
- Apple IIGS [http://www.sheppyware.com/products/a2/wolf3d/] - Apple IIGS: http://www.sheppyware.com/products/a2/wolf3d/
- 3DO - 3DO
* Rumored/Never Released? * Rumored/Never Released?
...@@ -20,8 +20,10 @@ Just some random facts/thoughts/ideas/musings: ...@@ -20,8 +20,10 @@ Just some random facts/thoughts/ideas/musings:
- Linux (this, xwolf, wolfgl) - Linux (this, xwolf, wolfgl)
XWolf: http://www.sirius.demon.co.uk/xwolf/ XWolf: http://www.sirius.demon.co.uk/xwolf/
- Amiga (port of my first pc wolf3d linux port) - Amiga (port of my first pc wolf3d linux port)
[http://www.silab.dsi.unimi.it/~cs556770/wolf3d/] http://www.silab.dsi.unimi.it/~cs556770/wolf3d/
- Windows (wolfgl) [http://www.sourceforge.net/projects/wolfgl/] - Windows
WolfGL: http://www.sourceforge.net/projects/wolfgl/
Wolf DX: http://www.phoebe.co.uk/glwolf/
- Acorn/Archemedes - Acorn/Archemedes
* PC source released August(?) ??, 1995: * PC source released August(?) ??, 1995:
...@@ -32,10 +34,10 @@ Just some random facts/thoughts/ideas/musings: ...@@ -32,10 +34,10 @@ Just some random facts/thoughts/ideas/musings:
- http://www.wolf3dmansion.com/index.phtml - http://www.wolf3dmansion.com/index.phtml
* Macintosh source released January 21, 2000 * Macintosh source released January 21, 2000
- http://www.maccentral.com/news/0001/24.wolf3d.shtml - http://www.maccentral.com/news/0001/24.wolf3d.shtml
* TED5 source (editor used for tons of games including wolf3d) * TED5 source (map editor used for tons of games including wolf3d)
- ftp://ftp.3drealms.com/misc/ted5.zip - ftp://ftp.3drealms.com/misc/ted5.zip
* Games which used the Wolfenstein 3D Engine: * Games which used the Wolfenstein 3D Engine:
- Blake Stone - Blake Stone (Aliens of Gold, Planet Strike)
- Corridor 7 - Corridor 7
- Operation Body Count - Operation Body Count
......
...@@ -31,6 +31,9 @@ B I - add mouse support ...@@ -31,6 +31,9 @@ B I - add mouse support
B M - add joystick/gamepad support B M - add joystick/gamepad support
P I - fill in the new fizzlefade function P I - fill in the new fizzlefade function
P I - add sound "emulation" to the necessary targets so WaitSoundDone works P I - add sound "emulation" to the necessary targets so WaitSoundDone works
B R - autoconf/automake
P R - change boolean SD_PlaySound to void SD_PlaySound
P M - position pushwall sounds
Complete: Complete:
P I - fix or remove fizzle fade P I - fix or remove fizzle fade
......
...@@ -833,13 +833,18 @@ memptr PM_GetPage(int pagenum) ...@@ -833,13 +833,18 @@ memptr PM_GetPage(int pagenum)
return page->addr; return page->addr;
} }
void PM_Preload(boolean (*update)(int current, int total)) void PM_FreePage(int pagenum)
{ {
int i; PageListStruct *page;
if (pagenum >= ChunksInFile)
Quit("PM_FreePage: Invalid page request");
for (i = 0; i < 50; i++) page = &PMPages[pagenum];
update(i, 50); /* yay */ if (page->addr != NULL) {
update(50, 50); MM_FreePtr((memptr)&page->addr);
page->addr = NULL;
}
} }
void PM_Startup() void PM_Startup()
......
...@@ -72,11 +72,10 @@ extern PageListStruct *PMPages; ...@@ -72,11 +72,10 @@ 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))
memptr PM_GetPage(int pagenum);
void PM_FreePage(int pagenum);
void PM_Startup(); void PM_Startup();
void PM_Shutdown(); void PM_Shutdown();
void PM_Preload(boolean (*update)(int current, int total));
memptr PM_GetPage(int pagenum);
#endif #endif
#include "wl_def.h"
/*
=====================
=
= InitDigiMap
=
=====================
*/
int DigiMap[LASTSOUND];
static int wolfdigimap[] =
{
#ifndef SPEAR
HALTSND, 0,
DOGBARKSND, 1,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
ATKMACHINEGUNSND, 4,
ATKPISTOLSND, 5,
ATKGATLINGSND, 6,
SCHUTZADSND, 7,
GUTENTAGSND, 8,
MUTTISND, 9,
BOSSFIRESND, 10,
SSFIRESND, 11,
DEATHSCREAM1SND, 12,
DEATHSCREAM2SND, 13,
DEATHSCREAM3SND, 13,
TAKEDAMAGESND, 14,
PUSHWALLSND, 15,
LEBENSND, 20,
NAZIFIRESND, 21,
SLURPIESND, 22,
YEAHSND, 32,
#ifndef UPLOAD
DOGDEATHSND, 16,
AHHHGSND, 17,
DIESND, 18,
EVASND, 19,
TOT_HUNDSND, 23,
MEINGOTTSND, 24,
SCHABBSHASND, 25,
HITLERHASND, 26,
SPIONSND, 27,
NEINSOVASSND, 28,
DOGATTACKSND, 29,
LEVELDONESND, 30,
MECHSTEPSND, 31,
SCHEISTSND, 33,
DEATHSCREAM4SND, 34, /* AIIEEE */
DEATHSCREAM5SND, 35, /* DEE-DEE */
DONNERSND, 36, /* EPISODE 4 BOSS DIE */
EINESND, 37, /* EPISODE 4 BOSS SIGHTING */
ERLAUBENSND, 38, /* EPISODE 6 BOSS SIGHTING */
DEATHSCREAM6SND, 39, /* FART */
DEATHSCREAM7SND, 40, /* GASP */
DEATHSCREAM8SND, 41, /* GUH-BOY! */
DEATHSCREAM9SND, 42, /* AH GEEZ! */
KEINSND, 43, /* EPISODE 5 BOSS SIGHTING */
MEINSND, 44, /* EPISODE 6 BOSS DIE */
ROSESND, 45, /* EPISODE 5 BOSS DIE */
#endif
#else /* SPEAR OF DESTINY DIGISOUNDS */
HALTSND, 0,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
ATKMACHINEGUNSND, 4,
ATKPISTOLSND, 5,
ATKGATLINGSND, 6,
SCHUTZADSND, 7,
BOSSFIRESND, 8,
SSFIRESND, 9,
DEATHSCREAM1SND, 10,
DEATHSCREAM2SND, 11,
TAKEDAMAGESND, 12,
PUSHWALLSND, 13,
AHHHGSND, 15,
LEBENSND, 16,
NAZIFIRESND, 17,
SLURPIESND, 18,
LEVELDONESND, 22,
DEATHSCREAM4SND, 23, // AIIEEE
DEATHSCREAM3SND, 23, // DOUBLY-MAPPED!!!
DEATHSCREAM5SND, 24, // DEE-DEE
DEATHSCREAM6SND, 25, // FART
DEATHSCREAM7SND, 26, // GASP
DEATHSCREAM8SND, 27, // GUH-BOY!
DEATHSCREAM9SND, 28, // AH GEEZ!
GETGATLINGSND, 38, // Got Gat replacement
#ifndef SPEARDEMO
DOGBARKSND, 1,
DOGDEATHSND, 14,
SPIONSND, 19,
NEINSOVASSND, 20,
DOGATTACKSND, 21,
TRANSSIGHTSND, 29, // Trans Sight
TRANSDEATHSND, 30, // Trans Death
WILHELMSIGHTSND, 31, // Wilhelm Sight
WILHELMDEATHSND, 32, // Wilhelm Death
UBERDEATHSND, 33, // Uber Death
KNIGHTSIGHTSND, 34, // Death Knight Sight
KNIGHTDEATHSND, 35, // Death Knight Death
ANGELSIGHTSND, 36, // Angel Sight
ANGELDEATHSND, 37, // Angel Death
GETSPEARSND, 39, // Got Spear replacement
#endif
#endif
LASTSOUND
};
void InitDigiMap()
{
int *map, i;
for (i = 0; i < LASTSOUND; i++)
DigiMap[i] = -1;
for (map = wolfdigimap; *map != LASTSOUND; map += 2)
DigiMap[map[0]] = map[1];
}
...@@ -45,7 +45,7 @@ extern boolean AdLibPresent, SoundBlasterPresent; ...@@ -45,7 +45,7 @@ extern boolean AdLibPresent, SoundBlasterPresent;
extern SDMode SoundMode; extern SDMode SoundMode;
extern SDSMode DigiMode; extern SDSMode DigiMode;
extern SMMode MusicMode; extern SMMode MusicMode;
extern int DigiMap[];
extern void SD_Startup(); extern void SD_Startup();
extern void SD_Shutdown(); extern void SD_Shutdown();
...@@ -58,15 +58,18 @@ extern void SD_StopSound(), ...@@ -58,15 +58,18 @@ extern void SD_StopSound(),
SD_MusicOff(), SD_MusicOff(),
SD_FadeOutMusic(); SD_FadeOutMusic();
extern boolean SD_MusicPlaying(), extern boolean SD_MusicPlaying(), SD_SetSoundMode(SDMode mode),
SD_SetSoundMode(SDMode mode),
SD_SetMusicMode(SMMode mode); SD_SetMusicMode(SMMode mode);
extern word SD_SoundPlaying(); extern word SD_SoundPlaying();
extern void SD_SetDigiDevice(SDSMode); extern void SD_SetDigiDevice(SDSMode);
extern void SD_Poll();
void PlaySoundLocGlobal(word s, int id, fixed gx, fixed gy); void PlaySoundLocGlobal(word s, int id, fixed gx, fixed gy);
void UpdateSoundLoc(fixed x, fixed y, int angle); void UpdateSoundLoc(fixed x, fixed y, int angle);
extern int DigiMap[];
void InitDigiMap();
#endif #endif
...@@ -5,17 +5,11 @@ boolean AdLibPresent, SoundBlasterPresent; ...@@ -5,17 +5,11 @@ boolean AdLibPresent, SoundBlasterPresent;
SDMode SoundMode, MusicMode; SDMode SoundMode, MusicMode;
SDSMode DigiMode; SDSMode DigiMode;
int DigiMap[LASTSOUND];
static boolean SD_Started; static boolean SD_Started;
static boolean sqActive; static boolean sqActive;
void SD_Poll()
{
}
void SD_SetDigiDevice(SDSMode mode) void SD_SetDigiDevice(SDSMode mode)
{ {
} }
...@@ -49,6 +43,8 @@ void SD_Startup() ...@@ -49,6 +43,8 @@ void SD_Startup()
{ {
if (SD_Started) if (SD_Started)
return; return;
InitDigiMap();
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
This diff is collapsed.
...@@ -19,8 +19,6 @@ static int leftchannel, rightchannel; ...@@ -19,8 +19,6 @@ static int leftchannel, rightchannel;
static volatile boolean SoundPositioned; static volatile boolean SoundPositioned;
int DigiMap[LASTSOUND];
static word *DigiList; static word *DigiList;
static volatile boolean SD_Started; static volatile boolean SD_Started;
...@@ -258,15 +256,13 @@ void SD_Startup() ...@@ -258,15 +256,13 @@ void SD_Startup()
{ {
audio_buf_info info; audio_buf_info info;
int want, set; int want, set;
int i;
if (SD_Started) if (SD_Started)
return; return;
Blah(); Blah();
for (i = 0; i < LASTSOUND; i++) InitDigiMap();
DigiMap[i] = -1;
OPL = OPLCreate(OPL_TYPE_YM3812, 3579545, 44100); OPL = OPLCreate(OPL_TYPE_YM3812, 3579545, 44100);
...@@ -573,6 +569,8 @@ void SD_MusicOff() ...@@ -573,6 +569,8 @@ void SD_MusicOff()
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void SD_StartMusic(int music) void SD_StartMusic(int music)
{ {
CA_CacheAudioChunk(music);
SD_MusicOff(); SD_MusicOff();
SD_MusicOn(); SD_MusicOn();
Music = (MusicGroup *)audiosegs[music]; Music = (MusicGroup *)audiosegs[music];
...@@ -601,10 +599,6 @@ boolean SD_MusicPlaying() ...@@ -601,10 +599,6 @@ boolean SD_MusicPlaying()
return sqActive; return sqActive;
} }
void SD_Poll()
{
}
void SD_SetDigiDevice(SDSMode mode) void SD_SetDigiDevice(SDSMode mode)
{ {
} }
......
...@@ -87,8 +87,8 @@ void VL_Startup() ...@@ -87,8 +87,8 @@ void VL_Startup()
//if (gfxbuf == NULL) //if (gfxbuf == NULL)
// gfxbuf = malloc(vwidth * vheight * 1); // gfxbuf = malloc(vwidth * vheight * 1);
/* TODO: renable parachute for release version? */
if (SDL_Init(SDL_INIT_VIDEO) < 0) { if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) < 0) {
Quit("Couldn't init SDL"); Quit("Couldn't init SDL");
} }
......
...@@ -45,12 +45,11 @@ extern int vwidth, vheight; /* size of screen */ ...@@ -45,12 +45,11 @@ extern int vwidth, vheight; /* size of screen */
#define PLAYERSIZE MINDIST /* player radius */ #define PLAYERSIZE MINDIST /* player radius */
#define MINACTORDIST 0x10000 /* minimum dist from player center */ #define MINACTORDIST 0x10000 /* minimum dist from player center */
/* to any actor center */ /* to any actor center */
#define TILESHIFT 16
#define GLOBAL1 0x10000 #define UNSIGNEDSHIFT (TILESHIFT-8)
#define GLOBAL1 (1<<TILESHIFT)
#define TILEGLOBAL GLOBAL1 #define TILEGLOBAL GLOBAL1
#define VIEWGLOBAL GLOBAL1 #define VIEWGLOBAL GLOBAL1
#define TILESHIFT 16
#define UNSIGNEDSHIFT 8
#define ANGLES 360 /* must be divisible by 4 */ #define ANGLES 360 /* must be divisible by 4 */
#define ANGLEQUAD (ANGLES/4) #define ANGLEQUAD (ANGLES/4)
...@@ -741,7 +740,7 @@ void DrawPlayBorder(); ...@@ -741,7 +740,7 @@ void DrawPlayBorder();
void DrawPlayBorderSides(); void DrawPlayBorderSides();
void DrawStatusBar(); void DrawStatusBar();
#define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(int)((tx<<6)|(ty)),(((long)(tx) << TILESHIFT) + (1L << (TILESHIFT - 1))),(((long)ty << TILESHIFT) + (1L << (TILESHIFT - 1)))) #define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(int)((tx<<6)|(ty)), (tx << TILESHIFT) + (1 << (TILESHIFT - 1)), (ty << TILESHIFT) + (1L << (TILESHIFT - 1)))
#define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(int)ob,(ob)->x,(ob)->y) #define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(int)ob,(ob)->x,(ob)->y)
/* /*
......
...@@ -1041,18 +1041,15 @@ static void HitVertPWall() ...@@ -1041,18 +1041,15 @@ static void HitVertPWall()
#define DEG270 2700 #define DEG270 2700
#define DEG360 3600 #define DEG360 3600
#define xpartialbyystep() FixedByFrac(xpartial, ystep)
#define ypartialbyxstep() FixedByFrac(ypartial, xstep)
static int samex(int intercept, int tile) static int samex(int intercept, int tile)
{ {
if (xtilestep > 0) { if (xtilestep > 0) {
if ((intercept>>16) >= tile) if ((intercept>>TILESHIFT) >= tile)
return 0; return 0;
else else
return 1; return 1;
} else { } else {
if ((intercept>>16) <= tile) if ((intercept>>TILESHIFT) <= tile)
return 0; return 0;
else else
return 1; return 1;
...@@ -1062,12 +1059,12 @@ static int samex(int intercept, int tile) ...@@ -1062,12 +1059,12 @@ static int samex(int intercept, int tile)
static int samey(int intercept, int tile) static int samey(int intercept, int tile)
{ {
if (ytilestep > 0) { if (ytilestep > 0) {
if ((intercept>>16) >= tile) if ((intercept>>TILESHIFT) >= tile)
return 0; return 0;
else else
return 1; return 1;
} else { } else {
if ((intercept>>16) <= tile) if ((intercept>>TILESHIFT) <= tile)
return 0; return 0;
else else
return 1; return 1;
...@@ -1139,16 +1136,15 @@ for (postx = 0; postx < viewwidth; postx++) { ...@@ -1139,16 +1136,15 @@ for (postx = 0; postx < viewwidth; postx++) {
goto entry90; goto entry90;
} }
/* add tilestep to fix raycasting problems? */ yintercept = viewy + FixedByFrac(xpartial, ystep); // + xtilestep;
yintercept = viewy + xpartialbyystep(); // + xtilestep;
xtile = focaltx + xtilestep; xtile = focaltx + xtilestep;
xintercept = viewx + ypartialbyxstep(); // + ytilestep; xintercept = viewx + FixedByFrac(ypartial, xstep); // + ytilestep;
ytile = focalty + ytilestep; ytile = focalty + ytilestep;
/* CORE LOOP */ /* CORE LOOP */
#define TILE(n) ((n)>>16) #define TILE(n) ((n)>>TILESHIFT)
/* check intersections with vertical walls */ /* check intersections with vertical walls */
vertcheck: vertcheck:
...@@ -1169,7 +1165,7 @@ vertentry: ...@@ -1169,7 +1165,7 @@ vertentry:
goto passvert; goto passvert;
yintercept = doorhit; yintercept = doorhit;
xintercept = xtile << 16; xintercept = xtile << TILESHIFT;
HitVertPWall(); HitVertPWall();
} else { } else {
/* vertdoor */ /* vertdoor */
...@@ -1183,11 +1179,11 @@ vertentry: ...@@ -1183,11 +1179,11 @@ vertentry:
goto passvert; goto passvert;
yintercept = doorhit; yintercept = doorhit;
xintercept = (xtile << 16) + 32768; xintercept = (xtile << TILESHIFT) + TILEGLOBAL/2;
HitVertDoor(); HitVertDoor();
} }
} else { } else {
xintercept = xtile << 16; xintercept = xtile << TILESHIFT;
HitVertWall(); HitVertWall();
} }
continue; continue;
...@@ -1218,7 +1214,7 @@ horizentry: ...@@ -1218,7 +1214,7 @@ horizentry:
goto passhoriz; goto passhoriz;
xintercept = doorhit; xintercept = doorhit;
yintercept = ytile << 16; yintercept = ytile << TILESHIFT;
HitHorizPWall(); HitHorizPWall();
} else { } else {
doorhit = xintercept + xstep / 2; doorhit = xintercept + xstep / 2;
...@@ -1231,11 +1227,11 @@ horizentry: ...@@ -1231,11 +1227,11 @@ horizentry:
goto passhoriz; goto passhoriz;
xintercept = doorhit; xintercept = doorhit;
yintercept = (ytile << 16) + 32768; yintercept = (ytile << TILESHIFT) + TILEGLOBAL/2;
HitHorizDoor(); HitHorizDoor();
} }
} else { } else {
yintercept = ytile << 16; yintercept = ytile << TILESHIFT;
HitHorizWall(); HitHorizWall();
} }
continue; continue;
......
...@@ -1072,15 +1072,11 @@ startplayloop: ...@@ -1072,15 +1072,11 @@ startplayloop:
SD_StopSound(); SD_StopSound();
SD_PlaySound(GETSPEARSND); SD_PlaySound(GETSPEARSND);
if (DigiMode != sds_Off) if (DigiMode == sds_Off) {
{
long lasttimecount = get_TimeCount(); long lasttimecount = get_TimeCount();
while(get_TimeCount() < (lasttimecount+150)) while(get_TimeCount() < (lasttimecount+150)) ;
//while(SD_SoundPlaying()!=false) } else
SD_Poll();
}
else
SD_WaitSoundDone(); SD_WaitSoundDone();
ClearMemory (); ClearMemory ();
......
...@@ -17,7 +17,7 @@ void ClearSplitVWB() ...@@ -17,7 +17,7 @@ void ClearSplitVWB()
} }
//========================================================================== /* ======================================================================== */
#if defined(SPEAR) && !defined(SPEARDEMO) #if defined(SPEAR) && !defined(SPEARDEMO)
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
...@@ -90,7 +90,7 @@ void EndSpear() ...@@ -90,7 +90,7 @@ void EndSpear()
} }
#endif #endif
//========================================================================== /* ======================================================================== */
/* /*
================== ==================
...@@ -236,11 +236,10 @@ void Victory() ...@@ -236,11 +236,10 @@ void Victory()
EndSpear(); EndSpear();
#endif #endif
#endif // SPEARDEMO #endif /* SPEARDEMO */
} }
/* ======================================================================== */
//==========================================================================
/* /*
================== ==================
...@@ -331,7 +330,7 @@ void Write(int x,int y,char *string) ...@@ -331,7 +330,7 @@ void Write(int x,int y,char *string)
// //
// Breathe Mr. BJ!!! // Breathe Mr. BJ!!!
// //
void BJ_Breathe(void) void BJ_Breathe()
{ {
static int which=0,max=10; static int which=0,max=10;
int pics[2]={L_GUYPIC,L_GUY2PIC}; int pics[2]={L_GUYPIC,L_GUY2PIC};
...@@ -851,8 +850,6 @@ void LevelCompleted() ...@@ -851,8 +850,6 @@ void LevelCompleted()
= =
= PreloadGraphics = PreloadGraphics
= =
= Fill the cache up
=
================= =================
*/ */
...@@ -873,6 +870,8 @@ boolean PreloadUpdate(int current, int total) ...@@ -873,6 +870,8 @@ boolean PreloadUpdate(int current, int total)
void PreloadGraphics() void PreloadGraphics()
{ {
int i;
DrawLevel(); DrawLevel();
ClearSplitVWB(); ClearSplitVWB();
...@@ -887,7 +886,10 @@ void PreloadGraphics() ...@@ -887,7 +886,10 @@ void PreloadGraphics()
VW_UpdateScreen(); VW_UpdateScreen();
VW_FadeIn(); VW_FadeIn();
PM_Preload(PreloadUpdate); for (i = 0; i <= 40; i++)
PreloadUpdate(i, 50);
PreloadUpdate(50, 50);
IN_UserInput(70); IN_UserInput(70);
VW_FadeOut(); VW_FadeOut();
......
...@@ -60,7 +60,7 @@ fixed FixedByFrac(fixed a, fixed b) ...@@ -60,7 +60,7 @@ fixed FixedByFrac(fixed a, fixed b)
int64_t r; int64_t r;
r = ra * rb; r = ra * rb;
r >>= 16; r >>= TILESHIFT;
return (fixed)r; return (fixed)r;
} }
...@@ -745,126 +745,6 @@ int MS_CheckParm(char *check) ...@@ -745,126 +745,6 @@ int MS_CheckParm(char *check)
return 0; return 0;
} }
//===========================================================================
/*
=====================
=
= InitDigiMap
=
=====================
*/
static int wolfdigimap[] =
{
#ifndef SPEAR
HALTSND, 0,
DOGBARKSND, 1,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
ATKMACHINEGUNSND, 4,
ATKPISTOLSND, 5,
ATKGATLINGSND, 6,
SCHUTZADSND, 7,
GUTENTAGSND, 8,
MUTTISND, 9,
BOSSFIRESND, 10,
SSFIRESND, 11,
DEATHSCREAM1SND, 12,
DEATHSCREAM2SND, 13,
DEATHSCREAM3SND, 13,
TAKEDAMAGESND, 14,
PUSHWALLSND, 15,
LEBENSND, 20,
NAZIFIRESND, 21,
SLURPIESND, 22,
YEAHSND, 32,
#ifndef UPLOAD
DOGDEATHSND, 16,
AHHHGSND, 17,
DIESND, 18,
EVASND, 19,
TOT_HUNDSND, 23,
MEINGOTTSND, 24,
SCHABBSHASND, 25,
HITLERHASND, 26,
SPIONSND, 27,
NEINSOVASSND, 28,
DOGATTACKSND, 29,
LEVELDONESND, 30,
MECHSTEPSND, 31,
SCHEISTSND, 33,
DEATHSCREAM4SND, 34, // AIIEEE
DEATHSCREAM5SND, 35, // DEE-DEE
DONNERSND, 36, // EPISODE 4 BOSS DIE
EINESND, 37, // EPISODE 4 BOSS SIGHTING
ERLAUBENSND, 38, // EPISODE 6 BOSS SIGHTING
DEATHSCREAM6SND, 39, // FART
DEATHSCREAM7SND, 40, // GASP
DEATHSCREAM8SND, 41, // GUH-BOY!
DEATHSCREAM9SND, 42, // AH GEEZ!
KEINSND, 43, // EPISODE 5 BOSS SIGHTING
MEINSND, 44, // EPISODE 6 BOSS DIE
ROSESND, 45, // EPISODE 5 BOSS DIE
#endif
#else /* SPEAR OF DESTINY DIGISOUNDS */
HALTSND, 0,
CLOSEDOORSND, 2,
OPENDOORSND, 3,
ATKMACHINEGUNSND, 4,
ATKPISTOLSND, 5,
ATKGATLINGSND, 6,
SCHUTZADSND, 7,
BOSSFIRESND, 8,
SSFIRESND, 9,
DEATHSCREAM1SND, 10,
DEATHSCREAM2SND, 11,
TAKEDAMAGESND, 12,
PUSHWALLSND, 13,
AHHHGSND, 15,
LEBENSND, 16,
NAZIFIRESND, 17,
SLURPIESND, 18,
LEVELDONESND, 22,
DEATHSCREAM4SND, 23, // AIIEEE
DEATHSCREAM3SND, 23, // DOUBLY-MAPPED!!!
DEATHSCREAM5SND, 24, // DEE-DEE
DEATHSCREAM6SND, 25, // FART
DEATHSCREAM7SND, 26, // GASP
DEATHSCREAM8SND, 27, // GUH-BOY!
DEATHSCREAM9SND, 28, // AH GEEZ!
GETGATLINGSND, 38, // Got Gat replacement
#ifndef SPEARDEMO
DOGBARKSND, 1,
DOGDEATHSND, 14,
SPIONSND, 19,
NEINSOVASSND, 20,
DOGATTACKSND, 21,
TRANSSIGHTSND, 29, // Trans Sight
TRANSDEATHSND, 30, // Trans Death
WILHELMSIGHTSND, 31, // Wilhelm Sight
WILHELMDEATHSND, 32, // Wilhelm Death
UBERDEATHSND, 33, // Uber Death
KNIGHTSIGHTSND, 34, // Death Knight Sight
KNIGHTDEATHSND, 35, // Death Knight Death
ANGELSIGHTSND, 36, // Angel Sight
ANGELDEATHSND, 37, // Angel Death
GETSPEARSND, 39, // Got Spear replacement
#endif
#endif
LASTSOUND
};
void InitDigiMap()
{
int *map;
for (map = wolfdigimap; *map != LASTSOUND; map += 2)
DigiMap[map[0]] = map[1];
}
/* ======================================================================== */ /* ======================================================================== */
/* /*
...@@ -1217,7 +1097,6 @@ void InitGame() ...@@ -1217,7 +1097,6 @@ void InitGame()
// //
// build some tables // build some tables
// //
InitDigiMap();
for (i = 0;i < MAPSIZE; i++) for (i = 0;i < MAPSIZE; i++)
{ {
......
...@@ -369,34 +369,6 @@ void US_ControlPanel(byte scancode) ...@@ -369,34 +369,6 @@ void US_ControlPanel(byte scancode)
break; break;
case backtodemo: case backtodemo:
#ifdef SPEAR
/* TODO: why was this added for spear only? */
if (!ingame)
{
int start, i;
//
// DEALLOCATE ALL SOUNDS!
//
switch (SoundMode)
{
case sdm_PC:
start = STARTPCSOUNDS;
break;
case sdm_AdLib:
start = STARTADLIBSOUNDS;
break;
default:
start = 0;
break;
}
if (SoundMode != sdm_Off)
for (i=0;i<NUMSOUNDS;i++,start++)
if (audiosegs[start])
MM_SetPurge ((memptr)&audiosegs[start],3); // make purgable
}
#endif
MM_SortMem(); MM_SortMem();
StartGame=1; StartGame=1;
if (!ingame) if (!ingame)
...@@ -439,7 +411,7 @@ void US_ControlPanel(byte scancode) ...@@ -439,7 +411,7 @@ void US_ControlPanel(byte scancode)
// RETURN/START GAME EXECUTION // RETURN/START GAME EXECUTION
#ifdef SPEAR #ifdef SPEAR
UnCacheLump (OPTIONS_LUMP_START,OPTIONS_LUMP_END); UnCacheLump(OPTIONS_LUMP_START, OPTIONS_LUMP_END);
MM_SortMem(); MM_SortMem();
#endif #endif
} }
...@@ -3177,18 +3149,12 @@ void StartCPMusic(int song) ...@@ -3177,18 +3149,12 @@ void StartCPMusic(int song)
lastmusic = song; lastmusic = song;
CA_CacheAudioChunk(STARTMUSIC + song);
SD_StartMusic(STARTMUSIC + song); SD_StartMusic(STARTMUSIC + song);
} }
void FreeMusic() void FreeMusic()
{ {
SD_MusicOff(); SD_MusicOff();
if (lastmusic >= 0) {
CA_UnCacheAudioChunk(STARTMUSIC + lastmusic);
lastmusic = -1;
}
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
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