Commit fd76d414 authored by Steven Fuller's avatar Steven Fuller

Initial port to Windows.

parent 93d851a3
......@@ -2,14 +2,14 @@
dataset?
* 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
handles this transparently
handles this transparently (after setting correct glViewport)
* Audio support using OpenAL (somewhat decently supported at the moment)
* Add support for the Mac version, if possible
* Network support!
* 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?
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... More strategy...
......@@ -17,9 +17,12 @@
regardless of future plans [IDEAS]) and no TODO/FIXME/XXXs in the source
code
* Have some sort of way of playing both digital and adlib sounds on all
platforms
platforms (if possible)
* Test with other available mods (that were compatible with the original
game)
* Unified input handling
* Configuration files and save games which work regardless of operating
system/processor/binary build
* Suite of utilities to edit the game data.
* Building on previous idea, have some way to break out of requiring the
game to be recompiled for each game dataset
......@@ -3,13 +3,13 @@ CC = gcc
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -g -Wall
#CFLAGS = -g
#CFLAGS = -Os
CFLAGS = -g -Wall -I/home/relnev/cvs/oal/include
CFLAGS = -Os
#CFLAGS = -g -Wall -I/home/relnev/cvs/oal/include
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_oal.o # sd_null.o
wl_debug.o gfxsave.o sd_null.o # sd_oal.o # sd_null.o
ROBJS = wl_draw.o wl_scale.o
SOBJS = $(OBJS) $(ROBJS) vi_svga.o
XOBJS = $(OBJS) $(ROBJS) vi_xlib.o
......
Just some random facts/thoughts/ideas/musings:
* Wolfenstein 3D for:
- PC (released, of course) [May 5, 1992]
- PC Spear of Destiny 1992
- SNES
- Macintosh
- Jaguar
- Apple IIGS
- 3DO (? - not mentioned in apogee faq, but you can find cheatcodes for it)
* Rumored/Never Released?
- Atari Lynx
- Sega Genesis
- Japanese PC Version
- Spanish PC Version
- Japanese Mac Version
* Unofficial ports:
- Linux (this, xwolf, wolfgl)
- Windows (wolfgl)
- Acorn/Archemedes
* PC source released on:
- now many ports, projects, etc
- urls
* Mac source released January 22(?), 2000
- url
* TED source (editor used for tons of games including wolf3d)
Wolfenstein 3D was originally planned to be a much more complex game. ...
... lots of unused code ... possibly from previous projects and incarnations
of wolf3d.
......
......@@ -17,6 +17,7 @@ actual gameplay/etc.
* is that memory intro screen needed anymore? probably not, although it
would be nice to show what version is loaded, but doom just printed text
and the intro screen which came with wolf3d has copyrighted images
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
......@@ -33,7 +34,7 @@ outside the viewarea, leaving artifacts
* 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...
* add a ViewMap?
* add a ViewMap?
* 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
......@@ -51,7 +52,7 @@ metaname like sc_Left etc or something
update once per frame or such.. hm
and where is that stray pixel coming from (when using end game with largest
window size) in svgalib
no idea how to do fizzlefade in 16bit.
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
......@@ -68,7 +69,7 @@ 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
but palette fades will still need it! damnit
* what are special keys... ?
* the higher bitrates 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
screen update
* make sure none of the code tries to handle gfx/sound data directly
......@@ -80,9 +81,4 @@ 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.
* change visable -> visible
Specific:
* memory/sound intro screen goes
- Trademarked images, only came with wolf3d 1.4's (I believe)
* copy protection goes
- Who needs a manual to look at the source?
* fix up windows port
#include <stdio.h>
#include <stdlib.h>
#define PACKED __attribute__((packed))
#include "wl_def.h"
typedef struct pcx_header_type
{
......
......@@ -36,7 +36,7 @@ int mapon;
word *mapsegs[MAPPLANES];
maptype *mapheaderseg[NUMMAPS];
byte *audiosegs[NUMSNDCHUNKS];
void *grsegs[NUMCHUNKS];
byte *grsegs[NUMCHUNKS];
byte grneeded[NUMCHUNKS];
byte ca_levelbit,ca_levelnum;
......
......@@ -26,7 +26,7 @@ extern int mapon;
extern word *mapsegs[MAPPLANES];
extern maptype *mapheaderseg[NUMMAPS];
extern byte *audiosegs[NUMSNDCHUNKS];
extern void *grsegs[NUMCHUNKS];
extern byte *grsegs[NUMCHUNKS];
extern byte grneeded[NUMCHUNKS];
extern byte ca_levelbit,ca_levelnum;
......
#ifndef __ID_HEADS_H__
#define __ID_HEADS_H__
#ifdef _WIN32
/* TODO: rename dosism, because like djgpp has glob() */
#define DOSISM /* for junk which isn't abstracted (namely stuff in wl_menu.c with glob/findfirst and misc.c) */
#undef HAVE_FFBLK /* TODO: what to do with hacks like this */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <io.h>
#include <dos.h>
#define boolean BOOLEAN
#define false FALSE
#define true TRUE
#define PACKED
#pragma pack(1) /* TODO: this unfortunately packs every struct... */
#define ssize_t SSIZE_T
#else
#undef DOSISM
#include <unistd.h>
#include <sys/time.h>
#include <values.h>
#include <glob.h>
#define PACKED __attribute__((packed))
#define LONGLONG long long
#define O_BINARY 0
typedef enum {false,true} boolean;
#endif
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
......@@ -9,23 +46,17 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <values.h>
#include <sys/types.h>
#include <glob.h>
#include <math.h>
#include "misc.h"
#include "version.h"
#define PACKED __attribute__((packed))
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* ------------------------------------------------------------------------ */
#ifndef SPEAR
......@@ -52,7 +83,7 @@
/* ---------------- */
typedef enum {false,true} boolean;
typedef unsigned char byte;
typedef unsigned short int word;
typedef unsigned long longword;
......@@ -79,7 +110,6 @@ extern const byte introscn[];
extern const byte gamepal[];
int MS_CheckParm(char *string);
int WolfMain(int argc, char *argv[]);
void Quit(char *error);
#undef PI
......
#include "id_heads.h"
#ifdef DOSISM /* TODO: bad name.. since djgpp code would use interrupt (maybe uclock?) most likely */
#define TICKCOUNT 70
long TimeCount;
double AdjClock = CLOCKS_PER_SEC / TICKCOUNT;
double LastClock;
void set_TimeCount(unsigned long count)
{
/* TODO: would using queryperformancecounter be better? */
TimeCount = count;
LastClock = clock();
}
unsigned long get_TimeCount()
{
return (unsigned long)(TimeCount + ((clock() - LastClock) / AdjClock));
}
#else /* DOSISM */
/* TimeCount from David Haslam -- dch@sirius.demon.co.uk */
static struct timeval t0;
static long tc0;
/* From David Haslam -- dch@sirius.demon.co.uk */
void set_TimeCount(unsigned long t)
{
tc0 = t;
......@@ -69,3 +92,5 @@ char *ultoa(unsigned long value, char *string, int radix)
sprintf(string, "%lu", value);
return string;
}
#endif /* DOSISM */
......@@ -10,6 +10,8 @@ void SavePCXRGBToFile(unsigned char *buf, int width, int height, char *name);
void set_TimeCount(unsigned long t);
unsigned long get_TimeCount();
#ifndef DOSISM
long filelength(int handle);
#define stricmp strcasecmp
......@@ -20,6 +22,8 @@ char *itoa(short int value, char *string, int radix);
char *ltoa(long value, char *string, int radix);
char *ultoa(unsigned long value, char *string, int radix);
#endif /* DOSISM */
#else
#error "fix me TODO"
#endif
......@@ -36,7 +36,6 @@ static boolean sbNoCheck,sbNoProCheck;
static byte sbOldIntMask = -1;
static byte *sbNextSegPtr;
static longword sbNextSegLen;
static SampledSound *sbSamples;
// SoundSource variables
boolean ssNoCheck;
......@@ -166,7 +165,7 @@ void SD_PositionSound(int leftvol,int rightvol)
// SD_PlaySound() - plays the specified sound on the appropriate hardware
//
///////////////////////////////////////////////////////////////////////////
boolean SD_PlaySound(soundnames sound)
void SD_PlaySound(soundnames sound)
{
boolean ispos;
int lp,rp;
......@@ -179,7 +178,6 @@ boolean SD_PlaySound(soundnames sound)
ispos = nextsoundpos;
nextsoundpos = false;
return false;
}
///////////////////////////////////////////////////////////////////////////
......@@ -317,8 +315,9 @@ byte lefttable[ATABLEMAX][ATABLEMAX * 2] = {
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}
};
void SetSoundLoc(fixed gx,fixed gy)
void SetSoundLoc(fixed gx, fixed gy)
{
#if 0
fixed xt,yt;
int x,y;
......@@ -352,6 +351,7 @@ void SetSoundLoc(fixed gx,fixed gy)
x = ATABLEMAX - 1;
leftchannel = lefttable[x][y + ATABLEMAX];
rightchannel = righttable[x][y + ATABLEMAX];
#endif
}
/*
......@@ -368,14 +368,14 @@ void PlaySoundLocGlobal(word s,fixed gx,fixed gy)
{
SetSoundLoc(gx,gy);
SD_PositionSound(leftchannel,rightchannel);
if (SD_PlaySound(s))
{
globalsoundx = gx;
globalsoundy = gy;
}
SD_PlaySound(s);
globalsoundx = gx;
globalsoundy = gy;
}
void UpdateSoundLoc()
void UpdateSoundLoc(fixed x, fixed y, int angle)
{
if (SoundPositioned)
{
......
......@@ -6,7 +6,7 @@
/* SDM = 2 */
/* SOD = 3 */
#ifndef WMODE
#define WMODE 1
#define WMODE 0
#endif
#if WMODE == 0
......
......@@ -22,7 +22,7 @@ void VL_Hlin(unsigned x, unsigned y, unsigned width, unsigned color);
void VL_Vlin(int x, int y, int height, int color);
void VL_Bar(int x, int y, int width, int height, int color);
void VL_MemToScreen(byte *source, int width, int height, int x, int y);
void VL_MemToScreen(const byte *source, int width, int height, int x, int y);
void VL_DeModeXize(byte *buf, int width, int height);
......
/* id_vl.c */
#include "id_heads.h"
#include "wl_def.h"
#include <X11/Xlib.h>
#include <X11/keysym.h>
......@@ -34,6 +34,41 @@ int attrib[] = {
None
};
/*
==========================
=
= Quit
=
==========================
*/
void Quit(char *error)
{
/* TODO: blah blah blah */
memptr screen = NULL;
if (!error || !*error) {
CA_CacheGrChunk(ORDERSCREEN);
screen = grsegs[ORDERSCREEN];
WriteConfig();
} else if (error) {
CA_CacheGrChunk(ERRORSCREEN);
screen = grsegs[ERRORSCREEN];
}
ShutdownId();
if (screen) {
printf("TODO: spiffy ansi screen goes here..\n");
}
if (error && *error) {
fprintf(stderr, "Quit: %s", error);
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
int main(int argc, char *argv[])
{
/* TODO: move this to the proper functions */
......@@ -368,7 +403,7 @@ void VL_Bar(int x, int y, int width, int height, int color)
=================
*/
void VL_MemToScreen(byte *source, int width, int height, int x, int y)
void VL_MemToScreen(const byte *source, int width, int height, int x, int y)
{
byte *ptr = gfxbuf + 320 * y + x;
while(height--) {
......
/* id_vl.c */
#include "id_heads.h"
#include "wl_def.h"
#include <vga.h>
#include <vgakeyboard.h>
byte *gfxbuf = NULL;
/*
==========================
=
= Quit
=
==========================
*/
void Quit(char *error)
{
/* TODO: blah blah blah */
memptr screen = NULL;
if (!error || !*error) {
CA_CacheGrChunk(ORDERSCREEN);
screen = grsegs[ORDERSCREEN];
WriteConfig();
} else if (error) {
CA_CacheGrChunk(ERRORSCREEN);
screen = grsegs[ERRORSCREEN];
}
ShutdownId();
if (screen) {
printf("TODO: spiffy ansi screen goes here..\n");
}
if (error && *error) {
fprintf(stderr, "Quit: %s", error);
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
void VL_WaitVBL(int vbls)
{
vga_waitretrace();
......@@ -228,7 +263,7 @@ void VL_Bar(int x, int y, int width, int height, int color)
=================
*/
void VL_MemToScreen(byte *source, int width, int height, int x, int y)
void VL_MemToScreen(const byte *source, int width, int height, int x, int y)
{
byte *ptr = gfxbuf + 320 * y + x;
while(height--) {
......
This diff is collapsed.
/* id_vl.c */
#include "id_heads.h"
#include "wl_def.h"
#include <sys/ipc.h>
#include <sys/shm.h>
......@@ -44,6 +44,41 @@ int main(int argc, char *argv[])
return WolfMain(argc, argv);
}
/*
==========================
=
= Quit
=
==========================
*/
void Quit(char *error)
{
/* TODO: blah blah blah */
memptr screen = NULL;
if (!error || !*error) {
CA_CacheGrChunk(ORDERSCREEN);
screen = grsegs[ORDERSCREEN];
WriteConfig();
} else if (error) {
CA_CacheGrChunk(ERRORSCREEN);
screen = grsegs[ERRORSCREEN];
}
ShutdownId();
if (screen) {
printf("TODO: spiffy ansi screen goes here..\n");
}
if (error && *error) {
fprintf(stderr, "Quit: %s", error);
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
/*
=======================
=
......@@ -470,6 +505,7 @@ void VL_SetPalette(const byte *palette)
}
XStoreColors(dpy, cmap, clr, 256);
} else {
/* TODO: memcpy? */
for (i = 0; i < 256; i++) {
mypal[i*3+0] = palette[i*3+0];
mypal[i*3+1] = palette[i*3+1];
......@@ -606,7 +642,7 @@ void VL_Bar(int x, int y, int width, int height, int color)
=================
*/
void VL_MemToScreen(byte *source, int width, int height, int x, int y)
void VL_MemToScreen(const byte *source, int width, int height, int x, int y)
{
byte *ptr = gfxbuf + 320 * y + x;
while(height--) {
......
......@@ -1612,8 +1612,8 @@ void T_Launch (objtype *ob)
deltay = ob->y - player->y;
angle = atan2 (deltay,deltax);
if (angle<0)
angle = M_PI*2+angle;
iangle = angle/(M_PI*2)*ANGLES;
angle = PI*2+angle;
iangle = angle/(PI*2)*ANGLES;
if (ob->obclass == deathobj)
{
T_Shoot (ob);
......@@ -2269,8 +2269,8 @@ void T_SchabbThrow (objtype *ob)
deltay = ob->y - player->y;
angle = atan2 (deltay,deltax);
if (angle<0)
angle = M_PI*2+angle;
iangle = angle/(M_PI*2)*ANGLES;
angle = PI*2+angle;
iangle = angle/(PI*2)*ANGLES;
GetNewActor ();
new->state = &s_needle1;
......@@ -2311,8 +2311,8 @@ void T_GiftThrow (objtype *ob)
deltay = ob->y - player->y;
angle = atan2 (deltay,deltax);
if (angle<0)
angle = M_PI*2+angle;
iangle = angle/(M_PI*2)*ANGLES;
angle = PI*2+angle;
iangle = angle/(PI*2)*ANGLES;
GetNewActor ();
new->state = &s_rocket;
......@@ -2902,8 +2902,8 @@ void T_FakeFire (objtype *ob)
deltay = ob->y - player->y;
angle = atan2 (deltay,deltax);
if (angle<0)
angle = M_PI*2+angle;
iangle = angle/(M_PI*2)*ANGLES;
angle = PI*2+angle;
iangle = angle/(PI*2)*ANGLES;
GetNewActor ();
new->state = &s_fire1;
......@@ -3766,9 +3766,9 @@ void A_StartDeathCam (objtype *ob)
fangle = atan2(dy,dx); // returns -pi to pi
if (fangle<0)
fangle = M_PI*2+fangle;
fangle = PI*2+fangle;
player->angle = fangle/(M_PI*2)*ANGLES;
player->angle = fangle/(PI*2)*ANGLES;
//
// try to position as close as possible without being in a wall
......
......@@ -726,7 +726,9 @@ boolean LoadTheGame(int file,int x,int y);
boolean SaveTheGame(int file,int x,int y);
void ShowViewSize (int width);
void ShutdownId (void);
void WriteConfig(void);
int WolfMain(int argc, char *argv[]);
/*
=============================================================================
......
......@@ -847,7 +847,7 @@ void AsmRefresh (void)
ytile += ytilestep;
xintercept += xstep;
goto horizcheck;
nextpix:
nextpix: ;
}
}
......
......@@ -962,9 +962,9 @@ void Died()
fangle = atan2(dy,dx); // returns -pi to pi
if (fangle<0)
fangle = M_PI*2+fangle;
fangle = PI*2+fangle;
iangle = fangle/(M_PI*2)*ANGLES;
iangle = fangle/(PI*2)*ANGLES;
if (player->angle > iangle)
{
......
......@@ -1277,8 +1277,7 @@ void CopyProtection(void)
whichone,whichpicked[4]={0,0,0,0},quiztype,whichmem,
memberpicked[5]={0,0,0,0,0},wordpicked[5]={0,0,0,0,0},whichword;
char inputbuffer[20],
message[80];
char message[30], inputbuffer[20];
enum
{
......@@ -1485,13 +1484,7 @@ void CopyProtection(void)
}
}
ClearMemory();
ShutdownId();
strcpy(message,DosMessages[US_RndT()%9]);
printf("%s\n",message);
exit(1);
Quit(DosMessages[US_RndT()%9]);
}
#endif // SPEARDEMO
......
......@@ -85,9 +85,9 @@ char **_argv;
fixed FixedByFrac(fixed a, fixed b)
{
long long ra = a;
long long rb = b;
long long r;
LONGLONG ra = a;
LONGLONG rb = b;
LONGLONG r;
r = ra * rb;
r >>= 16;
......@@ -138,7 +138,7 @@ void ReadConfig(void)
SMMode sm;
SDSMode sds;
#if 0 /* TODO */
if ( (file = open(configname,O_BINARY | O_RDONLY)) != -1)
{
//
......@@ -184,6 +184,7 @@ void ReadConfig(void)
MainItems.curpos=0;
}
else
#endif
{
//
// no config file, so select by hardware
......@@ -521,15 +522,15 @@ boolean LoadTheGame(int file,int x,int y)
==========================
*/
void ShutdownId (void)
void ShutdownId()
{
US_Shutdown ();
SD_Shutdown ();
PM_Shutdown ();
IN_Shutdown ();
VW_Shutdown ();
CA_Shutdown ();
MM_Shutdown ();
US_Shutdown();
SD_Shutdown();
IN_Shutdown();
VW_Shutdown();
CA_Shutdown();
PM_Shutdown();
MM_Shutdown();
}
......@@ -605,8 +606,6 @@ void BuildTables (void)
====================
*/
#include <sys/mman.h>
void CalcProjection (long focal)
{
int i;
......@@ -1153,14 +1152,14 @@ boolean SetViewSize(unsigned width, unsigned height)
void ShowViewSize (int width)
{
int oldwidth,oldheight;
int oldwidth,oldheight;
oldwidth = viewwidth;
oldheight = viewheight;
viewwidth = width*16;
viewheight = width*16*HEIGHTRATIO;
DrawPlayBorder ();
DrawPlayBorder();
viewheight = oldheight;
viewwidth = oldwidth;
......@@ -1180,45 +1179,6 @@ void NewViewSize(int width)
//===========================================================================
/*
==========================
=
= Quit
=
==========================
*/
void Quit(char *error)
{
memptr screen = NULL;
if (!error || !*error) {
CA_CacheGrChunk(ORDERSCREEN);
screen = grsegs[ORDERSCREEN];
WriteConfig();
} else if (error) {
CA_CacheGrChunk(ERRORSCREEN);
screen = grsegs[ERRORSCREEN];
}
ShutdownId();
if (screen) {
printf("TODO: spiffy ansi screen goes here..\n");
}
if (error && *error) {
fprintf(stderr, "Quit: %s\n", error);
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
//===========================================================================
/*
=====================
=
......
......@@ -2603,7 +2603,8 @@ void DrawOutline(int x,int y,int w,int h,int color1,int color2)
////////////////////////////////////////////////////////////////////
void SetupControlPanel(void)
{
#if 0 /* DOS VERSION */
#ifdef DOSISM /* DOS VERSION */
#ifdef HAVE_FFBLK
struct ffblk f;
int which;
......@@ -2629,8 +2630,8 @@ void SetupControlPanel(void)
//
// SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN
//
strcpy(name,SaveName);
if (!findfirst(name,&f,0))
if (!findfirst(SaveNaame,&f,0))
do
{
which=f.ff_name[7]-'0';
......@@ -2647,6 +2648,53 @@ void SetupControlPanel(void)
}
} while(!findnext(&f));
#else
struct _finddata_t f;
int which;
long hand;
//
// CACHE GRAPHICS & SOUNDS
//
CA_CacheGrChunk(STARTFONT+1);
#ifndef SPEAR
CacheLump(CONTROLS_LUMP_START,CONTROLS_LUMP_END);
#else
CacheLump(BACKDROP_LUMP_START,BACKDROP_LUMP_END);
#endif
SETFONTCOLOR(TEXTCOLOR,BKGDCOLOR);
fontnumber=1;
WindowH=200;
if (!ingame)
CA_LoadAllSounds();
else
MainMenu[savegame].active=1;
//
// SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN
//
if ((hand = _findfirst(SaveName, &f)) != -1)
do
{
which=f.name[7]-'0';
if (which<10)
{
int handle;
char temp[32];
SaveGamesAvail[which]=1;
handle=open(f.name,O_BINARY);
read(handle,temp,32);
close(handle);
strcpy(&SaveGameNames[which][0],temp);
}
} while(_findnext(hand, &f) != -1);
#endif
#else
glob_t globbuf;
int which, x;
......@@ -3180,7 +3228,7 @@ void Message(char *string)
CA_CacheGrChunk (STARTFONT+1);
fontnumber=1;
font=grsegs[STARTFONT+fontnumber];
font= (fontstruct *)grsegs[STARTFONT+fontnumber];
h=font->height;
for (i=0;i<strlen(string);i++)
if (string[i]=='\n')
......@@ -3320,9 +3368,10 @@ void ShootSnd(void)
// CHECK FOR EPISODES
//
///////////////////////////////////////////////////////////////////////////
void CheckForEpisodes(void)
void CheckForEpisodes()
{
#if 0 /* DOS VERSION */
#ifdef DOSISM /* DOS VERSION */
#ifdef HAVE_FFBLK
struct ffblk f;
//
// ENGLISH
......@@ -3386,6 +3435,70 @@ void CheckForEpisodes(void)
strcat(SaveName,extension);
strcat(PageFileName,extension);
#else
struct _finddata_t f;
//
// ENGLISH
//
#ifndef UPLOAD
#ifndef SPEAR
if (_findfirst("*.WL6", &f) != -1)
{
strcpy(extension,"WL6");
NewEmenu[2].active =
NewEmenu[4].active =
NewEmenu[6].active =
NewEmenu[8].active =
NewEmenu[10].active =
EpisodeSelect[1] =
EpisodeSelect[2] =
EpisodeSelect[3] =
EpisodeSelect[4] =
EpisodeSelect[5] = 1;
} else if (_findfirst("*.WL3",&f) != -1) {
strcpy(extension,"WL3");
NewEmenu[2].active =
NewEmenu[4].active =
EpisodeSelect[1] =
EpisodeSelect[2] = 1;
}
else
#endif /* SPEAR */
#endif /* UPLOAD */
#ifdef SPEAR
#ifndef SPEARDEMO
if (_findfirst("*.SOD",&f) != -1)
{
strcpy(extension,"SOD");
}
else
Quit("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
#else /* SPEARDEMO */
if (_findfirst("*.SDM",&f) != -1)
{
strcpy(extension,"SDM");
}
else
Quit("NO SPEAR OF DESTINY DEMO DATA FILES TO BE FOUND!");
#endif /* SPEARDEMO */
#else /* SPEAR */
if (_findfirst("*.WL1",&f) != -1)
{
strcpy(extension,"WL1");
}
else
Quit("NO WOLFENSTEIN 3-D DATA FILES to be found!");
#endif /* SPEAR */
strcat(configname,extension);
strcat(SaveName,extension);
strcat(PageFileName,extension);
#endif
#else
glob_t globbuf;
//
......
......@@ -996,7 +996,9 @@ boolean palshifted;
void InitRedShifts (void)
{
byte *workptr, *baseptr;
byte *workptr;
const byte *baseptr;
int i,j,delta;
......
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