Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wolf3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
wolf3d
Commits
fd76d414
Commit
fd76d414
authored
May 09, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial port to Windows.
parent
93d851a3
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1482 additions
and
135 deletions
+1482
-135
IDEAS
src/IDEAS
+6
-3
Makefile
src/Makefile
+3
-3
NOTES
src/NOTES
+28
-0
TODO
src/TODO
+5
-9
gfxsave.c
src/gfxsave.c
+1
-4
id_ca.c
src/id_ca.c
+1
-1
id_ca.h
src/id_ca.h
+1
-1
id_heads.h
src/id_heads.h
+41
-11
misc.c
src/misc.c
+26
-1
misc.h
src/misc.h
+4
-0
sd_null.c
src/sd_null.c
+10
-10
version.h
src/version.h
+1
-1
vi_comm.h
src/vi_comm.h
+1
-1
vi_glx.c
src/vi_glx.c
+37
-2
vi_svga.c
src/vi_svga.c
+37
-2
vi_wdx.c
src/vi_wdx.c
+1088
-0
vi_xlib.c
src/vi_xlib.c
+38
-2
wl_act2.c
src/wl_act2.c
+10
-10
wl_def.h
src/wl_def.h
+2
-0
wl_draw.c
src/wl_draw.c
+1
-1
wl_game.c
src/wl_game.c
+2
-2
wl_inter.c
src/wl_inter.c
+2
-9
wl_main.c
src/wl_main.c
+15
-55
wl_menu.c
src/wl_menu.c
+119
-6
wl_play.c
src/wl_play.c
+3
-1
No files found.
src/IDEAS
View file @
fd76d414
...
...
@@ -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
src/Makefile
View file @
fd76d414
...
...
@@ -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
...
...
src/NOTES
View file @
fd76d414
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.
...
...
src/TODO
View file @
fd76d414
...
...
@@ -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
bitrate
s are a hack since a palette lookup has to be done
* the higher
depth
s 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
src/gfxsave.c
View file @
fd76d414
#include <stdio.h>
#include <stdlib.h>
#define PACKED __attribute__((packed))
#include "wl_def.h"
typedef
struct
pcx_header_type
{
...
...
src/id_ca.c
View file @
fd76d414
...
...
@@ -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
;
...
...
src/id_ca.h
View file @
fd76d414
...
...
@@ -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
;
...
...
src/id_heads.h
View file @
fd76d414
#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
...
...
src/misc.c
View file @
fd76d414
#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 */
src/misc.h
View file @
fd76d414
...
...
@@ -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
src/sd_null.c
View file @
fd76d414
...
...
@@ -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
)
{
...
...
src/version.h
View file @
fd76d414
...
...
@@ -6,7 +6,7 @@
/* SDM = 2 */
/* SOD = 3 */
#ifndef WMODE
#define WMODE
1
#define WMODE
0
#endif
#if WMODE == 0
...
...
src/vi_comm.h
View file @
fd76d414
...
...
@@ -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
);
...
...
src/vi_glx.c
View file @
fd76d414
/* 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
--
)
{
...
...
src/vi_svga.c
View file @
fd76d414
/* 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
--
)
{
...
...
src/vi_wdx.c
0 → 100644
View file @
fd76d414
This diff is collapsed.
Click to expand it.
src/vi_xlib.c
View file @
fd76d414
/* 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
--
)
{
...
...
src/wl_act2.c
View file @
fd76d414
...
...
@@ -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
...
...
src/wl_def.h
View file @
fd76d414
...
...
@@ -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
[]);
/*
=============================================================================
...
...
src/wl_draw.c
View file @
fd76d414
...
...
@@ -847,7 +847,7 @@ void AsmRefresh (void)
ytile
+=
ytilestep
;
xintercept
+=
xstep
;
goto
horizcheck
;
nextpix:
nextpix:
;
}
}
...
...
src/wl_game.c
View file @
fd76d414
...
...
@@ -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
)
{
...
...
src/wl_inter.c
View file @
fd76d414
...
...
@@ -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
...
...
src/wl_main.c
View file @
fd76d414
...
...
@@ -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
);
}
//===========================================================================
/*
=====================
=
...
...
src/wl_menu.c
View file @
fd76d414
...
...
@@ -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
(
n
ame
,
&
f
,
0
))
if
(
!
findfirst
(
SaveNa
ame
,
&
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
;
//
...
...
src/wl_play.c
View file @
fd76d414
...
...
@@ -996,7 +996,9 @@ boolean palshifted;
void
InitRedShifts
(
void
)
{
byte
*
workptr
,
*
baseptr
;
byte
*
workptr
;
const
byte
*
baseptr
;
int
i
,
j
,
delta
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment