summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fuller <relnev@icculus.org>2002-01-09 23:07:34 +0000
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-20 02:22:37 +0200
commit08545b98c621ca2303108db79154046f360451eb (patch)
tree9ee7ddc53dcab94f35d962787b7ab7c2dd295041
parent6fc3502f4b14932dc607c6bafcdc2d0ada30ba94 (diff)
Cleanups (Tim Beckmann)
-rw-r--r--src/avp/avpview.h1
-rw-r--r--src/avp/bh_alien.h1
-rw-r--r--src/avp/bh_fhug.c4
-rw-r--r--src/avp/bh_marin.c1
-rw-r--r--src/avp/bh_weap.h1
-rw-r--r--src/avp/cheatmodes.c4
-rw-r--r--src/avp/cheatmodes.h10
-rw-r--r--src/avp/decal.c1
-rw-r--r--src/avp/decal.h1
-rw-r--r--src/avp/particle.c1
-rw-r--r--src/avp/particle.h3
-rw-r--r--src/avp/pfarlocs.c7
-rw-r--r--src/avp/player.c7
-rw-r--r--src/avp/player.h3
-rw-r--r--src/avp/pmove.c24
-rw-r--r--src/avp/pmove.h1
-rw-r--r--src/avp/psnd.c3
-rw-r--r--src/avp/psndproj.c7
-rw-r--r--src/avp/psndproj.h3
-rw-r--r--src/avp/pvisible.c17
-rw-r--r--src/avp/savegame.c2
-rw-r--r--src/avp/sfx.c2
-rw-r--r--src/avp/shapes/cube.c12
-rw-r--r--src/avp/stratdef.c1
-rw-r--r--src/avp/support/coordstr.cpp12
-rw-r--r--src/avp/support/rentrntq.cpp2
-rw-r--r--src/avp/support/scstring.cpp2
-rw-r--r--src/avp/targeting.h1
-rw-r--r--src/avp/triggers.c1
-rw-r--r--src/avp/weapons.c42
-rw-r--r--src/avp/weapons.h1
-rw-r--r--src/avp/win95/avpchunk.cpp6
-rw-r--r--src/avp/win95/d3d_hud.cpp8
-rw-r--r--src/avp/win95/ddplat.cpp8
-rw-r--r--src/avp/win95/endianio.c2
-rw-r--r--src/avp/win95/frontend/avp_menudata.c2
-rw-r--r--src/avp/win95/frontend/avp_menudata.h6
-rw-r--r--src/avp/win95/frontend/avp_menugfx.cpp2
-rw-r--r--src/avp/win95/frontend/avp_menugfx.hpp6
-rw-r--r--src/avp/win95/frontend/avp_menus.c17
-rw-r--r--src/avp/win95/frontend/avp_menus.h2
-rw-r--r--src/avp/win95/hud_data.h10
-rw-r--r--src/avp/win95/kzsort.c21
-rw-r--r--src/avp/win95/objsetup.cpp190
-rw-r--r--src/avp/win95/pldghost.c13
-rw-r--r--src/avp/win95/pldghost.h3
-rw-r--r--src/avp/win95/pldnet.c51
-rw-r--r--src/avp/win95/pldnet.h1
-rw-r--r--src/avp/win95/projload.cpp46
-rw-r--r--src/avp/win95/scrshot.cpp2
-rw-r--r--src/avp/win95/system.c12
-rw-r--r--src/avp/win95/vision.c3
-rw-r--r--src/cdplayer.h1
-rw-r--r--src/include/module.h1
-rw-r--r--src/kshape.h2
-rw-r--r--src/menus.c6
-rw-r--r--src/net.c1
-rw-r--r--src/net.h14
-rw-r--r--src/openal.c1
-rw-r--r--src/openal.h6
-rw-r--r--src/opengl.h4
-rw-r--r--src/win95/huffman.cpp8
62 files changed, 370 insertions, 263 deletions
diff --git a/src/avp/avpview.h b/src/avp/avpview.h
index 942a43e..220718b 100644
--- a/src/avp/avpview.h
+++ b/src/avp/avpview.h
@@ -5,6 +5,7 @@
void AvpShowViews(void);
void InitCameraValues(void);
void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr);
+void ReflectObject(DISPLAYBLOCK *dPtr);
extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr;
diff --git a/src/avp/bh_alien.h b/src/avp/bh_alien.h
index 9fed333..5a7d814 100644
--- a/src/avp/bh_alien.h
+++ b/src/avp/bh_alien.h
@@ -249,6 +249,7 @@
void Alien_GoToApproach(STRATEGYBLOCK *sbPtr);
void Alien_Awaken(STRATEGYBLOCK *sbPtr);
int AlienIsCrawling(STRATEGYBLOCK *sbPtr);
+ void DoAlienLimbLossSound(VECTORCH *position);
#ifdef __cplusplus
diff --git a/src/avp/bh_fhug.c b/src/avp/bh_fhug.c
index 1328b82..b371b61 100644
--- a/src/avp/bh_fhug.c
+++ b/src/avp/bh_fhug.c
@@ -53,7 +53,9 @@ static int HuggerShouldAttackPlayer(void);
static void SetHuggerAnimationSequence(STRATEGYBLOCK *sbPtr, HUGGER_SUBSEQUENCES seq, int length);
static void KillFaceHugger(STRATEGYBLOCK *sbPtr,DAMAGE_PROFILE *damage);
+#if 0
static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr);
+#endif
static void JumpAtPlayer(STRATEGYBLOCK *sbPtr);
extern SECTION *GetHierarchyFromLibrary(const char *rif_name);
@@ -932,6 +934,7 @@ static int HuggerShouldAttackPlayer(void)
return 1;
}
+#if 0
static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr)
{
struct collisionreport *nextReport;
@@ -948,6 +951,7 @@ static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr)
return 0;
}
+#endif
static void JumpAtPlayer(STRATEGYBLOCK *sbPtr)
{
diff --git a/src/avp/bh_marin.c b/src/avp/bh_marin.c
index 6d5fb3c..3ca31ce 100644
--- a/src/avp/bh_marin.c
+++ b/src/avp/bh_marin.c
@@ -80,7 +80,6 @@ extern enum PARTICLE_ID GetBloodType(STRATEGYBLOCK *sbPtr);
extern HIERARCHY_SHAPE_REPLACEMENT* GetHierarchyAlternateShapeSetFromLibrary(const char* rif_name,const char* shape_set_name);
extern HIERARCHY_VARIANT_DATA* GetHierarchyAlternateShapeSetCollectionFromLibrary(const char* rif_name,int collection_index);
extern SECTION * GetNamedHierarchyFromLibrary(const char * rif_name, const char * hier_name);
-extern STRATEGYBLOCK* CreateGrenadeKernel(AVP_BEHAVIOUR_TYPE behaviourID, VECTORCH *position, MATRIXCH *orient,int fromplayer);
extern STRATEGYBLOCK* CreateRocketKernel(VECTORCH *position, MATRIXCH *orient,int fromplayer);
extern STRATEGYBLOCK* CreateFrisbeeKernel(VECTORCH *position, MATRIXCH *orient, int fromplayer);
extern int AlienPCIsCurrentlyVisible(int checktime,STRATEGYBLOCK *sbPtr);
diff --git a/src/avp/bh_weap.h b/src/avp/bh_weap.h
index ace01a1..3d27e08 100644
--- a/src/avp/bh_weap.h
+++ b/src/avp/bh_weap.h
@@ -145,6 +145,7 @@ typedef struct SpearBehaviourType
#define PROX_GRENADE_SOUND_GENERATION_TIME 65536
#define PROX_GRENADE_LIFETIME (20)
+STRATEGYBLOCK* CreateGrenadeKernel(AVP_BEHAVIOUR_TYPE behaviourID, VECTORCH *position, MATRIXCH *orient,int fromplayer);
/* KJL 17:46:30 02/24/97 - below is some old stuff I'll leave for reference */
diff --git a/src/avp/cheatmodes.c b/src/avp/cheatmodes.c
index bf5fc20..5c5fd83 100644
--- a/src/avp/cheatmodes.c
+++ b/src/avp/cheatmodes.c
@@ -5,15 +5,13 @@
#include "avp_userprofile.h"
#include "avp_menus.h"
+#include "cheatmodes.h"
int CheatMode_Active=0;
int CheatMode_Species=0;
int CheatMode_Environment=0;
-extern void CheatMode_GetNextAllowedSpecies(int *speciesPtr, int searchForward);
-extern void CheatMode_GetNextAllowedEnvironment(int *environmentPtr, int searchForward);
-extern void CheatMode_CheckOptionsAreValid(void);
static int ThereIsAnAllowedEnvironment(void);
static int EnvironmentPlayableBySpecies(int environment);
diff --git a/src/avp/cheatmodes.h b/src/avp/cheatmodes.h
new file mode 100644
index 0000000..e092b1e
--- /dev/null
+++ b/src/avp/cheatmodes.h
@@ -0,0 +1,10 @@
+#ifndef CHEATMODES_H
+#define CHEATMODES_H
+
+int AnyCheatModesAllowed(void);
+void CheatMode_GetNextAllowedSpecies(int *speciesPtr, int searchForward);
+void CheatMode_GetNextAllowedEnvironment(int *environmentPtr, int searchForward);
+void CheatMode_GetNextAllowedMode(int *cheatModePtr, int searchForward);
+void CheatMode_CheckOptionsAreValid(void);
+
+#endif
diff --git a/src/avp/decal.c b/src/avp/decal.c
index 07f4678..ce91072 100644
--- a/src/avp/decal.c
+++ b/src/avp/decal.c
@@ -23,6 +23,7 @@
#include "paintball.h"
#include "detaillevels.h"
#include "savegame.h"
+#include "decal.h"
#define UseLocalAssert Yes
#include "ourasert.h"
diff --git a/src/avp/decal.h b/src/avp/decal.h
index c0d6a78..5652cbe 100644
--- a/src/avp/decal.h
+++ b/src/avp/decal.h
@@ -99,6 +99,7 @@ extern void HandleDecalSystem(void);
struct section_data; // hmodel.h
extern void AddDecalToHModel(VECTORCH *normalPtr, VECTORCH *positionPtr, struct section_data *sectionPtr);
+void ScanHModelForDecals(DISPLAYBLOCK *objectPtr, struct section_data *sectionDataPtr);
extern FIXED_DECAL* AllocateFixedDecal(void);
extern void RemoveFixedDecal(void);
diff --git a/src/avp/particle.c b/src/avp/particle.c
index 192a393..444fe7f 100644
--- a/src/avp/particle.c
+++ b/src/avp/particle.c
@@ -25,6 +25,7 @@
#include "bh_rubberduck.h"
#include "bh_weap.h"
#include "weapons.h"
+#include "decal.h"
#include "avpview.h"
#include "pldghost.h"
#include "detaillevels.h"
diff --git a/src/avp/particle.h b/src/avp/particle.h
index 85e3a80..5af50ee 100644
--- a/src/avp/particle.h
+++ b/src/avp/particle.h
@@ -200,6 +200,9 @@ void MakeGrenadeTrailParticles(VECTORCH *prevPositionPtr, VECTORCH *positionPtr)
void MakePlasmaTrailParticles(DYNAMICSBLOCK *dynPtr, int number);
void NewTrailPoint(DYNAMICSBLOCK *dynPtr);
void TimeScaleThingy();
+void DrawFrisbeePlasmaBolt(VECTORCH *positionPtr,VECTORCH *directionPtr);
+void DrawPredatorPlasmaBolt(VECTORCH *positionPtr,VECTORCH *directionPtr);
+void DrawSmallPredatorPlasmaBolt(VECTORCH *positionPtr,VECTORCH *directionPtr);
#define MAX_NO_OF_BLOOD_PARTICLES 500
diff --git a/src/avp/pfarlocs.c b/src/avp/pfarlocs.c
index 556ec1f..203c23c 100644
--- a/src/avp/pfarlocs.c
+++ b/src/avp/pfarlocs.c
@@ -605,6 +605,7 @@ typedef struct epbbextents
int minZ;
} EPBBEXTENTS;
+#if 0
static EPBBEXTENTS MI_Volume1;
static EPBBEXTENTS MI_Volume2;
static EPBBEXTENTS MI_Volume3;
@@ -612,6 +613,7 @@ static EPBBEXTENTS MI_Volume3;
static int GetModulesIntersection(MODULE *thisModule, MODULE *targetModule);
static int GetModulePointBox(MODULE *thisModule, EPBBEXTENTS *extents);
static void AddModuleEP(MODULE* thisModule, MODULE*fromModule, VECTORCH *posn);
+#endif
/*-----------------------Patrick 16/12/96---------------------------
This Function checks if a module has any adjacent modules, and if
@@ -943,6 +945,7 @@ static void BuildFM_ASingleEP(MODULE *thisModule, MODULE *targetModule)
Returns 1 if the bounding box is valis, 0 if not.
------------------------------------------------------------------*/
+#if 0
static int GetModulesIntersection(MODULE *thisModule, MODULE *targetModule)
{
int thisExtent, targetExtent;
@@ -1051,7 +1054,7 @@ static void AddModuleEP(MODULE* thisModule, MODULE*fromModule, VECTORCH *posn)
FARENTRYPOINTSHEADER *epHeader = &FALLP_EntryPoints[thisModule->m_index];
FARENTRYPOINT *epList = epHeader->entryPointsList;
- if(epHeader->numEntryPoints==(NumAdjacentModules(thisModule)))
+ if(epHeader->numEntryPoints==(NumAdjacentModules((AIMODULE*)thisModule)))
{
/* no room for any more eps. This may occur where two modules are not
mutually linked as adjacent... specifically, the target is missing the
@@ -1074,7 +1077,7 @@ static void AddModuleEP(MODULE* thisModule, MODULE*fromModule, VECTORCH *posn)
(epHeader->numEntryPoints)++;
}
-
+#endif
/*-----------------------Patrick 20/12/96---------------------------
LOCAL FUNCTIONS FOR AUXILARY MODULE LOCATION SUPPORT
diff --git a/src/avp/player.c b/src/avp/player.c
index d89476c..c134ee4 100644
--- a/src/avp/player.c
+++ b/src/avp/player.c
@@ -19,6 +19,9 @@ so player.c is looking a bit bare at the moment. */
#include "particle.h"
#include "scream.h"
#include "savegame.h"
+#include "game_statistics.h"
+#include "pfarlocs.h"
+#include "bh_ais.h"
#if SupportWindows95
#include "rebmenus.hpp"
#endif
@@ -112,7 +115,9 @@ void InitPlayer(STRATEGYBLOCK* sbPtr, int sb_type)
* and fills in some initial values. *
**************************************************************************************KJL*/
+#if 0
SECTION *root_section;
+#endif
PLAYER_STATUS *psPtr = &PlayerStatusBlock;
GLOBALASSERT(psPtr);
GLOBALASSERT(sbPtr);
@@ -1346,7 +1351,9 @@ void DeInitialisePlayer(void) {
/* I thought it would be logical to put it here... */
int slot = MAX_NO_OF_WEAPON_SLOTS;
+#if 0
PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr);
+#endif
do {
TXACTRLBLK *txactrl,*txactrl_next;
diff --git a/src/avp/player.h b/src/avp/player.h
index d46a942..b215394 100644
--- a/src/avp/player.h
+++ b/src/avp/player.h
@@ -2,5 +2,8 @@
#define PLAYER_H
void DeInitialisePlayer(void);
+void ChangeToMarine();
+void ChangeToAlien();
+void ChangeToPredator();
#endif
diff --git a/src/avp/pmove.c b/src/avp/pmove.c
index f0db3f1..d6092d0 100644
--- a/src/avp/pmove.c
+++ b/src/avp/pmove.c
@@ -37,6 +37,7 @@
#include "avp_menus.h"
#include "lighting.h"
#include "scream.h"
+#include "player.h"
#include "avp_userprofile.h"
@@ -104,9 +105,14 @@ unsigned char GotAnyKey;
#endif
static char FlyModeOn = 0;
+#if FLY_MODE_CHEAT_ON
static char FlyModeDebounced = 0;
+#endif
+#if 0
static char BonusAbilityDebounced = 0;
+static void MakePlayerLieDown(STRATEGYBLOCK* sbPtr);
+#endif
extern int deathFadeLevel;
extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr;
@@ -117,7 +123,6 @@ extern void DeInitialisePlayer(void);
/* some prototypes for this source file */
static void MakePlayerCrouch(STRATEGYBLOCK* sbPtr);
-static void MakePlayerLieDown(STRATEGYBLOCK* sbPtr);
static void MaintainPlayerShape(STRATEGYBLOCK* sbPtr);
static void NetPlayerDeadProcessing(STRATEGYBLOCK* sbPtr);
static void CorpseMovement(STRATEGYBLOCK *sbPtr);
@@ -125,7 +130,6 @@ static void CorpseMovement(STRATEGYBLOCK *sbPtr);
extern SECTION * GetNamedHierarchyFromLibrary(const char * rif_name, const char * hier_name);
extern void NewOnScreenMessage(unsigned char *messagePtr);
extern void RemoveAllThisPlayersDiscs(void);
-void NetPlayerRespawn(STRATEGYBLOCK *sbPtr);
int timeInContactWithFloor;
@@ -1173,8 +1177,6 @@ static void CorpseMovement(STRATEGYBLOCK *sbPtr)
------------------------------------------------------*/
static void NetPlayerDeadProcessing(STRATEGYBLOCK *sbPtr)
{
- SECTION *root_section;
-
#if SupportWindows95
PLAYER_STATUS *psPtr= (PLAYER_STATUS *) (sbPtr->SBdataptr);
@@ -1257,7 +1259,9 @@ extern void InitPlayerCloakingSystem(void);
void NetPlayerRespawn(STRATEGYBLOCK *sbPtr)
{
extern int LeanScale;
+#if 0
SECTION *root_section;
+#endif
#if SupportWindows95
PLAYER_STATUS *psPtr= (PLAYER_STATUS *) (sbPtr->SBdataptr);
@@ -1684,18 +1688,6 @@ static void LoadInMovementValues(void)
#endif
-
-
-
-
-
-
-
-
-
-
-
-
void ThrowAFlare(void)
{
extern int NumberOfFlaresActive;
diff --git a/src/avp/pmove.h b/src/avp/pmove.h
index a0637d7..4a77301 100644
--- a/src/avp/pmove.h
+++ b/src/avp/pmove.h
@@ -75,6 +75,7 @@ extern void PlayerBehaviour(STRATEGYBLOCK* sbptr);
extern void ExecuteFreeMovement(STRATEGYBLOCK* sbPtr);
void ThrowAFlare(void);
void StartPlayerTaunt(void);
+void NetPlayerRespawn(STRATEGYBLOCK *sbPtr);
#ifdef __cplusplus
diff --git a/src/avp/psnd.c b/src/avp/psnd.c
index 2553744..a28ca83 100644
--- a/src/avp/psnd.c
+++ b/src/avp/psnd.c
@@ -18,6 +18,9 @@
#include "db.h"
#include "showcmds.h"
#include "avp_userprofile.h"
+#include "cdplayer.h"
+#include "openal.h"
+
/* Patrick 5/6/97 -------------------------------------------------------------
Internal globals
----------------------------------------------------------------------------*/
diff --git a/src/avp/psndproj.c b/src/avp/psndproj.c
index eb78145..4f8e959 100644
--- a/src/avp/psndproj.c
+++ b/src/avp/psndproj.c
@@ -44,10 +44,12 @@
-----------------------------------------------------------------------------*/
int weaponHandle = SOUND_NOACTIVEINDEX;
+#if 0
static int weaponReloading = 0;
+static int backgroundHandle = SOUND_NOACTIVEINDEX;
+#endif
static int sadarReloadTimer = 0;
static int weaponPitchTimer = 0;
-static int backgroundHandle = SOUND_NOACTIVEINDEX;
static int playOneShotWS = 1;
static int oldRandomValue = -1;
@@ -76,6 +78,7 @@ extern ACTIVESOUNDSAMPLE ActiveSounds[];
A.N.Other background sound management function
------------------------------------------------------------------------------*/
+#if 0
static void DoPredatorBackgroundLoop(void)
{
if (backgroundHandle == SOUND_NOACTIVEINDEX)
@@ -83,7 +86,7 @@ static void DoPredatorBackgroundLoop(void)
Sound_Play(SID_VISION_LOOP,"evl",&backgroundHandle,75);
}
}
-
+#endif
void DoPlayerSounds(void)
diff --git a/src/avp/psndproj.h b/src/avp/psndproj.h
index cebc6a5..bc703fa 100644
--- a/src/avp/psndproj.h
+++ b/src/avp/psndproj.h
@@ -8,6 +8,8 @@
extern "C" {
#endif
+#include "equipmnt.h"
+
/* Andy 12/6/97 --------------------------------------------------------------
Some background sound defines
----------------------------------------------------------------------------*/
@@ -371,6 +373,7 @@ extern void MenuChangeSound(void);
extern void MenuSelectSound(void);
extern void MenuNotAvailableSound(int *handlePtr);
extern void MenuSliderBarSound(int *handlePtr);
+void PlayWeaponClickingNoise(enum WEAPON_ID weaponIDNumber);
/* Patrick 5/6/97 -------------------------------------------------------------
diff --git a/src/avp/pvisible.c b/src/avp/pvisible.c
index a800881..bcb4dd8 100644
--- a/src/avp/pvisible.c
+++ b/src/avp/pvisible.c
@@ -32,6 +32,11 @@
#include "bh_dummy.h"
#include "bh_videoscreen.h"
#include "bh_plift.h"
+#include "bh_light.h"
+#include "weapons.h"
+#include "bh_agun.h"
+#include "bh_corpse.h"
+#include "chnkload.h"
#if SupportWindows95
/* for win95 net game support */
@@ -73,8 +78,8 @@ MODULEMAPBLOCK VisibilityDefaultObjectMap =
{
MapType_Default,
I_ShapeCube, /* this is a default value */
- 0,0,0,
- 0,0,0,
+ {0,0,0},
+ {0,0,0},
#if StandardStrategyAndCollisions
ObFlag_Dynamic|ObFlag_NewtonMovement|ObFlag_MatMul,
#else
@@ -96,14 +101,16 @@ MODULEMAPBLOCK VisibilityDefaultObjectMap =
0,
0,0,0,
#endif
- 0,0,0,
+ {0,0,0},
0,
0,
#if StandardStrategyAndCollisions
0,
0,
#endif
- 0,0,0,
+ 0,
+ 0,
+ {0,0,0}
};
@@ -683,7 +690,7 @@ of reasons, eg: an object is blown out of the visible part of the
environment, or an npc falls out...
NB returns 0 if relocation failed.
--------------------------------------------------------------------*/
-static EmergRelocCalls = 0;
+static int EmergRelocCalls = 0;
static int EmergencyRelocateObject(STRATEGYBLOCK *sbPtr)
{
diff --git a/src/avp/savegame.c b/src/avp/savegame.c
index 0585e0f..8a53b88 100644
--- a/src/avp/savegame.c
+++ b/src/avp/savegame.c
@@ -29,6 +29,8 @@
#include "avp_menus.h"
#include "game_statistics.h"
#include "avp_userprofile.h"
+#include "huddefs.h"
+#include "avp_menus.h"
#include "savegame.h"
#include "huffman.hpp"
diff --git a/src/avp/sfx.c b/src/avp/sfx.c
index 722fbe0..cb5246c 100644
--- a/src/avp/sfx.c
+++ b/src/avp/sfx.c
@@ -284,7 +284,7 @@ void HandleObjectOnFire(DISPLAYBLOCK *dispPtr)
MakeParticle(&(position), &velocity, PARTICLE_FIRE);
}
- if (FastRandom()&65535 > 32768)
+ if ((FastRandom()&65535) > 32768)
{
MakeParticle(&(position), &velocity, PARTICLE_IMPACTSMOKE);
}
diff --git a/src/avp/shapes/cube.c b/src/avp/shapes/cube.c
index ab61f19..291ae99 100644
--- a/src/avp/shapes/cube.c
+++ b/src/avp/shapes/cube.c
@@ -69,12 +69,12 @@ SHAPEHEADER CUBE_header={
};
SHAPEINSTR CUBE_instructions[]={
- I_ShapePoints,8,&CUBE_points[0],
- I_ShapeNormals,6,&CUBE_normals[0],
- I_ShapeProject,8,&CUBE_points[0],
- I_ShapeVNormals,8,&CUBE_vnormals[0],
- I_ShapeItems,6,&CUBE_items[0],
- I_ShapeEnd,0,0
+ {I_ShapePoints,8,&CUBE_points[0]},
+ {I_ShapeNormals,6,&CUBE_normals[0]},
+ {I_ShapeProject,8,&CUBE_points[0]},
+ {I_ShapeVNormals,8,&CUBE_vnormals[0]},
+ {I_ShapeItems,6,&CUBE_items[0]},
+ {I_ShapeEnd,0,0}
};
int *CUBE_points[]={
diff --git a/src/avp/stratdef.c b/src/avp/stratdef.c
index 5cad5fe..e021abb 100644
--- a/src/avp/stratdef.c
+++ b/src/avp/stratdef.c
@@ -16,6 +16,7 @@
#include "bh_corpse.h"
#include "bh_debri.h"
#include "pldnet.h"
+#include "maths.h"
/*
this attaches runtime and precompiled object
strategyblocks
diff --git a/src/avp/support/coordstr.cpp b/src/avp/support/coordstr.cpp
index 909f416..66c6685 100644
--- a/src/avp/support/coordstr.cpp
+++ b/src/avp/support/coordstr.cpp
@@ -325,18 +325,6 @@ ACTIVITY_RETURN_TYPE CyclicPulsingCoordinate :: Activity(ACTIVITY_INPUT)
-
-
-
-
-
-
-
-
-
-
-
-
#if 1
HomingCoordinate::HomingCoordinate
(
diff --git a/src/avp/support/rentrntq.cpp b/src/avp/support/rentrntq.cpp
index ac71fdb..da0af28 100644
--- a/src/avp/support/rentrntq.cpp
+++ b/src/avp/support/rentrntq.cpp
@@ -121,7 +121,7 @@ void RE_ENTRANT_QUEUE_WinMain_FlushMessages(void)
// AVP/Win95-specific code
if ( HUDGadget :: GetHUD() )
{
- int i;
+ unsigned int i;
for (i=0;i<NumQMessages;i++)
{
diff --git a/src/avp/support/scstring.cpp b/src/avp/support/scstring.cpp
index 4d3c578..7e340de 100644
--- a/src/avp/support/scstring.cpp
+++ b/src/avp/support/scstring.cpp
@@ -535,7 +535,7 @@ SCString :: SCString
NumberOfCharacters = STRUTIL_SC_Strlen( pProjCh_Init );
// doesn't include NULL terminator
- if ( NumberOfCharacters > Length )
+ if ( (unsigned)NumberOfCharacters > Length )
{
NumberOfCharacters = Length;
}
diff --git a/src/avp/targeting.h b/src/avp/targeting.h
index 34ce929..75beac9 100644
--- a/src/avp/targeting.h
+++ b/src/avp/targeting.h
@@ -3,3 +3,4 @@
extern void GetTargetingPointOfObject(DISPLAYBLOCK *objectPtr, VECTORCH *targetPtr);
extern void GetTargetingPointOfObject_Far(STRATEGYBLOCK *sbPtr, VECTORCH *targetPtr);
extern void CalculatePlayersTarget(TEMPLATE_WEAPON_DATA *twPtr, PLAYER_WEAPON_DATA *weaponPtr);
+void SmartTarget_GetCofM(DISPLAYBLOCK *target,VECTORCH *viewSpaceOutput);
diff --git a/src/avp/triggers.c b/src/avp/triggers.c
index ff02eaf..df68ab9 100644
--- a/src/avp/triggers.c
+++ b/src/avp/triggers.c
@@ -12,6 +12,7 @@
#include "huddefs.h"
#include "triggers.h"
#include "pldnet.h"
+#include "los.h"
#define UseLocalAssert Yes
#include "ourasert.h"
diff --git a/src/avp/weapons.c b/src/avp/weapons.c
index c00c372..9773612 100644
--- a/src/avp/weapons.c
+++ b/src/avp/weapons.c
@@ -35,6 +35,8 @@
#include "bh_light.h"
#include "bh_corpse.h"
#include "bh_ais.h"
+#include "bh_videoscreen.h"
+#include "bh_track.h"
#include "weapons.h"
#include "avpview.h"
@@ -46,6 +48,7 @@
#include "psndproj.h"
#include "psndplat.h"
#include "showcmds.h"
+#include "projload.hpp"
/* for win 95 net support */
#if SupportWindows95
@@ -289,7 +292,6 @@ int FireEmptyMinigun(PLAYER_WEAPON_DATA *weaponPtr);
int Staff_Manager(DAMAGE_PROFILE *damage,SECTION_DATA *section1,SECTION_DATA *section2,SECTION_DATA *section3,
STRATEGYBLOCK *wielder);
-static void FireLineOfSightAmmo(enum AMMO_ID AmmoID, VECTORCH* sourcePtr, VECTORCH* directionPtr, int multiple);
static void PlayerFireLineOfSightAmmo(enum AMMO_ID AmmoID, int multiple);
extern void FireProjectileAmmo(enum AMMO_ID AmmoID);
@@ -328,8 +330,6 @@ void WeaponCreateStartFrame(void *playerStatus, PLAYER_WEAPON_DATA *weaponPtr);
int PC_Alien_Eat_Attack(int hits);
int FirePredatorDisc(PLAYER_WEAPON_DATA *weaponPtr,SECTION_DATA *disc_section);
-void SmartTarget_GetCofM(DISPLAYBLOCK *target,VECTORCH *viewSpaceOutput);
-
void BiteAttack_AwardHealth(STRATEGYBLOCK *sbPtr,AVP_BEHAVIOUR_TYPE pre_bite_type);
void LimbRip_AwardHealth(void);
void GrenadeLauncher_EmergencyChangeAmmo(PLAYER_WEAPON_DATA *weaponPtr);
@@ -1360,8 +1360,8 @@ static void WeaponStateIdle(PLAYER_STATUS *playerStatusPtr,PLAYER_WEAPON_DATA *w
}
}
} else if ((RequestChangeOfWeapon(playerStatusPtr,weaponPtr))
- ||((playerStatusPtr->SelectedWeaponSlot!=playerStatusPtr->SwapToWeaponSlot))
- &&(playerStatusPtr->SwapToWeaponSlot!=WEAPON_FINISHED_SWAPPING)) {
+ ||((playerStatusPtr->SelectedWeaponSlot!=playerStatusPtr->SwapToWeaponSlot)
+ &&(playerStatusPtr->SwapToWeaponSlot!=WEAPON_FINISHED_SWAPPING))) {
weaponPtr->CurrentState = WEAPONSTATE_UNREADYING;
weaponPtr->StateTimeOutCounter = WEAPONSTATE_INITIALTIMEOUTCOUNT;
NewOnScreenMessage
@@ -3358,7 +3358,7 @@ void FindEndOfShape(VECTORCH* endPositionPtr, int shapeIndex)
}
-
+#if 0
static void FireLineOfSightAmmo(enum AMMO_ID AmmoID, VECTORCH* sourcePtr, VECTORCH* directionPtr, int multiple)
{
#if 0
@@ -3396,7 +3396,7 @@ static void FireLineOfSightAmmo(enum AMMO_ID AmmoID, VECTORCH* sourcePtr, VECTOR
HandleWeaponImpact(&LOS_Point,LOS_ObjectHitPtr->ObStrategyBlock,AmmoID,directionPtr, multiple*ONE_FIXED, LOS_HModel_Section);
}
}
-
+#endif
static void CalculateTorque(EULER *rotationPtr, VECTORCH *directionPtr, STRATEGYBLOCK *sbPtr)
@@ -6325,7 +6325,6 @@ void PredPistol_Firing(void *playerStatus, PLAYER_WEAPON_DATA *weaponPtr) {
int PlayerFireFlameThrower(PLAYER_WEAPON_DATA *weaponPtr) {
- extern VECTORCH CentreOfMuzzleOffset;
VECTORCH *firingpos;
TEMPLATE_WEAPON_DATA *twPtr=&TemplateWeapon[weaponPtr->WeaponIDNumber];
@@ -6578,7 +6577,7 @@ DISPLAYBLOCK *CauseDamageToHModel(HMODELCONTROLLER *HMC_Ptr, STRATEGYBLOCK *sbPt
} else if ( ((this_section_data->sempai->flags&section_is_master_root)==0)
&&((this_section_data->sempai->flags&section_flag_never_frag)==0)
&&(((this_section_data->sempai->flags&section_sprays_acid)&&((this_section_data->sempai->flags&section_flag_fragonlyfordisks)==0))
- ||((this_section_data->sempai->StartingStats.Health<TotalKineticDamage(damage))&&(this_section_data->sempai->flags&section_flag_fragonlyfordisks==0))
+ ||((this_section_data->sempai->StartingStats.Health<TotalKineticDamage(damage))&&((this_section_data->sempai->flags&section_flag_fragonlyfordisks)==0))
||((damage->Slicing>2)&&(this_section_data->sempai->flags&section_flag_fragonlyfordisks))
||((damage->Slicing>0)&&((this_section_data->sempai->flags&section_flag_fragonlyfordisks)==0))
)
@@ -10540,7 +10539,6 @@ extern void AutoSwapToDisc_OutOfSequence(void) {
#define SPEAR_NPC_IMPULSE (20000)
-void CreateSpearPossiblyWithFragment(DISPLAYBLOCK *dispPtr, VECTORCH *spearPositionPtr, VECTORCH *spearDirectionPtr);
void HandleSpearImpact(VECTORCH *positionPtr, STRATEGYBLOCK *sbPtr, enum AMMO_ID AmmoID, VECTORCH *directionPtr, int multiple, SECTION_DATA *this_section_data)
{
VECTORCH incoming,*invec;
@@ -11667,18 +11665,6 @@ int AreTwoPistolsInTertiaryFire(void) {
}
-int FireMarineTwoPistolsPrimary(PLAYER_WEAPON_DATA *weaponPtr) {
-
- return(FireMarineTwoPistols(weaponPtr,0));
-
-}
-
-int FireMarineTwoPistolsSecondary(PLAYER_WEAPON_DATA *weaponPtr) {
-
- return(FireMarineTwoPistols(weaponPtr,1));
-
-}
-
int FireMarineTwoPistols(PLAYER_WEAPON_DATA *weaponPtr, int secondary)
{
TEMPLATE_WEAPON_DATA *twPtr=&TemplateWeapon[weaponPtr->WeaponIDNumber];
@@ -11778,6 +11764,18 @@ int FireMarineTwoPistols(PLAYER_WEAPON_DATA *weaponPtr, int secondary)
return(1);
}
+int FireMarineTwoPistolsPrimary(PLAYER_WEAPON_DATA *weaponPtr) {
+
+ return(FireMarineTwoPistols(weaponPtr,0));
+
+}
+
+int FireMarineTwoPistolsSecondary(PLAYER_WEAPON_DATA *weaponPtr) {
+
+ return(FireMarineTwoPistols(weaponPtr,1));
+
+}
+
void MarineTwoPistols_Fidget(void *playerStatus, PLAYER_WEAPON_DATA *weaponPtr) {
DELTA_CONTROLLER *FireRight;
diff --git a/src/avp/weapons.h b/src/avp/weapons.h
index 6cc078b..c9bbeb5 100644
--- a/src/avp/weapons.h
+++ b/src/avp/weapons.h
@@ -95,6 +95,7 @@ extern void PositionPlayersWeapon(void);
extern void PositionPlayersWeaponMuzzleFlash(void);
extern void AutoSwapToDisc(void);
extern void AutoSwapToDisc_OutOfSequence(void);
+void CreateSpearPossiblyWithFragment(DISPLAYBLOCK *dispPtr, VECTORCH *spearPositionPtr, VECTORCH *spearDirectionPtr);
struct Target
diff --git a/src/avp/win95/avpchunk.cpp b/src/avp/win95/avpchunk.cpp
index fa43ac9..d6780df 100644
--- a/src/avp/win95/avpchunk.cpp
+++ b/src/avp/win95/avpchunk.cpp
@@ -329,7 +329,7 @@ AVP_Generator_Extended_Settings_Chunk::AVP_Generator_Extended_Settings_Chunk(Chu
CHUNK_EXTRACT(spare2,int)
- size_t size=max(*(int*) data,sizeof(AVP_Generator_Weighting));
+ size_t size=max(*(int*) data,(int)sizeof(AVP_Generator_Weighting));
weights=(AVP_Generator_Weighting*)new unsigned char[size];
memset(weights,0,sizeof(AVP_Generator_Weighting));
@@ -704,7 +704,7 @@ AVP_Decal_Chunk::AVP_Decal_Chunk(Chunk_With_Children* parent,const char* data,si
int loaded_decal_size=*(int*)data;
data+=4;
- decal_size=max(loaded_decal_size,sizeof(AVP_Decal));
+ decal_size=max(loaded_decal_size,(int)sizeof(AVP_Decal));
//allocate buffer for decals , and initialise to zero
decal_buffer=new char[num_decals*decal_size];
@@ -720,7 +720,7 @@ AVP_Decal_Chunk::AVP_Decal_Chunk(Chunk_With_Children* parent,const char* data,si
//only allow access to the decals if the loaded structure size is less than or equal
//to the current stucture size
- if(loaded_decal_size<=sizeof(AVP_Decal))
+ if(loaded_decal_size<=(int)sizeof(AVP_Decal))
{
decals=(AVP_Decal*)decal_buffer;
}
diff --git a/src/avp/win95/d3d_hud.cpp b/src/avp/win95/d3d_hud.cpp
index b9fa78e..a7b0d41 100644
--- a/src/avp/win95/d3d_hud.cpp
+++ b/src/avp/win95/d3d_hud.cpp
@@ -192,8 +192,6 @@ void D3D_InitialiseMarineHUD(void)
{
//SelectGenTexDirectory(ITI_TEXTURE);
- extern unsigned char *ScreenBuffer;
-
/* set game mode: different though for multiplayer game */
if(AvP.Network==I_No_Network)
cl_pszGameMode = "marine";
@@ -328,7 +326,6 @@ void D3D_BLTMotionTrackerToHUD(int scanLineSize)
struct VertexTag quadVertices[4];
int widthCos,widthSin;
- extern int CloakingPhase;
BlueBar.TopLeftY = ScreenDescriptorBlock.SDB_Height-MUL_FIXED(MotionTrackerScale,40);
MotionTrackerCentreY = BlueBar.TopLeftY;
@@ -444,7 +441,6 @@ void D3D_BLTMotionTrackerToHUD(int scanLineSize)
void D3D_BLTMotionTrackerBlipToHUD(int x, int y, int brightness)
{
HUDImageDesc imageDesc;
- int screenX,screenY; /* in 16.16 */
int frame;
int motionTrackerScaledHalfWidth = MUL_FIXED(MotionTrackerScale*3,MotionTrackerHalfWidth/2);
@@ -700,8 +696,6 @@ void D3D_BLTGunSightToHUD(int screenX, int screenY, enum GUNSIGHT_SHAPE gunsight
void Render_HealthAndArmour(unsigned int health, unsigned int armour)
{
- HUDCharDesc charDesc;
- int i=MAX_NO_OF_COMMON_HUD_DIGITS;
unsigned int healthColour;
unsigned int armourColour;
@@ -847,8 +841,6 @@ void Render_HealthAndArmour(unsigned int health, unsigned int armour)
}
void Render_MarineAmmo(enum TEXTSTRING_ID ammoText, enum TEXTSTRING_ID magazinesText, unsigned int magazines, enum TEXTSTRING_ID roundsText, unsigned int rounds, int primaryAmmo)
{
- HUDCharDesc charDesc;
- int i=MAX_NO_OF_COMMON_HUD_DIGITS;
int xCentre = MUL_FIXED(HUDLayout_RightmostTextCentre,HUDScaleFactor)+ScreenDescriptorBlock.SDB_Width;
if(!primaryAmmo) xCentre+=MUL_FIXED(HUDScaleFactor,HUDLayout_RightmostTextCentre*2);
diff --git a/src/avp/win95/ddplat.cpp b/src/avp/win95/ddplat.cpp
index 9c261d9..477451a 100644
--- a/src/avp/win95/ddplat.cpp
+++ b/src/avp/win95/ddplat.cpp
@@ -90,7 +90,12 @@ void PlatformSpecificEnteringHUD(void);
void BLTMotionTrackerToHUD(int scanLineSize);
void BLTMotionTrackerBlipToHUD(int x, int y, int brightness);
+#if 0
static void BLTDigitToHUD(char digit, int x, int y, int font);
+void BLTPredatorOverlayToHUD(void);
+static void DrawMotionTrackerPoly(void);
+static void BLTPredatorDigitToHUD(char digit, int x, int y, int font);
+#endif
void BLTGunSightToScreen(int screenX, int screenY, enum GUNSIGHT_SHAPE gunsightShape);
void BLTWeaponToHUD(PLAYER_WEAPON_DATA* weaponPtr);
@@ -98,14 +103,11 @@ int CueWeaponFrameFromSequence(struct WeaponFrameTag *weaponFramePtr, int timeOu
-void BLTPredatorOverlayToHUD(void);
void BLTPredatorNumericsToHUD(void);
-static void BLTPredatorDigitToHUD(char digit, int x, int y, int font);
void LoadDDGraphic(struct DDGraphicTag *DDGfxPtr, char *Filename);
-static void DrawMotionTrackerPoly(void);
static void SetupScanlinePoly(char const *filenamePtr, int width);
diff --git a/src/avp/win95/endianio.c b/src/avp/win95/endianio.c
index 41c494d..f2c0f63 100644
--- a/src/avp/win95/endianio.c
+++ b/src/avp/win95/endianio.c
@@ -20,7 +20,7 @@ DWORD GetLittleDword(FILE *fp)
unsigned char c3 = fgetc(fp);
unsigned char c4 = fgetc(fp);
- return c1 + (c2 + (c3 + (c4 << 8) << 8) << 8);
+ return c1 + ((c2 + ((c3 + (c4 << 8)) << 8)) << 8);
}
VOID PutByte(BYTE v, FILE *fp)
diff --git a/src/avp/win95/frontend/avp_menudata.c b/src/avp/win95/frontend/avp_menudata.c
index 238814e..3b61ef9 100644
--- a/src/avp/win95/frontend/avp_menudata.c
+++ b/src/avp/win95/frontend/avp_menudata.c
@@ -1080,7 +1080,7 @@ extern void MakeUserProfileSelectMenu(void)
else UserProfileNumber=0;
}
-extern void MakeConnectionSelectMenu()
+void MakeConnectionSelectMenu()
{
int pos=0;
diff --git a/src/avp/win95/frontend/avp_menudata.h b/src/avp/win95/frontend/avp_menudata.h
new file mode 100644
index 0000000..306ee71
--- /dev/null
+++ b/src/avp/win95/frontend/avp_menudata.h
@@ -0,0 +1,6 @@
+#ifndef AVP_MENUDATA_H
+#define AVP_MENUDATA_H
+
+void MakeConnectionSelectMenu();
+
+#endif
diff --git a/src/avp/win95/frontend/avp_menugfx.cpp b/src/avp/win95/frontend/avp_menugfx.cpp
index f45404c..54797fc 100644
--- a/src/avp/win95/frontend/avp_menugfx.cpp
+++ b/src/avp/win95/frontend/avp_menugfx.cpp
@@ -636,7 +636,7 @@ static int RenderSmallFontString(char *textPtr,int sx,int sy,int alpha, int red,
}
-extern void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* output_x,int* output_y)
+extern void RenderSmallFontString_Wrapped(const char *textPtr,RECT* area,int alpha,int* output_x,int* output_y)
{
DDSURFACEDESC ddsdimage;
unsigned short *destPtr;
diff --git a/src/avp/win95/frontend/avp_menugfx.hpp b/src/avp/win95/frontend/avp_menugfx.hpp
index 9194353..94bf8e5 100644
--- a/src/avp/win95/frontend/avp_menugfx.hpp
+++ b/src/avp/win95/frontend/avp_menugfx.hpp
@@ -106,7 +106,11 @@ extern int Hardware_RenderSmallMenuText(char *textPtr, int x, int y, int alpha,
extern int Hardware_RenderSmallMenuText_Coloured(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int red, int green, int blue);
extern int RenderMenuText_Clipped(char *textPtr, int x, int y, int alpha, enum AVPMENUFORMAT_ID format, int topY, int bottomY);
-extern void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* output_x,int* output_y);
+extern void RenderSmallFontString_Wrapped(const char *textPtr,RECT* area,int alpha,int* output_x,int* output_y);
+extern void Hardware_RenderKeyConfigRectangle(int alpha);
+extern void RenderKeyConfigRectangle(int alpha);
+extern void Hardware_RenderHighlightRectangle(int x1,int y1,int x2,int y2,int r, int g, int b);
+extern void RenderHighlightRectangle(int x1,int y1,int x2,int y2, int r, int g, int b);
extern void DrawAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format);
diff --git a/src/avp/win95/frontend/avp_menus.c b/src/avp/win95/frontend/avp_menus.c
index 5d47b92..7765a61 100644
--- a/src/avp/win95/frontend/avp_menus.c
+++ b/src/avp/win95/frontend/avp_menus.c
@@ -4,8 +4,12 @@
#include "stratdef.h"
#include "gamedef.h"
#include "bh_types.h"
+#include "cheatmodes.h"
+#include "net.h"
+#include "opengl.h"
#include "pldnet.h"
+#include "avp_menudata.h"
#include "avp_menus.h"
#include "avp_envinfo.h"
@@ -75,6 +79,9 @@ extern void Show_WinnerScreen(void);
extern void GetNextAllowedSpecies(int* species,BOOL search_forwards);
static void SetBriefingTextForMultiplayer();
+int NumberOfAvailableLevels(I_PLAYER_TYPE playerID);
+int LevelMostLikelyToPlay(I_PLAYER_TYPE playerID);
+int MaxDifficultyLevelAllowed(I_PLAYER_TYPE playerID, int level);
int CloudTable[128][128];
@@ -110,8 +117,6 @@ void HandleCheatModeFeatures(void);
void ShowMenuFrameRate(void);
static void KeyboardEntryQueue_Clear(void);
static void KeyboardEntryQueue_StartProcessing(void);
-void ScanSaveSlots(void);
-extern void GetFilenameForSaveSlot(int i, unsigned char *filenamePtr);
static void PasteFromClipboard(char* Text,int MaxTextLength);
/* KJL 11:23:03 23/06/98 - Requirements
@@ -2038,8 +2043,8 @@ static void ActUponUsersInput(void)
{
extern char AAFontWidths[256];
//using small font
- if(AvPMenus.WidthLeftForText<AAFontWidths[c]) break;
- AvPMenus.WidthLeftForText-=AAFontWidths[c];
+ if(AvPMenus.WidthLeftForText<AAFontWidths[(int)c]) break;
+ AvPMenus.WidthLeftForText-=AAFontWidths[(int)c];
}
elementPtr->c.TextPtr[AvPMenus.PositionInTextField++] = c;
@@ -2070,7 +2075,7 @@ static void ActUponUsersInput(void)
char c=0;
KeyboardEntryQueue_StartProcessing();
- while(c=KeyboardEntryQueue_ProcessCharacter())
+ while((c=KeyboardEntryQueue_ProcessCharacter()))
{
if (AvPMenus.PositionInTextField<elementPtr->b.MaxTextLength)
{
@@ -5300,7 +5305,7 @@ void RenderBriefingText(int centreY, int brightness)
while(*ptr)
{
- length+=AAFontWidths[*ptr++];
+ length+=AAFontWidths[(int)(*ptr++)];
}
}
diff --git a/src/avp/win95/frontend/avp_menus.h b/src/avp/win95/frontend/avp_menus.h
index f900fe6..eb6ab96 100644
--- a/src/avp/win95/frontend/avp_menus.h
+++ b/src/avp/win95/frontend/avp_menus.h
@@ -352,5 +352,7 @@ int AvP_InGameMenus(void);
int InGameMenusAreRunning(void);
void RenderBriefingText(int centreY, int brightness);
+void GetFilenameForSaveSlot(int i, unsigned char *filenamePtr);
+void ScanSaveSlots(void);
#endif
diff --git a/src/avp/win95/hud_data.h b/src/avp/win95/hud_data.h
index 3892065..415f6e4 100644
--- a/src/avp/win95/hud_data.h
+++ b/src/avp/win95/hud_data.h
@@ -58,6 +58,7 @@ static char *LoresMarineHUDGfxFilenamePtr[]=
{"trakfont.pg0"},
{"bluebar.pg0"},
};
+#if 0
static struct HUDFontDescTag LoresHUDFontDesc[] =
{
//MARINE_HUD_FONT_BLUE,
@@ -92,6 +93,7 @@ static struct HUDFontDescTag LoresHUDFontDesc[] =
},
};
+#endif
static struct LittleMDescTag LoresHUDLittleM =
{
80,8, // source top,left
@@ -154,6 +156,7 @@ static char *MedresMarineHUDGfxFilenamePtr[]=
{"trkfntmr.pg0"},
{"blubarmr.pg0"},
};
+#if 0
static struct HUDFontDescTag MedresHUDFontDesc[] =
{
//MARINE_HUD_FONT_BLUE,
@@ -188,6 +191,7 @@ static struct HUDFontDescTag MedresHUDFontDesc[] =
},
};
+#endif
static struct LittleMDescTag MedresHUDLittleM =
{
120,14, // source top,left
@@ -254,6 +258,7 @@ static char *HiresMarineHUDGfxFilenamePtr[]=
{"trkfnthr.pg0"},
{"blubarhr.pg0"},
};
+#if 0
static struct HUDFontDescTag HiresHUDFontDesc[] =
{
//MARINE_HUD_FONT_BLUE,
@@ -281,6 +286,7 @@ static struct HUDFontDescTag HiresHUDFontDesc[] =
17,//Width
},
};
+#endif
static struct LittleMDescTag HiresHUDLittleM =
{
150,17, // source top,left
@@ -327,6 +333,7 @@ static char *MedresPredatorHUDGfxFilenamePtr[]=
{"prednum.pg0"}, //PREDATOR_HUD_GFX_NUMBERS,
{"predsymb.pg0"}, //PREDATOR_HUD_GFX_SYMBOLS,
};
+#if 0
static struct DigitPropertiesTag LoresPredatorHUDDigitProperties[] =
{
/* armour, units first */
@@ -381,6 +388,7 @@ static struct DigitPropertiesTag MedresPredatorHUDDigitProperties[] =
{230-6, 180, PREDATOR_HUD_GFX_NUMBERS},
};
+#endif
/* ALIEN */
@@ -400,6 +408,7 @@ static char *MedresAlienHUDGfxFilenamePtr[]=
{"ahMRTop.pg0"}, // ALIEN_HUD_GFX_TOP
{"ahMRNum.pg0"}, // ALIEN_HUD_GFX_NUMBERS
};
+#if 0
static struct DigitPropertiesTag LoresAlienHUDDigitProperties[] =
{
/* health, units first */
@@ -415,3 +424,4 @@ static struct DigitPropertiesTag MedresAlienHUDDigitProperties[] =
{281*2, 157*2+80, ALIEN_HUD_GFX_NUMBERS},
{274*2, 157*2+80, ALIEN_HUD_GFX_NUMBERS},
};
+#endif
diff --git a/src/avp/win95/kzsort.c b/src/avp/win95/kzsort.c
index d119343..848bc5a 100644
--- a/src/avp/win95/kzsort.c
+++ b/src/avp/win95/kzsort.c
@@ -7,6 +7,8 @@
#include "kzsort.h"
#include "kshape.h"
+#include "pldnet.h"
+#include "avpview.h"
#include "d3d_render.h"
#define UseLocalAssert Yes
@@ -31,20 +33,24 @@ extern int NumVertices;
extern int WireFrameMode;
extern int DrawingAReflection;
-struct KItem KItemList[maxpolyptrs]={0,};
-static struct KItem KItemList2[maxpolyptrs]={0,};
+struct KItem KItemList[maxpolyptrs];
+#if 0
+static struct KItem KItemList2[maxpolyptrs];
+#endif
-static struct KObject VisibleModules[MAX_NUMBER_OF_VISIBLE_MODULES]={0,};
-static struct KObject VisibleModules2[MAX_NUMBER_OF_VISIBLE_MODULES]={0,};
+static struct KObject VisibleModules[MAX_NUMBER_OF_VISIBLE_MODULES];
+static struct KObject VisibleModules2[MAX_NUMBER_OF_VISIBLE_MODULES];
static struct KObject *SortedModules;
-static struct KObject VisibleObjects[maxobjects]={0,};
+static struct KObject VisibleObjects[maxobjects];
+static int PointIsInModule(VECTORCH *pointPtr,MODULE *modulePtr);
/*KJL*****************************
* externs for new shape function *
*****************************KJL*/
int *MorphedObjectPointsPtr=0;
+#if 0
static void MergeItems(struct KItem *src1, int n1, struct KItem *src2, int n2, struct KItem *dest)
{
/* merge the 2 sorted lists: at src1, length n1, and at src2, length n2, into dest */
@@ -84,6 +90,7 @@ static void MergeItems(struct KItem *src1, int n1, struct KItem *src2, int n2, s
}
}
}
+#endif
static void MergeObjects(struct KObject *src1, int n1, struct KObject *src2, int n2, struct KObject *dest)
{
@@ -306,7 +313,6 @@ void SortModules(unsigned int noOfItems)
/* KJL 12:21:51 02/11/97 - This routine is too big and ugly. Split & clean up required! */
void KRenderItems(VIEWDESCRIPTORBLOCK *VDBPtr)
{
- extern int NumActiveBlocks;
extern int NumOnScreenBlocks;
extern DISPLAYBLOCK *OnScreenBlockList[];
int numOfObjects = NumOnScreenBlocks;
@@ -737,6 +743,7 @@ void KRenderItems(VIEWDESCRIPTORBLOCK *VDBPtr)
}
}
+#if 0
static int ObjectIsInModule(DISPLAYBLOCK *objectPtr,MODULE *modulePtr)
{
int objectSize = objectPtr->ObRadius;
@@ -757,6 +764,8 @@ static int ObjectIsInModule(DISPLAYBLOCK *objectPtr,MODULE *modulePtr)
return 0;
}
+#endif
+
static int PointIsInModule(VECTORCH *pointPtr,MODULE *modulePtr)
{
VECTORCH position = *pointPtr;
diff --git a/src/avp/win95/objsetup.cpp b/src/avp/win95/objsetup.cpp
index 0db896a..4ccdb9d 100644
--- a/src/avp/win95/objsetup.cpp
+++ b/src/avp/win95/objsetup.cpp
@@ -139,8 +139,8 @@ void setup_track_sound(Indexed_Sound_Chunk* s_chunk,TRACK_SOUND** ts)
TRACK_SOUND* sound=(TRACK_SOUND*)PoolAllocateMem(sizeof(TRACK_SOUND));
sound->sound_loaded=ls;
- sound->inner_range=s_chunk->inner_range*local_scale;
- sound->outer_range=s_chunk->outer_range*local_scale;
+ sound->inner_range=(unsigned)(s_chunk->inner_range*local_scale);
+ sound->outer_range=(unsigned)(s_chunk->outer_range*local_scale);
sound->pitch=s_chunk->pitch;
sound->max_volume=s_chunk->max_volume;
sound->activ_no=SOUND_NOACTIVEINDEX;
@@ -195,8 +195,8 @@ void setup_track_sound(Object_Chunk* oc,TRACK_SOUND** start_sound,TRACK_SOUND**
TRACK_SOUND* sound=(TRACK_SOUND*)PoolAllocateMem(sizeof(TRACK_SOUND));
sound->sound_loaded=ls;
- sound->inner_range=otsc->inner_range*local_scale;
- sound->outer_range=otsc->outer_range*local_scale;
+ sound->inner_range=(unsigned)(otsc->inner_range*local_scale);
+ sound->outer_range=(unsigned)(otsc->outer_range*local_scale);
sound->pitch=otsc->pitch;
sound->max_volume=otsc->max_volume;
sound->activ_no=SOUND_NOACTIVEINDEX;
@@ -619,7 +619,7 @@ void deallocate_behaviour_list()
MISSION_COMPLETE_TOOLS_TEMPLATE* mctt=(MISSION_COMPLETE_TOOLS_TEMPLATE*)bbd->bhdata;
if(mctt->mission_objective_ptr)
{
- delete mctt->mission_objective_ptr;
+ delete (MissionObjective *)(mctt->mission_objective_ptr);
}
}
@@ -828,9 +828,9 @@ static void add_default_object(Object_Chunk * ob, int list_pos)
TOOLS_DATA_INANIMATEOBJECT* tdio =(TOOLS_DATA_INANIMATEOBJECT*) PoolAllocateMem(sizeof(TOOLS_DATA_INANIMATEOBJECT));
- tdio->position.vx = ob->object_data.location.x * local_scale;
- tdio->position.vy = ob->object_data.location.y * local_scale;
- tdio->position.vz = ob->object_data.location.z * local_scale;
+ tdio->position.vx = (int)(ob->object_data.location.x * local_scale);
+ tdio->position.vy = (int)(ob->object_data.location.y * local_scale);
+ tdio->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -873,9 +873,9 @@ static void add_trackobject(Object_Chunk* ob, int list_pos,AVP_Strategy_Chunk* a
*(ObjectID*)&tott->nameID[0]=ob->object_data.ID;
- tott->position.vx = ob->object_data.location.x * local_scale;
- tott->position.vy = ob->object_data.location.y * local_scale;
- tott->position.vz = ob->object_data.location.z * local_scale;
+ tott->position.vx = (int)(ob->object_data.location.x * local_scale);
+ tott->position.vy = (int)(ob->object_data.location.y * local_scale);
+ tott->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -978,8 +978,8 @@ void add_placed_hierarchy(Placed_Hierarchy_Chunk* phc,const char* fname,const ch
Indexed_Sound_Chunk* isc=(Indexed_Sound_Chunk*)chlif();
PLACED_HIERARCHY_SOUND* phs=&phtt->sounds[isc->index];
- phs->inner_range=isc->inner_range*local_scale;
- phs->outer_range=isc->outer_range*local_scale;
+ phs->inner_range=(unsigned)(isc->inner_range*local_scale);
+ phs->outer_range=(unsigned)(isc->outer_range*local_scale);
phs->pitch=isc->pitch;
phs->max_volume=isc->max_volume;
phs->playing=0;
@@ -1015,7 +1015,7 @@ void add_placed_hierarchy(Placed_Hierarchy_Chunk* phc,const char* fname,const ch
ph_seq->sequence_no=phsc->sequence;
ph_seq->sub_sequence_no=phsc->sub_sequence;
- ph_seq->time=((float)phsc->time*(float)ONE_FIXED)/1000.0;
+ ph_seq->time=(int)(((float)phsc->time*(float)ONE_FIXED)/1000.0);
ph_seq->loop=((phsc->flags & HierarchySequenceFlag_Loop)!=0);
if(phsc->flags & HierarchySequenceFlag_InitialSequence)
@@ -1100,9 +1100,9 @@ void add_placed_hierarchy(Placed_Hierarchy_Chunk* phc,const char* fname,const ch
*(ObjectID*) &phtt->nameID[0]=data->id;
- phtt->position.vx = data->location.x * local_scale;
- phtt->position.vy = data->location.y * local_scale;
- phtt->position.vz = data->location.z * local_scale;
+ phtt->position.vx = (int)(data->location.x * local_scale);
+ phtt->position.vy = (int)(data->location.y * local_scale);
+ phtt->position.vz = (int)(data->location.z * local_scale);
QUAT q;
@@ -1173,9 +1173,9 @@ static void add_fan(Object_Chunk* ob, int list_pos,AVP_Strategy_Chunk* asc)
*(ObjectID*)&ftt->nameID[0]=ob->object_data.ID;
- ftt->position.vx = ob->object_data.location.x * local_scale;
- ftt->position.vy = ob->object_data.location.y * local_scale;
- ftt->position.vz = ob->object_data.location.z * local_scale;
+ ftt->position.vx = (int)(ob->object_data.location.x * local_scale);
+ ftt->position.vy = (int)(ob->object_data.location.y * local_scale);
+ ftt->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -1229,9 +1229,9 @@ static void add_linkswitch(const char* name,AVP_Strategy_Chunk* asc,const Object
if(oc) //switch has a shape
{
- lstt->position.vx = oc->object_data.location.x * local_scale;
- lstt->position.vy = oc->object_data.location.y * local_scale;
- lstt->position.vz = oc->object_data.location.z * local_scale;
+ lstt->position.vx = (int)(oc->object_data.location.x * local_scale);
+ lstt->position.vy = (int)(oc->object_data.location.y * local_scale);
+ lstt->position.vz = (int)(oc->object_data.location.z * local_scale);
QUAT q;
@@ -1315,9 +1315,9 @@ static void add_multitarget_linkswitch(const char* name,AVP_Strategy_Chunk* asc,
if(oc) //switch has a shape
{
- lstt->position.vx = oc->object_data.location.x * local_scale;
- lstt->position.vy = oc->object_data.location.y * local_scale;
- lstt->position.vz = oc->object_data.location.z * local_scale;
+ lstt->position.vx = (int)(oc->object_data.location.x * local_scale);
+ lstt->position.vy = (int)(oc->object_data.location.y * local_scale);
+ lstt->position.vz = (int)(oc->object_data.location.z * local_scale);
QUAT q;
@@ -1431,9 +1431,9 @@ static void add_binswitch (const char* name,AVP_Strategy_Chunk* asc,const Object
if(oc)//switch has a shape
{
- bstt->position.vx = oc->object_data.location.x * local_scale;
- bstt->position.vy = oc->object_data.location.y * local_scale;
- bstt->position.vz = oc->object_data.location.z * local_scale;
+ bstt->position.vx = (int)(oc->object_data.location.x * local_scale);
+ bstt->position.vy = (int)(oc->object_data.location.y * local_scale);
+ bstt->position.vz = (int)(oc->object_data.location.z * local_scale);
bstt->trigger_volume_min.vx=bstt->trigger_volume_max.vx=0;
@@ -1522,9 +1522,9 @@ static void add_multiswitch (const char* name,AVP_Strategy_Chunk* asc,const Obje
if(oc) //switch has a shape
{
- bstt->position.vx = oc->object_data.location.x * local_scale;
- bstt->position.vy = oc->object_data.location.y * local_scale;
- bstt->position.vz = oc->object_data.location.z * local_scale;
+ bstt->position.vx = (int)(oc->object_data.location.x * local_scale);
+ bstt->position.vy = (int)(oc->object_data.location.y * local_scale);
+ bstt->position.vz = (int)(oc->object_data.location.z * local_scale);
QUAT q;
@@ -1618,9 +1618,9 @@ static void add_platlift (Object_Chunk * ob, int list_pos, AVP_Strategy_Chunk *
PLATFORMLIFT_TOOLS_TEMPLATE* ptt=(PLATFORMLIFT_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(PLATFORMLIFT_TOOLS_TEMPLATE));
- ptt->position.vx = ob->object_data.location.x * local_scale;
- ptt->position.vy = ob->object_data.location.y * local_scale;
- ptt->position.vz = ob->object_data.location.z * local_scale;
+ ptt->position.vx = (int)(ob->object_data.location.x * local_scale);
+ ptt->position.vy = (int)(ob->object_data.location.y * local_scale);
+ ptt->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -1645,7 +1645,7 @@ static void add_platlift (Object_Chunk * ob, int list_pos, AVP_Strategy_Chunk *
{
if(otc->num_sections==1)
{
- ptt->travel=(otc->sections[0].pivot_end.y-otc->sections[0].pivot_start.y)*local_scale;
+ ptt->travel=(int)((otc->sections[0].pivot_end.y-otc->sections[0].pivot_start.y)*local_scale);
}
}
else
@@ -1740,9 +1740,9 @@ static void add_placed_light(Object_Chunk* ob,int list_pos,AVP_Strategy_Chunk* a
TOOLS_DATA_PLACEDLIGHT* pltd=(TOOLS_DATA_PLACEDLIGHT*) PoolAllocateMem(sizeof(TOOLS_DATA_PLACEDLIGHT));
- pltd->position.vx = ob->object_data.location.x * local_scale;
- pltd->position.vy = ob->object_data.location.y * local_scale;
- pltd->position.vz = ob->object_data.location.z * local_scale;
+ pltd->position.vx = (int)(ob->object_data.location.x * local_scale);
+ pltd->position.vy = (int)(ob->object_data.location.y * local_scale);
+ pltd->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -2060,9 +2060,9 @@ static void add_videoscreen(Object_Chunk * ob, int list_pos, AVP_Strategy_Chunk
TOOLS_DATA_VIDEO_SCREEN* tdvs=(TOOLS_DATA_VIDEO_SCREEN*) PoolAllocateMem(sizeof(TOOLS_DATA_VIDEO_SCREEN));
- tdvs->position.vx = ob->object_data.location.x * local_scale;
- tdvs->position.vy = ob->object_data.location.y * local_scale;
- tdvs->position.vz = ob->object_data.location.z * local_scale;
+ tdvs->position.vx = (int)(ob->object_data.location.x * local_scale);
+ tdvs->position.vy = (int)(ob->object_data.location.y * local_scale);
+ tdvs->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -2113,9 +2113,9 @@ static void add_newsimpleobject(Object_Chunk * ob, int list_pos, AVP_Strategy_Ch
TOOLS_DATA_INANIMATEOBJECT* tdio=(TOOLS_DATA_INANIMATEOBJECT*) PoolAllocateMem(sizeof(TOOLS_DATA_INANIMATEOBJECT));
- tdio->position.vx = ob->object_data.location.x * local_scale;
- tdio->position.vy = ob->object_data.location.y * local_scale;
- tdio->position.vz = ob->object_data.location.z * local_scale;
+ tdio->position.vx = (int)(ob->object_data.location.x * local_scale);
+ tdio->position.vy = (int)(ob->object_data.location.y * local_scale);
+ tdio->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -2206,9 +2206,9 @@ static void add_simpleobject(Object_Chunk * ob, int list_pos, AVP_Strategy_Chunk
TOOLS_DATA_INANIMATEOBJECT* tdio=(TOOLS_DATA_INANIMATEOBJECT*) PoolAllocateMem(sizeof(TOOLS_DATA_INANIMATEOBJECT));
- tdio->position.vx = ob->object_data.location.x * local_scale;
- tdio->position.vy = ob->object_data.location.y * local_scale;
- tdio->position.vz = ob->object_data.location.z * local_scale;
+ tdio->position.vx = (int)(ob->object_data.location.x * local_scale);
+ tdio->position.vy = (int)(ob->object_data.location.y * local_scale);
+ tdio->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q;
@@ -2350,9 +2350,9 @@ static void add_alien(AVP_Generator_Chunk * agc)
{
TOOLS_DATA_ALIEN* tda=(TOOLS_DATA_ALIEN*) PoolAllocateMem(sizeof(TOOLS_DATA_ALIEN));
- tda->position.vx = agc->location.x * local_scale;
- tda->position.vy = agc->location.y * local_scale;
- tda->position.vz = agc->location.z * local_scale;
+ tda->position.vx = (int)(agc->location.x * local_scale);
+ tda->position.vy = (int)(agc->location.y * local_scale);
+ tda->position.vz = (int)(agc->location.z * local_scale);
//tda->shapeIndex = GetLoadedShapeMSL("Alien");
tda->shapeIndex = 0;
@@ -2424,9 +2424,9 @@ static void add_marine(AVP_Generator_Chunk * agc)
{
TOOLS_DATA_MARINE* tdm=(TOOLS_DATA_MARINE*) PoolAllocateMem(sizeof(TOOLS_DATA_MARINE));
- tdm->position.vx = agc->location.x * local_scale;
- tdm->position.vy = agc->location.y * local_scale;
- tdm->position.vz = agc->location.z * local_scale;
+ tdm->position.vx = (int)(agc->location.x * local_scale);
+ tdm->position.vy = (int)(agc->location.y * local_scale);
+ tdm->position.vz = (int)(agc->location.z * local_scale);
EULER euler;
euler.EulerX=0;
@@ -2578,9 +2578,9 @@ static void add_predator(AVP_Generator_Chunk * agc)
{
TOOLS_DATA_PREDATOR* tdp=(TOOLS_DATA_PREDATOR*) PoolAllocateMem(sizeof(TOOLS_DATA_PREDATOR));
- tdp->position.vx = agc->location.x * local_scale;
- tdp->position.vy = agc->location.y * local_scale;
- tdp->position.vz = agc->location.z * local_scale;
+ tdp->position.vx = (int)(agc->location.x * local_scale);
+ tdp->position.vy = (int)(agc->location.y * local_scale);
+ tdp->position.vz = (int)(agc->location.z * local_scale);
#if 0
switch (agc->textureID)
@@ -2715,9 +2715,9 @@ static void add_queen(AVP_Generator_Chunk * agc)
{
TOOLS_DATA_QUEEN* tdq=(TOOLS_DATA_QUEEN*) PoolAllocateMem(sizeof(TOOLS_DATA_QUEEN));
- tdq->position.vx = agc->location.x * local_scale;
- tdq->position.vy = agc->location.y * local_scale;
- tdq->position.vz = agc->location.z * local_scale;
+ tdq->position.vx = (int)(agc->location.x * local_scale);
+ tdq->position.vy = (int)(agc->location.y * local_scale);
+ tdq->position.vz = (int)(agc->location.z * local_scale);
tdq->shapeIndex = 0;
@@ -2766,9 +2766,9 @@ static void add_hugger(AVP_Generator_Chunk * agc)
TOOLS_DATA_FACEHUGGER* tdfh =(TOOLS_DATA_FACEHUGGER*) PoolAllocateMem(sizeof(TOOLS_DATA_FACEHUGGER));
- tdfh->position.vx = agc->location.x * local_scale;
- tdfh->position.vy = agc->location.y * local_scale;
- tdfh->position.vz = agc->location.z * local_scale;
+ tdfh->position.vx = (int)(agc->location.x * local_scale);
+ tdfh->position.vy = (int)(agc->location.y * local_scale);
+ tdfh->position.vz = (int)(agc->location.z * local_scale);
//tdfh->shapeIndex = GetLoadedShapeMSL("Facehug");
tdfh->shapeIndex = 0;
@@ -2817,9 +2817,9 @@ static void add_hugger(AVP_Generator_Chunk * agc)
static void add_autogun(AVP_Generator_Chunk * agc)
{
AUTOGUN_TOOLS_TEMPLATE* att=(AUTOGUN_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(AUTOGUN_TOOLS_TEMPLATE));
- att->position.vx = agc->location.x * local_scale;
- att->position.vy = agc->location.y * local_scale;
- att->position.vz = agc->location.z * local_scale;
+ att->position.vx = (int)(agc->location.x * local_scale);
+ att->position.vy = (int)(agc->location.y * local_scale);
+ att->position.vz = (int)(agc->location.z * local_scale);
att->shapenum = 0;
@@ -2876,9 +2876,9 @@ static void add_xenoborg(AVP_Generator_Chunk * agc)
TOOLS_DATA_XENO* tdx=(TOOLS_DATA_XENO*) PoolAllocateMem(sizeof(TOOLS_DATA_XENO));
- tdx->position.vx = agc->location.x * local_scale;
- tdx->position.vy = agc->location.y * local_scale;
- tdx->position.vz = agc->location.z * local_scale;
+ tdx->position.vx = (int)(agc->location.x * local_scale);
+ tdx->position.vy = (int)(agc->location.y * local_scale);
+ tdx->position.vz = (int)(agc->location.z * local_scale);
tdx->shapeIndex = 0;
@@ -3068,9 +3068,9 @@ void setup_generators (Environment_Data_Chunk * envd)
GENERATOR_BLOCK* tdg = (GENERATOR_BLOCK*) PoolAllocateMem(sizeof(GENERATOR_BLOCK));
memset(tdg,0,sizeof(GENERATOR_BLOCK));
- tdg->Position.vx = agc->location.x * local_scale;
- tdg->Position.vy = agc->location.y * local_scale;
- tdg->Position.vz = agc->location.z * local_scale;
+ tdg->Position.vx = (int)(agc->location.x * local_scale);
+ tdg->Position.vy = (int)(agc->location.y * local_scale);
+ tdg->Position.vz = (int)(agc->location.z * local_scale);
tdg->Active=!(agc->flags & AVPGENFLAG_GENERATORINACTIVE);
tdg->GenerationRate=1;
@@ -3232,9 +3232,9 @@ void setup_generators (Environment_Data_Chunk * envd)
}
MULTIPLAYER_START start_pos;
- start_pos.location.vx = agc->location.x * local_scale;
- start_pos.location.vy = agc->location.y * local_scale;
- start_pos.location.vz = agc->location.z * local_scale;
+ start_pos.location.vx = (int)(agc->location.x * local_scale);
+ start_pos.location.vy = (int)(agc->location.y * local_scale);
+ start_pos.location.vz = (int)(agc->location.z * local_scale);
start_pos.orientation.EulerX=0;
start_pos.orientation.EulerY=agc->orientation & 4095;
@@ -3383,19 +3383,19 @@ void setup_light_data (LIGHTBLOCK * lPtr, Light_Chunk * lc)
lPtr->LightType = LightType_PerVertex;
- lPtr->LightWorld.vx = lc->light.location.x * local_scale;
- lPtr->LightWorld.vy = lc->light.location.y * local_scale;
- lPtr->LightWorld.vz = lc->light.location.z * local_scale;
+ lPtr->LightWorld.vx = (int)(lc->light.location.x * local_scale);
+ lPtr->LightWorld.vy = (int)(lc->light.location.y * local_scale);
+ lPtr->LightWorld.vz = (int)(lc->light.location.z * local_scale);
- lPtr->LightBright = lc->light.brightness * 1.0;
- lPtr->LightBrightStore = lc->light.brightness * 1.0;
+ lPtr->LightBright = (int)(lc->light.brightness * 1.0);
+ lPtr->LightBrightStore = (int)(lc->light.brightness * 1.0);
/* KJL 10:57:57 9/24/97 - colour scales - these take the values 0 to 65536 */
lPtr->RedScale = ((lc->light.colour>>16)&255)*257;
lPtr->GreenScale = ((lc->light.colour>>8)&255)*257;
lPtr->BlueScale = ((lc->light.colour)&255)*257;
- lPtr->LightRange = (lc->light.range * 1.0) * local_scale;
+ lPtr->LightRange = (int)((lc->light.range * 1.0) * local_scale);
if (lc->light.local_light_flags & LOFlag_NoPreLight)
{
@@ -3423,15 +3423,15 @@ void setup_placed_light_data (LIGHTBLOCK * lPtr, Placed_Object_Light_Chunk * lc)
lPtr->LightWorld.vy = 0;
lPtr->LightWorld.vz = 0;
- lPtr->LightBright = lc->light.brightness * 1.0;
- lPtr->LightBrightStore = lc->light.brightness * 1.0;
+ lPtr->LightBright = (int)(lc->light.brightness * 1.0);
+ lPtr->LightBrightStore = (int)(lc->light.brightness * 1.0);
/* KJL 10:57:57 9/24/97 - colour scales - these take the values 0 to 65536 */
lPtr->RedScale = ((lc->light.up_colour>>16)&255)*257;
lPtr->GreenScale = ((lc->light.up_colour>>8)&255)*257;
lPtr->BlueScale = ((lc->light.up_colour)&255)*257;
- lPtr->LightRange = (lc->light.range * 1.0) * local_scale;
+ lPtr->LightRange = (int)((lc->light.range * 1.0) * local_scale);
}
@@ -3711,12 +3711,12 @@ void setup_sounds (Environment_Data_Chunk * envd)
Sound_Object_Chunk * snd = (Sound_Object_Chunk *) cli();
SOUND_TOOLS_TEMPLATE* stt =(SOUND_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(SOUND_TOOLS_TEMPLATE));
- stt->position.vx = snd->position.x * local_scale;
- stt->position.vy = snd->position.y * local_scale;
- stt->position.vz = snd->position.z * local_scale;
+ stt->position.vx = (int)(snd->position.x * local_scale);
+ stt->position.vy = (int)(snd->position.y * local_scale);
+ stt->position.vz = (int)(snd->position.z * local_scale);
- stt->inner_range = snd->inner_range * local_scale;
- stt->outer_range = snd->outer_range * local_scale;
+ stt->inner_range = (unsigned)(snd->inner_range * local_scale);
+ stt->outer_range = (unsigned)(snd->outer_range * local_scale);
stt->max_volume = snd->max_volume;
stt->pitch = snd->pitch;
@@ -3757,9 +3757,9 @@ void setup_cables(Environment_Data_Chunk * envd)
POWER_CABLE_TOOLS_TEMPLATE* tdpc=(POWER_CABLE_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(POWER_CABLE_TOOLS_TEMPLATE));
- tdpc->position.vx = appc->location.x * local_scale;
- tdpc->position.vy = appc->location.y * local_scale;
- tdpc->position.vz = appc->location.z * local_scale;
+ tdpc->position.vx = (int)(appc->location.x * local_scale);
+ tdpc->position.vy = (int)(appc->location.y * local_scale);
+ tdpc->position.vz = (int)(appc->location.z * local_scale);
if(appc->flags & PowerCableFlag_UseDefaultSettings)
{
@@ -3798,9 +3798,9 @@ void setup_particle_generators(Environment_Data_Chunk * envd)
PARTICLE_GENERATOR_TOOLS_TEMPLATE* part_temp=(PARTICLE_GENERATOR_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(PARTICLE_GENERATOR_TOOLS_TEMPLATE));
- part_temp->position.vx = data_chunk->location.x * local_scale;
- part_temp->position.vy = data_chunk->location.y * local_scale;
- part_temp->position.vz = data_chunk->location.z * local_scale;
+ part_temp->position.vx = (int)(data_chunk->location.x * local_scale);
+ part_temp->position.vy = (int)(data_chunk->location.y * local_scale);
+ part_temp->position.vz = (int)(data_chunk->location.z * local_scale);
*(ObjectID*)&part_temp->nameID[0]=data_chunk->id;
*(ObjectID*)&part_temp->parentID[0]=data_chunk->parent_id;
diff --git a/src/avp/win95/pldghost.c b/src/avp/win95/pldghost.c
index ea4135b..7d75a1e 100644
--- a/src/avp/win95/pldghost.c
+++ b/src/avp/win95/pldghost.c
@@ -25,6 +25,7 @@
#include "bh_corpse.h"
#include "bh_weap.h"
#include "showcmds.h"
+#include "weapons.h"
#define UseLocalAssert Yes
#include "ourasert.h"
@@ -51,7 +52,9 @@ extern MATRIXCH Identity_RotMat; /* From HModel.c */
----------------------------------------------------------------------*/
static void SetPlayerGhostAnimationSequence(STRATEGYBLOCK *sbPtr, int sequence, int special);
+#if 0
static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr);
+#endif
static void UpdatePlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr, int sequence, int special);
SOUND3DDATA Ghost_Explosion_SoundData={
@@ -62,9 +65,6 @@ SOUND3DDATA Ghost_Explosion_SoundData={
};
void UpdateObjectTrails(STRATEGYBLOCK *sbPtr);
-void CreateMarineHModel(NETGHOSTDATABLOCK *ghostDataPtr, int weapon);
-void CreateAlienHModel(NETGHOSTDATABLOCK *ghostDataPtr,int alienType);
-void CreatePredatorHModel(NETGHOSTDATABLOCK *ghostDataPtr, int weapon);
static void CalculatePosnForGhostAutoGunMuzzleFlash(STRATEGYBLOCK *sbPtr,VECTORCH *position, EULER *orientation);
void UpdateAlienAIGhostAnimSequence(STRATEGYBLOCK *sbPtr,HMODEL_SEQUENCE_TYPES type, int subtype, int length, int tweeningtime);
@@ -882,7 +882,6 @@ void PostDynamicsExtrapolationUpdate()
{
if(MultiplayerObservedPlayer==ghostData->playerId)
{
- PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr);
Player->ObStrategyBlock->DynPtr->Position=sbPtr->DynPtr->Position;
Player->ObStrategyBlock->DynPtr->PrevPosition=sbPtr->DynPtr->Position;
@@ -1669,6 +1668,7 @@ Update changes the sequence if appropriate (and calls set if the sbPtr has a dpt
Set selects the correct sequence/type, infers the speed and follow-on sequences,
etc, and sets it.
------------------------------------------------------------------------------*/
+#if 0
static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr)
{
NETGHOSTDATABLOCK *ghostData;
@@ -1705,6 +1705,7 @@ static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr)
}
}
}
+#endif
static void UpdatePlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr, int sequence, int special)
{
@@ -4448,9 +4449,6 @@ int Deduce_PlayerMarineDeathSequence(STRATEGYBLOCK* sbPtr,DAMAGE_PROFILE* damage
NETCORPSEDATABLOCK *corpseDataPtr=(NETCORPSEDATABLOCK *)sbPtr->SBdataptr;
int deathtype,gibbFactor;
- int a;
-
- SECTION_DATA *head;
/* Set GibbFactor and death type*/
gibbFactor=0;
@@ -4719,7 +4717,6 @@ int Deduce_PlayerPredatorDeathSequence(STRATEGYBLOCK* sbPtr,DAMAGE_PROFILE* dama
HIT_FACING facing;
SECTION *root;
int burning;
- int wounds;
int crouched;
root=GetNamedHierarchyFromLibrary("hnpcpredator","Template");
diff --git a/src/avp/win95/pldghost.h b/src/avp/win95/pldghost.h
index 1997869..3a7a39b 100644
--- a/src/avp/win95/pldghost.h
+++ b/src/avp/win95/pldghost.h
@@ -109,6 +109,9 @@ extern void KillAlienAIGhost(STRATEGYBLOCK *sbPtr,int death_code,int death_time,
extern void Convert_DiscGhost_To_PickupGhost(STRATEGYBLOCK *sbPtr);
extern void PlayHitDeltaOnGhost(STRATEGYBLOCK *sbPtr,char delta_seq,char delta_sub_seq);
extern void PlayOtherSound(enum soundindex SoundIndex, VECTORCH *position, int explosion);
+void CreateMarineHModel(NETGHOSTDATABLOCK *ghostDataPtr, int weapon);
+void CreateAlienHModel(NETGHOSTDATABLOCK *ghostDataPtr,int alienType);
+void CreatePredatorHModel(NETGHOSTDATABLOCK *ghostDataPtr, int weapon);
/*---------------------------Patrick 29/3/97----------------------------
Defines
diff --git a/src/avp/win95/pldnet.c b/src/avp/win95/pldnet.c
index 9222819..3e1b31c 100644
--- a/src/avp/win95/pldnet.c
+++ b/src/avp/win95/pldnet.c
@@ -2,6 +2,7 @@
Source for Multi-Player game support
----------------------------------------------------------------------*/
+#include <ctype.h>
#include "3dc.h"
#include "inline.h"
#include "module.h"
@@ -21,9 +22,16 @@
#include "weapons.h"
#include "multmenu.h"
#include "bh_gener.h"
+#include "bh_lnksw.h"
+#include "bh_track.h"
#include "psnd.h"
#include "kshape.h"
#include "pfarlocs.h"
+#include "avpview.h"
+#include "net.h"
+#include "los.h"
+#include "maths.h"
+#include "opengl.h"
/* these required sequence enumerations...*/
#include "bh_pred.h"
@@ -279,8 +287,7 @@ static void ProcessGameMessage(DPID senderId, char *msgP,unsigned int msgSize);
static void AddPlayerToGame(DPID id, char*name);
static void AddPlayerAndObjectUpdateMessages(void);
static void UpdateNetworkGameScores(DPID playerKilledId, DPID killerId,NETGAME_CHARACTERTYPE playerKilledType,NETGAME_CHARACTERTYPE killerType);
-static void InitFinalNetGameScores(void);
-static void ConvertNetNameToUpperCase(char *strPtr);
+//static void ConvertNetNameToUpperCase(char *strPtr);
static void ProcessNetMsg_GameDescription(NETMESSAGE_GAMEDESCRIPTION *msgPtr);
static void ProcessNetMsg_PlayerDescription(NETMESSAGE_PLAYERDESCRIPTION *msgPtr, DPID senderId);
@@ -379,6 +386,8 @@ static int CalculateMyScore();
static void PeriodicScoreUpdate();
void CheckStateOfObservedPlayer();
+static int MyPlayerHasAMuzzleFlash(STRATEGYBLOCK *sbPtr);
+
/*----------------------------------------------------------------------
Initalisation of net game
----------------------------------------------------------------------*/
@@ -482,7 +491,7 @@ void InitAVPNetGameForHost(int species, int gamestyle, int level)
int i,j;
for(i=0;i<(NET_MAXPLAYERS);i++)
{
- netGameData.playerData[i].playerId = NULL;
+ netGameData.playerData[i].playerId = 0;
for(j=0;j<(NET_PLAYERNAMELENGTH);j++) netGameData.playerData[i].name[j] = '\0';
netGameData.playerData[i].characterType = NGCT_Marine;
netGameData.playerData[i].characterSubType = NGSCT_General;
@@ -636,7 +645,7 @@ void InitAVPNetGameForJoin(void)
int i,j;
for(i=0;i<(NET_MAXPLAYERS);i++)
{
- netGameData.playerData[i].playerId = NULL;
+ netGameData.playerData[i].playerId = 0;
for(j=0;j<(NET_PLAYERNAMELENGTH);j++) netGameData.playerData[i].name[j] = '\0';
netGameData.playerData[i].characterType = NGCT_Marine;
netGameData.playerData[i].characterSubType = NGSCT_General;
@@ -725,8 +734,8 @@ void MinimalNetCollectMessages(void)
void NetCollectMessages(void)
{
HRESULT res = DP_OK;
- DPID dPlayFromId = NULL;
- DPID dPlayToId = NULL;
+ DPID dPlayFromId = 0;
+ DPID dPlayToId = 0;
unsigned char *msgP = NULL;
unsigned msgSize = 0;
@@ -1118,7 +1127,7 @@ void RemovePlayerFromGame(DPID id)
}
/* free the slot */
- netGameData.playerData[playerIndex].playerId = NULL;
+ netGameData.playerData[playerIndex].playerId = 0;
for(j=0;j<NET_PLAYERNAMELENGTH;j++) netGameData.playerData[playerIndex].name[j] = '\0';
netGameData.playerData[playerIndex].characterType = NGCT_Marine;
netGameData.playerData[playerIndex].characterSubType = NGSCT_General;
@@ -1868,7 +1877,9 @@ static void AddPlayerAndObjectUpdateMessages(void)
----------------------------------------------------------------------*/
void EndAVPNetGame(void)
{
+#if 0
HRESULT hres;
+#endif
/* garry's dp extended clean up */
if(!netGameData.skirmishMode)
@@ -5465,7 +5476,7 @@ static void ProcessNetMsg_GameDescription(NETMESSAGE_GAMEDESCRIPTION *messagePtr
if (netGameData.myGameState==NGS_Playing && playerChanged)
{
- if (messagePtr->players[i].playerId==NULL)
+ if (messagePtr->players[i].playerId==0)
{
Inform_PlayerHasLeft(netGameData.playerData[i].playerId);
}
@@ -7382,7 +7393,6 @@ static void ProcessNetMsg_StrategySynch(NETMESSAGE_STRATEGYSYNCH *messagePtr)
for (i=0; i<NumActiveStBlocks; i++)
{
STRATEGYBLOCK *sbPtr = ActiveStBlockList[i];
- int status;
if(sbPtr->I_SBtype == I_BehaviourBinarySwitch ||
sbPtr->I_SBtype == I_BehaviourLinkSwitch ||
@@ -7897,9 +7907,6 @@ static void ProcessNetMsg_Gibbing(NETMESSAGE_GIBBING *messagePtr,DPID senderId)
}
else
{
- SECTION_DATA *section_data=NULL;
- HMODELCONTROLLER *controller=NULL;
-
ghostData = (NETGHOSTDATABLOCK *)sbPtr->SBdataptr;
//only interested in gibbing corpses
@@ -7972,7 +7979,7 @@ int PlayerIdInPlayerList(DPID Id)
{
int i;
/* check first, if we've been passed a null id */
- if(Id==NULL) return NET_IDNOTINPLAYERLIST;
+ if(Id==0) return NET_IDNOTINPLAYERLIST;
/* check player list */
for(i=0;i<NET_MAXPLAYERS;i++)
@@ -7991,7 +7998,7 @@ int EmptySlotInPlayerList(void)
for(i=0;i<NET_MAXPLAYERS;i++)
{
- if(netGameData.playerData[i].playerId == NULL) return i;
+ if(netGameData.playerData[i].playerId == 0) return i;
}
return NET_NOEMPTYSLOTINPLAYERLIST;
}
@@ -8094,7 +8101,7 @@ static void UpdateNetworkGameScores(DPID playerKilledId, DPID killerId,NETGAME_C
playerKilledIndex = PlayerIdInPlayerList(playerKilledId);
if(playerKilledIndex==NET_IDNOTINPLAYERLIST) return;
- if(killerId==NULL || killerId == playerKilledId || killerType>=NGCT_AI_Alien)
+ if(killerId==0 || killerId == playerKilledId || killerType>=NGCT_AI_Alien)
{
//suicide
killerIndex=playerKilledIndex;
@@ -8330,6 +8337,7 @@ int AddUpPlayerFrags(int playerId)
return score;
}
+#if 0
static void ConvertNetNameToUpperCase(char *strPtr)
{
int count = 0;
@@ -8340,6 +8348,7 @@ static void ConvertNetNameToUpperCase(char *strPtr)
}
}
+#endif
/* Patrick 11/7/97 ----------------------------------------------
@@ -8498,7 +8507,6 @@ static MARINE_SEQUENCE GetMyMarineSequence(void)
static ALIEN_SEQUENCE GetMyAlienSequence(void)
{
extern STRATEGYBLOCK *Biting;
- extern int Bit;
int playerIsMoving = 0;
int playerIsFiring = 0;
int playerIsCrouching = 0;
@@ -9095,9 +9103,6 @@ void TeleportNetPlayerToAStartingPosition(STRATEGYBLOCK *playerSbPtr, int startO
{
int numStartPositions;
MULTIPLAYER_START* startPositions;
-
- int sbIndex = 0;
-
int start_index;
int numChecked=0;
int bestDistance=-1;
@@ -9222,8 +9227,6 @@ void TeleportNetPlayerToAStartingPosition(STRATEGYBLOCK *playerSbPtr, int startO
in order to avoid having several players appearing at the same place*/
void StartOfGame_PlayerPlacement(STRATEGYBLOCK *playerSbPtr,int seed)
{
- extern int NumActiveStBlocks;
- extern STRATEGYBLOCK *ActiveStBlockList[];
int numStartPositions;
MULTIPLAYER_START* startPositions;
PLAYER_STATUS *psPtr=(PLAYER_STATUS*)playerSbPtr->SBdataptr;
@@ -9436,7 +9439,7 @@ void CreatePlayersImageInMirror(void)
}
case(I_BehaviourAlienPlayer):
{
- CreateAlienHModel(ghostData);
+ CreateAlienHModel(ghostData,AT_Standard);
break;
}
case(I_BehaviourPredatorPlayer):
@@ -9827,7 +9830,7 @@ static int GetDynamicScoreMultiplier(int playerKilledIndex,int killerIndex)
//count players
for(i=0;i<NET_MAXPLAYERS;i++)
{
- if(netGameData.playerData[i].playerId==NULL) continue;
+ if(netGameData.playerData[i].playerId==0) continue;
playerCount++;
}
//only bother if there are at least 3 players
@@ -10895,7 +10898,7 @@ static void CheckForPointBasedObjectRespawn()
static int CountMultiplayerLivesLeft()
{
- int i,j;
+ int i;
int livesUsed=0;
diff --git a/src/avp/win95/pldnet.h b/src/avp/win95/pldnet.h
index e23391a..e7469ab 100644
--- a/src/avp/win95/pldnet.h
+++ b/src/avp/win95/pldnet.h
@@ -1007,6 +1007,7 @@ void MinimalNetCollectMessages(void);
void InitAVPNetGameForHost(int species, int gamestyle, int level);
void InitAVPNetGameForJoin(void);
void CreatePlayersImageInMirror(void);
+void RenderPlayersImageInMirror(void);
/* ---------------------------------------------------------------------
diff --git a/src/avp/win95/projload.cpp b/src/avp/win95/projload.cpp
index 40c81af..39005a5 100644
--- a/src/avp/win95/projload.cpp
+++ b/src/avp/win95/projload.cpp
@@ -117,9 +117,9 @@ void setup_start_position(RIFFHANDLE h)
}
if(start_chunk)
{
- PlayerStartLocation.vx=start_chunk->location.x*local_scale;
- PlayerStartLocation.vy=start_chunk->location.y*local_scale;
- PlayerStartLocation.vz=start_chunk->location.z*local_scale;
+ PlayerStartLocation.vx=(int)(start_chunk->location.x*local_scale);
+ PlayerStartLocation.vy=(int)(start_chunk->location.y*local_scale);
+ PlayerStartLocation.vz=(int)(start_chunk->location.z*local_scale);
PlayerStartMat.mat11=start_chunk->orientation.mat11;
PlayerStartMat.mat12=start_chunk->orientation.mat12;
@@ -489,8 +489,8 @@ Global_Hierarchy_Store::Global_Hierarchy_Store (RIFFHANDLE h)
GLOBALASSERT(sound_array[index].sound_loaded==0);
- sound_array[index].s3d.inner_range=isc->inner_range*local_scale;
- sound_array[index].s3d.outer_range=isc->outer_range*local_scale;
+ sound_array[index].s3d.inner_range=(int)(isc->inner_range*local_scale);
+ sound_array[index].s3d.outer_range=(int)(isc->outer_range*local_scale);
sound_array[index].s3d.velocity=ZeroVector;
sound_array[index].s3d.position=ZeroVector;
@@ -911,7 +911,7 @@ SECTION * Global_Hierarchy_Store::build_hierarchy (Object_Hierarchy_Chunk * ohc,
KEYFRAME_DATA * kfd=0;
- for(int frame_no=0;frame_no<seq->num_frames;)
+ for(unsigned int frame_no=0;frame_no<seq->num_frames;)
{
Object_Animation_Frame* frame=&seq->frames[frame_no];
@@ -964,9 +964,9 @@ SECTION * Global_Hierarchy_Store::build_hierarchy (Object_Hierarchy_Chunk * ohc,
VECTORCH offset;
- offset.vx = frame->transform.x * local_scale;
- offset.vy = frame->transform.y * local_scale;
- offset.vz = frame->transform.z * local_scale;
+ offset.vx = (int)(frame->transform.x * local_scale);
+ offset.vy = (int)(frame->transform.y * local_scale);
+ offset.vz = (int)(frame->transform.z * local_scale);
SetKeyFrameOffset(kfd,&offset);
@@ -1174,9 +1174,9 @@ SECTION * Global_Hierarchy_Store::build_hierarchy (Object_Hierarchy_Chunk * ohc,
VECTORCH offset;
- offset.vx = frame->transform.x * local_scale;
- offset.vy = frame->transform.y * local_scale;
- offset.vz = frame->transform.z * local_scale;
+ offset.vx = (int)(frame->transform.x * local_scale);
+ offset.vy = (int)(frame->transform.y * local_scale);
+ offset.vz = (int)(frame->transform.z * local_scale);
SetKeyFrameOffset(kfd,&offset);
@@ -1380,7 +1380,7 @@ static BOOL copy_rif_data_as_hierarchy (RIFFHANDLE h, int flags,int progress_sta
if((NumObjectsLoaded &0xf)==0)
{
//update bar every 16 objects
- Set_Progress_Bar_Position(progress_start+progress_interval*((.5*NumObjectsLoaded)/NumObjectsToLoad));
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*((.5*NumObjectsLoaded)/NumObjectsToLoad)));
}
NumObjectsLoaded++;
@@ -1440,7 +1440,7 @@ static BOOL copy_rif_data_as_hierarchy (RIFFHANDLE h, int flags,int progress_sta
int ir=svic->intensity_array[vn]>>16;
int ig=svic->intensity_array[vn]>>8 &0xff;
int ib=svic->intensity_array[vn] &0xff;
- int mag =sqrt((ir*ir+ig*ig+ib*ib)/3.0);
+ int mag = (int)sqrt((ir*ir+ig*ig+ib*ib)/3.0);
mainshapelist[osnp->sh_num]->sh_extraitemdata[vn].EID_VertexI = svic->intensity_array[vn] + (mag<<24);
@@ -1487,7 +1487,7 @@ static BOOL copy_rif_data_as_hierarchy (RIFFHANDLE h, int flags,int progress_sta
**-----------------------------*/
- Set_Progress_Bar_Position(progress_start+progress_interval*.5);
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*.5));
//get the distances at which the various detail levels should be used
int* distance_array=0;
Hierarchy_Degradation_Distance_Chunk* hddc=(Hierarchy_Degradation_Distance_Chunk*)h->fc->lookup_single_child("HIDEGDIS");
@@ -1587,7 +1587,7 @@ static BOOL copy_rif_data_as_hierarchy (RIFFHANDLE h, int flags,int progress_sta
for (LIF<Chunk *> cli (&cl); !cli.done(); cli.next())
{
- Set_Progress_Bar_Position(progress_start+progress_interval*(.7+(.2*NumHierLoaded)/NumHierToLoad));
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*(.7+(.2*NumHierLoaded)/NumHierToLoad)));
NumHierLoaded++;
Object_Hierarchy_Chunk * ohc = (Object_Hierarchy_Chunk *)cli();
@@ -1606,7 +1606,7 @@ static BOOL copy_rif_data_as_hierarchy (RIFFHANDLE h, int flags,int progress_sta
Global_Hierarchy_Library.add_entry(ghs);
- Set_Progress_Bar_Position(progress_start+progress_interval*.9);
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*.9));
//reset the sound directory
Rif_Sound_Directory=0;
@@ -1958,7 +1958,7 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
if((NumShapesLoaded & 0xf)==0)
{
//update bar every 16 objects
- Set_Progress_Bar_Position(progress_start+progress_interval*((.6*NumShapesLoaded)/NumShapesToLoad));
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*((.6*NumShapesLoaded)/NumShapesToLoad)));
}
NumShapesLoaded++;
@@ -2052,7 +2052,7 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
int ir=svic->intensity_array[vn]>>16;
int ig=svic->intensity_array[vn]>>8 &0xff;
int ib=svic->intensity_array[vn] &0xff;
- int mag =sqrt((ir*ir+ig*ig+ib*ib)/3.0);
+ int mag =(int)sqrt((ir*ir+ig*ig+ib*ib)/3.0);
mainshapelist[list_pos]->sh_extraitemdata[vn].EID_VertexI = svic->intensity_array[vn] + (mag<<24);
@@ -2130,7 +2130,7 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
if (flags & CCF_ENVIRONMENT)
{
- Set_Progress_Bar_Position(progress_start+progress_interval*.6);
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*.6));
}
MainScene.sm_module[mod_pos] = Term_Module;
MainScene.sm_marray[mod_pos] = 0;
@@ -2218,7 +2218,7 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
if (flags & CCF_ENVIRONMENT)
{
- Set_Progress_Bar_Position(progress_start+progress_interval*.7);
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*.7));
}
for (i=0; i<mod_pos; i++)
@@ -2582,7 +2582,7 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
if (flags & CCF_ENVIRONMENT)
{
- Set_Progress_Bar_Position(progress_start+progress_interval*.8);
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*.8));
}
//setup entry points
for(i=0;i<AIModuleArraySize;i++)
@@ -2701,7 +2701,7 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
- Set_Progress_Bar_Position(progress_start+progress_interval*.9);
+ Set_Progress_Bar_Position((int)(progress_start+progress_interval*.9));
}
else
{
diff --git a/src/avp/win95/scrshot.cpp b/src/avp/win95/scrshot.cpp
index 23ccd76..a26bef6 100644
--- a/src/avp/win95/scrshot.cpp
+++ b/src/avp/win95/scrshot.cpp
@@ -65,7 +65,9 @@ void LogCameraPosForModuleLinking()
#endif
}
int SaveCameraPosKeyPressed=0;
+#ifdef AVP_DEBUG_VERSION
static BOOL ModuleLinkAssist=FALSE;
+#endif
void HandleScreenShot()
{
diff --git a/src/avp/win95/system.c b/src/avp/win95/system.c
index 2be52f1..e2c9345 100644
--- a/src/avp/win95/system.c
+++ b/src/avp/win95/system.c
@@ -5,7 +5,13 @@
#include "stratdef.h"
#include "gamedef.h"
#include "bh_types.h"
+#include "bh_marin.h"
+#include "game.h"
#include "gameplat.h"
+#include "lighting.h"
+#include "messagehistory.h"
+#include "particle.h"
+#include "pldnet.h"
#define UseLocalAssert Yes
#include "ourasert.h"
@@ -461,13 +467,13 @@ void InitCharacter()
if(alien_weapon_rif!=INVALID_RIFFHANDLE)
- copy_rif_data(alien_weapon_rif,CCF_LOAD_AS_HIERARCHY_IF_EXISTS|CCF_IMAGEGROUPSET+CCF_DONT_INITIALISE_TEXTURES,PBAR_HUD_START+PBAR_HUD_INTERVAL*.5,PBAR_HUD_INTERVAL*.25);
+ copy_rif_data(alien_weapon_rif,CCF_LOAD_AS_HIERARCHY_IF_EXISTS|CCF_IMAGEGROUPSET|CCF_DONT_INITIALISE_TEXTURES,PBAR_HUD_START+PBAR_HUD_INTERVAL*.5,PBAR_HUD_INTERVAL*.25);
if(marine_weapon_rif!=INVALID_RIFFHANDLE)
- copy_rif_data(marine_weapon_rif,CCF_LOAD_AS_HIERARCHY_IF_EXISTS|CCF_IMAGEGROUPSET+CCF_DONT_INITIALISE_TEXTURES,PBAR_HUD_START+PBAR_HUD_INTERVAL*.5,PBAR_HUD_INTERVAL*.25);
+ copy_rif_data(marine_weapon_rif,CCF_LOAD_AS_HIERARCHY_IF_EXISTS|CCF_IMAGEGROUPSET|CCF_DONT_INITIALISE_TEXTURES,PBAR_HUD_START+PBAR_HUD_INTERVAL*.5,PBAR_HUD_INTERVAL*.25);
if(predator_weapon_rif!=INVALID_RIFFHANDLE)
- copy_rif_data(predator_weapon_rif,CCF_LOAD_AS_HIERARCHY_IF_EXISTS|CCF_IMAGEGROUPSET+CCF_DONT_INITIALISE_TEXTURES,PBAR_HUD_START+PBAR_HUD_INTERVAL*.5,PBAR_HUD_INTERVAL*.25);
+ copy_rif_data(predator_weapon_rif,CCF_LOAD_AS_HIERARCHY_IF_EXISTS|CCF_IMAGEGROUPSET|CCF_DONT_INITIALISE_TEXTURES,PBAR_HUD_START+PBAR_HUD_INTERVAL*.5,PBAR_HUD_INTERVAL*.25);
Set_Progress_Bar_Position(PBAR_HUD_START+PBAR_HUD_INTERVAL);
//copy_chunks_from_environment(0);
diff --git a/src/avp/win95/vision.c b/src/avp/win95/vision.c
index dea02d2..ad95ae5 100644
--- a/src/avp/win95/vision.c
+++ b/src/avp/win95/vision.c
@@ -9,6 +9,7 @@
#include "gamedef.h"
#include "bh_types.h"
#include "huddefs.h"
+#include "opengl.h"
/* patrick's sound include */
#include "psnd.h"
@@ -30,7 +31,7 @@
****************************************************************************************KJL*/
enum VISION_MODE_ID CurrentVisionMode;
-static visionModeDebounced=0;
+static int visionModeDebounced=0;
extern ACTIVESOUNDSAMPLE ActiveSounds[];
int predOVision_SoundHandle;
diff --git a/src/cdplayer.h b/src/cdplayer.h
index e55b671..8e0df2a 100644
--- a/src/cdplayer.h
+++ b/src/cdplayer.h
@@ -4,5 +4,6 @@
void CDDA_Start();
void CDDA_Stop();
void CDDA_End();
+void CheckCDVolume();
#endif
diff --git a/src/include/module.h b/src/include/module.h
index cf225f9..2c64a17 100644
--- a/src/include/module.h
+++ b/src/include/module.h
@@ -454,6 +454,7 @@ int SaveModuleArray(MODULE *mptr, char *filename);
MODULE* LoadModuleArray(MODULE *mptr, int size, char *filename);
int IsModuleVisibleFromModule(MODULE *source, MODULE *target);
+int ThisObjectIsInAModuleVisibleFromCurrentlyVisibleModules(struct strategyblock *sbPtr);
#endif /* IncludeModuleFunctionPrototypes */
diff --git a/src/kshape.h b/src/kshape.h
index 6bd1f60..a3434ef 100644
--- a/src/kshape.h
+++ b/src/kshape.h
@@ -110,6 +110,8 @@ void OutputTranslucentPolyList(void);
void RenderLightFlare(VECTORCH *positionPtr, unsigned int colour);
extern void RenderFlechetteParticle(PARTICLE *particlePtr);
void RenderExplosionSurface(VOLUMETRIC_EXPLOSION *explosionPtr);
+void ClearTranslucentPolyList(void);
+void AddHierarchicalShape(DISPLAYBLOCK *dptr, VIEWDESCRIPTORBLOCK *VDB_Ptr);
/* KJL 10:25:44 7/23/97 - this offset is used to push back the normal game gfx,
so that the HUD can be drawn over the top without sinking into walls, etc. */
diff --git a/src/menus.c b/src/menus.c
index f31014a..5415dc3 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -667,7 +667,7 @@ static int RenderSmallFontString(char *textPtr,int sx,int sy,int alpha, int red,
return sx;
}
-void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* output_x,int* output_y)
+void RenderSmallFontString_Wrapped(const char *textPtr,RECT* area,int alpha,int* output_x,int* output_y)
{
unsigned char *srcPtr;
unsigned short *destPtr;
@@ -684,7 +684,7 @@ void RenderSmallFontString_Wrapped(char *textPtr,RECT* area,int alpha,int* outpu
Determine area used by text , so we can draw it centrally
*/
{
- char *textPtr2=textPtr;
+ const char *textPtr2=textPtr;
while (*textPtr2) {
int widthFromSpaces=0;
int widthFromChars=0;
@@ -749,7 +749,7 @@ Determine area used by text , so we can draw it centrally
}
while ( *textPtr ) {
- char* textPtr2=textPtr;
+ const char* textPtr2=textPtr;
wordWidth=0;
while(*textPtr2 && *textPtr2==' ') {
diff --git a/src/net.c b/src/net.c
index 166ec4a..3c24f11 100644
--- a/src/net.c
+++ b/src/net.c
@@ -14,6 +14,7 @@
#include "equipmnt.h"
#include "pldnet.h"
+#include "net.h"
DPID AVPDPNetID;
diff --git a/src/net.h b/src/net.h
new file mode 100644
index 0000000..2456cbf
--- /dev/null
+++ b/src/net.h
@@ -0,0 +1,14 @@
+#ifndef AVP_NET_H
+#define AVP_NET_H
+
+BOOL DpExtInit(DWORD cGrntdBufs, DWORD cBytesPerBuf, BOOL bErrChcks);
+HRESULT DpExtRecv(int lpDP2A, void *lpidFrom, void *lpidTo, DWORD dwFlags, void *lplpData, LPDWORD lpdwDataSize);
+HRESULT DpExtSend(int lpDP2A, DPID idFrom, DPID idTo, DWORD dwFlags, void *lpData, DWORD dwDataSize);
+void DpExtUnInit();
+int DirectPlay_Disconnect();
+HRESULT IDirectPlayX_GetPlayerName(int glpDP, DPID id, void *data, void *size);
+int DirectPlay_ConnectingToSession();
+int DirectPlay_ConnectingToLobbiedGame(char* playerName);
+void DirectPlay_EnumConnections();
+
+#endif
diff --git a/src/openal.c b/src/openal.c
index ba0163c..d00a0ab 100644
--- a/src/openal.c
+++ b/src/openal.c
@@ -21,6 +21,7 @@
#include "dynamics.h"
#include "dynblock.h"
#include "stratdef.h"
+#include "openal.h"
ACTIVESOUNDSAMPLE ActiveSounds[SOUND_MAXACTIVE];
ACTIVESOUNDSAMPLE BlankActiveSound = {SID_NOSOUND,ASP_Minimum,0,0,NULL,0,0,0,0,0, { {0,0,0},{0,0,0},0,0 }, 0, 0, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, NULL, NULL, NULL};
diff --git a/src/openal.h b/src/openal.h
new file mode 100644
index 0000000..a227c31
--- /dev/null
+++ b/src/openal.h
@@ -0,0 +1,6 @@
+#ifndef OPENAL_AVP_H
+#define OPENAL_AVP_H
+
+void UpdateSoundFrequencies();
+
+#endif
diff --git a/src/opengl.h b/src/opengl.h
index 876a71e..91cce43 100644
--- a/src/opengl.h
+++ b/src/opengl.h
@@ -11,9 +11,13 @@ void D3D_DrawBackdrop();
void D3D_FadeDownScreen(int brightness, int colour);
void RenderString(char *stringPtr, int x, int y, int colour);
void RenderStringCentred(char *stringPtr, int centreX, int y, int colour);
+void RenderStringVertically(char *stringPtr, int centreX, int bottomY, int colour);
void D3D_DecalSystem_Setup();
void D3D_DecalSystem_End();
void SecondFlushD3DZBuffer();
void D3D_PlayerDamagedOverlay(int intensity);
+void D3D_PredatorScreenInversionOverlay();
+void D3D_ScreenInversionOverlay();
+void D3D_DrawColourBar(int yTop, int yBottom, int rScale, int gScale, int bScale);
#endif
diff --git a/src/win95/huffman.cpp b/src/win95/huffman.cpp
index b9523d9..f641071 100644
--- a/src/win95/huffman.cpp
+++ b/src/win95/huffman.cpp
@@ -236,7 +236,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
unsigned int promotions, excess, hi;
goal = 1 << maxdepth;
- for (n = 0, sum = 0, items = 0; n <= maxdepth; n++)
+ for (n = 0, sum = 0, items = 0; n <= (unsigned int)maxdepth; n++)
{
items += depth[n];
sum += (goal >> n) * depth[n];
@@ -249,7 +249,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
{
gain = (1 << (maxdepth - n)) - 1;
busts = (sum - goal + gain - 1) / gain;
- busts = depth[n] < busts ? depth[n] : busts;
+ busts = (unsigned int)depth[n] < busts ? depth[n] : busts;
depth[n] -= busts;
depth[maxdepth] += busts;
sum -= busts * gain;
@@ -259,7 +259,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
for (n = 0; excess; n++)
{
hi = 1 << (maxdepth - n);
- for (m = n + 1; m <= maxdepth; m++)
+ for (m = n + 1; m <= (unsigned int)maxdepth; m++)
{
gain = hi - (1 << (maxdepth - m));
if (excess < gain)
@@ -267,7 +267,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
if (depth[m])
{
promotions = excess / gain;
- promotions = depth[m] > promotions ? promotions : depth[m];
+ promotions = (unsigned int)depth[m] > promotions ? promotions : depth[m];
depth[n] += promotions;
depth[m] -= promotions;
excess -= promotions * gain;