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
97af6bcd
Commit
97af6bcd
authored
Apr 27, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanups (once again)
parent
893a320a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
99 deletions
+26
-99
Makefile
src/Makefile
+4
-4
id_heads.h
src/id_heads.h
+4
-7
vi_svga.c
src/vi_svga.c
+1
-66
vi_xlib.c
src/vi_xlib.c
+4
-5
wl_def.h
src/wl_def.h
+2
-1
wl_draw.c
src/wl_draw.c
+2
-2
wl_main.c
src/wl_main.c
+9
-14
No files found.
src/Makefile
View file @
97af6bcd
CC
=
gcc
CC
=
gcc
#CFLAGS = -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -g -Wall -pedantic
CFLAGS
=
-g
-Wall
CFLAGS
=
-g
#
CFLAGS = -g
#CFLAGS = -Os
#CFLAGS = -Os
OBJS
=
objs.o misc.o id_ca.o id_sd.o id_vh.o id_us.o
\
OBJS
=
objs.o misc.o id_ca.o id_sd.o id_vh.o id_us.o
\
wl_scale.o wl_draw.o wl_act1.o wl_act2.o wl_agent.o wl_game.o
\
wl_scale.o wl_draw.o wl_act1.o wl_act2.o wl_agent.o wl_game.o
\
...
@@ -21,8 +21,8 @@ NASM = nasm
...
@@ -21,8 +21,8 @@ NASM = nasm
all
:
swolf3d xwolf3d
all
:
swolf3d xwolf3d
$(SOBJS)
:
version.h id_heads.h
$(SOBJS)
:
version.h id_heads.h
wl_def.h
$(XOBJS)
:
version.h id_heads.h
$(XOBJS)
:
version.h id_heads.h
wl_def.h
.asm.o
:
.asm.o
:
$(NASM)
-f
elf
-o
$@
$<
$(NASM)
-f
elf
-o
$@
$<
...
...
src/id_heads.h
View file @
97af6bcd
...
@@ -31,10 +31,6 @@ int WolfMain(int argc, char *argv[]);
...
@@ -31,10 +31,6 @@ int WolfMain(int argc, char *argv[]);
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
extern
char
signon
;
#define introscn signon
#ifndef SPEAR
#ifndef SPEAR
#ifndef UPLOAD
#ifndef UPLOAD
...
@@ -59,9 +55,6 @@ extern char signon;
...
@@ -59,9 +55,6 @@ extern char signon;
/* ---------------- */
/* ---------------- */
#define GREXT "VGA"
typedef
enum
{
false
,
true
}
boolean
;
typedef
enum
{
false
,
true
}
boolean
;
typedef
unsigned
char
byte
;
typedef
unsigned
char
byte
;
typedef
unsigned
short
int
word
;
typedef
unsigned
short
int
word
;
...
@@ -88,6 +81,10 @@ typedef struct
...
@@ -88,6 +81,10 @@ typedef struct
#include "id_sd.h"
#include "id_sd.h"
#include "id_us.h"
#include "id_us.h"
extern
byte
signon
;
#define introscn signon
void
Quit
(
char
*
error
);
// defined in user program
void
Quit
(
char
*
error
);
// defined in user program
#define MAXTICS 10
#define MAXTICS 10
...
...
src/vi_svga.c
View file @
97af6bcd
...
@@ -378,76 +378,11 @@ static char *ParmStrings[] = {"nojoys","nomouse",nil};
...
@@ -378,76 +378,11 @@ static char *ParmStrings[] = {"nojoys","nomouse",nil};
// Internal routines
// Internal routines
///////////////////////////////////////////////////////////////////////////
//
// INL_KeyService() - Handles a keyboard interrupt (key up/down)
//
///////////////////////////////////////////////////////////////////////////
static
void
INL_KeyService
(
void
)
{
static
boolean
special
;
byte
k
,
c
,
temp
;
int
i
;
/* k = inportb(0x60); // Get the scan code */
if
(
k
==
0xe0
)
// Special key prefix
special
=
true
;
else
if
(
k
==
0xe1
)
// Handle Pause key
Paused
=
true
;
else
{
if
(
k
&
0x80
)
// Break code
{
k
&=
0x7f
;
// DEBUG - handle special keys: ctl-alt-delete, print scrn
Keyboard
[
k
]
=
false
;
}
else
// Make code
{
LastCode
=
CurCode
;
CurCode
=
LastScan
=
k
;
Keyboard
[
k
]
=
true
;
if
(
special
)
c
=
SpecialNames
[
k
];
else
{
if
(
k
==
sc_CapsLock
)
{
CapsLock
^=
true
;
}
if
(
Keyboard
[
sc_LShift
]
||
Keyboard
[
sc_RShift
])
// If shifted
{
c
=
ShiftNames
[
k
];
if
((
c
>=
'A'
)
&&
(
c
<=
'Z'
)
&&
CapsLock
)
c
+=
'a'
-
'A'
;
}
else
{
c
=
ASCIINames
[
k
];
if
((
c
>=
'a'
)
&&
(
c
<=
'z'
)
&&
CapsLock
)
c
-=
'a'
-
'A'
;
}
}
if
(
c
)
LastASCII
=
c
;
}
special
=
false
;
}
}
void
keyboard_handler
(
int
code
,
int
press
)
void
keyboard_handler
(
int
code
,
int
press
)
{
{
static
boolean
special
;
static
boolean
special
;
byte
k
,
c
,
temp
;
byte
k
,
c
;
int
i
;
/* k = inportb(0x60); // Get the scan code */
k
=
code
;
k
=
code
;
if
(
k
==
0xe0
)
// Special key prefix
if
(
k
==
0xe0
)
// Special key prefix
...
...
src/vi_xlib.c
View file @
97af6bcd
...
@@ -134,7 +134,7 @@ void VL_Startup()
...
@@ -134,7 +134,7 @@ void VL_Startup()
if
(
gfxbuf
==
NULL
)
if
(
gfxbuf
==
NULL
)
gfxbuf
=
malloc
(
320
*
200
*
1
);
gfxbuf
=
malloc
(
320
*
200
*
1
);
img
=
XCreateImage
(
dpy
,
vi
->
visual
,
8
,
ZPixmap
,
0
,
gfxbuf
,
320
,
200
,
img
=
XCreateImage
(
dpy
,
vi
->
visual
,
8
,
ZPixmap
,
0
,
(
char
*
)
gfxbuf
,
320
,
200
,
8
,
320
);
8
,
320
);
XMapWindow
(
dpy
,
win
);
XMapWindow
(
dpy
,
win
);
...
@@ -275,8 +275,8 @@ void VL_SetPalette(byte *palette)
...
@@ -275,8 +275,8 @@ void VL_SetPalette(byte *palette)
*/
*/
void
VL_GetPalette
(
byte
*
palette
)
void
VL_GetPalette
(
byte
*
palette
)
{
{
int
i
,
r
,
g
,
b
;
int
i
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
{
palette
[
i
*
3
+
0
]
=
clr
[
i
].
red
>>
10
;
palette
[
i
*
3
+
0
]
=
clr
[
i
].
red
>>
10
;
...
@@ -540,8 +540,7 @@ int XKeysymToScancode(unsigned int keysym)
...
@@ -540,8 +540,7 @@ int XKeysymToScancode(unsigned int keysym)
void
keyboard_handler
(
int
code
,
int
press
)
void
keyboard_handler
(
int
code
,
int
press
)
{
{
static
boolean
special
;
static
boolean
special
;
byte
k
,
c
,
temp
;
byte
k
,
c
;
int
i
;
k
=
code
;
k
=
code
;
...
...
src/wl_def.h
View file @
97af6bcd
...
@@ -414,7 +414,7 @@ enum {
...
@@ -414,7 +414,7 @@ enum {
SPR_MACHINEGUNATK4
,
SPR_MACHINEGUNATK4
,
SPR_CHAINREADY
,
SPR_CHAINATK1
,
SPR_CHAINATK2
,
SPR_CHAINATK3
,
SPR_CHAINREADY
,
SPR_CHAINATK1
,
SPR_CHAINATK2
,
SPR_CHAINATK3
,
SPR_CHAINATK4
,
SPR_CHAINATK4
};
};
...
@@ -868,6 +868,7 @@ void LevelCompleted (void);
...
@@ -868,6 +868,7 @@ void LevelCompleted (void);
void
CheckHighScore
(
long
score
,
word
other
);
void
CheckHighScore
(
long
score
,
word
other
);
void
Victory
(
void
);
void
Victory
(
void
);
void
ClearSplitVWB
(
void
);
void
ClearSplitVWB
(
void
);
void
PG13
();
/*
/*
=============================================================================
=============================================================================
...
...
src/wl_draw.c
View file @
97af6bcd
...
@@ -945,7 +945,7 @@ void HitVertWall (void)
...
@@ -945,7 +945,7 @@ void HitVertWall (void)
{
{
int
wallpic
;
int
wallpic
;
unsigned
texture
;
unsigned
texture
;
char
*
wall
;
byte
*
wall
;
#ifdef DEBUGx
#ifdef DEBUGx
printf
(
"HitVertWall: xtile = %d, TILE(yintercept) = %d
\n
"
,
printf
(
"HitVertWall: xtile = %d, TILE(yintercept) = %d
\n
"
,
...
@@ -981,7 +981,7 @@ void HitHorizWall (void)
...
@@ -981,7 +981,7 @@ void HitHorizWall (void)
{
{
int
wallpic
;
int
wallpic
;
unsigned
texture
;
unsigned
texture
;
char
*
wall
;
byte
*
wall
;
#ifdef DEBUGx
#ifdef DEBUGx
printf
(
"HitHorizWall: ytile = %d, TILE(xintercept) = %d
\n
"
,
printf
(
"HitHorizWall: ytile = %d, TILE(xintercept) = %d
\n
"
,
...
...
src/wl_main.c
View file @
97af6bcd
...
@@ -272,7 +272,7 @@ long DoChecksum(byte *source,unsigned size,long checksum)
...
@@ -272,7 +272,7 @@ long DoChecksum(byte *source,unsigned size,long checksum)
boolean
SaveTheGame
(
int
file
,
int
x
,
int
y
)
boolean
SaveTheGame
(
int
file
,
int
x
,
int
y
)
{
{
long
avail
,
size
,
checksum
;
long
checksum
;
objtype
*
ob
,
nullobj
;
objtype
*
ob
,
nullobj
;
checksum
=
0
;
checksum
=
0
;
...
@@ -358,8 +358,7 @@ boolean SaveTheGame(int file,int x,int y)
...
@@ -358,8 +358,7 @@ boolean SaveTheGame(int file,int x,int y)
boolean
LoadTheGame
(
int
file
,
int
x
,
int
y
)
boolean
LoadTheGame
(
int
file
,
int
x
,
int
y
)
{
{
long
checksum
,
oldchecksum
;
long
checksum
,
oldchecksum
;
objtype
*
ob
,
nullobj
;
objtype
nullobj
;
checksum
=
0
;
checksum
=
0
;
...
@@ -557,15 +556,12 @@ void BuildTables (void)
...
@@ -557,15 +556,12 @@ void BuildTables (void)
void
CalcProjection
(
long
focal
)
void
CalcProjection
(
long
focal
)
{
{
int
i
;
int
i
;
long
intang
;
long
intang
;
float
angle
;
float
angle
;
double
tang
;
double
tang
;
double
planedist
;
int
halfview
;
double
globinhalf
;
double
facedist
;
int
halfview
;
double
halfangle
,
facedist
;
focallength
=
focal
;
focallength
=
focal
;
facedist
=
focal
+
MINDIST
;
facedist
=
focal
+
MINDIST
;
...
@@ -1021,7 +1017,7 @@ void DoJukebox(void)
...
@@ -1021,7 +1017,7 @@ void DoJukebox(void)
void
InitGame
(
void
)
void
InitGame
(
void
)
{
{
int
i
,
x
,
y
;
int
i
;
MM_Startup
();
MM_Startup
();
VW_Startup
();
VW_Startup
();
...
@@ -1191,7 +1187,6 @@ void Quit(char *error)
...
@@ -1191,7 +1187,6 @@ void Quit(char *error)
void
DemoLoop
(
void
)
void
DemoLoop
(
void
)
{
{
static
int
LastDemo
;
int
i
;
int
i
;
//
//
// main game cycle
// main game cycle
...
@@ -1210,6 +1205,8 @@ void DemoLoop (void)
...
@@ -1210,6 +1205,8 @@ void DemoLoop (void)
if
(
i
&&
(
(
i
+
1
)
<
_argc
)
)
{
if
(
i
&&
(
(
i
+
1
)
<
_argc
)
)
{
i
++
;
i
++
;
for
(;
i
<
_argc
;
i
++
)
{
for
(;
i
<
_argc
;
i
++
)
{
if
(
_argv
[
i
][
0
]
==
'-'
)
break
;
IN_ClearKeysDown
();
IN_ClearKeysDown
();
if
(
PlayDemoFromFile
(
_argv
[
i
]))
if
(
PlayDemoFromFile
(
_argv
[
i
]))
IN_UserInput
(
3
*
70
);
IN_UserInput
(
3
*
70
);
...
@@ -1310,8 +1307,6 @@ void DemoLoop (void)
...
@@ -1310,8 +1307,6 @@ void DemoLoop (void)
int
WolfMain
(
int
argc
,
char
*
argv
[])
int
WolfMain
(
int
argc
,
char
*
argv
[])
{
{
int
i
;
_argc
=
argc
;
_argc
=
argc
;
_argv
=
argv
;
_argv
=
argv
;
...
...
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