Commit 0f888293 authored by Steven Fuller's avatar Steven Fuller

* Added a NoEnemies debug-type hack

* Walls appear to be drawn correctly
* Moved some palette and floor clearing functions to specific draw files
* Sprites are shown -- just with wall textures.
parent 66b71f73
......@@ -40,12 +40,6 @@ void InitYTable(void)
} while (++i<480);
}
/**********************************
Palette Manager
**********************************/
/**********************************
Load and set a palette resource
......@@ -58,20 +52,6 @@ void SetAPalette(Word PalNum)
ReleaseAResource(PalNum); /* Release the resource */
}
/**********************************
Load and set a palette from a pointer
**********************************/
Byte CurrentPal[768];
void SetAPalettePtr(unsigned char *PalPtr)
{
memcpy(&CurrentPal, PalPtr, 768);
SetPalette(PalPtr);
}
/**********************************
Fade the screen to black
......@@ -82,7 +62,7 @@ void FadeToBlack(void)
{
unsigned char MyPal[768];
memset(MyPal,0,sizeof(MyPal)); /* Fill with black */
memset(MyPal, 0, sizeof(MyPal)); /* Fill with black */
MyPal[0] = MyPal[1] = MyPal[2] = 255;
FadeToPtr(MyPal);
}
......@@ -90,54 +70,15 @@ void FadeToBlack(void)
/**********************************
Fade the screen to a palette
**********************************/
void FadeTo(Word RezNum)
{
FadeToPtr(LoadAResource(RezNum));
ReleaseAResource(RezNum);
ReleaseAResource(RezNum);
}
/**********************************
Fade the palette
**********************************/
void FadeToPtr(unsigned char *PalPtr)
{
int DestPalette[768]; /* Dest offsets */
Byte WorkPalette[768]; /* Palette to draw */
Byte SrcPal[768];
Word Count;
Word i;
if (!memcmp(PalPtr,&CurrentPal,768)) { /* Same palette? */
return;
}
memcpy(SrcPal,CurrentPal,768);
i = 0;
do { /* Convert the source palette to ints */
DestPalette[i] = PalPtr[i];
} while (++i<768);
i = 0;
do {
DestPalette[i] -= SrcPal[i]; /* Convert to delta's */
} while (++i<768);
Count = 1;
do {
i = 0;
do {
WorkPalette[i] = ((DestPalette[i] * (int)(Count)) / 16) + SrcPal[i];
} while (++i<768);
SetAPalettePtr(WorkPalette);
WaitTicks(1);
} while (++Count<17);
}
/**********************************
Resource manager subsystem
......
......@@ -37,6 +37,7 @@ Word nummissiles; /* Number of active missiles */
missile_t missiles[MAXMISSILES]; /* Data for the missile items */
Word numactors; /* Number of active actors */
actor_t actors[MAXACTORS]; /* Data for the actors */
Word NoEnemies = 0; /* No Enemies Debug Mode */
unsigned char **GameShapes; /* Pointer to the game shape array */
Word difficulty; /* 0 = easy, 1= normal, 2=hard*/
gametype_t gamestate; /* Status of the game (Save game) */
......
This diff is collapsed.
......@@ -300,9 +300,11 @@ void LevelCompleted (void)
if (gamestate.treasurecount == gamestate.treasuretotal) {
k++; /* Perfect treasure */
}
RollRatio(RATIOX,RATIOY2,(gamestate.killcount*100)/gamestate.killtotal);
if (gamestate.killcount == gamestate.killtotal) {
k++; /* Perfect kills */
if (!NoEnemies) {
RollRatio(RATIOX,RATIOY2,(gamestate.killcount*100)/gamestate.killtotal);
if (gamestate.killcount == gamestate.killtotal) {
k++; /* Perfect kills */
}
}
RollRatio(RATIOX,RATIOY3,(gamestate.secretcount*100)/gamestate.secrettotal);
if (gamestate.secretcount == gamestate.secrettotal) {
......
......@@ -300,6 +300,9 @@ void SpawnStand(Word x,Word y,class_t which)
Word *TilePtr;
Word tile;
if (NoEnemies) /* DEBUG MODE */
return;
if (numactors >= MAXACTORS) {
fprintf("SpawnStand DEBUG (%d, %d)\n", numactors, MAXACTORS);
}
......@@ -347,6 +350,9 @@ void SpawnAmbush(Word x,Word y,class_t which)
{
actor_t *ActorPtr;
if (NoEnemies) /* DEBUG MODE */
return;
if (numactors >= MAXACTORS) {
fprintf("SpawnAmbush DEBUG (%d, %d)\n", numactors, MAXACTORS);
}
......
......@@ -453,10 +453,10 @@ void RenderView(void)
viewcos = costable[gamestate.viewangle]; /* Get the basic cosine */
memset(areavis, 0, sizeof(areavis)); /* No areas are visible */
IO_ClearViewBuffer(); /* Erase to ceiling / floor colors*/
StartRenderView(); /* Marker to let GL code know */
ClearClipSegs(); /* Clip first seg only to sides of screen */
IO_ClearViewBuffer(); /* Erase to ceiling / floor colors*/
ClearClipSegs(); /* Clip first seg only to sides of screen */
bspcoord[BSPTOP] = 0; /* The map is 64*64 */
bspcoord[BSPBOTTOM] = 64*FRACUNIT;
......
......@@ -19,6 +19,95 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h"
/**********************************
Load and set a palette from a pointer
**********************************/
Byte CurrentPal[768];
void SetAPalettePtr(unsigned char *PalPtr)
{
memcpy(&CurrentPal, PalPtr, 768);
SetPalette(PalPtr);
}
/**********************************
Fade the palette
**********************************/
void FadeToPtr(unsigned char *PalPtr)
{
int DestPalette[768]; /* Dest offsets */
Byte WorkPalette[768]; /* Palette to draw */
Byte SrcPal[768];
Word Count;
Word i;
if (!memcmp(PalPtr,&CurrentPal,768)) { /* Same palette? */
return;
}
memcpy(SrcPal,CurrentPal,768);
i = 0;
do { /* Convert the source palette to ints */
DestPalette[i] = PalPtr[i];
} while (++i<768);
i = 0;
do {
DestPalette[i] -= SrcPal[i]; /* Convert to delta's */
} while (++i<768);
Count = 1;
do {
i = 0;
do {
WorkPalette[i] = ((DestPalette[i] * (int)(Count)) / 16) + SrcPal[i];
} while (++i<768);
SetAPalettePtr(WorkPalette);
WaitTicks(1);
} while (++Count<17);
}
/**********************************
Erase the floor and ceiling
**********************************/
void IO_ClearViewBuffer(void)
{
unsigned char *Screenad;
Word Count,WCount;
LongWord *LScreenad;
LongWord Fill;
Screenad = VideoPointer;
Count = VIEWHEIGHT/2;
Fill = 0x2f2f2f2f;
do {
WCount = SCREENWIDTH/4;
LScreenad = (LongWord *) Screenad;
do {
*LScreenad++ = Fill; /* 004 */
} while (--WCount);
Screenad+=VideoWidth;
} while (--Count);
Count = VIEWHEIGHT/2;
Fill = 0x2A2A2A2A;
do {
WCount = SCREENWIDTH/4;
LScreenad = (LongWord *) Screenad;
do {
*LScreenad++ = Fill;
} while (--WCount);
Screenad+=VideoWidth;
} while (--Count);
}
void ScaledDraw(Byte *gfx, Word scale, Byte *vid, LongWord TheFrac, Word TheInt, Word Width, LongWord Delta)
{
LongWord OldDelta;
......
......@@ -223,42 +223,6 @@ void IO_DrawStatusBar(void)
DrawShape(ScaleX(0),ScaleY(160),GameShapes[46]);
}
/**********************************
Erase the floor and ceiling
**********************************/
void IO_ClearViewBuffer(void)
{
unsigned char *Screenad;
Word Count,WCount;
LongWord *LScreenad;
LongWord Fill;
Screenad = VideoPointer;
Count = VIEWHEIGHT/2;
Fill = 0x2f2f2f2f;
do {
WCount = SCREENWIDTH/4;
LScreenad = (LongWord *) Screenad;
do {
*LScreenad++ = Fill; /* 004 */
} while (--WCount);
Screenad+=VideoWidth;
} while (--Count);
Count = VIEWHEIGHT/2;
Fill = 0x2A2A2A2A;
do {
WCount = SCREENWIDTH/4;
LScreenad = (LongWord *) Screenad;
do {
*LScreenad++ = Fill;
} while (--WCount);
Screenad+=VideoWidth;
} while (--Count);
}
/**********************************
Copy the 3-D screen to display memory
......
......@@ -172,7 +172,9 @@ int main(int argc, char *argv[])
ClearTheScreen(BLACK);
BlastScreen();
NoEnemies = 1;
return WolfMain(argc, argv);
}
......@@ -255,6 +257,7 @@ Word NewGameWindow(Word NewVidSize)
sizehints.flags = PMinSize | PMaxSize | PBaseSize;
XSetWMNormalHints(dpy, win, &sizehints);
XResizeWindow(dpy, win, w, h);
XSync(dpy, False);
glViewport(0, 0, w, h);
gfxbuf = (Byte *)malloc(w * h);
......
......@@ -826,6 +826,7 @@ extern Word nummissiles; /* Number of active missiles */
extern missile_t missiles[MAXMISSILES]; /* Data for the missile items */
extern Word numactors; /* Number of active actors */
extern actor_t actors[MAXACTORS]; /* Data for the actors */
extern Word NoEnemies; /* No Enemies Debug Mode */
extern Byte **GameShapes; /* Pointer to the game shape array */
extern Word difficulty; /* 0 = easy, 1= normal, 2=hard*/
extern gametype_t gamestate; /* Status of the game (Save game) */
......
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