diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/avp/gamecmds.cpp | 1 | ||||
| -rw-r--r-- | src/avp/language.c | 4 | ||||
| -rw-r--r-- | src/avp/win95/frontend/avp_menus.h | 17 | ||||
| -rw-r--r-- | src/avp/win95/npcsetup.cpp | 9 | ||||
| -rw-r--r-- | src/main.c | 13 | ||||
| -rw-r--r-- | src/opengl.c | 11 |
6 files changed, 45 insertions, 10 deletions
diff --git a/src/avp/gamecmds.cpp b/src/avp/gamecmds.cpp index 53b4b96..9a71aaa 100644 --- a/src/avp/gamecmds.cpp +++ b/src/avp/gamecmds.cpp @@ -13,7 +13,6 @@ extern "C" { -#include "3dc.h" #include "module.h" #include "inline.h" diff --git a/src/avp/language.c b/src/avp/language.c index 45e611f..cd4fc0e 100644 --- a/src/avp/language.c +++ b/src/avp/language.c @@ -71,6 +71,9 @@ void InitTextStrings(void) for (i=1; i<MAX_NO_OF_TEXTSTRINGS; i++) { /* scan for a quote mark */ + if (*textPtr == 0) /* TODO: probably a broken hack (added for predator demo)... */ + break; + while (*textPtr++ != '"'); /* now pointing to a text string after quote mark*/ @@ -84,6 +87,7 @@ void InitTextStrings(void) /* change quote mark to zero terminator */ *textPtr = 0; + textPtr++; #if SupportWindows95 AddToTable( TextStringPtr[i] ); diff --git a/src/avp/win95/frontend/avp_menus.h b/src/avp/win95/frontend/avp_menus.h index 8d0cbf8..800747b 100644 --- a/src/avp/win95/frontend/avp_menus.h +++ b/src/avp/win95/frontend/avp_menus.h @@ -1,15 +1,20 @@ #ifndef _included_AvP_Menus_h_ #define _included_AvP_Menus_h_ +#ifndef MARINE_DEMO #define MARINE_DEMO 0 +#endif + +#ifndef PREDATOR_DEMO #define PREDATOR_DEMO 0 +#endif + +#ifndef ALIEN_DEMO #define ALIEN_DEMO 0 - // Edmond modified for Mplayer Demo - #ifdef MPLAYER_DEMO - #define DEATHMATCH_DEMO 1 - #else - #define DEATHMATCH_DEMO 0 // more multiplayer-only demo really - #endif +#endif + +#define DEATHMATCH_DEMO 0 // more multiplayer-only demo really + #ifdef AVP_DEBUG_VERSION #define CONSOLE_DEBUGGING_COMMANDS_ACTIVATED 1 diff --git a/src/avp/win95/npcsetup.cpp b/src/avp/win95/npcsetup.cpp index e1b8878..238ad1c 100644 --- a/src/avp/win95/npcsetup.cpp +++ b/src/avp/win95/npcsetup.cpp @@ -558,7 +558,9 @@ void InitNPCs(RIFFHANDLE h) } } } - #if 1 + +/* predator disk not included in demos */ +#if !(PREDATOR_DEMO||MARINE_DEMO||ALIEN_DEMO) if(AvP.PlayerType==I_Predator || Load_HNPC[HNPC_Predator]) { //need to load the disk hierarchy @@ -569,7 +571,10 @@ void InitNPCs(RIFFHANDLE h) } } +#endif +/* i believe this was added for the gold edition */ +#if !(PREDATOR_DEMO||MARINE_DEMO||ALIEN_DEMO)//||REGULAR_EDITION /* TODO */ if(AvP.PlayerType==I_Marine || Load_HNPC[HNPC_Marine]) { //need to load the mdisk hierarchy @@ -580,7 +585,7 @@ void InitNPCs(RIFFHANDLE h) } } - #endif +#endif // see what we already have, unloading what we don't need, and ensuring we don't load a npc twice @@ -573,7 +573,17 @@ int main(int argc, char *argv[]) } AvP.CurrentEnv = AvP.StartingEnv = 0; /* are these even used? */ - + +#if ALIEN_DEMO + AvP.PlayerType = I_Alien; + SetLevelToLoad(AVP_ENVIRONMENT_INVASION_A); +#elif PREDATOR_DEMO + AvP.PlayerType = I_Predator; + SetLevelToLoad(AVP_ENVIRONMENT_INVASION_P); +#elif MARINE_DEMO + AvP.PlayerType = I_Marine; + SetLevelToLoad(AVP_ENVIRONMENT_INVASION); +#else // AvP.PlayerType = I_Alien; // SetLevelToLoad(AVP_ENVIRONMENT_TEMPLE); /* starting alien level */ @@ -586,6 +596,7 @@ int main(int argc, char *argv[]) // SetLevelToLoad(AVP_ENVIRONMENT_LEADWORKS_MP); /* multiplayer */ // SetLevelToLoad(AVP_ENVIRONMENT_E3DEMOSP); /* demo level */ +#endif // while(AvP_MainMenus()) { diff --git a/src/opengl.c b/src/opengl.c index 3ea3293..8cc43de 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -1536,6 +1536,8 @@ void D3D_RenderHUDString(char *stringPtr,int x,int y,int colour) { struct VertexTag quadVertices[4]; +if (stringPtr == NULL) return; + quadVertices[0].Y = y-1; quadVertices[1].Y = y-1; quadVertices[2].Y = y + HUD_FONT_HEIGHT + 1; @@ -1581,6 +1583,7 @@ void D3D_RenderHUDString_Clipped(char *stringPtr,int x,int y,int colour) struct VertexTag quadVertices[4]; // LOCALASSERT(y<=0); +if (stringPtr == NULL) return; CheckFilteringModeIsCorrect(FILTERING_BILINEAR_OFF); @@ -1628,6 +1631,8 @@ void D3D_RenderHUDString_Centred(char *stringPtr, int centreX, int y, int colour int x, length = 0; char *ptr = stringPtr; struct VertexTag quadVertices[4]; + +if (stringPtr == NULL) return; while(*ptr) { @@ -1679,6 +1684,8 @@ void D3D_RenderHUDString_Centred(char *stringPtr, int centreX, int y, int colour void RenderString(char *stringPtr, int x, int y, int colour) { +if (stringPtr == NULL) return; + D3D_RenderHUDString(stringPtr,x,y,colour); } @@ -1686,6 +1693,8 @@ void RenderStringCentred(char *stringPtr, int centreX, int y, int colour) { int length = 0; char *ptr = stringPtr; + +if (stringPtr == NULL) return; while(*ptr) { @@ -1699,6 +1708,8 @@ void RenderStringVertically(char *stringPtr, int centreX, int bottomY, int colou struct VertexTag quadVertices[4]; int y = bottomY; +if (stringPtr == NULL) return; + quadVertices[0].X = centreX - (HUD_FONT_HEIGHT/2) - 1; quadVertices[1].X = quadVertices[0].X; quadVertices[2].X = quadVertices[0].X+2+HUD_FONT_HEIGHT*1; |
