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
0d5404c8
Commit
0d5404c8
authored
Apr 20, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More outdated code removal
parent
646cf19b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
65 additions
and
246 deletions
+65
-246
id_us.c
src/id_us.c
+44
-16
id_us.h
src/id_us.h
+0
-5
id_us_a.asm
src/id_us_a.asm
+0
-101
wl_act2.c
src/wl_act2.c
+3
-3
wl_agent.c
src/wl_agent.c
+3
-11
wl_debug.c
src/wl_debug.c
+0
-2
wl_def.h
src/wl_def.h
+10
-43
wl_game.c
src/wl_game.c
+1
-2
wl_main.c
src/wl_main.c
+1
-37
wl_play.c
src/wl_play.c
+3
-26
No files found.
src/id_us.c
View file @
0d5404c8
...
...
@@ -9,11 +9,9 @@ word WindowX,WindowY,WindowW,WindowH;
// Internal variables
static
char
*
ParmStrings
[]
=
{
"
TEDLEVEL"
,
"NOWAIT
"
};
static
char
*
ParmStrings
[]
=
{
"
nowait
"
};
static
boolean
US_Started
;
int
CursorX
,
CursorY
;
void
(
*
USL_MeasureString
)(
char
*
,
word
*
,
word
*
)
=
VW_MeasurePropString
,
(
*
USL_DrawString
)(
char
*
)
=
VWB_DrawPropString
;
...
...
@@ -43,19 +41,12 @@ void US_Startup(void)
US_InitRndT
(
true
);
// Initialize the random number generator
// Check for TED launching here
for
(
i
=
1
;
i
<
_argc
;
i
++
)
{
n
=
US_CheckParm
(
_argv
[
i
],
ParmStrings
);
switch
(
n
)
{
case
0
:
tedlevelnum
=
atoi
(
_argv
[
i
+
1
]);
if
(
tedlevelnum
>=
0
)
tedlevel
=
true
;
break
;
case
1
:
NoWait
=
true
;
break
;
}
...
...
@@ -217,8 +208,7 @@ void US_PrintCentered(char *s)
// advances to the next line. Newlines are not supported.
//
///////////////////////////////////////////////////////////////////////////
void
US_CPrintLine
(
char
*
s
)
void
US_CPrintLine
(
char
*
s
)
{
word
w
,
h
;
...
...
@@ -238,8 +228,7 @@ US_CPrintLine(char *s)
// supported.
//
///////////////////////////////////////////////////////////////////////////
void
US_CPrint
(
char
*
s
)
void
US_CPrint
(
char
*
s
)
{
char
c
,
*
se
;
...
...
@@ -267,8 +256,7 @@ US_CPrint(char *s)
// cursor
//
///////////////////////////////////////////////////////////////////////////
void
US_ClearWindow
(
void
)
void
US_ClearWindow
(
void
)
{
VWB_Bar
(
WindowX
,
WindowY
,
WindowW
,
WindowH
,
WHITE
);
PrintX
=
WindowX
;
...
...
@@ -529,3 +517,43 @@ boolean US_LineInput(int x,int y,char *buf,char *def,boolean escok,
IN_ClearKeysDown
();
return
(
result
);
}
int
rndtable
[]
=
{
0
,
8
,
109
,
220
,
222
,
241
,
149
,
107
,
75
,
248
,
254
,
140
,
16
,
66
,
74
,
21
,
211
,
47
,
80
,
242
,
154
,
27
,
205
,
128
,
161
,
89
,
77
,
36
,
95
,
110
,
85
,
48
,
212
,
140
,
211
,
249
,
22
,
79
,
200
,
50
,
28
,
188
,
52
,
140
,
202
,
120
,
68
,
145
,
62
,
70
,
184
,
190
,
91
,
197
,
152
,
224
,
149
,
104
,
25
,
178
,
252
,
182
,
202
,
182
,
141
,
197
,
4
,
81
,
181
,
242
,
145
,
42
,
39
,
227
,
156
,
198
,
225
,
193
,
219
,
93
,
122
,
175
,
249
,
0
,
175
,
143
,
70
,
239
,
46
,
246
,
163
,
53
,
163
,
109
,
168
,
135
,
2
,
235
,
25
,
92
,
20
,
145
,
138
,
77
,
69
,
166
,
78
,
176
,
173
,
212
,
166
,
113
,
94
,
161
,
41
,
50
,
239
,
49
,
111
,
164
,
70
,
60
,
2
,
37
,
171
,
75
,
136
,
156
,
11
,
56
,
42
,
146
,
138
,
229
,
73
,
146
,
77
,
61
,
98
,
196
,
135
,
106
,
63
,
197
,
195
,
86
,
96
,
203
,
113
,
101
,
170
,
247
,
181
,
113
,
80
,
250
,
108
,
7
,
255
,
237
,
129
,
226
,
79
,
107
,
112
,
166
,
103
,
241
,
24
,
223
,
239
,
120
,
198
,
58
,
60
,
82
,
128
,
3
,
184
,
66
,
143
,
224
,
145
,
224
,
81
,
206
,
163
,
45
,
63
,
90
,
168
,
114
,
59
,
33
,
159
,
95
,
28
,
139
,
123
,
98
,
125
,
196
,
15
,
70
,
194
,
253
,
54
,
14
,
109
,
226
,
71
,
17
,
161
,
93
,
186
,
87
,
244
,
138
,
20
,
52
,
123
,
251
,
26
,
36
,
17
,
46
,
52
,
231
,
232
,
76
,
31
,
221
,
84
,
37
,
216
,
165
,
212
,
106
,
197
,
242
,
98
,
43
,
39
,
175
,
254
,
145
,
190
,
84
,
118
,
222
,
187
,
136
,
120
,
163
,
236
,
249
};
static
int
rndindex
=
0
;
void
US_InitRndT
(
boolean
randomize
)
{
if
(
randomize
)
rndindex
=
time
(
NULL
)
&
0xFF
;
else
rndindex
=
0
;
}
int
US_RndT
()
{
rndindex
++
;
rndindex
&=
0xFF
;
return
rndtable
[
rndindex
];
}
src/id_us.h
View file @
0d5404c8
...
...
@@ -22,9 +22,6 @@ typedef struct
px
,
py
;
}
WindowRec
;
// Record used to save & restore screen windows
extern
boolean
tedlevel
;
/* TODO: rename or remove */
extern
int
tedlevelnum
;
extern
boolean
ingame
,
// Set by game code if a game is in progress
abortgame
,
// Set if a game load failed
loadedgame
,
// Set if the current game was loaded
...
...
@@ -33,8 +30,6 @@ extern word PrintX,PrintY; // Current printing location in the window
extern
word
WindowX
,
WindowY
,
// Current location of window
WindowW
,
WindowH
;
// Current size of window
extern
int
CursorX
,
CursorY
;
extern
void
(
*
USL_MeasureString
)(
char
*
,
word
*
,
word
*
),
(
*
USL_DrawString
)(
char
*
);
...
...
src/id_us_a.asm
deleted
100644 → 0
View file @
646cf19b
IDEAL
MODEL
MEDIUM
,
C
; Assembly portion of the User Mgr. This is just John Carmack's table
; driven pseudo-random number generator, and we put it in the User Mgr
; because we couldn't figure out where it should go
;============================================================================
;
; RANDOM ROUTINES
;
;============================================================================
FARDATA
rndindex
dw
?
rndtable
db
0
,
8
,
109
,
220
,
222
,
241
,
149
,
107
,
75
,
248
,
254
,
140
,
16
,
66
db
74
,
21
,
211
,
47
,
80
,
242
,
154
,
27
,
205
,
128
,
161
,
89
,
77
,
36
db
95
,
110
,
85
,
48
,
212
,
140
,
211
,
249
,
22
,
79
,
200
,
50
,
28
,
188
db
52
,
140
,
202
,
120
,
68
,
145
,
62
,
70
,
184
,
190
,
91
,
197
,
152
,
224
db
149
,
104
,
25
,
178
,
252
,
182
,
202
,
182
,
141
,
197
,
4
,
81
,
181
,
242
db
145
,
42
,
39
,
227
,
156
,
198
,
225
,
193
,
219
,
93
,
122
,
175
,
249
,
0
db
175
,
143
,
70
,
239
,
46
,
246
,
163
,
53
,
163
,
109
,
168
,
135
,
2
,
235
db
25
,
92
,
20
,
145
,
138
,
77
,
69
,
166
,
78
,
176
,
173
,
212
,
166
,
113
db
94
,
161
,
41
,
50
,
239
,
49
,
111
,
164
,
70
,
60
,
2
,
37
,
171
,
75
db
136
,
156
,
11
,
56
,
42
,
146
,
138
,
229
,
73
,
146
,
77
,
61
,
98
,
196
db
135
,
106
,
63
,
197
,
195
,
86
,
96
,
203
,
113
,
101
,
170
,
247
,
181
,
113
db
80
,
250
,
108
,
7
,
255
,
237
,
129
,
226
,
79
,
107
,
112
,
166
,
103
,
241
db
24
,
223
,
239
,
120
,
198
,
58
,
60
,
82
,
128
,
3
,
184
,
66
,
143
,
224
db
145
,
224
,
81
,
206
,
163
,
45
,
63
,
90
,
168
,
114
,
59
,
33
,
159
,
95
db
28
,
139
,
123
,
98
,
125
,
196
,
15
,
70
,
194
,
253
,
54
,
14
,
109
,
226
db
71
,
17
,
161
,
93
,
186
,
87
,
244
,
138
,
20
,
52
,
123
,
251
,
26
,
36
db
17
,
46
,
52
,
231
,
232
,
76
,
31
,
221
,
84
,
37
,
216
,
165
,
212
,
106
db
197
,
242
,
98
,
43
,
39
,
175
,
254
,
145
,
190
,
84
,
118
,
222
,
187
,
136
db
120
,
163
,
236
,
249
PUBLIC
rndtable
CODESEG
LastRnd
dw
?
;=================================================
;
; void US_InitRndT (boolean randomize)
; Init table based RND generator
; if randomize is false, the counter is set to 0
;
;=================================================
PROC
US_InitRndT
randomize
:
word
uses
si
,
di
public
US_InitRndT
mov
ax
,
SEG
rndtable
mov
es
,
ax
mov
ax
,[randomize]
or
ax
,
ax
jne
@@
timeit
;if randomize is true, really random
mov
dx
,
0
;set to a definite value
jmp
@@
setit
@@
timeit
:
mov
ah
,
2
ch
int
21
h
;GetSystemTime
and
dx
,
0
ffh
@@
setit
:
mov
[
es
:
rndindex
]
,
dx
ret
ENDP
;=================================================
;
; int US_RndT (void)
; Return a random # between 0-255
; Exit : AX = value
;
;=================================================
PROC
US_RndT
public
US_RndT
mov
ax
,
SEG
rndtable
mov
es
,
ax
mov
bx
,
[
es
:
rndindex
]
inc
bx
and
bx
,
0
ffh
mov
[
es
:
rndindex
]
,
bx
mov
al
,
[
es
:
rndtable
+
BX
]
xor
ah
,
ah
ret
ENDP
END
src/wl_act2.c
View file @
0d5404c8
...
...
@@ -3673,7 +3673,7 @@ void T_BJRun (objtype *ob)
===============
*/
void
T_BJJump
(
objtype
*
ob
)
void
T_BJJump
(
objtype
*
ob
)
{
long
move
;
...
...
@@ -3690,9 +3690,9 @@ void T_BJJump (objtype *ob)
===============
*/
void
T_BJYell
(
objtype
*
ob
)
void
T_BJYell
(
objtype
*
ob
)
{
PlaySoundLocActor
(
YEAHSND
,
ob
);
// JAB
PlaySoundLocActor
(
YEAHSND
,
ob
);
}
...
...
src/wl_agent.c
View file @
0d5404c8
...
...
@@ -30,7 +30,6 @@
//
// player state info
//
boolean
running
;
long
thrustspeed
;
unsigned
plux
,
pluy
;
// player coordinates scaled to unsigned
...
...
@@ -241,19 +240,12 @@ void ControlMovement (objtype *ob)
void
StatusDrawPic
(
unsigned
x
,
unsigned
y
,
unsigned
picnum
)
{
unsigned
temp
;
temp
=
bufferofs
;
bufferofs
=
0
;
bufferofs
=
PAGE1START
+
(
200
-
STATUSLINES
)
*
SCREENWIDTH
;
/* TODO hmm */
LatchDrawPic
(
x
,
y
,
picnum
);
bufferofs
=
PAGE2START
+
(
200
-
STATUSLINES
)
*
SCREENWIDTH
;
/*
LatchDrawPic (x,y,picnum);
bufferofs
=
PAGE3START
+
(
200
-
STATUSLINES
)
*
SCREENWIDTH
;
LatchDrawPic (x,y,picnum);
bufferofs
=
temp
;
*/
}
...
...
src/wl_debug.c
View file @
0d5404c8
...
...
@@ -389,8 +389,6 @@ int DebugKeys (void)
if
(
Keyboard
[
sc_E
])
// E = quit level
{
if
(
tedlevel
)
Quit
(
NULL
);
playstate
=
ex_completed
;
// gamestate.mapon++;
}
...
...
src/wl_def.h
View file @
0d5404c8
...
...
@@ -91,12 +91,6 @@
#define STATUSLINES 40
#define SCREENSIZE (SCREENBWIDE*208)
#define PAGE1START 0
#define PAGE2START (SCREENSIZE)
#define PAGE3START (SCREENSIZE*2u)
#define FREESTART (SCREENSIZE*3u)
#define STARTAMMO 8
// object flag values
...
...
@@ -577,7 +571,7 @@ typedef struct statstruct
{
byte
tilex
,
tiley
;
byte
*
visspot
;
int
shapenum
;
// if shapenum == -1 the obj has been removed
int
shapenum
;
/* if shapenum == -1 the obj has been removed */
byte
flags
;
byte
itemnumber
;
}
statobj_t
;
...
...
@@ -610,25 +604,25 @@ typedef struct objstruct
classtype
obclass
;
statetype
*
state
;
byte
flags
;
// FL_SHOOTABLE, etc
byte
flags
;
/* FL_SHOOTABLE, etc */
long
distance
;
// if negative, wait for that door to open
long
distance
;
/* if negative, wait for that door to open */
dirtype
dir
;
fixed
x
,
y
;
unsigned
tilex
,
tiley
;
byte
areanumber
;
int
viewx
;
int
viewx
;
unsigned
viewheight
;
fixed
transx
,
transy
;
// in global coord
fixed
transx
,
transy
;
/* in global coord */
int
angle
;
int
hitpoints
;
long
speed
;
int
temp1
,
temp2
,
temp3
;
struct
objstruct
*
next
,
*
prev
;
int
temp1
,
temp2
,
temp3
;
struct
objstruct
*
next
,
*
prev
;
}
objtype
;
...
...
@@ -715,8 +709,6 @@ typedef enum {
extern
boolean
MS_CheckParm
(
char
*
string
);
extern
char
str
[
80
],
str2
[
20
];
extern
int
tedlevelnum
;
extern
boolean
tedlevel
;
extern
fixed
focallength
;
extern
unsigned
viewangles
;
...
...
@@ -835,7 +827,7 @@ extern int extravbls;
//
// control info
//
extern
boolean
mouseenabled
,
joystickenabled
,
joypadenabled
,
joystickprogressive
;
extern
boolean
mouseenabled
,
joystickenabled
,
joypadenabled
;
extern
int
joystickport
;
extern
int
dirscan
[
4
];
extern
int
buttonscan
[
NUMBUTTONS
];
...
...
@@ -968,7 +960,7 @@ void FarScalePost (void);
=============================================================================
*/
#define TURNTICS 10
#define SPDPATROL 512
#define SPDDOG 1500
...
...
@@ -1003,39 +995,15 @@ boolean CheckSight (objtype *ob);
=============================================================================
*/
#define COMPSCALECODESTART (65*4) // offset to start of code in comp scaler
typedef
struct
{
unsigned
codeofs
[
65
];
unsigned
width
[
65
];
byte
*
code
;
}
t_compscale
;
typedef
struct
{
unsigned
leftpix
,
rightpix
;
unsigned
dataofs
[
64
];
/
/ table data after dataofs[rightpix-leftpix+1]
/
* table data after dataofs[rightpix-leftpix+1] */
}
t_compshape
;
extern
t_compscale
*
scaledirectory
[
MAXSCALEHEIGHT
+
1
];
extern
long
fullscalefarcall
[
MAXSCALEHEIGHT
+
1
];
extern
byte
bitmasks1
[
8
][
8
];
extern
byte
bitmasks2
[
8
][
8
];
extern
unsigned
wordmasks
[
8
][
8
];
extern
byte
mapmasks1
[
4
][
8
];
extern
byte
mapmasks2
[
4
][
8
];
extern
byte
mapmasks3
[
4
][
8
];
extern
int
maxscale
,
maxscaleshl2
;
extern
boolean
insetupscaling
;
void
SetupScaling
(
int
maxscaleheight
);
void
ScaleShape
(
int
xcenter
,
int
shapenum
,
unsigned
height
);
void
SimpleScaleShape
(
int
xcenter
,
int
shapenum
,
unsigned
height
);
...
...
@@ -1051,7 +1019,6 @@ void SimpleScaleShape (int xcenter, int shapenum, unsigned height);
//
// player state info
//
extern
boolean
running
;
extern
long
thrustspeed
;
extern
unsigned
plux
,
pluy
;
// player coordinates scaled to unsigned
...
...
src/wl_game.c
View file @
0d5404c8
...
...
@@ -1180,8 +1180,7 @@ void Died (void)
IN_UserInput
(
100
);
SD_WaitSoundDone
();
if
(
tedlevel
==
false
)
// SO'S YA DON'T GET KILLED WHILE LAUNCHING!
gamestate
.
lives
--
;
gamestate
.
lives
--
;
if
(
gamestate
.
lives
>
-
1
)
{
...
...
src/wl_main.c
View file @
0d5404c8
...
...
@@ -35,8 +35,6 @@
*/
char
str
[
80
],
str2
[
20
];
int
tedlevelnum
;
boolean
tedlevel
;
int
dirangle
[
9
]
=
{
0
,
ANGLES
/
8
,
2
*
ANGLES
/
8
,
3
*
ANGLES
/
8
,
4
*
ANGLES
/
8
,
5
*
ANGLES
/
8
,
6
*
ANGLES
/
8
,
7
*
ANGLES
/
8
,
ANGLES
};
...
...
@@ -105,7 +103,6 @@ void ReadConfig(void)
read
(
file
,
&
mouseenabled
,
sizeof
(
mouseenabled
));
read
(
file
,
&
joystickenabled
,
sizeof
(
joystickenabled
));
read
(
file
,
&
joypadenabled
,
sizeof
(
joypadenabled
));
read
(
file
,
&
joystickprogressive
,
sizeof
(
joystickprogressive
));
read
(
file
,
&
joystickport
,
sizeof
(
joystickport
));
read
(
file
,
&
dirscan
,
sizeof
(
dirscan
));
...
...
@@ -165,7 +162,6 @@ void ReadConfig(void)
joystickenabled
=
false
;
joypadenabled
=
false
;
joystickport
=
0
;
joystickprogressive
=
false
;
viewsize
=
15
;
mouseadjustment
=
5
;
...
...
@@ -204,7 +200,6 @@ void WriteConfig(void)
write
(
file
,
&
mouseenabled
,
sizeof
(
mouseenabled
));
write
(
file
,
&
joystickenabled
,
sizeof
(
joystickenabled
));
write
(
file
,
&
joypadenabled
,
sizeof
(
joypadenabled
));
write
(
file
,
&
joystickprogressive
,
sizeof
(
joystickprogressive
));
write
(
file
,
&
joystickport
,
sizeof
(
joystickport
));
write
(
file
,
&
dirscan
,
sizeof
(
dirscan
));
...
...
@@ -1267,44 +1262,13 @@ void Quit (char *error)
=====================
*/
static
char
*
ParmStrings
[]
=
{
"baby"
,
"easy"
,
"normal"
,
"hard"
,
""
};
void
DemoLoop
(
void
)
void
DemoLoop
(
void
)
{
static
int
LastDemo
;
int
i
,
level
;
long
nsize
;
memptr
nullblock
;
//
// check for launch from ted
//
if
(
tedlevel
)
{
NoWait
=
true
;
NewGame
(
1
,
0
);
for
(
i
=
1
;
i
<
_argc
;
i
++
)
{
if
(
(
level
=
US_CheckParm
(
_argv
[
i
],
ParmStrings
))
!=
-
1
)
{
gamestate
.
difficulty
=
level
;
break
;
}
}
#ifndef SPEAR
gamestate
.
episode
=
tedlevelnum
/
10
;
gamestate
.
mapon
=
tedlevelnum
%
10
;
#else
gamestate
.
episode
=
0
;
gamestate
.
mapon
=
tedlevelnum
;
#endif
GameLoop
();
Quit
(
NULL
);
}
//
// main game cycle
//
...
...
src/wl_play.c
View file @
0d5404c8
...
...
@@ -2,17 +2,6 @@
#include "wl_def.h"
/*
=============================================================================
LOCAL CONSTANTS
=============================================================================
*/
#define sc_Question 0x35
/*
=============================================================================
...
...
@@ -53,7 +42,7 @@ byte update[UPDATESIZE];
//
// control info
//
boolean
mouseenabled
,
joystickenabled
,
joypadenabled
,
joystickprogressive
;
boolean
mouseenabled
,
joystickenabled
,
joypadenabled
;
int
joystickport
;
int
dirscan
[
4
]
=
{
sc_UpArrow
,
sc_RightArrow
,
sc_DownArrow
,
sc_LeftArrow
};
int
buttonscan
[
NUMBUTTONS
]
=
...
...
@@ -391,22 +380,11 @@ void PollMouseMove (void)
void
PollJoystickMove
(
void
)
{
int
joyx
,
joyy
;
int
joyx
,
joyy
;
INL_GetJoyDelta
(
joystickport
,
&
joyx
,
&
joyy
);
if
(
joystickprogressive
)
{
if
(
joyx
>
64
)
controlx
+=
(
joyx
-
64
)
*
JOYSCALE
*
tics
;
else
if
(
joyx
<
-
64
)
controlx
-=
(
-
joyx
-
64
)
*
JOYSCALE
*
tics
;
if
(
joyy
>
64
)
controlx
+=
(
joyy
-
64
)
*
JOYSCALE
*
tics
;
else
if
(
joyy
<
-
64
)
controly
-=
(
-
joyy
-
64
)
*
JOYSCALE
*
tics
;
}
else
if
(
buttonstate
[
bt_run
])
if
(
buttonstate
[
bt_run
])
{
if
(
joyx
>
64
)
controlx
+=
RUNMOVE
*
tics
;
...
...
@@ -1348,7 +1326,6 @@ void PlayLoop (void)
playstate
=
TimeCount
=
lasttimecount
=
0
;
frameon
=
0
;
running
=
false
;
anglefrac
=
0
;
facecount
=
0
;
funnyticount
=
0
;
...
...
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