Commit 0f7a8ddd authored by Steven Fuller's avatar Steven Fuller

Nothing major, but I didn't intend to have such a large delay between

updates...

gfxsave.c, vi_wdx.c: removed since they were no longer needed.

sd_oal.c: currently doesn't do anything (yet)

rest: cleanups and things of this nature
parent 2492518c
...@@ -3,13 +3,14 @@ CC = gcc ...@@ -3,13 +3,14 @@ CC = gcc
#CFLAGS = -g -O2 -Wall -pedantic #CFLAGS = -g -O2 -Wall -pedantic
#CFLAGS = -Wall -pedantic -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro #CFLAGS = -Wall -pedantic -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
CFLAGS = -g -Wall -pedantic CFLAGS = -g -Wall -pedantic
#CFLAGS = -Wall -pedantic -std=c99
#CFLAGS = -Os -Wall -peantic #CFLAGS = -Os -Wall -peantic
#CFLAGS = -Os -Wall -peantic -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro #CFLAGS = -Os -Wall -peantic -fomit-frame-pointer -ffast-math -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
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 gfxsave.o wl_debug.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
...@@ -21,7 +22,9 @@ OBJS += sd_null.o ...@@ -21,7 +22,9 @@ OBJS += sd_null.o
#OBJS += sd_oss.o fmopl.o #OBJS += sd_oss.o fmopl.o
#CFLAGS += -D_REENTRANT #CFLAGS += -D_REENTRANT
#LFLAGS += -lpthread #LFLAGS += -lpthread
#OBJS += sd_oal.o
#CFLAGS += -D_REENTRANT
#LFLAGS += -lpthread #-lopenal
CFLAGS += `sdl-config --cflags` CFLAGS += `sdl-config --cflags`
......
...@@ -2,11 +2,11 @@ Just some random facts/thoughts/ideas/musings: ...@@ -2,11 +2,11 @@ Just some random facts/thoughts/ideas/musings:
* Wolfenstein 3D for: * Wolfenstein 3D for:
- PC (released, of course) [May 5, 1992] - PC (released, of course) [May 5, 1992]
- PC (Spear of Destiny) [Late (September?) 1992] - PC (Spear of Destiny) [September 18, 1992]
- SNES - SNES
- Macintosh - Macintosh
- Jaguar - Jaguar
- Apple IIGS - Apple IIGS [http://www.sheppyware.com/products/a2/wolf3d/]
- 3DO - 3DO
* Rumored/Never Released? * Rumored/Never Released?
...@@ -51,12 +51,21 @@ How to get Wolfenstein 3D: ...@@ -51,12 +51,21 @@ How to get Wolfenstein 3D:
http://www.3drealms.com/downloads.html http://www.3drealms.com/downloads.html
- Spear of Destiny Demo: - Spear of Destiny Demo:
ftp://ftp.gamers.org/pub/3daction/00archives/speardestiny/releases/soddemo2.zip ftp://ftp.gamers.org/pub/3daction/00archives/speardestiny/releases/soddemo2.zip
- Macintosh versions: TODO - Macintosh versions:
- Where to Buy: TODO - Search for the shareware version (First Encounter) on Macintosh Shareware
websites.
- The commercial Macintosh version (Second Encounter, not Third) is out of
print, but you may find someone selling it on websites such as
http://www.ebay.com.
- Where to Buy:
http://www.3drealms.com
http://www.idsoftware.com (look for how to order direct, etc)
http://www.activison.com
Wolfenstein 3D was originally planned to be a much more complex game. ... Wolfenstein 3D was originally planned to be a much more complex game. ...
... lots of unused code ... possibly from previous projects and incarnations ... lots of unused code ... possibly from previous projects and incarnations
of wolf3d. of Wolf3D. In fact, Commander Keen 4 shares a lot of code with Wolf3D!
Version 1.4 of Wolfenstein 3D (full) did not had a Read Me! option, but the 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 text still exists in the data files, but all the graphics are incorrect
......
#include "wl_def.h"
#define PACKED __attribute__((packed))
typedef struct pcx_header_type
{
char manufacturer;
char version;
char encoding;
char bits_per_pixel;
short int x, y;
short int width, height;
short int horz_res;
short int virt_res;
char ega_palette[48];
char reserved;
char num_color_planes;
short int byte_per_line;
short int palette_type;
short int hscreen_size;
short int vscreen_size;
char padding[54];
} PACKED pcx_header, *pcx_header_ptr;
void SavePCX256ToFile(unsigned char *buf, int width, int height, unsigned char *pal, char *name)
{
FILE *fp;
pcx_header ph;
unsigned char *dat, *ptr, *ptrd, ch;
int x, y, z;
ph.manufacturer = 10;
ph.version = 5;
ph.encoding = 1;
ph.bits_per_pixel = 8;
ph.x = ph.y = 0;
ph.width = width - 1;
ph.height = height - 1;
ph.horz_res = ph.virt_res = 0;
for (x = 0; x < sizeof(ph.ega_palette); x++)
ph.ega_palette[x] = 0;
ph.reserved = 0;
ph.num_color_planes = 1;
ph.byte_per_line = width;
ph.palette_type = 1;
ph.hscreen_size = width;
ph.vscreen_size = height;
for (x = 0; x < sizeof(ph.padding); x++)
ph.padding[x] = 0;
#if 0
dat = malloc(width * height * 2);
for (x = 0; x < width * height; x++) {
*(dat + x*2) = 0xC1;
*(dat + x*2+1) = *(buf + x);
}
z = width * height * 2;
#else
dat = malloc(width * height * 2);
ptr = buf; ptrd = dat;
x = 0; z = 0;
while (x < width * height) {
ch = *ptr;
ptr++;
x++;
y = 0xC1;
while((x < width * height) && (*ptr == ch) && (y < 0xFF)) {
x++; y++; ptr++;
}
*ptrd = y;
ptrd++;
*ptrd = ch;
ptrd++;
z += 2;
}
#endif
fp = fopen(name, "wb");
fwrite(&ph, sizeof(ph), 1, fp);
fwrite(dat, 1, z, fp);
fputc(12, fp);
fwrite(pal, 1, 768, fp);
fclose(fp);
free(dat);
}
void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name)
{
FILE *fp;
pcx_header ph;
unsigned char *dat;
int x, y, s;
memset(&ph, 0, sizeof(ph));
ph.manufacturer = 10;
ph.version = 5;
ph.encoding = 1;
ph.bits_per_pixel = 8;
ph.x = ph.y = 0;
ph.width = width - 1;
ph.height = height - 1;
ph.horz_res = ph.virt_res = 0;
ph.num_color_planes = 3;
ph.byte_per_line = width;
ph.palette_type = 1;
ph.hscreen_size = width;
ph.vscreen_size = height;
dat = malloc(width * height * 2 * 3);
for (y = 0; y < height; y++) {
for (s = 0; s < 3; s++) {
for (x = 0; x < width; x++) {
*(dat + (y*(width*3) + (width*s) + x)*2) = 0xC1;
*(dat + (y*(width*3) + (width*s) + x)*2+1) = *(buf + y*(width*3) + x*3 + s);
}
}
}
fp = fopen(name, "wb");
fwrite(&ph, sizeof(ph), 1, fp);
fwrite(dat, 1, width * height * 2 * 3, fp);
fclose(fp);
free(dat);
}
...@@ -218,12 +218,6 @@ typedef enum { ...@@ -218,12 +218,6 @@ typedef enum {
#define TITLESCREEN_LUMP_START 79 #define TITLESCREEN_LUMP_START 79
#define TITLESCREEN_LUMP_END 80 #define TITLESCREEN_LUMP_END 80
#define ENDGAME1_LUMP_START 81
#define ENDGAME1_LUMP_END 81
#define ENDGAME2_LUMP_START 82
#define ENDGAME2_LUMP_END 82
#define EASTEREGG_LUMP_START 93 #define EASTEREGG_LUMP_START 93
#define EASTEREGG_LUMP_END 94 #define EASTEREGG_LUMP_END 94
...@@ -242,6 +236,7 @@ typedef enum { ...@@ -242,6 +236,7 @@ typedef enum {
#define NUMPICS 147 #define NUMPICS 147
#define NUMTILE8 35 #define NUMTILE8 35
#define NUMEXTERNS 18 #define NUMEXTERNS 18
// //
// File offsets for data items // File offsets for data items
// //
......
...@@ -301,8 +301,6 @@ static void CAL_SetupGrFile() ...@@ -301,8 +301,6 @@ static void CAL_SetupGrFile()
{ {
char fname[13]; char fname[13];
int handle; int handle;
memptr compseg;
long chunkcomplen;
byte *grtemp; byte *grtemp;
int i; int i;
...@@ -350,24 +348,15 @@ static void CAL_SetupGrFile() ...@@ -350,24 +348,15 @@ static void CAL_SetupGrFile()
CA_CannotOpen(fname); CA_CannotOpen(fname);
/* load the pic headers into pictable */ /* load the pic headers into pictable */
chunkcomplen = grstarts[STRUCTPIC+1] - grstarts[STRUCTPIC]; CA_CacheGrChunk(STRUCTPIC);
ReadSeek(grhandle, grstarts[STRUCTPIC], SEEK_SET);
MM_GetPtr(&compseg, chunkcomplen);
ReadBytes(grhandle, compseg, chunkcomplen);
/* pictable is word width, height */
MM_GetPtr((memptr)&grtemp, NUMPICS*4);
CAL_HuffExpand((byte *)compseg+4, (byte *)grtemp, NUMPICS*4, grhuffman);
MM_FreePtr(&compseg);
grtemp = grsegs[STRUCTPIC];
for (i = 0; i < NUMPICS; i++) { for (i = 0; i < NUMPICS; i++) {
pictable[i].width = grtemp[i*4+0] | (grtemp[i*4+1] << 8); pictable[i].width = grtemp[i*4+0] | (grtemp[i*4+1] << 8);
pictable[i].height = grtemp[i*4+2] | (grtemp[i*4+3] << 8); pictable[i].height = grtemp[i*4+2] | (grtemp[i*4+3] << 8);
} }
MM_FreePtr((memptr)&grtemp); CA_UnCacheGrChunk(STRUCTPIC);
} }
/* ======================================================================== */ /* ======================================================================== */
......
...@@ -14,28 +14,6 @@ int xfrac, yfrac; ...@@ -14,28 +14,6 @@ int xfrac, yfrac;
/* ======================================================================== */ /* ======================================================================== */
/*
===================
=
= LoadLatchMem
=
===================
*/
void LoadLatchMem()
{
int i;
CA_CacheGrChunk(STARTTILE8);
for (i = LATCHPICS_LUMP_START; i <= LATCHPICS_LUMP_END; i++) {
CA_CacheGrChunk(i);
}
}
/* ======================================================================== */
/* /*
=================== ===================
= =
...@@ -61,7 +39,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un ...@@ -61,7 +39,7 @@ boolean FizzleFade(unsigned xx, unsigned yy, unsigned width, unsigned height, un
frame = 0; frame = 0;
set_TimeCount(0); set_TimeCount(0);
if (vwidth != 320) if (vwidth != 320) /* TODO */
return false; return false;
retr = -1; retr = -1;
...@@ -221,7 +199,7 @@ void VL_DeModeXize(byte *buf, int width, int height) ...@@ -221,7 +199,7 @@ void VL_DeModeXize(byte *buf, int width, int height)
return; return;
} }
MM_GetPtr((memptr)&mem, width *height); MM_GetPtr((memptr)&mem, width * height);
ptr = buf; ptr = buf;
......
...@@ -36,8 +36,6 @@ boolean FizzleFade(unsigned xoffset, unsigned yoffset, unsigned width,unsigned h ...@@ -36,8 +36,6 @@ boolean FizzleFade(unsigned xoffset, unsigned yoffset, unsigned width,unsigned h
void VL_FadeOut(int start, int end, int red, int green, int blue, int steps); void VL_FadeOut(int start, int end, int red, int green, int blue, int steps);
void VL_FadeIn(int start, int end, const byte *palette, int steps); void VL_FadeIn(int start, int end, const byte *palette, int steps);
void LoadLatchMem();
void VL_CacheScreen(int chunk); void VL_CacheScreen(int chunk);
void VW_Bar(int x, int y, int width, int height, int color); void VW_Bar(int x, int y, int width, int height, int color);
......
...@@ -201,7 +201,7 @@ void DisplayTextSplash(byte *text, int l) ...@@ -201,7 +201,7 @@ void DisplayTextSplash(byte *text, int l)
uint16_t SwapInt16L(uint16_t i) uint16_t SwapInt16L(uint16_t i)
{ {
#if __BYTE_ORDER == __BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
return ((uint16_t)i >> 8) | ((uint16_t)i << 8); return ((uint16_t)i >> 8) | ((uint16_t)i << 8);
#else #else
return i; return i;
...@@ -210,7 +210,7 @@ uint16_t SwapInt16L(uint16_t i) ...@@ -210,7 +210,7 @@ uint16_t SwapInt16L(uint16_t i)
uint32_t SwapInt32L(uint32_t i) uint32_t SwapInt32L(uint32_t i)
{ {
#if __BYTE_ORDER == __BIG_ENDIAN #if BYTE_ORDER == BIG_ENDIAN
return ((uint32_t)(i & 0xFF000000) >> 24) | return ((uint32_t)(i & 0xFF000000) >> 24) |
((uint32_t)(i & 0x00FF0000) >> 8) | ((uint32_t)(i & 0x00FF0000) >> 8) |
((uint32_t)(i & 0x0000FF00) << 8) | ((uint32_t)(i & 0x0000FF00) << 8) |
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#define PACKED __attribute__((packed)) #define PACKED __attribute__((packed))
#define TickBase 70 // 70Hz per tick #define TickBase 70 /* 70Hz per tick */
typedef enum { typedef enum {
sdm_Off, sdm_Off,
...@@ -13,7 +13,7 @@ typedef enum { ...@@ -13,7 +13,7 @@ typedef enum {
smm_Off,smm_AdLib smm_Off,smm_AdLib
} SMMode; } SMMode;
typedef enum { typedef enum {
sds_Off,sds_PC,sds_SoundSource,sds_SoundBlaster sds_Off,sds_PC,sds_SoundBlaster
} SDSMode; } SDSMode;
typedef struct { typedef struct {
longword length; longword length;
...@@ -40,16 +40,15 @@ typedef struct { ...@@ -40,16 +40,15 @@ typedef struct {
word length, values[1]; word length, values[1];
} PACKED MusicGroup; } PACKED MusicGroup;
// Global variables extern boolean AdLibPresent, SoundBlasterPresent;
extern boolean AdLibPresent, SoundSourcePresent, SoundBlasterPresent;
extern SDMode SoundMode; extern SDMode SoundMode;
extern SDSMode DigiMode; extern SDSMode DigiMode;
extern SMMode MusicMode; extern SMMode MusicMode;
extern int DigiMap[]; extern int DigiMap[];
// Function prototypes extern void SD_Startup();
extern void SD_Startup(), SD_Shutdown(); extern void SD_Shutdown();
extern boolean SD_PlaySound(soundnames sound); extern boolean SD_PlaySound(soundnames sound);
extern void SD_StopSound(), extern void SD_StopSound(),
...@@ -67,7 +66,7 @@ extern word SD_SoundPlaying(); ...@@ -67,7 +66,7 @@ extern word SD_SoundPlaying();
extern void SD_SetDigiDevice(SDSMode); extern void SD_SetDigiDevice(SDSMode);
extern void SD_Poll(); extern void SD_Poll();
void PlaySoundLocGlobal(word s, 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);
#endif #endif
#include "wl_def.h" #include "wl_def.h"
boolean SoundSourcePresent, AdLibPresent, SoundBlasterPresent; boolean AdLibPresent, SoundBlasterPresent;
SDMode SoundMode, MusicMode; SDMode SoundMode, MusicMode;
SDSMode DigiMode; SDSMode DigiMode;
...@@ -157,7 +157,7 @@ boolean SD_MusicPlaying() ...@@ -157,7 +157,7 @@ boolean SD_MusicPlaying()
return false; return false;
} }
void PlaySoundLocGlobal(word s,fixed gx,fixed gy) void PlaySoundLocGlobal(word s, int id, fixed gx,fixed gy)
{ {
SD_PlaySound(s); SD_PlaySound(s);
} }
......
#include "wl_def.h"
boolean AdLibPresent, SoundBlasterPresent;
SDMode SoundMode, MusicMode;
SDSMode DigiMode;
int DigiMap[LASTSOUND];
static boolean SD_Started;
static boolean sqActive;
#error "please ignore me for now, thanks"
void SD_Poll()
{
}
void SD_SetDigiDevice(SDSMode mode)
{
}
///////////////////////////////////////////////////////////////////////////
//
// SD_SetSoundMode() - Sets which sound hardware to use for sound effects
//
///////////////////////////////////////////////////////////////////////////
boolean SD_SetSoundMode(SDMode mode)
{
return false;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_SetMusicMode() - sets the device to use for background music
//
///////////////////////////////////////////////////////////////////////////
boolean SD_SetMusicMode(SMMode mode)
{
return false;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_Startup() - starts up the Sound Mgr
//
///////////////////////////////////////////////////////////////////////////
void SD_Startup()
{
if (SD_Started)
return;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_Shutdown() - shuts down the Sound Mgr
//
///////////////////////////////////////////////////////////////////////////
void SD_Shutdown()
{
if (!SD_Started)
return;
SD_Started = false;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_PlaySound() - plays the specified sound on the appropriate hardware
//
///////////////////////////////////////////////////////////////////////////
boolean SD_PlaySound(soundnames sound)
{
return false;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_SoundPlaying() - returns the sound number that's playing, or 0 if
// no sound is playing
//
///////////////////////////////////////////////////////////////////////////
word SD_SoundPlaying()
{
return false;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_StopSound() - if a sound is playing, stops it
//
///////////////////////////////////////////////////////////////////////////
void SD_StopSound()
{
}
///////////////////////////////////////////////////////////////////////////
//
// SD_WaitSoundDone() - waits until the current sound is done playing
//
///////////////////////////////////////////////////////////////////////////
void SD_WaitSoundDone()
{
/* TODO: should also "work" when sound is disabled... */
while (SD_SoundPlaying())
;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_MusicOn() - turns on the sequencer
//
///////////////////////////////////////////////////////////////////////////
void SD_MusicOn()
{
sqActive = true;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_MusicOff() - turns off the sequencer and any playing notes
//
///////////////////////////////////////////////////////////////////////////
void SD_MusicOff()
{
sqActive = false;
}
///////////////////////////////////////////////////////////////////////////
//
// SD_StartMusic() - starts playing the music pointed to
//
///////////////////////////////////////////////////////////////////////////
void SD_StartMusic(MusicGroup *music)
{
SD_MusicOff();
}
///////////////////////////////////////////////////////////////////////////
//
// SD_FadeOutMusic() - starts fading out the music. Call SD_MusicPlaying()
// to see if the fadeout is complete
//
///////////////////////////////////////////////////////////////////////////
void SD_FadeOutMusic()
{
}
///////////////////////////////////////////////////////////////////////////
//
// SD_MusicPlaying() - returns true if music is currently playing, false if
// not
//
///////////////////////////////////////////////////////////////////////////
boolean SD_MusicPlaying()
{
return false;
}
void PlaySoundLocGlobal(word s, int id, fixed gx, fixed gy)
{
SD_PlaySound(s);
}
void UpdateSoundLoc(fixed x, fixed y, int angle)
{
}
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "fmopl.h" #include "fmopl.h"
boolean SoundSourcePresent, AdLibPresent, SoundBlasterPresent; boolean AdLibPresent, SoundBlasterPresent;
SDMode SoundMode, MusicMode; SDMode SoundMode, MusicMode;
SDSMode DigiMode; SDSMode DigiMode;
...@@ -522,7 +522,7 @@ static void SetSoundLoc(fixed gx, fixed gy) ...@@ -522,7 +522,7 @@ static void SetSoundLoc(fixed gx, fixed gy)
========================== ==========================
*/ */
void PlaySoundLocGlobal(word s, fixed gx, fixed gy) void PlaySoundLocGlobal(word s, int id, fixed gx, fixed gy)
{ {
SetSoundLoc(gx, gy); SetSoundLoc(gx, gy);
......
This diff is collapsed.
...@@ -435,7 +435,7 @@ void GiveExtraMan() ...@@ -435,7 +435,7 @@ void GiveExtraMan()
void DrawScore() void DrawScore()
{ {
LatchNumber (6,16,6,gamestate.score); LatchNumber(6, 16, 6, gamestate.score);
} }
/* /*
...@@ -472,7 +472,6 @@ void DrawWeapon() ...@@ -472,7 +472,6 @@ void DrawWeapon()
StatusDrawPic(32,8,KNIFEPIC+gamestate.weapon); StatusDrawPic(32,8,KNIFEPIC+gamestate.weapon);
} }
/* /*
================== ==================
= =
...@@ -494,8 +493,6 @@ void DrawKeys() ...@@ -494,8 +493,6 @@ void DrawKeys()
StatusDrawPic(30,20,NOKEYPIC); StatusDrawPic(30,20,NOKEYPIC);
} }
/* /*
================== ==================
= =
...@@ -515,7 +512,6 @@ void GiveWeapon(int weapon) ...@@ -515,7 +512,6 @@ void GiveWeapon(int weapon)
DrawWeapon(); DrawWeapon();
} }
//=========================================================================== //===========================================================================
/* /*
...@@ -531,7 +527,6 @@ void DrawAmmo() ...@@ -531,7 +527,6 @@ void DrawAmmo()
LatchNumber(27,16,2,gamestate.ammo); LatchNumber(27,16,2,gamestate.ammo);
} }
/* /*
=============== ===============
= =
...@@ -572,8 +567,6 @@ void GiveKey(int key) ...@@ -572,8 +567,6 @@ void GiveKey(int key)
DrawKeys(); DrawKeys();
} }
/* /*
============================================================================= =============================================================================
...@@ -582,7 +575,6 @@ void GiveKey(int key) ...@@ -582,7 +575,6 @@ void GiveKey(int key)
============================================================================= =============================================================================
*/ */
/* /*
=================== ===================
= =
...@@ -713,7 +705,6 @@ void GetBonus (statobj_t *check) ...@@ -713,7 +705,6 @@ void GetBonus (statobj_t *check)
check->shapenum = -1; // remove from list check->shapenum = -1; // remove from list
} }
/* /*
=================== ===================
= =
...@@ -781,7 +772,6 @@ boolean TryMove(objtype *ob) ...@@ -781,7 +772,6 @@ boolean TryMove(objtype *ob)
return true; return true;
} }
/* /*
=================== ===================
= =
...@@ -842,7 +832,6 @@ void VictoryTile() ...@@ -842,7 +832,6 @@ void VictoryTile()
gamestate.victoryflag = true; gamestate.victoryflag = true;
} }
/* /*
=================== ===================
= =
......
...@@ -677,7 +677,6 @@ typedef enum { ...@@ -677,7 +677,6 @@ typedef enum {
extern char str[80], str2[20]; extern char str[80], str2[20];
extern fixed focallength; extern fixed focallength;
extern unsigned viewangles;
extern int viewwidth, viewheight; extern int viewwidth, viewheight;
extern int viewwidthwin, viewheightwin; extern int viewwidthwin, viewheightwin;
...@@ -743,8 +742,8 @@ void DrawPlayBorder(); ...@@ -743,8 +742,8 @@ void DrawPlayBorder();
void DrawPlayBorderSides(); void DrawPlayBorderSides();
void DrawStatusBar(); void DrawStatusBar();
#define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(((long)(tx) << TILESHIFT) + (1L << (TILESHIFT - 1))),(((long)ty << TILESHIFT) + (1L << (TILESHIFT - 1)))) #define PlaySoundLocTile(s,tx,ty) PlaySoundLocGlobal(s,(int)((tx<<6)|(ty)),(((long)(tx) << TILESHIFT) + (1L << (TILESHIFT - 1))),(((long)ty << TILESHIFT) + (1L << (TILESHIFT - 1))))
#define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(ob)->x,(ob)->y) #define PlaySoundLocActor(s,ob) PlaySoundLocGlobal(s,(int)ob,(ob)->x,(ob)->y)
/* /*
============================================================================= =============================================================================
...@@ -860,7 +859,6 @@ extern long heightnumerator; ...@@ -860,7 +859,6 @@ extern long heightnumerator;
// refresh variables // refresh variables
// //
extern fixed viewx,viewy; // the focal point extern fixed viewx,viewy; // the focal point
extern int viewangle;
extern fixed viewsin,viewcos; extern fixed viewsin,viewcos;
extern int horizwall[],vertwall[]; extern int horizwall[],vertwall[];
......
#include "wl_def.h" #include "wl_def.h"
/* C AsmRefresh() originally from David Haslam -- dch@sirius.demon.co.uk */ /* C AsmRefresh() and related code
originally from David Haslam -- dch@sirius.demon.co.uk */
// the door is the last picture before the sprites /* the door is the last picture before the sprites */
#define DOORWALL (PMSpriteStart-8) #define DOORWALL (PMSpriteStart-8)
#define ACTORSIZE 0x4000 #define ACTORSIZE 0x4000
static unsigned wallheight[MAXVIEWWIDTH]; static unsigned wallheight[MAXVIEWWIDTH];
// /* refresh variables */
// refresh variables fixed viewx,viewy; /* the focal point */
//
fixed viewx,viewy; // the focal point
int viewangle;
// /* ray casting variables */
// ray casting variables
//
static int focaltx, focalty; static int focaltx, focalty;
static int midangle;
static unsigned xpartial, ypartial; static unsigned xpartial, ypartial;
static unsigned xpartialup, xpartialdown, ypartialup, ypartialdown; static int viewangle;
static unsigned tilehit; static unsigned tilehit;
...@@ -257,7 +252,7 @@ static void DrawScaleds() ...@@ -257,7 +252,7 @@ static void DrawScaleds()
// //
// place static objects // place static objects
// //
for (statptr = &statobjlist[0] ; statptr !=laststatobj ; statptr++) for (statptr = &statobjlist[0]; statptr != laststatobj; statptr++)
{ {
if ((visptr->shapenum = statptr->shapenum) == -1) if ((visptr->shapenum = statptr->shapenum) == -1)
continue; // object has been deleted continue; // object has been deleted
...@@ -268,7 +263,7 @@ static void DrawScaleds() ...@@ -268,7 +263,7 @@ static void DrawScaleds()
if (TransformTile(statptr->tilex, statptr->tiley if (TransformTile(statptr->tilex, statptr->tiley
,&visptr->viewx,&visptr->viewheight) && statptr->flags & FL_BONUS) ,&visptr->viewx,&visptr->viewheight) && statptr->flags & FL_BONUS)
{ {
GetBonus (statptr); GetBonus(statptr);
continue; continue;
} }
...@@ -406,7 +401,7 @@ static void WallRefresh() ...@@ -406,7 +401,7 @@ static void WallRefresh()
set up variables for this view set up variables for this view
*/ */
viewangle = player->angle; viewangle = player->angle;
midangle = viewangle*(FINEANGLES/ANGLES);
viewsin = sintable[viewangle]; viewsin = sintable[viewangle];
viewcos = costable[viewangle]; viewcos = costable[viewangle];
viewx = player->x - FixedByFrac(focallength,viewcos); viewx = player->x - FixedByFrac(focallength,viewcos);
...@@ -415,11 +410,6 @@ static void WallRefresh() ...@@ -415,11 +410,6 @@ static void WallRefresh()
focaltx = viewx>>TILESHIFT; focaltx = viewx>>TILESHIFT;
focalty = viewy>>TILESHIFT; focalty = viewy>>TILESHIFT;
xpartialdown = viewx&(TILEGLOBAL-1);
xpartialup = TILEGLOBAL-xpartialdown;
ypartialdown = viewy&(TILEGLOBAL-1);
ypartialup = TILEGLOBAL-ypartialdown;
AsmRefresh(); AsmRefresh();
} }
...@@ -1068,14 +1058,21 @@ static int samey(int intercept, int tile) ...@@ -1068,14 +1058,21 @@ static int samey(int intercept, int tile)
else else
return 1; return 1;
} }
} }
static void AsmRefresh() static void AsmRefresh()
{ {
fixed doorxhit, dooryhit; fixed doorxhit, dooryhit;
long xtemp, ytemp; long xtemp, ytemp;
unsigned xpartialup, xpartialdown, ypartialup, ypartialdown;
int angle; /* ray angle through postx */ int angle; /* ray angle through postx */
int midangle;
midangle = viewangle*(FINEANGLES/ANGLES);
xpartialdown = viewx&(TILEGLOBAL-1);
xpartialup = TILEGLOBAL-xpartialdown;
ypartialdown = viewy&(TILEGLOBAL-1);
ypartialup = TILEGLOBAL-ypartialdown;
for (postx = 0; postx < viewwidth; postx++) { for (postx = 0; postx < viewwidth; postx++) {
angle = midangle + pixelangle[postx]; angle = midangle + pixelangle[postx];
......
...@@ -1288,13 +1288,13 @@ void InitGame() ...@@ -1288,13 +1288,13 @@ void InitGame()
ReadConfig(); ReadConfig();
// /* load in and lock down some basic chunks */
// load in and lock down some basic chunks
//
CA_CacheGrChunk(STARTFONT); CA_CacheGrChunk(STARTFONT);
CA_CacheGrChunk(STARTTILE8);
for (i = LATCHPICS_LUMP_START; i <= LATCHPICS_LUMP_END; i++)
CA_CacheGrChunk(i);
LoadLatchMem();
BuildTables(); BuildTables();
SetupWalls(); SetupWalls();
......
...@@ -931,7 +931,7 @@ void DrawNewGameDiff(int w) ...@@ -931,7 +931,7 @@ void DrawNewGameDiff(int w)
// HANDLE SOUND MENU // HANDLE SOUND MENU
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void CP_Sound(void) void CP_Sound()
{ {
int which; int which;
...@@ -995,12 +995,6 @@ void CP_Sound(void) ...@@ -995,12 +995,6 @@ void CP_Sound(void)
} }
break; break;
case 6: case 6:
if (DigiMode!=sds_SoundSource)
{
SD_SetDigiDevice(sds_SoundSource);
DrawSoundMenu();
ShootSnd();
}
break; break;
case 7: case 7:
if (DigiMode!=sds_SoundBlaster) if (DigiMode!=sds_SoundBlaster)
...@@ -1069,13 +1063,12 @@ void DrawSoundMenu(void) ...@@ -1069,13 +1063,12 @@ void DrawSoundMenu(void)
SndMenu[2].active=SndMenu[10].active=SndMenu[11].active=0; SndMenu[2].active=SndMenu[10].active=SndMenu[11].active=0;
} }
if (!SoundSourcePresent) SndMenu[6].active = 0;
SndMenu[6].active=0;
if (!SoundBlasterPresent) if (!SoundBlasterPresent)
SndMenu[7].active=0; SndMenu[7].active=0;
if (!SoundSourcePresent && !SoundBlasterPresent) if (!SoundBlasterPresent)
SndMenu[5].active=0; SndMenu[5].active=0;
DrawMenu(&SndItems,&SndMenu[0]); DrawMenu(&SndItems,&SndMenu[0]);
...@@ -1103,7 +1096,7 @@ void DrawSoundMenu(void) ...@@ -1103,7 +1096,7 @@ void DrawSoundMenu(void)
// DIGITIZED SOUND // DIGITIZED SOUND
// //
case 5: if (DigiMode==sds_Off) on=1; break; case 5: if (DigiMode==sds_Off) on=1; break;
case 6: if (DigiMode==sds_SoundSource) on=1; break; case 6: break;
case 7: if (DigiMode==sds_SoundBlaster) on=1; break; case 7: if (DigiMode==sds_SoundBlaster) on=1; break;
// //
......
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