Cleanups (Tim Beckmann)

This commit is contained in:
Steven Fuller 2002-01-09 23:07:34 +00:00 committed by Patryk Obara
parent 6fc3502f4b
commit 08545b98c6
62 changed files with 370 additions and 263 deletions

View file

@ -5,6 +5,7 @@
void AvpShowViews(void); void AvpShowViews(void);
void InitCameraValues(void); void InitCameraValues(void);
void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr); void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr);
void ReflectObject(DISPLAYBLOCK *dPtr);
extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr; extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr;

View file

@ -249,6 +249,7 @@
void Alien_GoToApproach(STRATEGYBLOCK *sbPtr); void Alien_GoToApproach(STRATEGYBLOCK *sbPtr);
void Alien_Awaken(STRATEGYBLOCK *sbPtr); void Alien_Awaken(STRATEGYBLOCK *sbPtr);
int AlienIsCrawling(STRATEGYBLOCK *sbPtr); int AlienIsCrawling(STRATEGYBLOCK *sbPtr);
void DoAlienLimbLossSound(VECTORCH *position);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -53,7 +53,9 @@ static int HuggerShouldAttackPlayer(void);
static void SetHuggerAnimationSequence(STRATEGYBLOCK *sbPtr, HUGGER_SUBSEQUENCES seq, int length); static void SetHuggerAnimationSequence(STRATEGYBLOCK *sbPtr, HUGGER_SUBSEQUENCES seq, int length);
static void KillFaceHugger(STRATEGYBLOCK *sbPtr,DAMAGE_PROFILE *damage); static void KillFaceHugger(STRATEGYBLOCK *sbPtr,DAMAGE_PROFILE *damage);
#if 0
static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr); static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr);
#endif
static void JumpAtPlayer(STRATEGYBLOCK *sbPtr); static void JumpAtPlayer(STRATEGYBLOCK *sbPtr);
extern SECTION *GetHierarchyFromLibrary(const char *rif_name); extern SECTION *GetHierarchyFromLibrary(const char *rif_name);
@ -932,6 +934,7 @@ static int HuggerShouldAttackPlayer(void)
return 1; return 1;
} }
#if 0
static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr) static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr)
{ {
struct collisionreport *nextReport; struct collisionreport *nextReport;
@ -948,6 +951,7 @@ static int InContactWithPlayer(DYNAMICSBLOCK *dynPtr)
return 0; return 0;
} }
#endif
static void JumpAtPlayer(STRATEGYBLOCK *sbPtr) static void JumpAtPlayer(STRATEGYBLOCK *sbPtr)
{ {

View file

@ -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_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 HIERARCHY_VARIANT_DATA* GetHierarchyAlternateShapeSetCollectionFromLibrary(const char* rif_name,int collection_index);
extern SECTION * GetNamedHierarchyFromLibrary(const char * rif_name, const char * hier_name); 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* CreateRocketKernel(VECTORCH *position, MATRIXCH *orient,int fromplayer);
extern STRATEGYBLOCK* CreateFrisbeeKernel(VECTORCH *position, MATRIXCH *orient, int fromplayer); extern STRATEGYBLOCK* CreateFrisbeeKernel(VECTORCH *position, MATRIXCH *orient, int fromplayer);
extern int AlienPCIsCurrentlyVisible(int checktime,STRATEGYBLOCK *sbPtr); extern int AlienPCIsCurrentlyVisible(int checktime,STRATEGYBLOCK *sbPtr);

View file

@ -145,6 +145,7 @@ typedef struct SpearBehaviourType
#define PROX_GRENADE_SOUND_GENERATION_TIME 65536 #define PROX_GRENADE_SOUND_GENERATION_TIME 65536
#define PROX_GRENADE_LIFETIME (20) #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 */ /* KJL 17:46:30 02/24/97 - below is some old stuff I'll leave for reference */

View file

@ -5,15 +5,13 @@
#include "avp_userprofile.h" #include "avp_userprofile.h"
#include "avp_menus.h" #include "avp_menus.h"
#include "cheatmodes.h"
int CheatMode_Active=0; int CheatMode_Active=0;
int CheatMode_Species=0; int CheatMode_Species=0;
int CheatMode_Environment=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 ThereIsAnAllowedEnvironment(void);
static int EnvironmentPlayableBySpecies(int environment); static int EnvironmentPlayableBySpecies(int environment);

10
src/avp/cheatmodes.h Normal file
View file

@ -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

View file

@ -23,6 +23,7 @@
#include "paintball.h" #include "paintball.h"
#include "detaillevels.h" #include "detaillevels.h"
#include "savegame.h" #include "savegame.h"
#include "decal.h"
#define UseLocalAssert Yes #define UseLocalAssert Yes
#include "ourasert.h" #include "ourasert.h"

View file

@ -99,6 +99,7 @@ extern void HandleDecalSystem(void);
struct section_data; // hmodel.h struct section_data; // hmodel.h
extern void AddDecalToHModel(VECTORCH *normalPtr, VECTORCH *positionPtr, struct section_data *sectionPtr); 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 FIXED_DECAL* AllocateFixedDecal(void);
extern void RemoveFixedDecal(void); extern void RemoveFixedDecal(void);

View file

@ -25,6 +25,7 @@
#include "bh_rubberduck.h" #include "bh_rubberduck.h"
#include "bh_weap.h" #include "bh_weap.h"
#include "weapons.h" #include "weapons.h"
#include "decal.h"
#include "avpview.h" #include "avpview.h"
#include "pldghost.h" #include "pldghost.h"
#include "detaillevels.h" #include "detaillevels.h"

View file

@ -200,6 +200,9 @@ void MakeGrenadeTrailParticles(VECTORCH *prevPositionPtr, VECTORCH *positionPtr)
void MakePlasmaTrailParticles(DYNAMICSBLOCK *dynPtr, int number); void MakePlasmaTrailParticles(DYNAMICSBLOCK *dynPtr, int number);
void NewTrailPoint(DYNAMICSBLOCK *dynPtr); void NewTrailPoint(DYNAMICSBLOCK *dynPtr);
void TimeScaleThingy(); 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 #define MAX_NO_OF_BLOOD_PARTICLES 500

View file

@ -605,6 +605,7 @@ typedef struct epbbextents
int minZ; int minZ;
} EPBBEXTENTS; } EPBBEXTENTS;
#if 0
static EPBBEXTENTS MI_Volume1; static EPBBEXTENTS MI_Volume1;
static EPBBEXTENTS MI_Volume2; static EPBBEXTENTS MI_Volume2;
static EPBBEXTENTS MI_Volume3; static EPBBEXTENTS MI_Volume3;
@ -612,6 +613,7 @@ static EPBBEXTENTS MI_Volume3;
static int GetModulesIntersection(MODULE *thisModule, MODULE *targetModule); static int GetModulesIntersection(MODULE *thisModule, MODULE *targetModule);
static int GetModulePointBox(MODULE *thisModule, EPBBEXTENTS *extents); static int GetModulePointBox(MODULE *thisModule, EPBBEXTENTS *extents);
static void AddModuleEP(MODULE* thisModule, MODULE*fromModule, VECTORCH *posn); static void AddModuleEP(MODULE* thisModule, MODULE*fromModule, VECTORCH *posn);
#endif
/*-----------------------Patrick 16/12/96--------------------------- /*-----------------------Patrick 16/12/96---------------------------
This Function checks if a module has any adjacent modules, and if 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. Returns 1 if the bounding box is valis, 0 if not.
------------------------------------------------------------------*/ ------------------------------------------------------------------*/
#if 0
static int GetModulesIntersection(MODULE *thisModule, MODULE *targetModule) static int GetModulesIntersection(MODULE *thisModule, MODULE *targetModule)
{ {
int thisExtent, targetExtent; int thisExtent, targetExtent;
@ -1051,7 +1054,7 @@ static void AddModuleEP(MODULE* thisModule, MODULE*fromModule, VECTORCH *posn)
FARENTRYPOINTSHEADER *epHeader = &FALLP_EntryPoints[thisModule->m_index]; FARENTRYPOINTSHEADER *epHeader = &FALLP_EntryPoints[thisModule->m_index];
FARENTRYPOINT *epList = epHeader->entryPointsList; 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 /* no room for any more eps. This may occur where two modules are not
mutually linked as adjacent... specifically, the target is missing the 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)++; (epHeader->numEntryPoints)++;
} }
#endif
/*-----------------------Patrick 20/12/96--------------------------- /*-----------------------Patrick 20/12/96---------------------------
LOCAL FUNCTIONS FOR AUXILARY MODULE LOCATION SUPPORT LOCAL FUNCTIONS FOR AUXILARY MODULE LOCATION SUPPORT

View file

@ -19,6 +19,9 @@ so player.c is looking a bit bare at the moment. */
#include "particle.h" #include "particle.h"
#include "scream.h" #include "scream.h"
#include "savegame.h" #include "savegame.h"
#include "game_statistics.h"
#include "pfarlocs.h"
#include "bh_ais.h"
#if SupportWindows95 #if SupportWindows95
#include "rebmenus.hpp" #include "rebmenus.hpp"
#endif #endif
@ -112,7 +115,9 @@ void InitPlayer(STRATEGYBLOCK* sbPtr, int sb_type)
* and fills in some initial values. * * and fills in some initial values. *
**************************************************************************************KJL*/ **************************************************************************************KJL*/
#if 0
SECTION *root_section; SECTION *root_section;
#endif
PLAYER_STATUS *psPtr = &PlayerStatusBlock; PLAYER_STATUS *psPtr = &PlayerStatusBlock;
GLOBALASSERT(psPtr); GLOBALASSERT(psPtr);
GLOBALASSERT(sbPtr); GLOBALASSERT(sbPtr);
@ -1346,7 +1351,9 @@ void DeInitialisePlayer(void) {
/* I thought it would be logical to put it here... */ /* I thought it would be logical to put it here... */
int slot = MAX_NO_OF_WEAPON_SLOTS; int slot = MAX_NO_OF_WEAPON_SLOTS;
#if 0
PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr); PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr);
#endif
do { do {
TXACTRLBLK *txactrl,*txactrl_next; TXACTRLBLK *txactrl,*txactrl_next;

View file

@ -2,5 +2,8 @@
#define PLAYER_H #define PLAYER_H
void DeInitialisePlayer(void); void DeInitialisePlayer(void);
void ChangeToMarine();
void ChangeToAlien();
void ChangeToPredator();
#endif #endif

View file

@ -37,6 +37,7 @@
#include "avp_menus.h" #include "avp_menus.h"
#include "lighting.h" #include "lighting.h"
#include "scream.h" #include "scream.h"
#include "player.h"
#include "avp_userprofile.h" #include "avp_userprofile.h"
@ -104,9 +105,14 @@ unsigned char GotAnyKey;
#endif #endif
static char FlyModeOn = 0; static char FlyModeOn = 0;
#if FLY_MODE_CHEAT_ON
static char FlyModeDebounced = 0; static char FlyModeDebounced = 0;
#endif
#if 0
static char BonusAbilityDebounced = 0; static char BonusAbilityDebounced = 0;
static void MakePlayerLieDown(STRATEGYBLOCK* sbPtr);
#endif
extern int deathFadeLevel; extern int deathFadeLevel;
extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr; extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr;
@ -117,7 +123,6 @@ extern void DeInitialisePlayer(void);
/* some prototypes for this source file */ /* some prototypes for this source file */
static void MakePlayerCrouch(STRATEGYBLOCK* sbPtr); static void MakePlayerCrouch(STRATEGYBLOCK* sbPtr);
static void MakePlayerLieDown(STRATEGYBLOCK* sbPtr);
static void MaintainPlayerShape(STRATEGYBLOCK* sbPtr); static void MaintainPlayerShape(STRATEGYBLOCK* sbPtr);
static void NetPlayerDeadProcessing(STRATEGYBLOCK* sbPtr); static void NetPlayerDeadProcessing(STRATEGYBLOCK* sbPtr);
static void CorpseMovement(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 SECTION * GetNamedHierarchyFromLibrary(const char * rif_name, const char * hier_name);
extern void NewOnScreenMessage(unsigned char *messagePtr); extern void NewOnScreenMessage(unsigned char *messagePtr);
extern void RemoveAllThisPlayersDiscs(void); extern void RemoveAllThisPlayersDiscs(void);
void NetPlayerRespawn(STRATEGYBLOCK *sbPtr);
int timeInContactWithFloor; int timeInContactWithFloor;
@ -1173,8 +1177,6 @@ static void CorpseMovement(STRATEGYBLOCK *sbPtr)
------------------------------------------------------*/ ------------------------------------------------------*/
static void NetPlayerDeadProcessing(STRATEGYBLOCK *sbPtr) static void NetPlayerDeadProcessing(STRATEGYBLOCK *sbPtr)
{ {
SECTION *root_section;
#if SupportWindows95 #if SupportWindows95
PLAYER_STATUS *psPtr= (PLAYER_STATUS *) (sbPtr->SBdataptr); PLAYER_STATUS *psPtr= (PLAYER_STATUS *) (sbPtr->SBdataptr);
@ -1257,7 +1259,9 @@ extern void InitPlayerCloakingSystem(void);
void NetPlayerRespawn(STRATEGYBLOCK *sbPtr) void NetPlayerRespawn(STRATEGYBLOCK *sbPtr)
{ {
extern int LeanScale; extern int LeanScale;
#if 0
SECTION *root_section; SECTION *root_section;
#endif
#if SupportWindows95 #if SupportWindows95
PLAYER_STATUS *psPtr= (PLAYER_STATUS *) (sbPtr->SBdataptr); PLAYER_STATUS *psPtr= (PLAYER_STATUS *) (sbPtr->SBdataptr);
@ -1684,18 +1688,6 @@ static void LoadInMovementValues(void)
#endif #endif
void ThrowAFlare(void) void ThrowAFlare(void)
{ {
extern int NumberOfFlaresActive; extern int NumberOfFlaresActive;

View file

@ -75,6 +75,7 @@ extern void PlayerBehaviour(STRATEGYBLOCK* sbptr);
extern void ExecuteFreeMovement(STRATEGYBLOCK* sbPtr); extern void ExecuteFreeMovement(STRATEGYBLOCK* sbPtr);
void ThrowAFlare(void); void ThrowAFlare(void);
void StartPlayerTaunt(void); void StartPlayerTaunt(void);
void NetPlayerRespawn(STRATEGYBLOCK *sbPtr);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -18,6 +18,9 @@
#include "db.h" #include "db.h"
#include "showcmds.h" #include "showcmds.h"
#include "avp_userprofile.h" #include "avp_userprofile.h"
#include "cdplayer.h"
#include "openal.h"
/* Patrick 5/6/97 ------------------------------------------------------------- /* Patrick 5/6/97 -------------------------------------------------------------
Internal globals Internal globals
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/

View file

@ -44,10 +44,12 @@
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
int weaponHandle = SOUND_NOACTIVEINDEX; int weaponHandle = SOUND_NOACTIVEINDEX;
#if 0
static int weaponReloading = 0; static int weaponReloading = 0;
static int backgroundHandle = SOUND_NOACTIVEINDEX;
#endif
static int sadarReloadTimer = 0; static int sadarReloadTimer = 0;
static int weaponPitchTimer = 0; static int weaponPitchTimer = 0;
static int backgroundHandle = SOUND_NOACTIVEINDEX;
static int playOneShotWS = 1; static int playOneShotWS = 1;
static int oldRandomValue = -1; static int oldRandomValue = -1;
@ -76,6 +78,7 @@ extern ACTIVESOUNDSAMPLE ActiveSounds[];
A.N.Other background sound management function A.N.Other background sound management function
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
#if 0
static void DoPredatorBackgroundLoop(void) static void DoPredatorBackgroundLoop(void)
{ {
if (backgroundHandle == SOUND_NOACTIVEINDEX) if (backgroundHandle == SOUND_NOACTIVEINDEX)
@ -83,7 +86,7 @@ static void DoPredatorBackgroundLoop(void)
Sound_Play(SID_VISION_LOOP,"evl",&backgroundHandle,75); Sound_Play(SID_VISION_LOOP,"evl",&backgroundHandle,75);
} }
} }
#endif
void DoPlayerSounds(void) void DoPlayerSounds(void)

View file

@ -8,6 +8,8 @@
extern "C" { extern "C" {
#endif #endif
#include "equipmnt.h"
/* Andy 12/6/97 -------------------------------------------------------------- /* Andy 12/6/97 --------------------------------------------------------------
Some background sound defines Some background sound defines
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
@ -371,6 +373,7 @@ extern void MenuChangeSound(void);
extern void MenuSelectSound(void); extern void MenuSelectSound(void);
extern void MenuNotAvailableSound(int *handlePtr); extern void MenuNotAvailableSound(int *handlePtr);
extern void MenuSliderBarSound(int *handlePtr); extern void MenuSliderBarSound(int *handlePtr);
void PlayWeaponClickingNoise(enum WEAPON_ID weaponIDNumber);
/* Patrick 5/6/97 ------------------------------------------------------------- /* Patrick 5/6/97 -------------------------------------------------------------

View file

@ -32,6 +32,11 @@
#include "bh_dummy.h" #include "bh_dummy.h"
#include "bh_videoscreen.h" #include "bh_videoscreen.h"
#include "bh_plift.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 #if SupportWindows95
/* for win95 net game support */ /* for win95 net game support */
@ -73,8 +78,8 @@ MODULEMAPBLOCK VisibilityDefaultObjectMap =
{ {
MapType_Default, MapType_Default,
I_ShapeCube, /* this is a default value */ I_ShapeCube, /* this is a default value */
0,0,0, {0,0,0},
0,0,0, {0,0,0},
#if StandardStrategyAndCollisions #if StandardStrategyAndCollisions
ObFlag_Dynamic|ObFlag_NewtonMovement|ObFlag_MatMul, ObFlag_Dynamic|ObFlag_NewtonMovement|ObFlag_MatMul,
#else #else
@ -96,14 +101,16 @@ MODULEMAPBLOCK VisibilityDefaultObjectMap =
0, 0,
0,0,0, 0,0,0,
#endif #endif
0,0,0, {0,0,0},
0, 0,
0, 0,
#if StandardStrategyAndCollisions #if StandardStrategyAndCollisions
0, 0,
0, 0,
#endif #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... environment, or an npc falls out...
NB returns 0 if relocation failed. NB returns 0 if relocation failed.
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
static EmergRelocCalls = 0; static int EmergRelocCalls = 0;
static int EmergencyRelocateObject(STRATEGYBLOCK *sbPtr) static int EmergencyRelocateObject(STRATEGYBLOCK *sbPtr)
{ {

View file

@ -29,6 +29,8 @@
#include "avp_menus.h" #include "avp_menus.h"
#include "game_statistics.h" #include "game_statistics.h"
#include "avp_userprofile.h" #include "avp_userprofile.h"
#include "huddefs.h"
#include "avp_menus.h"
#include "savegame.h" #include "savegame.h"
#include "huffman.hpp" #include "huffman.hpp"

View file

@ -284,7 +284,7 @@ void HandleObjectOnFire(DISPLAYBLOCK *dispPtr)
MakeParticle(&(position), &velocity, PARTICLE_FIRE); MakeParticle(&(position), &velocity, PARTICLE_FIRE);
} }
if (FastRandom()&65535 > 32768) if ((FastRandom()&65535) > 32768)
{ {
MakeParticle(&(position), &velocity, PARTICLE_IMPACTSMOKE); MakeParticle(&(position), &velocity, PARTICLE_IMPACTSMOKE);
} }

View file

@ -69,12 +69,12 @@ SHAPEHEADER CUBE_header={
}; };
SHAPEINSTR CUBE_instructions[]={ SHAPEINSTR CUBE_instructions[]={
I_ShapePoints,8,&CUBE_points[0], {I_ShapePoints,8,&CUBE_points[0]},
I_ShapeNormals,6,&CUBE_normals[0], {I_ShapeNormals,6,&CUBE_normals[0]},
I_ShapeProject,8,&CUBE_points[0], {I_ShapeProject,8,&CUBE_points[0]},
I_ShapeVNormals,8,&CUBE_vnormals[0], {I_ShapeVNormals,8,&CUBE_vnormals[0]},
I_ShapeItems,6,&CUBE_items[0], {I_ShapeItems,6,&CUBE_items[0]},
I_ShapeEnd,0,0 {I_ShapeEnd,0,0}
}; };
int *CUBE_points[]={ int *CUBE_points[]={

View file

@ -16,6 +16,7 @@
#include "bh_corpse.h" #include "bh_corpse.h"
#include "bh_debri.h" #include "bh_debri.h"
#include "pldnet.h" #include "pldnet.h"
#include "maths.h"
/* /*
this attaches runtime and precompiled object this attaches runtime and precompiled object
strategyblocks strategyblocks

View file

@ -325,18 +325,6 @@ ACTIVITY_RETURN_TYPE CyclicPulsingCoordinate :: Activity(ACTIVITY_INPUT)
#if 1 #if 1
HomingCoordinate::HomingCoordinate HomingCoordinate::HomingCoordinate
( (

View file

@ -121,7 +121,7 @@ void RE_ENTRANT_QUEUE_WinMain_FlushMessages(void)
// AVP/Win95-specific code // AVP/Win95-specific code
if ( HUDGadget :: GetHUD() ) if ( HUDGadget :: GetHUD() )
{ {
int i; unsigned int i;
for (i=0;i<NumQMessages;i++) for (i=0;i<NumQMessages;i++)
{ {

View file

@ -535,7 +535,7 @@ SCString :: SCString
NumberOfCharacters = STRUTIL_SC_Strlen( pProjCh_Init ); NumberOfCharacters = STRUTIL_SC_Strlen( pProjCh_Init );
// doesn't include NULL terminator // doesn't include NULL terminator
if ( NumberOfCharacters > Length ) if ( (unsigned)NumberOfCharacters > Length )
{ {
NumberOfCharacters = Length; NumberOfCharacters = Length;
} }

View file

@ -3,3 +3,4 @@
extern void GetTargetingPointOfObject(DISPLAYBLOCK *objectPtr, VECTORCH *targetPtr); extern void GetTargetingPointOfObject(DISPLAYBLOCK *objectPtr, VECTORCH *targetPtr);
extern void GetTargetingPointOfObject_Far(STRATEGYBLOCK *sbPtr, VECTORCH *targetPtr); extern void GetTargetingPointOfObject_Far(STRATEGYBLOCK *sbPtr, VECTORCH *targetPtr);
extern void CalculatePlayersTarget(TEMPLATE_WEAPON_DATA *twPtr, PLAYER_WEAPON_DATA *weaponPtr); extern void CalculatePlayersTarget(TEMPLATE_WEAPON_DATA *twPtr, PLAYER_WEAPON_DATA *weaponPtr);
void SmartTarget_GetCofM(DISPLAYBLOCK *target,VECTORCH *viewSpaceOutput);

View file

@ -12,6 +12,7 @@
#include "huddefs.h" #include "huddefs.h"
#include "triggers.h" #include "triggers.h"
#include "pldnet.h" #include "pldnet.h"
#include "los.h"
#define UseLocalAssert Yes #define UseLocalAssert Yes
#include "ourasert.h" #include "ourasert.h"

View file

@ -35,6 +35,8 @@
#include "bh_light.h" #include "bh_light.h"
#include "bh_corpse.h" #include "bh_corpse.h"
#include "bh_ais.h" #include "bh_ais.h"
#include "bh_videoscreen.h"
#include "bh_track.h"
#include "weapons.h" #include "weapons.h"
#include "avpview.h" #include "avpview.h"
@ -46,6 +48,7 @@
#include "psndproj.h" #include "psndproj.h"
#include "psndplat.h" #include "psndplat.h"
#include "showcmds.h" #include "showcmds.h"
#include "projload.hpp"
/* for win 95 net support */ /* for win 95 net support */
#if SupportWindows95 #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, int Staff_Manager(DAMAGE_PROFILE *damage,SECTION_DATA *section1,SECTION_DATA *section2,SECTION_DATA *section3,
STRATEGYBLOCK *wielder); STRATEGYBLOCK *wielder);
static void FireLineOfSightAmmo(enum AMMO_ID AmmoID, VECTORCH* sourcePtr, VECTORCH* directionPtr, int multiple);
static void PlayerFireLineOfSightAmmo(enum AMMO_ID AmmoID, int multiple); static void PlayerFireLineOfSightAmmo(enum AMMO_ID AmmoID, int multiple);
extern void FireProjectileAmmo(enum AMMO_ID AmmoID); 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 PC_Alien_Eat_Attack(int hits);
int FirePredatorDisc(PLAYER_WEAPON_DATA *weaponPtr,SECTION_DATA *disc_section); 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 BiteAttack_AwardHealth(STRATEGYBLOCK *sbPtr,AVP_BEHAVIOUR_TYPE pre_bite_type);
void LimbRip_AwardHealth(void); void LimbRip_AwardHealth(void);
void GrenadeLauncher_EmergencyChangeAmmo(PLAYER_WEAPON_DATA *weaponPtr); 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)) } else if ((RequestChangeOfWeapon(playerStatusPtr,weaponPtr))
||((playerStatusPtr->SelectedWeaponSlot!=playerStatusPtr->SwapToWeaponSlot)) ||((playerStatusPtr->SelectedWeaponSlot!=playerStatusPtr->SwapToWeaponSlot)
&&(playerStatusPtr->SwapToWeaponSlot!=WEAPON_FINISHED_SWAPPING)) { &&(playerStatusPtr->SwapToWeaponSlot!=WEAPON_FINISHED_SWAPPING))) {
weaponPtr->CurrentState = WEAPONSTATE_UNREADYING; weaponPtr->CurrentState = WEAPONSTATE_UNREADYING;
weaponPtr->StateTimeOutCounter = WEAPONSTATE_INITIALTIMEOUTCOUNT; weaponPtr->StateTimeOutCounter = WEAPONSTATE_INITIALTIMEOUTCOUNT;
NewOnScreenMessage 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) static void FireLineOfSightAmmo(enum AMMO_ID AmmoID, VECTORCH* sourcePtr, VECTORCH* directionPtr, int multiple)
{ {
#if 0 #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); HandleWeaponImpact(&LOS_Point,LOS_ObjectHitPtr->ObStrategyBlock,AmmoID,directionPtr, multiple*ONE_FIXED, LOS_HModel_Section);
} }
} }
#endif
static void CalculateTorque(EULER *rotationPtr, VECTORCH *directionPtr, STRATEGYBLOCK *sbPtr) 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) { int PlayerFireFlameThrower(PLAYER_WEAPON_DATA *weaponPtr) {
extern VECTORCH CentreOfMuzzleOffset;
VECTORCH *firingpos; VECTORCH *firingpos;
TEMPLATE_WEAPON_DATA *twPtr=&TemplateWeapon[weaponPtr->WeaponIDNumber]; 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) } 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_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->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>2)&&(this_section_data->sempai->flags&section_flag_fragonlyfordisks))
||((damage->Slicing>0)&&((this_section_data->sempai->flags&section_flag_fragonlyfordisks)==0)) ||((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) #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) void HandleSpearImpact(VECTORCH *positionPtr, STRATEGYBLOCK *sbPtr, enum AMMO_ID AmmoID, VECTORCH *directionPtr, int multiple, SECTION_DATA *this_section_data)
{ {
VECTORCH incoming,*invec; 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) int FireMarineTwoPistols(PLAYER_WEAPON_DATA *weaponPtr, int secondary)
{ {
TEMPLATE_WEAPON_DATA *twPtr=&TemplateWeapon[weaponPtr->WeaponIDNumber]; TEMPLATE_WEAPON_DATA *twPtr=&TemplateWeapon[weaponPtr->WeaponIDNumber];
@ -11778,6 +11764,18 @@ int FireMarineTwoPistols(PLAYER_WEAPON_DATA *weaponPtr, int secondary)
return(1); 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) { void MarineTwoPistols_Fidget(void *playerStatus, PLAYER_WEAPON_DATA *weaponPtr) {
DELTA_CONTROLLER *FireRight; DELTA_CONTROLLER *FireRight;

View file

@ -95,6 +95,7 @@ extern void PositionPlayersWeapon(void);
extern void PositionPlayersWeaponMuzzleFlash(void); extern void PositionPlayersWeaponMuzzleFlash(void);
extern void AutoSwapToDisc(void); extern void AutoSwapToDisc(void);
extern void AutoSwapToDisc_OutOfSequence(void); extern void AutoSwapToDisc_OutOfSequence(void);
void CreateSpearPossiblyWithFragment(DISPLAYBLOCK *dispPtr, VECTORCH *spearPositionPtr, VECTORCH *spearDirectionPtr);
struct Target struct Target

View file

@ -329,7 +329,7 @@ AVP_Generator_Extended_Settings_Chunk::AVP_Generator_Extended_Settings_Chunk(Chu
CHUNK_EXTRACT(spare2,int) 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]; weights=(AVP_Generator_Weighting*)new unsigned char[size];
memset(weights,0,sizeof(AVP_Generator_Weighting)); 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; int loaded_decal_size=*(int*)data;
data+=4; 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 //allocate buffer for decals , and initialise to zero
decal_buffer=new char[num_decals*decal_size]; 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 //only allow access to the decals if the loaded structure size is less than or equal
//to the current stucture size //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; decals=(AVP_Decal*)decal_buffer;
} }

View file

@ -192,8 +192,6 @@ void D3D_InitialiseMarineHUD(void)
{ {
//SelectGenTexDirectory(ITI_TEXTURE); //SelectGenTexDirectory(ITI_TEXTURE);
extern unsigned char *ScreenBuffer;
/* set game mode: different though for multiplayer game */ /* set game mode: different though for multiplayer game */
if(AvP.Network==I_No_Network) if(AvP.Network==I_No_Network)
cl_pszGameMode = "marine"; cl_pszGameMode = "marine";
@ -328,7 +326,6 @@ void D3D_BLTMotionTrackerToHUD(int scanLineSize)
struct VertexTag quadVertices[4]; struct VertexTag quadVertices[4];
int widthCos,widthSin; int widthCos,widthSin;
extern int CloakingPhase;
BlueBar.TopLeftY = ScreenDescriptorBlock.SDB_Height-MUL_FIXED(MotionTrackerScale,40); BlueBar.TopLeftY = ScreenDescriptorBlock.SDB_Height-MUL_FIXED(MotionTrackerScale,40);
MotionTrackerCentreY = BlueBar.TopLeftY; MotionTrackerCentreY = BlueBar.TopLeftY;
@ -444,7 +441,6 @@ void D3D_BLTMotionTrackerToHUD(int scanLineSize)
void D3D_BLTMotionTrackerBlipToHUD(int x, int y, int brightness) void D3D_BLTMotionTrackerBlipToHUD(int x, int y, int brightness)
{ {
HUDImageDesc imageDesc; HUDImageDesc imageDesc;
int screenX,screenY; /* in 16.16 */
int frame; int frame;
int motionTrackerScaledHalfWidth = MUL_FIXED(MotionTrackerScale*3,MotionTrackerHalfWidth/2); 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) void Render_HealthAndArmour(unsigned int health, unsigned int armour)
{ {
HUDCharDesc charDesc;
int i=MAX_NO_OF_COMMON_HUD_DIGITS;
unsigned int healthColour; unsigned int healthColour;
unsigned int armourColour; 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) 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; int xCentre = MUL_FIXED(HUDLayout_RightmostTextCentre,HUDScaleFactor)+ScreenDescriptorBlock.SDB_Width;
if(!primaryAmmo) xCentre+=MUL_FIXED(HUDScaleFactor,HUDLayout_RightmostTextCentre*2); if(!primaryAmmo) xCentre+=MUL_FIXED(HUDScaleFactor,HUDLayout_RightmostTextCentre*2);

View file

@ -90,7 +90,12 @@ void PlatformSpecificEnteringHUD(void);
void BLTMotionTrackerToHUD(int scanLineSize); void BLTMotionTrackerToHUD(int scanLineSize);
void BLTMotionTrackerBlipToHUD(int x, int y, int brightness); void BLTMotionTrackerBlipToHUD(int x, int y, int brightness);
#if 0
static void BLTDigitToHUD(char digit, int x, int y, int font); 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 BLTGunSightToScreen(int screenX, int screenY, enum GUNSIGHT_SHAPE gunsightShape);
void BLTWeaponToHUD(PLAYER_WEAPON_DATA* weaponPtr); void BLTWeaponToHUD(PLAYER_WEAPON_DATA* weaponPtr);
@ -98,14 +103,11 @@ int CueWeaponFrameFromSequence(struct WeaponFrameTag *weaponFramePtr, int timeOu
void BLTPredatorOverlayToHUD(void);
void BLTPredatorNumericsToHUD(void); void BLTPredatorNumericsToHUD(void);
static void BLTPredatorDigitToHUD(char digit, int x, int y, int font);
void LoadDDGraphic(struct DDGraphicTag *DDGfxPtr, char *Filename); void LoadDDGraphic(struct DDGraphicTag *DDGfxPtr, char *Filename);
static void DrawMotionTrackerPoly(void);
static void SetupScanlinePoly(char const *filenamePtr, int width); static void SetupScanlinePoly(char const *filenamePtr, int width);

View file

@ -20,7 +20,7 @@ DWORD GetLittleDword(FILE *fp)
unsigned char c3 = fgetc(fp); unsigned char c3 = fgetc(fp);
unsigned char c4 = 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) VOID PutByte(BYTE v, FILE *fp)

View file

@ -1080,7 +1080,7 @@ extern void MakeUserProfileSelectMenu(void)
else UserProfileNumber=0; else UserProfileNumber=0;
} }
extern void MakeConnectionSelectMenu() void MakeConnectionSelectMenu()
{ {
int pos=0; int pos=0;

View file

@ -0,0 +1,6 @@
#ifndef AVP_MENUDATA_H
#define AVP_MENUDATA_H
void MakeConnectionSelectMenu();
#endif

View file

@ -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; DDSURFACEDESC ddsdimage;
unsigned short *destPtr; unsigned short *destPtr;

View file

@ -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 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 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); extern void DrawAvPMenuGfx(enum AVPMENUGFX_ID menuGfxID, int topleftX, int topleftY, int alpha,enum AVPMENUFORMAT_ID format);

View file

@ -4,8 +4,12 @@
#include "stratdef.h" #include "stratdef.h"
#include "gamedef.h" #include "gamedef.h"
#include "bh_types.h" #include "bh_types.h"
#include "cheatmodes.h"
#include "net.h"
#include "opengl.h"
#include "pldnet.h" #include "pldnet.h"
#include "avp_menudata.h"
#include "avp_menus.h" #include "avp_menus.h"
#include "avp_envinfo.h" #include "avp_envinfo.h"
@ -75,6 +79,9 @@ extern void Show_WinnerScreen(void);
extern void GetNextAllowedSpecies(int* species,BOOL search_forwards); extern void GetNextAllowedSpecies(int* species,BOOL search_forwards);
static void SetBriefingTextForMultiplayer(); 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]; int CloudTable[128][128];
@ -110,8 +117,6 @@ void HandleCheatModeFeatures(void);
void ShowMenuFrameRate(void); void ShowMenuFrameRate(void);
static void KeyboardEntryQueue_Clear(void); static void KeyboardEntryQueue_Clear(void);
static void KeyboardEntryQueue_StartProcessing(void); static void KeyboardEntryQueue_StartProcessing(void);
void ScanSaveSlots(void);
extern void GetFilenameForSaveSlot(int i, unsigned char *filenamePtr);
static void PasteFromClipboard(char* Text,int MaxTextLength); static void PasteFromClipboard(char* Text,int MaxTextLength);
/* KJL 11:23:03 23/06/98 - Requirements /* KJL 11:23:03 23/06/98 - Requirements
@ -2038,8 +2043,8 @@ static void ActUponUsersInput(void)
{ {
extern char AAFontWidths[256]; extern char AAFontWidths[256];
//using small font //using small font
if(AvPMenus.WidthLeftForText<AAFontWidths[c]) break; if(AvPMenus.WidthLeftForText<AAFontWidths[(int)c]) break;
AvPMenus.WidthLeftForText-=AAFontWidths[c]; AvPMenus.WidthLeftForText-=AAFontWidths[(int)c];
} }
elementPtr->c.TextPtr[AvPMenus.PositionInTextField++] = c; elementPtr->c.TextPtr[AvPMenus.PositionInTextField++] = c;
@ -2070,7 +2075,7 @@ static void ActUponUsersInput(void)
char c=0; char c=0;
KeyboardEntryQueue_StartProcessing(); KeyboardEntryQueue_StartProcessing();
while(c=KeyboardEntryQueue_ProcessCharacter()) while((c=KeyboardEntryQueue_ProcessCharacter()))
{ {
if (AvPMenus.PositionInTextField<elementPtr->b.MaxTextLength) if (AvPMenus.PositionInTextField<elementPtr->b.MaxTextLength)
{ {
@ -5300,7 +5305,7 @@ void RenderBriefingText(int centreY, int brightness)
while(*ptr) while(*ptr)
{ {
length+=AAFontWidths[*ptr++]; length+=AAFontWidths[(int)(*ptr++)];
} }
} }

View file

@ -352,5 +352,7 @@ int AvP_InGameMenus(void);
int InGameMenusAreRunning(void); int InGameMenusAreRunning(void);
void RenderBriefingText(int centreY, int brightness); void RenderBriefingText(int centreY, int brightness);
void GetFilenameForSaveSlot(int i, unsigned char *filenamePtr);
void ScanSaveSlots(void);
#endif #endif

View file

@ -58,6 +58,7 @@ static char *LoresMarineHUDGfxFilenamePtr[]=
{"trakfont.pg0"}, {"trakfont.pg0"},
{"bluebar.pg0"}, {"bluebar.pg0"},
}; };
#if 0
static struct HUDFontDescTag LoresHUDFontDesc[] = static struct HUDFontDescTag LoresHUDFontDesc[] =
{ {
//MARINE_HUD_FONT_BLUE, //MARINE_HUD_FONT_BLUE,
@ -92,6 +93,7 @@ static struct HUDFontDescTag LoresHUDFontDesc[] =
}, },
}; };
#endif
static struct LittleMDescTag LoresHUDLittleM = static struct LittleMDescTag LoresHUDLittleM =
{ {
80,8, // source top,left 80,8, // source top,left
@ -154,6 +156,7 @@ static char *MedresMarineHUDGfxFilenamePtr[]=
{"trkfntmr.pg0"}, {"trkfntmr.pg0"},
{"blubarmr.pg0"}, {"blubarmr.pg0"},
}; };
#if 0
static struct HUDFontDescTag MedresHUDFontDesc[] = static struct HUDFontDescTag MedresHUDFontDesc[] =
{ {
//MARINE_HUD_FONT_BLUE, //MARINE_HUD_FONT_BLUE,
@ -188,6 +191,7 @@ static struct HUDFontDescTag MedresHUDFontDesc[] =
}, },
}; };
#endif
static struct LittleMDescTag MedresHUDLittleM = static struct LittleMDescTag MedresHUDLittleM =
{ {
120,14, // source top,left 120,14, // source top,left
@ -254,6 +258,7 @@ static char *HiresMarineHUDGfxFilenamePtr[]=
{"trkfnthr.pg0"}, {"trkfnthr.pg0"},
{"blubarhr.pg0"}, {"blubarhr.pg0"},
}; };
#if 0
static struct HUDFontDescTag HiresHUDFontDesc[] = static struct HUDFontDescTag HiresHUDFontDesc[] =
{ {
//MARINE_HUD_FONT_BLUE, //MARINE_HUD_FONT_BLUE,
@ -281,6 +286,7 @@ static struct HUDFontDescTag HiresHUDFontDesc[] =
17,//Width 17,//Width
}, },
}; };
#endif
static struct LittleMDescTag HiresHUDLittleM = static struct LittleMDescTag HiresHUDLittleM =
{ {
150,17, // source top,left 150,17, // source top,left
@ -327,6 +333,7 @@ static char *MedresPredatorHUDGfxFilenamePtr[]=
{"prednum.pg0"}, //PREDATOR_HUD_GFX_NUMBERS, {"prednum.pg0"}, //PREDATOR_HUD_GFX_NUMBERS,
{"predsymb.pg0"}, //PREDATOR_HUD_GFX_SYMBOLS, {"predsymb.pg0"}, //PREDATOR_HUD_GFX_SYMBOLS,
}; };
#if 0
static struct DigitPropertiesTag LoresPredatorHUDDigitProperties[] = static struct DigitPropertiesTag LoresPredatorHUDDigitProperties[] =
{ {
/* armour, units first */ /* armour, units first */
@ -381,6 +388,7 @@ static struct DigitPropertiesTag MedresPredatorHUDDigitProperties[] =
{230-6, 180, PREDATOR_HUD_GFX_NUMBERS}, {230-6, 180, PREDATOR_HUD_GFX_NUMBERS},
}; };
#endif
/* ALIEN */ /* ALIEN */
@ -400,6 +408,7 @@ static char *MedresAlienHUDGfxFilenamePtr[]=
{"ahMRTop.pg0"}, // ALIEN_HUD_GFX_TOP {"ahMRTop.pg0"}, // ALIEN_HUD_GFX_TOP
{"ahMRNum.pg0"}, // ALIEN_HUD_GFX_NUMBERS {"ahMRNum.pg0"}, // ALIEN_HUD_GFX_NUMBERS
}; };
#if 0
static struct DigitPropertiesTag LoresAlienHUDDigitProperties[] = static struct DigitPropertiesTag LoresAlienHUDDigitProperties[] =
{ {
/* health, units first */ /* health, units first */
@ -415,3 +424,4 @@ static struct DigitPropertiesTag MedresAlienHUDDigitProperties[] =
{281*2, 157*2+80, ALIEN_HUD_GFX_NUMBERS}, {281*2, 157*2+80, ALIEN_HUD_GFX_NUMBERS},
{274*2, 157*2+80, ALIEN_HUD_GFX_NUMBERS}, {274*2, 157*2+80, ALIEN_HUD_GFX_NUMBERS},
}; };
#endif

View file

@ -7,6 +7,8 @@
#include "kzsort.h" #include "kzsort.h"
#include "kshape.h" #include "kshape.h"
#include "pldnet.h"
#include "avpview.h"
#include "d3d_render.h" #include "d3d_render.h"
#define UseLocalAssert Yes #define UseLocalAssert Yes
@ -31,20 +33,24 @@ extern int NumVertices;
extern int WireFrameMode; extern int WireFrameMode;
extern int DrawingAReflection; extern int DrawingAReflection;
struct KItem KItemList[maxpolyptrs]={0,}; struct KItem KItemList[maxpolyptrs];
static struct KItem KItemList2[maxpolyptrs]={0,}; #if 0
static struct KItem KItemList2[maxpolyptrs];
#endif
static struct KObject VisibleModules[MAX_NUMBER_OF_VISIBLE_MODULES]={0,}; static struct KObject VisibleModules[MAX_NUMBER_OF_VISIBLE_MODULES];
static struct KObject VisibleModules2[MAX_NUMBER_OF_VISIBLE_MODULES]={0,}; static struct KObject VisibleModules2[MAX_NUMBER_OF_VISIBLE_MODULES];
static struct KObject *SortedModules; static struct KObject *SortedModules;
static struct KObject VisibleObjects[maxobjects]={0,}; static struct KObject VisibleObjects[maxobjects];
static int PointIsInModule(VECTORCH *pointPtr,MODULE *modulePtr);
/*KJL***************************** /*KJL*****************************
* externs for new shape function * * externs for new shape function *
*****************************KJL*/ *****************************KJL*/
int *MorphedObjectPointsPtr=0; int *MorphedObjectPointsPtr=0;
#if 0
static void MergeItems(struct KItem *src1, int n1, struct KItem *src2, int n2, struct KItem *dest) 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 */ /* 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) 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! */ /* KJL 12:21:51 02/11/97 - This routine is too big and ugly. Split & clean up required! */
void KRenderItems(VIEWDESCRIPTORBLOCK *VDBPtr) void KRenderItems(VIEWDESCRIPTORBLOCK *VDBPtr)
{ {
extern int NumActiveBlocks;
extern int NumOnScreenBlocks; extern int NumOnScreenBlocks;
extern DISPLAYBLOCK *OnScreenBlockList[]; extern DISPLAYBLOCK *OnScreenBlockList[];
int numOfObjects = NumOnScreenBlocks; int numOfObjects = NumOnScreenBlocks;
@ -737,6 +743,7 @@ void KRenderItems(VIEWDESCRIPTORBLOCK *VDBPtr)
} }
} }
#if 0
static int ObjectIsInModule(DISPLAYBLOCK *objectPtr,MODULE *modulePtr) static int ObjectIsInModule(DISPLAYBLOCK *objectPtr,MODULE *modulePtr)
{ {
int objectSize = objectPtr->ObRadius; int objectSize = objectPtr->ObRadius;
@ -757,6 +764,8 @@ static int ObjectIsInModule(DISPLAYBLOCK *objectPtr,MODULE *modulePtr)
return 0; return 0;
} }
#endif
static int PointIsInModule(VECTORCH *pointPtr,MODULE *modulePtr) static int PointIsInModule(VECTORCH *pointPtr,MODULE *modulePtr)
{ {
VECTORCH position = *pointPtr; VECTORCH position = *pointPtr;

View file

@ -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)); TRACK_SOUND* sound=(TRACK_SOUND*)PoolAllocateMem(sizeof(TRACK_SOUND));
sound->sound_loaded=ls; sound->sound_loaded=ls;
sound->inner_range=s_chunk->inner_range*local_scale; sound->inner_range=(unsigned)(s_chunk->inner_range*local_scale);
sound->outer_range=s_chunk->outer_range*local_scale; sound->outer_range=(unsigned)(s_chunk->outer_range*local_scale);
sound->pitch=s_chunk->pitch; sound->pitch=s_chunk->pitch;
sound->max_volume=s_chunk->max_volume; sound->max_volume=s_chunk->max_volume;
sound->activ_no=SOUND_NOACTIVEINDEX; 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)); TRACK_SOUND* sound=(TRACK_SOUND*)PoolAllocateMem(sizeof(TRACK_SOUND));
sound->sound_loaded=ls; sound->sound_loaded=ls;
sound->inner_range=otsc->inner_range*local_scale; sound->inner_range=(unsigned)(otsc->inner_range*local_scale);
sound->outer_range=otsc->outer_range*local_scale; sound->outer_range=(unsigned)(otsc->outer_range*local_scale);
sound->pitch=otsc->pitch; sound->pitch=otsc->pitch;
sound->max_volume=otsc->max_volume; sound->max_volume=otsc->max_volume;
sound->activ_no=SOUND_NOACTIVEINDEX; sound->activ_no=SOUND_NOACTIVEINDEX;
@ -619,7 +619,7 @@ void deallocate_behaviour_list()
MISSION_COMPLETE_TOOLS_TEMPLATE* mctt=(MISSION_COMPLETE_TOOLS_TEMPLATE*)bbd->bhdata; MISSION_COMPLETE_TOOLS_TEMPLATE* mctt=(MISSION_COMPLETE_TOOLS_TEMPLATE*)bbd->bhdata;
if(mctt->mission_objective_ptr) 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)); TOOLS_DATA_INANIMATEOBJECT* tdio =(TOOLS_DATA_INANIMATEOBJECT*) PoolAllocateMem(sizeof(TOOLS_DATA_INANIMATEOBJECT));
tdio->position.vx = ob->object_data.location.x * local_scale; tdio->position.vx = (int)(ob->object_data.location.x * local_scale);
tdio->position.vy = ob->object_data.location.y * local_scale; tdio->position.vy = (int)(ob->object_data.location.y * local_scale);
tdio->position.vz = ob->object_data.location.z * local_scale; tdio->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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; *(ObjectID*)&tott->nameID[0]=ob->object_data.ID;
tott->position.vx = ob->object_data.location.x * local_scale; tott->position.vx = (int)(ob->object_data.location.x * local_scale);
tott->position.vy = ob->object_data.location.y * local_scale; tott->position.vy = (int)(ob->object_data.location.y * local_scale);
tott->position.vz = ob->object_data.location.z * local_scale; tott->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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(); Indexed_Sound_Chunk* isc=(Indexed_Sound_Chunk*)chlif();
PLACED_HIERARCHY_SOUND* phs=&phtt->sounds[isc->index]; PLACED_HIERARCHY_SOUND* phs=&phtt->sounds[isc->index];
phs->inner_range=isc->inner_range*local_scale; phs->inner_range=(unsigned)(isc->inner_range*local_scale);
phs->outer_range=isc->outer_range*local_scale; phs->outer_range=(unsigned)(isc->outer_range*local_scale);
phs->pitch=isc->pitch; phs->pitch=isc->pitch;
phs->max_volume=isc->max_volume; phs->max_volume=isc->max_volume;
phs->playing=0; 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->sequence_no=phsc->sequence;
ph_seq->sub_sequence_no=phsc->sub_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); ph_seq->loop=((phsc->flags & HierarchySequenceFlag_Loop)!=0);
if(phsc->flags & HierarchySequenceFlag_InitialSequence) 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; *(ObjectID*) &phtt->nameID[0]=data->id;
phtt->position.vx = data->location.x * local_scale; phtt->position.vx = (int)(data->location.x * local_scale);
phtt->position.vy = data->location.y * local_scale; phtt->position.vy = (int)(data->location.y * local_scale);
phtt->position.vz = data->location.z * local_scale; phtt->position.vz = (int)(data->location.z * local_scale);
QUAT q; 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; *(ObjectID*)&ftt->nameID[0]=ob->object_data.ID;
ftt->position.vx = ob->object_data.location.x * local_scale; ftt->position.vx = (int)(ob->object_data.location.x * local_scale);
ftt->position.vy = ob->object_data.location.y * local_scale; ftt->position.vy = (int)(ob->object_data.location.y * local_scale);
ftt->position.vz = ob->object_data.location.z * local_scale; ftt->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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 if(oc) //switch has a shape
{ {
lstt->position.vx = oc->object_data.location.x * local_scale; lstt->position.vx = (int)(oc->object_data.location.x * local_scale);
lstt->position.vy = oc->object_data.location.y * local_scale; lstt->position.vy = (int)(oc->object_data.location.y * local_scale);
lstt->position.vz = oc->object_data.location.z * local_scale; lstt->position.vz = (int)(oc->object_data.location.z * local_scale);
QUAT q; QUAT q;
@ -1315,9 +1315,9 @@ static void add_multitarget_linkswitch(const char* name,AVP_Strategy_Chunk* asc,
if(oc) //switch has a shape if(oc) //switch has a shape
{ {
lstt->position.vx = oc->object_data.location.x * local_scale; lstt->position.vx = (int)(oc->object_data.location.x * local_scale);
lstt->position.vy = oc->object_data.location.y * local_scale; lstt->position.vy = (int)(oc->object_data.location.y * local_scale);
lstt->position.vz = oc->object_data.location.z * local_scale; lstt->position.vz = (int)(oc->object_data.location.z * local_scale);
QUAT q; 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 if(oc)//switch has a shape
{ {
bstt->position.vx = oc->object_data.location.x * local_scale; bstt->position.vx = (int)(oc->object_data.location.x * local_scale);
bstt->position.vy = oc->object_data.location.y * local_scale; bstt->position.vy = (int)(oc->object_data.location.y * local_scale);
bstt->position.vz = oc->object_data.location.z * local_scale; bstt->position.vz = (int)(oc->object_data.location.z * local_scale);
bstt->trigger_volume_min.vx=bstt->trigger_volume_max.vx=0; 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 if(oc) //switch has a shape
{ {
bstt->position.vx = oc->object_data.location.x * local_scale; bstt->position.vx = (int)(oc->object_data.location.x * local_scale);
bstt->position.vy = oc->object_data.location.y * local_scale; bstt->position.vy = (int)(oc->object_data.location.y * local_scale);
bstt->position.vz = oc->object_data.location.z * local_scale; bstt->position.vz = (int)(oc->object_data.location.z * local_scale);
QUAT q; 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)); PLATFORMLIFT_TOOLS_TEMPLATE* ptt=(PLATFORMLIFT_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(PLATFORMLIFT_TOOLS_TEMPLATE));
ptt->position.vx = ob->object_data.location.x * local_scale; ptt->position.vx = (int)(ob->object_data.location.x * local_scale);
ptt->position.vy = ob->object_data.location.y * local_scale; ptt->position.vy = (int)(ob->object_data.location.y * local_scale);
ptt->position.vz = ob->object_data.location.z * local_scale; ptt->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; QUAT q;
@ -1645,7 +1645,7 @@ static void add_platlift (Object_Chunk * ob, int list_pos, AVP_Strategy_Chunk *
{ {
if(otc->num_sections==1) 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 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)); TOOLS_DATA_PLACEDLIGHT* pltd=(TOOLS_DATA_PLACEDLIGHT*) PoolAllocateMem(sizeof(TOOLS_DATA_PLACEDLIGHT));
pltd->position.vx = ob->object_data.location.x * local_scale; pltd->position.vx = (int)(ob->object_data.location.x * local_scale);
pltd->position.vy = ob->object_data.location.y * local_scale; pltd->position.vy = (int)(ob->object_data.location.y * local_scale);
pltd->position.vz = ob->object_data.location.z * local_scale; pltd->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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)); 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.vx = (int)(ob->object_data.location.x * local_scale);
tdvs->position.vy = ob->object_data.location.y * local_scale; tdvs->position.vy = (int)(ob->object_data.location.y * local_scale);
tdvs->position.vz = ob->object_data.location.z * local_scale; tdvs->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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)); TOOLS_DATA_INANIMATEOBJECT* tdio=(TOOLS_DATA_INANIMATEOBJECT*) PoolAllocateMem(sizeof(TOOLS_DATA_INANIMATEOBJECT));
tdio->position.vx = ob->object_data.location.x * local_scale; tdio->position.vx = (int)(ob->object_data.location.x * local_scale);
tdio->position.vy = ob->object_data.location.y * local_scale; tdio->position.vy = (int)(ob->object_data.location.y * local_scale);
tdio->position.vz = ob->object_data.location.z * local_scale; tdio->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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)); TOOLS_DATA_INANIMATEOBJECT* tdio=(TOOLS_DATA_INANIMATEOBJECT*) PoolAllocateMem(sizeof(TOOLS_DATA_INANIMATEOBJECT));
tdio->position.vx = ob->object_data.location.x * local_scale; tdio->position.vx = (int)(ob->object_data.location.x * local_scale);
tdio->position.vy = ob->object_data.location.y * local_scale; tdio->position.vy = (int)(ob->object_data.location.y * local_scale);
tdio->position.vz = ob->object_data.location.z * local_scale; tdio->position.vz = (int)(ob->object_data.location.z * local_scale);
QUAT q; 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)); TOOLS_DATA_ALIEN* tda=(TOOLS_DATA_ALIEN*) PoolAllocateMem(sizeof(TOOLS_DATA_ALIEN));
tda->position.vx = agc->location.x * local_scale; tda->position.vx = (int)(agc->location.x * local_scale);
tda->position.vy = agc->location.y * local_scale; tda->position.vy = (int)(agc->location.y * local_scale);
tda->position.vz = agc->location.z * local_scale; tda->position.vz = (int)(agc->location.z * local_scale);
//tda->shapeIndex = GetLoadedShapeMSL("Alien"); //tda->shapeIndex = GetLoadedShapeMSL("Alien");
tda->shapeIndex = 0; 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)); TOOLS_DATA_MARINE* tdm=(TOOLS_DATA_MARINE*) PoolAllocateMem(sizeof(TOOLS_DATA_MARINE));
tdm->position.vx = agc->location.x * local_scale; tdm->position.vx = (int)(agc->location.x * local_scale);
tdm->position.vy = agc->location.y * local_scale; tdm->position.vy = (int)(agc->location.y * local_scale);
tdm->position.vz = agc->location.z * local_scale; tdm->position.vz = (int)(agc->location.z * local_scale);
EULER euler; EULER euler;
euler.EulerX=0; 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)); TOOLS_DATA_PREDATOR* tdp=(TOOLS_DATA_PREDATOR*) PoolAllocateMem(sizeof(TOOLS_DATA_PREDATOR));
tdp->position.vx = agc->location.x * local_scale; tdp->position.vx = (int)(agc->location.x * local_scale);
tdp->position.vy = agc->location.y * local_scale; tdp->position.vy = (int)(agc->location.y * local_scale);
tdp->position.vz = agc->location.z * local_scale; tdp->position.vz = (int)(agc->location.z * local_scale);
#if 0 #if 0
switch (agc->textureID) 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)); TOOLS_DATA_QUEEN* tdq=(TOOLS_DATA_QUEEN*) PoolAllocateMem(sizeof(TOOLS_DATA_QUEEN));
tdq->position.vx = agc->location.x * local_scale; tdq->position.vx = (int)(agc->location.x * local_scale);
tdq->position.vy = agc->location.y * local_scale; tdq->position.vy = (int)(agc->location.y * local_scale);
tdq->position.vz = agc->location.z * local_scale; tdq->position.vz = (int)(agc->location.z * local_scale);
tdq->shapeIndex = 0; 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)); TOOLS_DATA_FACEHUGGER* tdfh =(TOOLS_DATA_FACEHUGGER*) PoolAllocateMem(sizeof(TOOLS_DATA_FACEHUGGER));
tdfh->position.vx = agc->location.x * local_scale; tdfh->position.vx = (int)(agc->location.x * local_scale);
tdfh->position.vy = agc->location.y * local_scale; tdfh->position.vy = (int)(agc->location.y * local_scale);
tdfh->position.vz = agc->location.z * local_scale; tdfh->position.vz = (int)(agc->location.z * local_scale);
//tdfh->shapeIndex = GetLoadedShapeMSL("Facehug"); //tdfh->shapeIndex = GetLoadedShapeMSL("Facehug");
tdfh->shapeIndex = 0; tdfh->shapeIndex = 0;
@ -2817,9 +2817,9 @@ static void add_hugger(AVP_Generator_Chunk * agc)
static void add_autogun(AVP_Generator_Chunk * agc) static void add_autogun(AVP_Generator_Chunk * agc)
{ {
AUTOGUN_TOOLS_TEMPLATE* att=(AUTOGUN_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(AUTOGUN_TOOLS_TEMPLATE)); AUTOGUN_TOOLS_TEMPLATE* att=(AUTOGUN_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(AUTOGUN_TOOLS_TEMPLATE));
att->position.vx = agc->location.x * local_scale; att->position.vx = (int)(agc->location.x * local_scale);
att->position.vy = agc->location.y * local_scale; att->position.vy = (int)(agc->location.y * local_scale);
att->position.vz = agc->location.z * local_scale; att->position.vz = (int)(agc->location.z * local_scale);
att->shapenum = 0; 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)); TOOLS_DATA_XENO* tdx=(TOOLS_DATA_XENO*) PoolAllocateMem(sizeof(TOOLS_DATA_XENO));
tdx->position.vx = agc->location.x * local_scale; tdx->position.vx = (int)(agc->location.x * local_scale);
tdx->position.vy = agc->location.y * local_scale; tdx->position.vy = (int)(agc->location.y * local_scale);
tdx->position.vz = agc->location.z * local_scale; tdx->position.vz = (int)(agc->location.z * local_scale);
tdx->shapeIndex = 0; tdx->shapeIndex = 0;
@ -3068,9 +3068,9 @@ void setup_generators (Environment_Data_Chunk * envd)
GENERATOR_BLOCK* tdg = (GENERATOR_BLOCK*) PoolAllocateMem(sizeof(GENERATOR_BLOCK)); GENERATOR_BLOCK* tdg = (GENERATOR_BLOCK*) PoolAllocateMem(sizeof(GENERATOR_BLOCK));
memset(tdg,0,sizeof(GENERATOR_BLOCK)); memset(tdg,0,sizeof(GENERATOR_BLOCK));
tdg->Position.vx = agc->location.x * local_scale; tdg->Position.vx = (int)(agc->location.x * local_scale);
tdg->Position.vy = agc->location.y * local_scale; tdg->Position.vy = (int)(agc->location.y * local_scale);
tdg->Position.vz = agc->location.z * local_scale; tdg->Position.vz = (int)(agc->location.z * local_scale);
tdg->Active=!(agc->flags & AVPGENFLAG_GENERATORINACTIVE); tdg->Active=!(agc->flags & AVPGENFLAG_GENERATORINACTIVE);
tdg->GenerationRate=1; tdg->GenerationRate=1;
@ -3232,9 +3232,9 @@ void setup_generators (Environment_Data_Chunk * envd)
} }
MULTIPLAYER_START start_pos; MULTIPLAYER_START start_pos;
start_pos.location.vx = agc->location.x * local_scale; start_pos.location.vx = (int)(agc->location.x * local_scale);
start_pos.location.vy = agc->location.y * local_scale; start_pos.location.vy = (int)(agc->location.y * local_scale);
start_pos.location.vz = agc->location.z * local_scale; start_pos.location.vz = (int)(agc->location.z * local_scale);
start_pos.orientation.EulerX=0; start_pos.orientation.EulerX=0;
start_pos.orientation.EulerY=agc->orientation & 4095; 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->LightType = LightType_PerVertex;
lPtr->LightWorld.vx = lc->light.location.x * local_scale; lPtr->LightWorld.vx = (int)(lc->light.location.x * local_scale);
lPtr->LightWorld.vy = lc->light.location.y * local_scale; lPtr->LightWorld.vy = (int)(lc->light.location.y * local_scale);
lPtr->LightWorld.vz = lc->light.location.z * local_scale; lPtr->LightWorld.vz = (int)(lc->light.location.z * local_scale);
lPtr->LightBright = lc->light.brightness * 1.0; lPtr->LightBright = (int)(lc->light.brightness * 1.0);
lPtr->LightBrightStore = 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 */ /* 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->RedScale = ((lc->light.colour>>16)&255)*257;
lPtr->GreenScale = ((lc->light.colour>>8)&255)*257; lPtr->GreenScale = ((lc->light.colour>>8)&255)*257;
lPtr->BlueScale = ((lc->light.colour)&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) 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.vy = 0;
lPtr->LightWorld.vz = 0; lPtr->LightWorld.vz = 0;
lPtr->LightBright = lc->light.brightness * 1.0; lPtr->LightBright = (int)(lc->light.brightness * 1.0);
lPtr->LightBrightStore = 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 */ /* 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->RedScale = ((lc->light.up_colour>>16)&255)*257;
lPtr->GreenScale = ((lc->light.up_colour>>8)&255)*257; lPtr->GreenScale = ((lc->light.up_colour>>8)&255)*257;
lPtr->BlueScale = ((lc->light.up_colour)&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_Object_Chunk * snd = (Sound_Object_Chunk *) cli();
SOUND_TOOLS_TEMPLATE* stt =(SOUND_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(SOUND_TOOLS_TEMPLATE)); SOUND_TOOLS_TEMPLATE* stt =(SOUND_TOOLS_TEMPLATE*) PoolAllocateMem(sizeof(SOUND_TOOLS_TEMPLATE));
stt->position.vx = snd->position.x * local_scale; stt->position.vx = (int)(snd->position.x * local_scale);
stt->position.vy = snd->position.y * local_scale; stt->position.vy = (int)(snd->position.y * local_scale);
stt->position.vz = snd->position.z * local_scale; stt->position.vz = (int)(snd->position.z * local_scale);
stt->inner_range = snd->inner_range * local_scale; stt->inner_range = (unsigned)(snd->inner_range * local_scale);
stt->outer_range = snd->outer_range * local_scale; stt->outer_range = (unsigned)(snd->outer_range * local_scale);
stt->max_volume = snd->max_volume; stt->max_volume = snd->max_volume;
stt->pitch = snd->pitch; 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)); 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.vx = (int)(appc->location.x * local_scale);
tdpc->position.vy = appc->location.y * local_scale; tdpc->position.vy = (int)(appc->location.y * local_scale);
tdpc->position.vz = appc->location.z * local_scale; tdpc->position.vz = (int)(appc->location.z * local_scale);
if(appc->flags & PowerCableFlag_UseDefaultSettings) 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)); 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.vx = (int)(data_chunk->location.x * local_scale);
part_temp->position.vy = data_chunk->location.y * local_scale; part_temp->position.vy = (int)(data_chunk->location.y * local_scale);
part_temp->position.vz = data_chunk->location.z * local_scale; part_temp->position.vz = (int)(data_chunk->location.z * local_scale);
*(ObjectID*)&part_temp->nameID[0]=data_chunk->id; *(ObjectID*)&part_temp->nameID[0]=data_chunk->id;
*(ObjectID*)&part_temp->parentID[0]=data_chunk->parent_id; *(ObjectID*)&part_temp->parentID[0]=data_chunk->parent_id;

View file

@ -25,6 +25,7 @@
#include "bh_corpse.h" #include "bh_corpse.h"
#include "bh_weap.h" #include "bh_weap.h"
#include "showcmds.h" #include "showcmds.h"
#include "weapons.h"
#define UseLocalAssert Yes #define UseLocalAssert Yes
#include "ourasert.h" #include "ourasert.h"
@ -51,7 +52,9 @@ extern MATRIXCH Identity_RotMat; /* From HModel.c */
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
static void SetPlayerGhostAnimationSequence(STRATEGYBLOCK *sbPtr, int sequence, int special); static void SetPlayerGhostAnimationSequence(STRATEGYBLOCK *sbPtr, int sequence, int special);
#if 0
static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr); static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr);
#endif
static void UpdatePlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr, int sequence, int special); static void UpdatePlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr, int sequence, int special);
SOUND3DDATA Ghost_Explosion_SoundData={ SOUND3DDATA Ghost_Explosion_SoundData={
@ -62,9 +65,6 @@ SOUND3DDATA Ghost_Explosion_SoundData={
}; };
void UpdateObjectTrails(STRATEGYBLOCK *sbPtr); 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); static void CalculatePosnForGhostAutoGunMuzzleFlash(STRATEGYBLOCK *sbPtr,VECTORCH *position, EULER *orientation);
void UpdateAlienAIGhostAnimSequence(STRATEGYBLOCK *sbPtr,HMODEL_SEQUENCE_TYPES type, int subtype, int length, int tweeningtime); void UpdateAlienAIGhostAnimSequence(STRATEGYBLOCK *sbPtr,HMODEL_SEQUENCE_TYPES type, int subtype, int length, int tweeningtime);
@ -882,7 +882,6 @@ void PostDynamicsExtrapolationUpdate()
{ {
if(MultiplayerObservedPlayer==ghostData->playerId) if(MultiplayerObservedPlayer==ghostData->playerId)
{ {
PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr);
Player->ObStrategyBlock->DynPtr->Position=sbPtr->DynPtr->Position; Player->ObStrategyBlock->DynPtr->Position=sbPtr->DynPtr->Position;
Player->ObStrategyBlock->DynPtr->PrevPosition=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, Set selects the correct sequence/type, infers the speed and follow-on sequences,
etc, and sets it. etc, and sets it.
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
#if 0
static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr) static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr)
{ {
NETGHOSTDATABLOCK *ghostData; NETGHOSTDATABLOCK *ghostData;
@ -1705,6 +1705,7 @@ static void InitPlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr)
} }
} }
} }
#endif
static void UpdatePlayerGhostAnimSequence(STRATEGYBLOCK *sbPtr, int sequence, int special) 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; NETCORPSEDATABLOCK *corpseDataPtr=(NETCORPSEDATABLOCK *)sbPtr->SBdataptr;
int deathtype,gibbFactor; int deathtype,gibbFactor;
int a;
SECTION_DATA *head;
/* Set GibbFactor and death type*/ /* Set GibbFactor and death type*/
gibbFactor=0; gibbFactor=0;
@ -4719,7 +4717,6 @@ int Deduce_PlayerPredatorDeathSequence(STRATEGYBLOCK* sbPtr,DAMAGE_PROFILE* dama
HIT_FACING facing; HIT_FACING facing;
SECTION *root; SECTION *root;
int burning; int burning;
int wounds;
int crouched; int crouched;
root=GetNamedHierarchyFromLibrary("hnpcpredator","Template"); root=GetNamedHierarchyFromLibrary("hnpcpredator","Template");

View file

@ -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 Convert_DiscGhost_To_PickupGhost(STRATEGYBLOCK *sbPtr);
extern void PlayHitDeltaOnGhost(STRATEGYBLOCK *sbPtr,char delta_seq,char delta_sub_seq); extern void PlayHitDeltaOnGhost(STRATEGYBLOCK *sbPtr,char delta_seq,char delta_sub_seq);
extern void PlayOtherSound(enum soundindex SoundIndex, VECTORCH *position, int explosion); 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---------------------------- /*---------------------------Patrick 29/3/97----------------------------
Defines Defines

View file

@ -2,6 +2,7 @@
Source for Multi-Player game support Source for Multi-Player game support
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
#include <ctype.h>
#include "3dc.h" #include "3dc.h"
#include "inline.h" #include "inline.h"
#include "module.h" #include "module.h"
@ -21,9 +22,16 @@
#include "weapons.h" #include "weapons.h"
#include "multmenu.h" #include "multmenu.h"
#include "bh_gener.h" #include "bh_gener.h"
#include "bh_lnksw.h"
#include "bh_track.h"
#include "psnd.h" #include "psnd.h"
#include "kshape.h" #include "kshape.h"
#include "pfarlocs.h" #include "pfarlocs.h"
#include "avpview.h"
#include "net.h"
#include "los.h"
#include "maths.h"
#include "opengl.h"
/* these required sequence enumerations...*/ /* these required sequence enumerations...*/
#include "bh_pred.h" #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 AddPlayerToGame(DPID id, char*name);
static void AddPlayerAndObjectUpdateMessages(void); static void AddPlayerAndObjectUpdateMessages(void);
static void UpdateNetworkGameScores(DPID playerKilledId, DPID killerId,NETGAME_CHARACTERTYPE playerKilledType,NETGAME_CHARACTERTYPE killerType); 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_GameDescription(NETMESSAGE_GAMEDESCRIPTION *msgPtr);
static void ProcessNetMsg_PlayerDescription(NETMESSAGE_PLAYERDESCRIPTION *msgPtr, DPID senderId); static void ProcessNetMsg_PlayerDescription(NETMESSAGE_PLAYERDESCRIPTION *msgPtr, DPID senderId);
@ -379,6 +386,8 @@ static int CalculateMyScore();
static void PeriodicScoreUpdate(); static void PeriodicScoreUpdate();
void CheckStateOfObservedPlayer(); void CheckStateOfObservedPlayer();
static int MyPlayerHasAMuzzleFlash(STRATEGYBLOCK *sbPtr);
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Initalisation of net game Initalisation of net game
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
@ -482,7 +491,7 @@ void InitAVPNetGameForHost(int species, int gamestyle, int level)
int i,j; int i,j;
for(i=0;i<(NET_MAXPLAYERS);i++) 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'; for(j=0;j<(NET_PLAYERNAMELENGTH);j++) netGameData.playerData[i].name[j] = '\0';
netGameData.playerData[i].characterType = NGCT_Marine; netGameData.playerData[i].characterType = NGCT_Marine;
netGameData.playerData[i].characterSubType = NGSCT_General; netGameData.playerData[i].characterSubType = NGSCT_General;
@ -636,7 +645,7 @@ void InitAVPNetGameForJoin(void)
int i,j; int i,j;
for(i=0;i<(NET_MAXPLAYERS);i++) 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'; for(j=0;j<(NET_PLAYERNAMELENGTH);j++) netGameData.playerData[i].name[j] = '\0';
netGameData.playerData[i].characterType = NGCT_Marine; netGameData.playerData[i].characterType = NGCT_Marine;
netGameData.playerData[i].characterSubType = NGSCT_General; netGameData.playerData[i].characterSubType = NGSCT_General;
@ -725,8 +734,8 @@ void MinimalNetCollectMessages(void)
void NetCollectMessages(void) void NetCollectMessages(void)
{ {
HRESULT res = DP_OK; HRESULT res = DP_OK;
DPID dPlayFromId = NULL; DPID dPlayFromId = 0;
DPID dPlayToId = NULL; DPID dPlayToId = 0;
unsigned char *msgP = NULL; unsigned char *msgP = NULL;
unsigned msgSize = 0; unsigned msgSize = 0;
@ -1118,7 +1127,7 @@ void RemovePlayerFromGame(DPID id)
} }
/* free the slot */ /* 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'; for(j=0;j<NET_PLAYERNAMELENGTH;j++) netGameData.playerData[playerIndex].name[j] = '\0';
netGameData.playerData[playerIndex].characterType = NGCT_Marine; netGameData.playerData[playerIndex].characterType = NGCT_Marine;
netGameData.playerData[playerIndex].characterSubType = NGSCT_General; netGameData.playerData[playerIndex].characterSubType = NGSCT_General;
@ -1868,7 +1877,9 @@ static void AddPlayerAndObjectUpdateMessages(void)
----------------------------------------------------------------------*/ ----------------------------------------------------------------------*/
void EndAVPNetGame(void) void EndAVPNetGame(void)
{ {
#if 0
HRESULT hres; HRESULT hres;
#endif
/* garry's dp extended clean up */ /* garry's dp extended clean up */
if(!netGameData.skirmishMode) if(!netGameData.skirmishMode)
@ -5465,7 +5476,7 @@ static void ProcessNetMsg_GameDescription(NETMESSAGE_GAMEDESCRIPTION *messagePtr
if (netGameData.myGameState==NGS_Playing && playerChanged) if (netGameData.myGameState==NGS_Playing && playerChanged)
{ {
if (messagePtr->players[i].playerId==NULL) if (messagePtr->players[i].playerId==0)
{ {
Inform_PlayerHasLeft(netGameData.playerData[i].playerId); Inform_PlayerHasLeft(netGameData.playerData[i].playerId);
} }
@ -7382,7 +7393,6 @@ static void ProcessNetMsg_StrategySynch(NETMESSAGE_STRATEGYSYNCH *messagePtr)
for (i=0; i<NumActiveStBlocks; i++) for (i=0; i<NumActiveStBlocks; i++)
{ {
STRATEGYBLOCK *sbPtr = ActiveStBlockList[i]; STRATEGYBLOCK *sbPtr = ActiveStBlockList[i];
int status;
if(sbPtr->I_SBtype == I_BehaviourBinarySwitch || if(sbPtr->I_SBtype == I_BehaviourBinarySwitch ||
sbPtr->I_SBtype == I_BehaviourLinkSwitch || sbPtr->I_SBtype == I_BehaviourLinkSwitch ||
@ -7897,9 +7907,6 @@ static void ProcessNetMsg_Gibbing(NETMESSAGE_GIBBING *messagePtr,DPID senderId)
} }
else else
{ {
SECTION_DATA *section_data=NULL;
HMODELCONTROLLER *controller=NULL;
ghostData = (NETGHOSTDATABLOCK *)sbPtr->SBdataptr; ghostData = (NETGHOSTDATABLOCK *)sbPtr->SBdataptr;
//only interested in gibbing corpses //only interested in gibbing corpses
@ -7972,7 +7979,7 @@ int PlayerIdInPlayerList(DPID Id)
{ {
int i; int i;
/* check first, if we've been passed a null id */ /* 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 */ /* check player list */
for(i=0;i<NET_MAXPLAYERS;i++) for(i=0;i<NET_MAXPLAYERS;i++)
@ -7991,7 +7998,7 @@ int EmptySlotInPlayerList(void)
for(i=0;i<NET_MAXPLAYERS;i++) 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; return NET_NOEMPTYSLOTINPLAYERLIST;
} }
@ -8094,7 +8101,7 @@ static void UpdateNetworkGameScores(DPID playerKilledId, DPID killerId,NETGAME_C
playerKilledIndex = PlayerIdInPlayerList(playerKilledId); playerKilledIndex = PlayerIdInPlayerList(playerKilledId);
if(playerKilledIndex==NET_IDNOTINPLAYERLIST) return; if(playerKilledIndex==NET_IDNOTINPLAYERLIST) return;
if(killerId==NULL || killerId == playerKilledId || killerType>=NGCT_AI_Alien) if(killerId==0 || killerId == playerKilledId || killerType>=NGCT_AI_Alien)
{ {
//suicide //suicide
killerIndex=playerKilledIndex; killerIndex=playerKilledIndex;
@ -8330,6 +8337,7 @@ int AddUpPlayerFrags(int playerId)
return score; return score;
} }
#if 0
static void ConvertNetNameToUpperCase(char *strPtr) static void ConvertNetNameToUpperCase(char *strPtr)
{ {
int count = 0; int count = 0;
@ -8340,6 +8348,7 @@ static void ConvertNetNameToUpperCase(char *strPtr)
} }
} }
#endif
/* Patrick 11/7/97 ---------------------------------------------- /* Patrick 11/7/97 ----------------------------------------------
@ -8498,7 +8507,6 @@ static MARINE_SEQUENCE GetMyMarineSequence(void)
static ALIEN_SEQUENCE GetMyAlienSequence(void) static ALIEN_SEQUENCE GetMyAlienSequence(void)
{ {
extern STRATEGYBLOCK *Biting; extern STRATEGYBLOCK *Biting;
extern int Bit;
int playerIsMoving = 0; int playerIsMoving = 0;
int playerIsFiring = 0; int playerIsFiring = 0;
int playerIsCrouching = 0; int playerIsCrouching = 0;
@ -9095,9 +9103,6 @@ void TeleportNetPlayerToAStartingPosition(STRATEGYBLOCK *playerSbPtr, int startO
{ {
int numStartPositions; int numStartPositions;
MULTIPLAYER_START* startPositions; MULTIPLAYER_START* startPositions;
int sbIndex = 0;
int start_index; int start_index;
int numChecked=0; int numChecked=0;
int bestDistance=-1; 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*/ in order to avoid having several players appearing at the same place*/
void StartOfGame_PlayerPlacement(STRATEGYBLOCK *playerSbPtr,int seed) void StartOfGame_PlayerPlacement(STRATEGYBLOCK *playerSbPtr,int seed)
{ {
extern int NumActiveStBlocks;
extern STRATEGYBLOCK *ActiveStBlockList[];
int numStartPositions; int numStartPositions;
MULTIPLAYER_START* startPositions; MULTIPLAYER_START* startPositions;
PLAYER_STATUS *psPtr=(PLAYER_STATUS*)playerSbPtr->SBdataptr; PLAYER_STATUS *psPtr=(PLAYER_STATUS*)playerSbPtr->SBdataptr;
@ -9436,7 +9439,7 @@ void CreatePlayersImageInMirror(void)
} }
case(I_BehaviourAlienPlayer): case(I_BehaviourAlienPlayer):
{ {
CreateAlienHModel(ghostData); CreateAlienHModel(ghostData,AT_Standard);
break; break;
} }
case(I_BehaviourPredatorPlayer): case(I_BehaviourPredatorPlayer):
@ -9827,7 +9830,7 @@ static int GetDynamicScoreMultiplier(int playerKilledIndex,int killerIndex)
//count players //count players
for(i=0;i<NET_MAXPLAYERS;i++) for(i=0;i<NET_MAXPLAYERS;i++)
{ {
if(netGameData.playerData[i].playerId==NULL) continue; if(netGameData.playerData[i].playerId==0) continue;
playerCount++; playerCount++;
} }
//only bother if there are at least 3 players //only bother if there are at least 3 players
@ -10895,7 +10898,7 @@ static void CheckForPointBasedObjectRespawn()
static int CountMultiplayerLivesLeft() static int CountMultiplayerLivesLeft()
{ {
int i,j; int i;
int livesUsed=0; int livesUsed=0;

View file

@ -1007,6 +1007,7 @@ void MinimalNetCollectMessages(void);
void InitAVPNetGameForHost(int species, int gamestyle, int level); void InitAVPNetGameForHost(int species, int gamestyle, int level);
void InitAVPNetGameForJoin(void); void InitAVPNetGameForJoin(void);
void CreatePlayersImageInMirror(void); void CreatePlayersImageInMirror(void);
void RenderPlayersImageInMirror(void);
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------

View file

@ -117,9 +117,9 @@ void setup_start_position(RIFFHANDLE h)
} }
if(start_chunk) if(start_chunk)
{ {
PlayerStartLocation.vx=start_chunk->location.x*local_scale; PlayerStartLocation.vx=(int)(start_chunk->location.x*local_scale);
PlayerStartLocation.vy=start_chunk->location.y*local_scale; PlayerStartLocation.vy=(int)(start_chunk->location.y*local_scale);
PlayerStartLocation.vz=start_chunk->location.z*local_scale; PlayerStartLocation.vz=(int)(start_chunk->location.z*local_scale);
PlayerStartMat.mat11=start_chunk->orientation.mat11; PlayerStartMat.mat11=start_chunk->orientation.mat11;
PlayerStartMat.mat12=start_chunk->orientation.mat12; 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); GLOBALASSERT(sound_array[index].sound_loaded==0);
sound_array[index].s3d.inner_range=isc->inner_range*local_scale; sound_array[index].s3d.inner_range=(int)(isc->inner_range*local_scale);
sound_array[index].s3d.outer_range=isc->outer_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.velocity=ZeroVector;
sound_array[index].s3d.position=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; 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]; Object_Animation_Frame* frame=&seq->frames[frame_no];
@ -964,9 +964,9 @@ SECTION * Global_Hierarchy_Store::build_hierarchy (Object_Hierarchy_Chunk * ohc,
VECTORCH offset; VECTORCH offset;
offset.vx = frame->transform.x * local_scale; offset.vx = (int)(frame->transform.x * local_scale);
offset.vy = frame->transform.y * local_scale; offset.vy = (int)(frame->transform.y * local_scale);
offset.vz = frame->transform.z * local_scale; offset.vz = (int)(frame->transform.z * local_scale);
SetKeyFrameOffset(kfd,&offset); SetKeyFrameOffset(kfd,&offset);
@ -1174,9 +1174,9 @@ SECTION * Global_Hierarchy_Store::build_hierarchy (Object_Hierarchy_Chunk * ohc,
VECTORCH offset; VECTORCH offset;
offset.vx = frame->transform.x * local_scale; offset.vx = (int)(frame->transform.x * local_scale);
offset.vy = frame->transform.y * local_scale; offset.vy = (int)(frame->transform.y * local_scale);
offset.vz = frame->transform.z * local_scale; offset.vz = (int)(frame->transform.z * local_scale);
SetKeyFrameOffset(kfd,&offset); 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) if((NumObjectsLoaded &0xf)==0)
{ {
//update bar every 16 objects //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++; 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 ir=svic->intensity_array[vn]>>16;
int ig=svic->intensity_array[vn]>>8 &0xff; int ig=svic->intensity_array[vn]>>8 &0xff;
int ib=svic->intensity_array[vn] &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); 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 //get the distances at which the various detail levels should be used
int* distance_array=0; int* distance_array=0;
Hierarchy_Degradation_Distance_Chunk* hddc=(Hierarchy_Degradation_Distance_Chunk*)h->fc->lookup_single_child("HIDEGDIS"); 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()) 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++; NumHierLoaded++;
Object_Hierarchy_Chunk * ohc = (Object_Hierarchy_Chunk *)cli(); 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); 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 //reset the sound directory
Rif_Sound_Directory=0; 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) if((NumShapesLoaded & 0xf)==0)
{ {
//update bar every 16 objects //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++; 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 ir=svic->intensity_array[vn]>>16;
int ig=svic->intensity_array[vn]>>8 &0xff; int ig=svic->intensity_array[vn]>>8 &0xff;
int ib=svic->intensity_array[vn] &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); 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) 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_module[mod_pos] = Term_Module;
MainScene.sm_marray[mod_pos] = 0; 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) 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++) 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) 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 //setup entry points
for(i=0;i<AIModuleArraySize;i++) 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 else
{ {

View file

@ -65,7 +65,9 @@ void LogCameraPosForModuleLinking()
#endif #endif
} }
int SaveCameraPosKeyPressed=0; int SaveCameraPosKeyPressed=0;
#ifdef AVP_DEBUG_VERSION
static BOOL ModuleLinkAssist=FALSE; static BOOL ModuleLinkAssist=FALSE;
#endif
void HandleScreenShot() void HandleScreenShot()
{ {

View file

@ -5,7 +5,13 @@
#include "stratdef.h" #include "stratdef.h"
#include "gamedef.h" #include "gamedef.h"
#include "bh_types.h" #include "bh_types.h"
#include "bh_marin.h"
#include "game.h"
#include "gameplat.h" #include "gameplat.h"
#include "lighting.h"
#include "messagehistory.h"
#include "particle.h"
#include "pldnet.h"
#define UseLocalAssert Yes #define UseLocalAssert Yes
#include "ourasert.h" #include "ourasert.h"
@ -461,13 +467,13 @@ void InitCharacter()
if(alien_weapon_rif!=INVALID_RIFFHANDLE) 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) 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) 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); Set_Progress_Bar_Position(PBAR_HUD_START+PBAR_HUD_INTERVAL);
//copy_chunks_from_environment(0); //copy_chunks_from_environment(0);

View file

@ -9,6 +9,7 @@
#include "gamedef.h" #include "gamedef.h"
#include "bh_types.h" #include "bh_types.h"
#include "huddefs.h" #include "huddefs.h"
#include "opengl.h"
/* patrick's sound include */ /* patrick's sound include */
#include "psnd.h" #include "psnd.h"
@ -30,7 +31,7 @@
****************************************************************************************KJL*/ ****************************************************************************************KJL*/
enum VISION_MODE_ID CurrentVisionMode; enum VISION_MODE_ID CurrentVisionMode;
static visionModeDebounced=0; static int visionModeDebounced=0;
extern ACTIVESOUNDSAMPLE ActiveSounds[]; extern ACTIVESOUNDSAMPLE ActiveSounds[];
int predOVision_SoundHandle; int predOVision_SoundHandle;

View file

@ -4,5 +4,6 @@
void CDDA_Start(); void CDDA_Start();
void CDDA_Stop(); void CDDA_Stop();
void CDDA_End(); void CDDA_End();
void CheckCDVolume();
#endif #endif

View file

@ -454,6 +454,7 @@ int SaveModuleArray(MODULE *mptr, char *filename);
MODULE* LoadModuleArray(MODULE *mptr, int size, char *filename); MODULE* LoadModuleArray(MODULE *mptr, int size, char *filename);
int IsModuleVisibleFromModule(MODULE *source, MODULE *target); int IsModuleVisibleFromModule(MODULE *source, MODULE *target);
int ThisObjectIsInAModuleVisibleFromCurrentlyVisibleModules(struct strategyblock *sbPtr);
#endif /* IncludeModuleFunctionPrototypes */ #endif /* IncludeModuleFunctionPrototypes */

View file

@ -110,6 +110,8 @@ void OutputTranslucentPolyList(void);
void RenderLightFlare(VECTORCH *positionPtr, unsigned int colour); void RenderLightFlare(VECTORCH *positionPtr, unsigned int colour);
extern void RenderFlechetteParticle(PARTICLE *particlePtr); extern void RenderFlechetteParticle(PARTICLE *particlePtr);
void RenderExplosionSurface(VOLUMETRIC_EXPLOSION *explosionPtr); 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, /* 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. */ so that the HUD can be drawn over the top without sinking into walls, etc. */

View file

@ -667,7 +667,7 @@ static int RenderSmallFontString(char *textPtr,int sx,int sy,int alpha, int red,
return sx; 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 char *srcPtr;
unsigned short *destPtr; 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 Determine area used by text , so we can draw it centrally
*/ */
{ {
char *textPtr2=textPtr; const char *textPtr2=textPtr;
while (*textPtr2) { while (*textPtr2) {
int widthFromSpaces=0; int widthFromSpaces=0;
int widthFromChars=0; int widthFromChars=0;
@ -749,7 +749,7 @@ Determine area used by text , so we can draw it centrally
} }
while ( *textPtr ) { while ( *textPtr ) {
char* textPtr2=textPtr; const char* textPtr2=textPtr;
wordWidth=0; wordWidth=0;
while(*textPtr2 && *textPtr2==' ') { while(*textPtr2 && *textPtr2==' ') {

View file

@ -14,6 +14,7 @@
#include "equipmnt.h" #include "equipmnt.h"
#include "pldnet.h" #include "pldnet.h"
#include "net.h"
DPID AVPDPNetID; DPID AVPDPNetID;

14
src/net.h Normal file
View file

@ -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

View file

@ -21,6 +21,7 @@
#include "dynamics.h" #include "dynamics.h"
#include "dynblock.h" #include "dynblock.h"
#include "stratdef.h" #include "stratdef.h"
#include "openal.h"
ACTIVESOUNDSAMPLE ActiveSounds[SOUND_MAXACTIVE]; 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}; 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};

6
src/openal.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef OPENAL_AVP_H
#define OPENAL_AVP_H
void UpdateSoundFrequencies();
#endif

View file

@ -11,9 +11,13 @@ void D3D_DrawBackdrop();
void D3D_FadeDownScreen(int brightness, int colour); void D3D_FadeDownScreen(int brightness, int colour);
void RenderString(char *stringPtr, int x, int y, int colour); void RenderString(char *stringPtr, int x, int y, int colour);
void RenderStringCentred(char *stringPtr, int centreX, 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_Setup();
void D3D_DecalSystem_End(); void D3D_DecalSystem_End();
void SecondFlushD3DZBuffer(); void SecondFlushD3DZBuffer();
void D3D_PlayerDamagedOverlay(int intensity); 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 #endif

View file

@ -236,7 +236,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
unsigned int promotions, excess, hi; unsigned int promotions, excess, hi;
goal = 1 << maxdepth; 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]; items += depth[n];
sum += (goal >> n) * depth[n]; sum += (goal >> n) * depth[n];
@ -249,7 +249,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
{ {
gain = (1 << (maxdepth - n)) - 1; gain = (1 << (maxdepth - n)) - 1;
busts = (sum - goal + gain - 1) / gain; 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[n] -= busts;
depth[maxdepth] += busts; depth[maxdepth] += busts;
sum -= busts * gain; sum -= busts * gain;
@ -259,7 +259,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
for (n = 0; excess; n++) for (n = 0; excess; n++)
{ {
hi = 1 << (maxdepth - 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)); gain = hi - (1 << (maxdepth - m));
if (excess < gain) if (excess < gain)
@ -267,7 +267,7 @@ static int HuffDepthsAdjust(int *depth, int maxdepth)
if (depth[m]) if (depth[m])
{ {
promotions = excess / gain; promotions = excess / gain;
promotions = depth[m] > promotions ? promotions : depth[m]; promotions = (unsigned int)depth[m] > promotions ? promotions : depth[m];
depth[n] += promotions; depth[n] += promotions;
depth[m] -= promotions; depth[m] -= promotions;
excess -= promotions * gain; excess -= promotions * gain;