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
5da70105
Commit
5da70105
authored
Jun 05, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Moved some code to the new function, DisplayScreen
parent
7b2ca892
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
122 deletions
+80
-122
GLDraw.c
macsrc/GLDraw.c
+14
-52
InterMis.c
macsrc/InterMis.c
+3
-7
Intro.c
macsrc/Intro.c
+9
-23
Main.c
macsrc/Main.c
+3
-10
README
macsrc/README
+7
-1
SoftDraw.c
macsrc/SoftDraw.c
+17
-1
TODO
macsrc/TODO
+20
-20
WolfIO.c
macsrc/WolfIO.c
+7
-8
No files found.
macsrc/GLDraw.c
View file @
5da70105
...
...
@@ -26,6 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h"
void
DisplayScreen
(
int
res
)
{
}
extern
Byte
Pal
[
768
];
void
FadeToPtr
(
unsigned
char
*
PalPtr
)
...
...
@@ -399,46 +403,6 @@ void DrawSprite(thing_t *t)
glPopMatrix
();
}
#if 0
void DrawSprites(void)
{
Word i;
static_t *stat;
actor_t *actor;
missile_t *MissilePtr;
if (numstatics) {
i = numstatics;
stat = statics;
do {
if (areavis[stat->areanumber])
DrawSprite((thing_t *)stat);
++stat;
} while (--i);
}
if (numactors > 1) {
i = 1;
actor = &actors[1];
do {
if (areavis[actor->areanumber])
DrawSprite((thing_t *)actor);
++actor;
} while (++i<numactors);
}
if (nummissiles) {
i = nummissiles;
MissilePtr = missiles;
do {
if (areavis[MissilePtr->areanumber])
DrawSprite((thing_t *)MissilePtr);
++MissilePtr;
} while (--i);
}
}
#endif
void
DrawTopSprite
()
{
GLfloat
z
=
-
128
.
0
/
(
GLfloat
)
topspritescale
;
...
...
@@ -458,18 +422,6 @@ void DrawTopSprite()
glPopMatrix
();
}
int
WallSeen
=
0
;
void
WallIsSeen
(
saveseg_t
*
seg
)
{
/* mark the segment as visible for auto map*/
seg
->
dir
|=
DIR_SEENFLAG
;
/* for automap*/
areavis
[
seg
->
area
]
=
1
;
/* for sprite drawing*/
WallSeen
=
1
;
}
Word
*
src1
,
*
src2
,
*
dest
;
/* Used by the sort */
/**********************************
...
...
@@ -722,6 +674,16 @@ void DrawSprites(void)
}
}
static
int
WallSeen
=
0
;
void
WallIsSeen
(
saveseg_t
*
seg
)
{
seg
->
dir
|=
DIR_SEENFLAG
;
/* for automap*/
areavis
[
seg
->
area
]
=
1
;
/* for sprite drawing*/
WallSeen
=
1
;
}
/*
===============================================================================
=
...
...
macsrc/InterMis.c
View file @
5da70105
...
...
@@ -243,13 +243,9 @@ void LevelCompleted (void)
IntermissionHack
=
TRUE
;
/* Hack to keep score from drawing twice */
NumberIndex
=
47
;
/* Hack to draw score using an alternate number set */
NewGameWindow
(
1
);
/* Force 512 mode screen */
PackPtr
=
LoadAResource
(
rIntermission
);
PackLength
=
lMSB
(
PackPtr
[
0
]);
ShapePtr
=
(
Byte
*
)
AllocSomeMem
(
PackLength
);
DLZSS
(
ShapePtr
,(
Byte
*
)
&
PackPtr
[
1
],
PackLength
);
DrawShape
(
0
,
0
,
ShapePtr
);
FreeSomeMem
(
ShapePtr
);
ReleaseAResource
(
rIntermission
);
DisplayScreen
(
rIntermission
);
PackPtr
=
LoadAResource
(
rInterPics
);
PackLength
=
lMSB
(
PackPtr
[
0
]);
BJPtr
=
(
Byte
*
)
AllocSomeMem
(
PackLength
);
...
...
macsrc/Intro.c
View file @
5da70105
...
...
@@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h"
#include <ctype.h>
#include <stdlib.h>
/**********************************
...
...
@@ -28,40 +27,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**********************************/
void
Intro
(
void
)
{
LongWord
*
PackPtr
;
LongWord
PackLength
;
Byte
*
ShapePtr
;
{
NewGameWindow
(
1
);
/* Set to 512 mode */
FadeToBlack
();
/* Fade out the video */
PackPtr
=
LoadAResource
(
rMacPlayPic
);
PackLength
=
lMSB
(
PackPtr
[
0
]);
ShapePtr
=
AllocSomeMem
(
PackLength
);
DLZSS
(
ShapePtr
,(
Byte
*
)
&
PackPtr
[
1
],
PackLength
);
DrawShape
(
0
,
0
,
ShapePtr
);
FreeSomeMem
(
ShapePtr
);
ReleaseAResource
(
rMacPlayPic
);
DisplayScreen
(
rMacPlayPic
);
BlastScreen
();
StartSong
(
SongListPtr
[
0
]);
/* Play the song */
FadeTo
(
rMacPlayPal
);
/* Fade in the picture */
FadeTo
(
rMacPlayPal
);
/* Fade in the picture */
WaitTicksEvent
(
240
);
/* Wait for event */
FadeTo
(
rIdLogoPal
);
if
(
toupper
(
WaitTicksEvent
(
240
))
==
'B'
)
{
/* Wait for event */
if
(
toupper
(
WaitTicksEvent
(
240
))
==
'B'
)
{
/* Wait for event */
FadeToBlack
();
ClearTheScreen
(
BLACK
);
BlastScreen
();
PackPtr
=
LoadAResource
(
rYummyPic
);
PackLength
=
lMSB
(
PackPtr
[
0
]);
ShapePtr
=
AllocSomeMem
(
PackLength
);
DLZSS
(
ShapePtr
,(
Byte
*
)
&
PackPtr
[
1
],
PackLength
);
DrawShape
((
SCREENWIDTH
-
320
)
/
2
,(
SCREENHEIGHT
-
200
)
/
2
,
ShapePtr
);
FreeSomeMem
(
ShapePtr
);
ReleaseAResource
(
rYummyPic
);
DisplayScreen
(
rYummyPic
);
BlastScreen
();
FadeTo
(
rYummyPal
);
WaitTicksEvent
(
600
);
}
}
macsrc/Main.c
View file @
5da70105
...
...
@@ -132,21 +132,14 @@ void StartGame(void)
Boolean
TitleScreen
()
{
Word
RetVal
;
/* Value to return */
LongWord
PackLen
;
LongWord
*
PackPtr
;
Byte
*
ShapePtr
;
playstate
=
EX_LIMBO
;
/* Game is not in progress */
NewGameWindow
(
1
);
/* Set to 512 mode */
FadeToBlack
();
/* Fade out the video */
PackPtr
=
LoadAResource
(
rTitlePic
);
PackLen
=
lMSB
(
PackPtr
[
0
]);
ShapePtr
=
(
Byte
*
)
AllocSomeMem
(
PackLen
);
DLZSS
(
ShapePtr
,
(
Byte
*
)
&
PackPtr
[
1
],
PackLen
);
DrawShape
(
0
,
0
,
ShapePtr
);
ReleaseAResource
(
rTitlePic
);
FreeSomeMem
(
ShapePtr
);
DisplayScreen
(
rTitlePic
);
BlastScreen
();
StartSong
(
SongListPtr
[
0
]);
FadeTo
(
rTitlePal
);
/* Fade in the picture */
BlastScreen
();
...
...
macsrc/README
View file @
5da70105
The README has not been written yet.
Contents:
* About (General)
* How to Compile
* How to Use
* About (More Specific, document how this source is different than original)
* License
* Contact
File Organization:
Some functions were moved to different files to account for functions which
...
...
macsrc/SoftDraw.c
View file @
5da70105
...
...
@@ -19,6 +19,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h"
void
DisplayScreen
(
int
res
)
{
LongWord
*
PackPtr
;
LongWord
PackLength
;
unsigned
short
*
ShapePtr
;
PackPtr
=
LoadAResource
(
res
);
PackLength
=
lMSB
(
PackPtr
[
0
]);
ShapePtr
=
(
unsigned
short
*
)
AllocSomeMem
(
PackLength
);
DLZSS
((
Byte
*
)
ShapePtr
,
(
Byte
*
)
&
PackPtr
[
1
],
PackLength
);
DrawShape
((
VidWidth
-
sMSB
(
ShapePtr
[
0
]))
/
2
,
(
VidHeight
-
sMSB
(
ShapePtr
[
1
]))
/
2
,
(
Byte
*
)
ShapePtr
);
FreeSomeMem
(
ShapePtr
);
ReleaseAResource
(
res
);
}
/**********************************
Load and set a palette from a pointer
...
...
@@ -164,7 +180,7 @@ typedef struct {
void
IO_ScaleMaskedColumn
(
Word
x
,
Word
scale
,
unsigned
short
*
CharPtr
,
Word
column
)
{
Byte
*
CharPtr2
;
Byte
*
CharPtr2
;
int
Y1
,
Y2
;
Byte
*
Screenad
;
SpriteRun
*
RunPtr
;
...
...
macsrc/TODO
View file @
5da70105
TODO:
* Correct copyrights
- vi_ are mostly mine, with portions based on the original code
- move stuff out of stub.c to more proper places
- vi_ are mostly mine, with portions based on the original code
- move stuff out of stub.c to more proper places
* Pause key
* SVGAlib Hack:
- Require 320x200x256
- If user requests a gamemode which SVGAlib says it does not support, fail
- If SVGAlib does not support 512x384x256, allow the user to pan around
with the keypad arrow keys if only mode supported 320x200x256 (center if
640x400 or 480 is supported?)
- Require 320x200x256
- If user requests a gamemode which SVGAlib says it does not support, fail
- If SVGAlib does not support 512x384x256, allow the user to pan around
with the keypad arrow keys if only mode supported 320x200x256 (center if
640x400 or 480 is supported?)
* Finish moving all 2D code to SoftDraw.c
* Compile with -Wall -ansi -pedantic (there shouldn't be much in the way)
* Finish OpenGL
- Check if top sprite drawing is correct
- Status bars
- Draw(XM)Shape
- Correct viewing frustum
- Check if top sprite drawing is correct
+ Status bars, Introscreens, etc. [Draw(XM)Shape]
- Not sure exactly yet how I will implement this.
- Correct viewing frustum
* Save/Load Games
* Documentation
* Sound!
- Waiting for information about music.
- Waiting for information about music.
* Command line (temporary workaround for no menus).
BUGS:
* Software Drawing seems like its imprecise, stationary sprites move back and
forth, and walls 'swim' when you move around, or sprites pop into different
sizes when are far enough and get closer/farther away
- Possibly caused by 8.8 imprecision?
- Possibly caused by 8.8 imprecision?
* Floors are drawn with wrong color in GL version?
IDEAS:
* Menu Keys
- ESC: Quit
- F1: Help
- XXX: Load Game
- XXX: Load Previously Loaded Game
- XXX: Save Game
- XXX: Save Game to Previously used File
- XXX: Options
- ESC: Quit
- F1: Help
- XXX: Load Game
- XXX: Load Previously Loaded Game
- XXX: Save Game
- XXX: Save Game to Previously used File
- XXX: Options
* How about adding red/white shifts (from PC wolf3d)? So screen changes
color when you are hit or pick up items.
* when saving/loading games, run them through htons/etc.
...
...
macsrc/WolfIO.c
View file @
5da70105
...
...
@@ -118,7 +118,7 @@ void IO_DrawFloor(Word floor)
void
IO_DrawScore
(
LongWord
score
)
{
if
(
!
IntermissionHack
)
{
/* Don't draw during intermission! */
if
(
!
IntermissionHack
)
{
/* Don't draw during intermission! */
SetNumber
(
score
,
ScaleX
(
56
),
ScaleY
(
176
),
7
);
}
}
...
...
@@ -130,14 +130,13 @@ void IO_DrawScore(LongWord score)
**********************************/
void
IO_DrawLives
(
Word
lives
)
{
if
(
!
IntermissionHack
)
{
/* Don't draw during intermission! */
--
lives
;
/* Adjust for zero start value */
if
(
lives
>
9
)
{
lives
=
9
;
/* Failsafe */
{
if
(
!
IntermissionHack
)
{
/* Don't draw during intermission! */
--
lives
;
/* Adjust for zero start value */
if
(
lives
>
9
)
{
lives
=
9
;
/* Failsafe */
}
SetNumber
(
lives
,
ScaleX
(
188
),
ScaleY
(
176
),
1
);
/* Draw the lives count */
SetNumber
(
lives
,
ScaleX
(
188
),
ScaleY
(
176
),
1
);
/* Draw the lives count */
}
}
...
...
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