Commit 5da70105 authored by Steven Fuller's avatar Steven Fuller

* Moved some code to the new function, DisplayScreen

parent 7b2ca892
...@@ -26,6 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -26,6 +26,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h" #include "wolfdef.h"
void DisplayScreen(int res)
{
}
extern Byte Pal[768]; extern Byte Pal[768];
void FadeToPtr(unsigned char *PalPtr) void FadeToPtr(unsigned char *PalPtr)
...@@ -399,46 +403,6 @@ void DrawSprite(thing_t *t) ...@@ -399,46 +403,6 @@ void DrawSprite(thing_t *t)
glPopMatrix(); 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() void DrawTopSprite()
{ {
GLfloat z = -128.0 / (GLfloat)topspritescale; GLfloat z = -128.0 / (GLfloat)topspritescale;
...@@ -458,18 +422,6 @@ void DrawTopSprite() ...@@ -458,18 +422,6 @@ void DrawTopSprite()
glPopMatrix(); 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 */ Word *src1,*src2,*dest; /* Used by the sort */
/********************************** /**********************************
...@@ -722,6 +674,16 @@ void DrawSprites(void) ...@@ -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;
}
/* /*
=============================================================================== ===============================================================================
= =
......
...@@ -243,13 +243,9 @@ void LevelCompleted (void) ...@@ -243,13 +243,9 @@ void LevelCompleted (void)
IntermissionHack = TRUE; /* Hack to keep score from drawing twice */ IntermissionHack = TRUE; /* Hack to keep score from drawing twice */
NumberIndex = 47; /* Hack to draw score using an alternate number set */ NumberIndex = 47; /* Hack to draw score using an alternate number set */
NewGameWindow(1); /* Force 512 mode screen */ NewGameWindow(1); /* Force 512 mode screen */
PackPtr = LoadAResource(rIntermission);
PackLength = lMSB(PackPtr[0]); DisplayScreen(rIntermission);
ShapePtr = (Byte *) AllocSomeMem(PackLength);
DLZSS(ShapePtr,(Byte *) &PackPtr[1],PackLength);
DrawShape(0,0,ShapePtr);
FreeSomeMem(ShapePtr);
ReleaseAResource(rIntermission);
PackPtr = LoadAResource(rInterPics); PackPtr = LoadAResource(rInterPics);
PackLength = lMSB(PackPtr[0]); PackLength = lMSB(PackPtr[0]);
BJPtr = (Byte *)AllocSomeMem(PackLength); BJPtr = (Byte *)AllocSomeMem(PackLength);
......
...@@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h" #include "wolfdef.h"
#include <ctype.h> #include <ctype.h>
#include <stdlib.h>
/********************************** /**********************************
...@@ -28,40 +27,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -28,40 +27,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**********************************/ **********************************/
void Intro(void) void Intro(void)
{ {
LongWord *PackPtr;
LongWord PackLength;
Byte *ShapePtr;
NewGameWindow(1); /* Set to 512 mode */ NewGameWindow(1); /* Set to 512 mode */
FadeToBlack(); /* Fade out the video */ 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(); BlastScreen();
StartSong(SongListPtr[0]); /* Play the song */ StartSong(SongListPtr[0]); /* Play the song */
FadeTo(rMacPlayPal); /* Fade in the picture */
FadeTo(rMacPlayPal); /* Fade in the picture */
WaitTicksEvent(240); /* Wait for event */ WaitTicksEvent(240); /* Wait for event */
FadeTo(rIdLogoPal); FadeTo(rIdLogoPal);
if (toupper(WaitTicksEvent(240))=='B') { /* Wait for event */
if (toupper(WaitTicksEvent(240))=='B') { /* Wait for event */
FadeToBlack(); FadeToBlack();
ClearTheScreen(BLACK); ClearTheScreen(BLACK);
BlastScreen(); DisplayScreen(rYummyPic);
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);
BlastScreen(); BlastScreen();
FadeTo(rYummyPal); FadeTo(rYummyPal);
WaitTicksEvent(600); WaitTicksEvent(600);
} }
} }
...@@ -132,21 +132,14 @@ void StartGame(void) ...@@ -132,21 +132,14 @@ void StartGame(void)
Boolean TitleScreen() Boolean TitleScreen()
{ {
Word RetVal; /* Value to return */ Word RetVal; /* Value to return */
LongWord PackLen;
LongWord *PackPtr;
Byte *ShapePtr;
playstate = EX_LIMBO; /* Game is not in progress */ playstate = EX_LIMBO; /* Game is not in progress */
NewGameWindow(1); /* Set to 512 mode */ NewGameWindow(1); /* Set to 512 mode */
FadeToBlack(); /* Fade out the video */ FadeToBlack(); /* Fade out the video */
PackPtr = LoadAResource(rTitlePic);
PackLen = lMSB(PackPtr[0]); DisplayScreen(rTitlePic);
ShapePtr = (Byte *)AllocSomeMem(PackLen);
DLZSS(ShapePtr, (Byte *)&PackPtr[1], PackLen);
DrawShape(0,0,ShapePtr);
ReleaseAResource(rTitlePic);
FreeSomeMem(ShapePtr);
BlastScreen(); BlastScreen();
StartSong(SongListPtr[0]); StartSong(SongListPtr[0]);
FadeTo(rTitlePal); /* Fade in the picture */ FadeTo(rTitlePal); /* Fade in the picture */
BlastScreen(); BlastScreen();
......
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: File Organization:
Some functions were moved to different files to account for functions which Some functions were moved to different files to account for functions which
......
...@@ -19,6 +19,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -19,6 +19,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h" #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 Load and set a palette from a pointer
...@@ -164,7 +180,7 @@ typedef struct { ...@@ -164,7 +180,7 @@ typedef struct {
void IO_ScaleMaskedColumn(Word x,Word scale, unsigned short *CharPtr,Word column) void IO_ScaleMaskedColumn(Word x,Word scale, unsigned short *CharPtr,Word column)
{ {
Byte * CharPtr2; Byte *CharPtr2;
int Y1,Y2; int Y1,Y2;
Byte *Screenad; Byte *Screenad;
SpriteRun *RunPtr; SpriteRun *RunPtr;
......
TODO: TODO:
* Correct copyrights * Correct copyrights
- vi_ are mostly mine, with portions based on the original code - vi_ are mostly mine, with portions based on the original code
- move stuff out of stub.c to more proper places - move stuff out of stub.c to more proper places
* Pause key * Pause key
* SVGAlib Hack: * SVGAlib Hack:
- Require 320x200x256 - Require 320x200x256
- If user requests a gamemode which SVGAlib says it does not support, fail - 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 - If SVGAlib does not support 512x384x256, allow the user to pan around
with the keypad arrow keys if only mode supported 320x200x256 (center if with the keypad arrow keys if only mode supported 320x200x256 (center if
640x400 or 480 is supported?) 640x400 or 480 is supported?)
* Finish moving all 2D code to SoftDraw.c * Finish moving all 2D code to SoftDraw.c
* Compile with -Wall -ansi -pedantic (there shouldn't be much in the way) * Compile with -Wall -ansi -pedantic (there shouldn't be much in the way)
* Finish OpenGL * Finish OpenGL
- Check if top sprite drawing is correct - Check if top sprite drawing is correct
- Status bars + Status bars, Introscreens, etc. [Draw(XM)Shape]
- Draw(XM)Shape - Not sure exactly yet how I will implement this.
- Correct viewing frustum - Correct viewing frustum
* Save/Load Games * Save/Load Games
* Documentation * Documentation
* Sound! * Sound!
- Waiting for information about music. - Waiting for information about music.
* Command line (temporary workaround for no menus). * Command line (temporary workaround for no menus).
BUGS: BUGS:
* Software Drawing seems like its imprecise, stationary sprites move back and * Software Drawing seems like its imprecise, stationary sprites move back and
forth, and walls 'swim' when you move around, or sprites pop into different forth, and walls 'swim' when you move around, or sprites pop into different
sizes when are far enough and get closer/farther away 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? * Floors are drawn with wrong color in GL version?
IDEAS: IDEAS:
* Menu Keys * Menu Keys
- ESC: Quit - ESC: Quit
- F1: Help - F1: Help
- XXX: Load Game - XXX: Load Game
- XXX: Load Previously Loaded Game - XXX: Load Previously Loaded Game
- XXX: Save Game - XXX: Save Game
- XXX: Save Game to Previously used File - XXX: Save Game to Previously used File
- XXX: Options - XXX: Options
* How about adding red/white shifts (from PC wolf3d)? So screen changes * How about adding red/white shifts (from PC wolf3d)? So screen changes
color when you are hit or pick up items. color when you are hit or pick up items.
* when saving/loading games, run them through htons/etc. * when saving/loading games, run them through htons/etc.
......
...@@ -118,7 +118,7 @@ void IO_DrawFloor(Word floor) ...@@ -118,7 +118,7 @@ void IO_DrawFloor(Word floor)
void IO_DrawScore(LongWord score) 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); SetNumber(score,ScaleX(56),ScaleY(176),7);
} }
} }
...@@ -130,14 +130,13 @@ void IO_DrawScore(LongWord score) ...@@ -130,14 +130,13 @@ void IO_DrawScore(LongWord score)
**********************************/ **********************************/
void IO_DrawLives(Word lives) void IO_DrawLives(Word lives)
{ {
if (!IntermissionHack) { /* Don't draw during intermission! */
if (!IntermissionHack) { /* Don't draw during intermission! */ --lives; /* Adjust for zero start value */
--lives; /* Adjust for zero start value */ if (lives > 9) {
if (lives > 9) { lives = 9; /* Failsafe */
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 */
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment