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.
#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;
}
/*
===============================================================================
=
......
......@@ -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);
......
......@@ -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);
}
}
......@@ -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();
......
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
......
......@@ -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;
......
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.
......
......@@ -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 */
}
}
......
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