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
a60d3dd1
Commit
a60d3dd1
authored
Dec 31, 2006
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
miscellaneous changes that have been sitting around for a while.
parent
bb4a737b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
22 deletions
+32
-22
Makefile
macsrc/Makefile
+10
-11
res.c
macsrc/res.c
+22
-10
wolfdef.h
macsrc/wolfdef.h
+0
-1
No files found.
macsrc/Makefile
View file @
a60d3dd1
CC
=
gcc
#CC = gcc-3.0
#CFLAGS = -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
#CFLAGS = -g -Wall -O6 -fomit-frame-pointer -ffast-math -funroll-loops -mpentiumpro -mcpu=pentiumpro -march=pentiumpro
CFLAGS
=
-g
-Wall
-ansi
-pedantic
CFLAGS
=
-g
-Wall
-ansi
-pedantic
-W
-O2
#CFLAGS = -Os -g
CFLAGS
+=
`
sdl-config
--cflags
`
CFLAGS
+=
$(
shell
sdl-config
--cflags
)
OBJS
=
Data.o Doors.o EnMove.o EnThink.o Intro.o Level.o
\
Missiles.o Sounds.o PlMove.o PlStuff.o PlThink.o PushWall.o
\
...
...
@@ -21,21 +20,21 @@ GLOBJS = $(OBJS) $(OGLOBJS) vi_glx.o
DOBJS
=
$(OBJS)
$(SOFTOBJS)
vi_sdl.o
LFLAGS
=
-lm
#LFLAGS = -lm /home/relnev/ElectricFence-2.1/libefence.a
#LFLAGS = -lm /home/relnev/ElectricFence-2.2.2/libefence.a -lpthread
SLFLAGS
=
$(LFLAGS)
-lvga
#XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga
XLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
GLFLAGS
=
$(LFLAGS)
`
gtk-config
--libs
`
# -L/usr/X11R6/lib -lX11 -lXi -lXext -lgdk -lgtk
GLLFLAGS
=
$(LFLAGS)
-L
/usr/
lib
-L
/usr/
X11R6/lib
-lX11
-lXext
-lGL
DLFLAGS
=
$(LFLAGS)
`
sdl-config
--libs
`
GLFLAGS
=
$(LFLAGS)
$(
shell
gtk-config
--libs
)
GLLFLAGS
=
$(LFLAGS)
-L
/usr/X11R6/lib
-lX11
-lXext
-lGL
DLFLAGS
=
$(LFLAGS)
$(
shell
sdl-config
--libs
)
NASM
=
nasm
.SUFFIXES
:
.asm
all
:
swolf3d xwolf3d gwolf3d glwolf3d sdlwolf3d
#all: swolf3d xwolf3d gwolf3d glwolf3d sdlwolf3d
all
:
xwolf3d
$(SOBJS)
:
Sounds.h Sprites.h States.h Wolf.h burger.h wolfdef.h
$(XOBJS)
:
Sounds.h Sprites.h States.h Wolf.h burger.h wolfdef.h
...
...
@@ -47,10 +46,10 @@ $(DOBJS): Sounds.h Sprites.h States.h Wolf.h burger.h wolfdef.h
$(NASM)
-f
elf
-o
$@
$<
vi_gtk.o
:
vi_gtk.c
$(CC)
-c
vi_gtk.c
$(CFLAGS)
`
gtk-config
--cflags
`
$(CC)
-c
vi_gtk.c
$(CFLAGS)
$(
shell
gtk-config
--cflags
)
gtkimagedb.o
:
gtkimagedb.c gtkimagedb.h
$(CC)
-c
gtkimagedb.c
$(CFLAGS)
`
gtk-config
--cflags
`
$(CC)
-c
gtkimagedb.c
$(CFLAGS)
$(
shell
gtk-config
--cflags
)
swolf3d
:
$(SOBJS)
$(CC)
-o
swolf3d
$(SOBJS)
$(SLFLAGS)
...
...
macsrc/res.c
View file @
a60d3dd1
...
...
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef
struct
ResItem_t
{
long
type
;
LongWord
type
;
Word
item
;
Byte
*
dat
;
...
...
@@ -69,7 +69,8 @@ static int16_t Read16M(FILE *fp)
int
InitResources
(
char
*
name
)
{
FILE
*
fp
;
ResItem
**
cur
=
&
lr
,
*
t
;
ResItem
**
cur
=
&
lr
;
ResItem
*
t
;
int
resfork
,
resmap
,
forklen
,
maplen
;
int
typelist
,
namelist
,
typecount
;
int
datalen
;
...
...
@@ -77,8 +78,9 @@ int InitResources(char *name)
fp
=
fopen
(
name
,
"rb"
);
if
(
fp
==
NULL
)
if
(
fp
==
NULL
)
{
return
-
1
;
}
resfork
=
Read32M
(
fp
);
resmap
=
Read32M
(
fp
);
...
...
@@ -104,6 +106,7 @@ int InitResources(char *name)
bak
=
ftell
(
fp
);
fseek
(
fp
,
resmap
+
typelist
+
off
,
SEEK_SET
);
for
(
x
=
0
;
x
<
count
;
x
++
)
{
int
id
;
...
...
@@ -166,8 +169,9 @@ void *LoadAResource2(Word RezNum, LongWord Type)
memcpy
(
c
->
buf
,
c
->
dat
,
c
->
size
);
}
if
(
c
->
buf
==
NULL
)
if
(
c
->
buf
==
NULL
)
{
Quit
(
"MALLOC FAILED?"
);
}
return
c
->
buf
;
}
...
...
@@ -192,18 +196,22 @@ void *FindResource(Word RezNum, LongWord Type)
}
else
{
/* DEBUG: we want a fresh copy... */
fprintf
(
stderr
,
"DEBUG: Item %ld/%d already loaded!
\n
"
,
Type
,
RezNum
);
/*
free(c->buf);
c->buf = malloc(c->size);
*/
memcpy
(
c
->
buf
,
c
->
dat
,
c
->
size
);
}
if
(
c
->
buf
==
NULL
)
if
(
c
->
buf
==
NULL
)
{
Quit
(
"MALLOC FAILED?"
);
}
return
c
->
buf
;
}
c
=
c
->
next
;
}
...
...
@@ -216,8 +224,10 @@ void ReleaseAResource2(Word RezNum, LongWord Type)
while
(
c
!=
NULL
)
{
if
(
(
c
->
type
==
Type
)
&&
(
c
->
item
==
RezNum
)
)
{
if
(
c
->
buf
)
if
(
c
->
buf
!=
NULL
)
{
free
(
c
->
buf
);
}
c
->
buf
=
NULL
;
return
;
}
...
...
@@ -240,12 +250,14 @@ void FreeResources()
while
(
c
)
{
ResItem
*
t
=
c
;
if
(
c
->
dat
)
if
(
c
->
dat
!=
NULL
)
{
free
(
c
->
dat
);
if
(
c
->
buf
)
}
if
(
c
->
buf
!=
NULL
)
{
free
(
c
->
buf
);
}
c
=
c
->
next
;
free
(
t
);
...
...
macsrc/wolfdef.h
View file @
a60d3dd1
...
...
@@ -756,7 +756,6 @@ extern void IO_AttackShape(Word shape);
extern
void
IO_DrawFace
(
Word
face
);
extern
void
IO_DrawStatusBar
(
void
);
extern
void
IO_ClearViewBuffer
(
void
);
extern
void
IO_ScaleWallColumn
(
Word
x
,
Word
scale
,
Word
tile
,
Word
column
);
extern
void
IO_DisplayViewBuffer
(
void
);
extern
void
IO_ScaleMaskedColumn
(
Word
x
,
Word
scale
,
unsigned
short
*
sprite
,
Word
column
);
...
...
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