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
095e8f06
Commit
095e8f06
authored
Dec 10, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Honestly, hell if I know...
parent
c71617f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
33 deletions
+115
-33
GLDraw.c
macsrc/GLDraw.c
+85
-4
Makefile
macsrc/Makefile
+1
-1
TODO
macsrc/TODO
+3
-4
vi_glx.c
macsrc/vi_glx.c
+1
-0
wolfdef.h
macsrc/wolfdef.h
+25
-24
No files found.
macsrc/GLDraw.c
View file @
095e8f06
...
...
@@ -196,17 +196,98 @@ void DrawPsyched(Word Index)
void
EndGetPsyched
()
{
}
static
Texture
BJPics
[
3
];
void
InitInterMisPic
()
{
LongWord
*
PackPtr
;
LongWord
PackLength
;
Byte
*
BJPtr
,
*
Pal
,
*
buf
,
*
tmp
;
LongWord
Indexs
[
3
];
ShortWord
*
Ptr
;
int
width
,
height
,
i
;
PackPtr
=
LoadAResource
(
rInterPics
);
PackLength
=
lMSB
(
PackPtr
[
0
]);
BJPtr
=
(
Byte
*
)
AllocSomeMem
(
PackLength
);
DLZSS
(
BJPtr
,
(
Byte
*
)
&
PackPtr
[
1
],
PackLength
);
ReleaseAResource
(
rInterPics
);
memcpy
(
Indexs
,
BJPtr
,
12
);
Indexs
[
0
]
=
lMSB
(
Indexs
[
0
]);
Indexs
[
1
]
=
lMSB
(
Indexs
[
1
]);
Indexs
[
2
]
=
lMSB
(
Indexs
[
2
]);
Pal
=
LoadAResource
(
rInterPal
);
tmp
=
malloc
(
256
*
256
*
3
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
glGenTextures
(
1
,
&
BJPics
[
i
].
t
);
Ptr
=
(
ShortWord
*
)
&
BJPtr
[
Indexs
[
i
]];
width
=
sMSB
(
Ptr
[
0
]);
height
=
sMSB
(
Ptr
[
1
]);
BJPics
[
i
].
w
=
width
;
BJPics
[
i
].
h
=
height
;
buf
=
Pal256toRGB
((
Byte
*
)
&
Ptr
[
2
],
width
*
height
,
Pal
);
glBindTexture
(
GL_TEXTURE_2D
,
BJPics
[
i
].
t
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_REPEAT
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_REPEAT
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_MODULATE
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
256
,
256
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
tmp
);
glTexSubImage2D
(
GL_TEXTURE_2D
,
0
,
0
,
0
,
width
,
height
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
buf
);
free
(
buf
);
}
free
(
tmp
);
ReleaseAResource
(
rInterPal
);
FreeSomeMem
(
BJPtr
);
}
void
DrawInterMisPic
(
Word
index
)
{
GLfloat
r
[
4
]
=
{
-
1
+
(
73
.
0
/
256
.
0
),
1
.
0
-
(
48
.
0
/
192
.
0
),
-
1
+
(
204
.
0
/
256
.
0
),
1
-
(
190
.
0
/
192
.
0
)
};
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
glMatrixMode
(
GL_MODELVIEW
);
glLoadIdentity
();
glBindTexture
(
GL_TEXTURE_2D
,
BJPics
[
index
].
t
);
glBegin
(
GL_QUADS
);
glTexCoord2f
(
0
.
0
f
,
0
.
0
f
);
glVertex2f
(
r
[
0
],
r
[
1
]);
glTexCoord2f
(
0
.
0
f
,
(
GLfloat
)
BJPics
[
index
].
h
/
256
.
0
f
);
glVertex2f
(
r
[
0
],
r
[
3
]);
glTexCoord2f
(
0
.
0
f
,
(
GLfloat
)
BJPics
[
index
].
h
/
256
.
0
f
);
glTexCoord2f
((
GLfloat
)
BJPics
[
index
].
w
/
256
.
0
f
,
(
GLfloat
)
BJPics
[
index
].
h
/
256
.
0
f
);
glVertex2f
(
r
[
2
],
r
[
3
]);
glTexCoord2f
((
GLfloat
)
BJPics
[
index
].
w
/
256
.
0
f
,
0
.
0
f
);
glVertex2f
(
r
[
2
],
r
[
1
]);
glEnd
();
}
void
FreeInitMisPic
()
{
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
glDeleteTextures
(
1
,
&
BJPics
[
i
].
t
);
BJPics
[
i
].
t
=
0
;
}
}
void
DisplayScreen
(
Word
res
,
Word
pres
)
...
...
@@ -624,8 +705,8 @@ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
/* glColor3f(1.0, 1.0, 1.0); */
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
glRotatef
(
270
.
0
-
((
GLfloat
)
gamestate
.
viewangle
/
(
GLfloat
)
ANGLES
*
360
.
0
),
0
.
0
,
1
.
0
,
0
.
0
);
glTranslatef
((
GLfloat
)
actors
[
0
].
x
/
256
.
0
,
0
,
(
GLfloat
)
actors
[
0
].
y
/
256
.
0
);
glRotatef
(
270
.
0
f
-
((
GLfloat
)
gamestate
.
viewangle
/
(
GLfloat
)
ANGLES
*
360
.
0
f
),
0
.
0
,
1
.
0
,
0
.
0
);
glTranslatef
((
GLfloat
)
actors
[
0
].
x
/
256
.
0
f
,
0
.
0
f
,
(
GLfloat
)
actors
[
0
].
y
/
256
.
0
f
);
}
GLuint
waltex
[
64
];
...
...
@@ -1379,7 +1460,7 @@ void P_DrawSegx(saveseg_t *seg)
min
=
0
.
5
;
i
++
;
}
else
{
i
+=
2
;
i
+=
2
;
min
=
0
.
0
;
}
max
=
1
.
0
f
;
...
...
macsrc/Makefile
View file @
095e8f06
...
...
@@ -35,7 +35,7 @@ NASM = nasm
.SUFFIXES
:
.asm
all
:
swolf3d xwolf3d
xmwolf3d gwolf3d glwolf3d glxmwolf3d
all
:
swolf3d xwolf3d
glwolf3d
$(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
...
...
macsrc/TODO
View file @
095e8f06
...
...
@@ -13,7 +13,7 @@ TODO:
* Finish moving all 2D code to SoftDraw.c
- Should move some code so it is not such a large file (SoftDraw2.c)
* Finish OpenGL
+ Status bars, Level completed screen, Psyched
[DrawShape]
+ Status bars, Level completed screen, Psyched
- IO_Draw* (status bar versions) are stubbed, update statusbar when
doing screen update
- Finish window resizing
...
...
@@ -24,8 +24,6 @@ TODO:
- Save "draw state" so redrawing works right when screen is
resized/exposed
- GLX 1.3?
- As an experiement, see if adding CVAs to the wall code will speed
anything up?
* Documentation
* Sound!
- Need to write sound playing code (probably access /dev/dsp directly
...
...
@@ -33,7 +31,7 @@ TODO:
- Check 'csnd' for a sample, then 'snd ' if not found.
+ Music is planned.
- Output using timidity with sounds did not end up sounding good.
Probably the INST resources are used for A
SD
R/looping/etc...
Probably the INST resources are used for A
DS
R/looping/etc...
- csnd: sox -t raw -r 11025 -c 1 -w -s a.dat -r 11025 -c 1 -w -s -t wav a.wav
- snd: sox -t raw -r 11025 -c 1 -w -u a.dat -r 11025 -c 1 -w -s -t wav a.wav
- csnd might be -b -s (odd)
...
...
@@ -61,6 +59,7 @@ TODO:
* vi_glx.c will probably be the most updated of the frontends. Be sure to
update the others later.
* Finish moving things out of stub.c
* Name conflicts between wolf3d and Xt types
BUGS:
* Software Drawing seems like its imprecise, stationary sprites move back and
...
...
macsrc/vi_glx.c
View file @
095e8f06
...
...
@@ -198,6 +198,7 @@ int main(int argc, char *argv[])
#endif
glShadeModel
(
GL_FLAT
);
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
1
);
InitData
();
...
...
macsrc/wolfdef.h
View file @
095e8f06
...
...
@@ -341,30 +341,9 @@ typedef struct {
/**********************************
Static data for each sprite state
**********************************/
typedef
struct
{
Word
sightsound
;
/* Sound at the sight of you */
Word
deathsound
;
/* Sound at the death of the actor */
stateindex_t
sightstate
;
/* State when you are sighted */
stateindex_t
standstate
;
/* State when at rest */
stateindex_t
attackstate
;
/* State when attacking you */
stateindex_t
painstate
;
/* State when hit */
stateindex_t
deathstate
;
/* State when dead */
Word
points
;
/* Points for death */
Word
speed
;
/* Speed of actor */
Word
reactionmask
;
/* reaction time = 1 + w_rnd()&reactionmask*/
Word
hitpoints
;
/* Hit points */
}
classinfo_t
;
enum
{
di_north
,
di_east
,
di_south
,
di_west
};
/* BSP base directions */
/**********************************
The saved data structures are held in a single list, with segs being differentiated from
nodes by the presence of DIR_SEGFLAG in the dir field
The saved data structures are held in a single list, with segs being
differentiated from nodes by the presence of DIR_SEGFLAG in the dir
field.
Note... saveseg_t and savenode_t share the same memory
**********************************/
...
...
@@ -398,6 +377,28 @@ typedef struct {
}
PACKED
saveseg_t
;
#endif
/**********************************
Static data for each sprite state
**********************************/
typedef
struct
{
Word
sightsound
;
/* Sound at the sight of you */
Word
deathsound
;
/* Sound at the death of the actor */
stateindex_t
sightstate
;
/* State when you are sighted */
stateindex_t
standstate
;
/* State when at rest */
stateindex_t
attackstate
;
/* State when attacking you */
stateindex_t
painstate
;
/* State when hit */
stateindex_t
deathstate
;
/* State when dead */
Word
points
;
/* Points for death */
Word
speed
;
/* Speed of actor */
Word
reactionmask
;
/* reaction time = 1 + w_rnd()&reactionmask*/
Word
hitpoints
;
/* Hit points */
}
classinfo_t
;
enum
{
di_north
,
di_east
,
di_south
,
di_west
};
/* BSP base directions */
/**********************************
Static object struct
...
...
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