More Warning cleanups (Tim Beckmann)

This commit is contained in:
Steven Fuller 2001-12-18 02:23:39 +00:00 committed by Patryk Obara
parent abab1011ac
commit 95b8b49b76
60 changed files with 205 additions and 110 deletions

View file

@ -22,7 +22,6 @@
#define UseLocalAssert Yes
#include "ourasert.h"
extern int MarineSight_FrustrumReject(STRATEGYBLOCK *sbPtr,VECTORCH *localOffset,STRATEGYBLOCK *target);
extern int FrisbeeSight_FrustrumReject(STRATEGYBLOCK *sbPtr,VECTORCH *localOffset,STRATEGYBLOCK *target);
int NPCCanSeeTarget(STRATEGYBLOCK *sbPtr, STRATEGYBLOCK *target, int viewRange)

View file

@ -1,3 +1,8 @@
#ifndef AI_SIGHT_H
#define AI_SIGHT_H
#define NPC_MAX_VIEWRANGE (50000)
extern int NPCCanSeeTarget(STRATEGYBLOCK *sbptr, STRATEGYBLOCK *target, int viewRange);
#endif

View file

@ -7,6 +7,7 @@
#include "dynblock.h"
#include "bh_types.h"
#include "avpview.h"
#include "opengl.h"
#include "kshape.h"
#include "kzsort.h"
@ -101,6 +102,7 @@ extern int GetSingleColourForPrimary(int Colour);
extern void ColourFillBackBuffer(int FillColour);
static void ModifyHeadOrientation(void);
int AVPViewVolumePlaneTest(CLIPPLANEBLOCK *cpb, DISPLAYBLOCK *dblockptr, int or);

View file

@ -1,7 +1,12 @@
#ifndef AVPVIEW_H
#define AVPVIEW_H
/* KJL 10:49:41 04/21/97 - avpview.h */
extern void AvpShowViews(void);
extern void InitCameraValues(void);
extern void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr);
void AvpShowViews(void);
void InitCameraValues(void);
void LightSourcesInRangeOfObject(DISPLAYBLOCK *dptr);
extern VIEWDESCRIPTORBLOCK *Global_VDB_Ptr;
#endif

View file

@ -803,8 +803,8 @@ int AGunSight_FrustrumReject(VECTORCH *localOffset) {
fixed_offset=*localOffset;
fixed_offset.vy-=300; /* ish */
if ((fixed_offset.vz <0) && (
((fixed_offset.vy) < (-fixed_offset.vz))&&(fixed_offset.vy>=0))
if (((fixed_offset.vz <0) && (
((fixed_offset.vy) < (-fixed_offset.vz))&&(fixed_offset.vy>=0)))
||((fixed_offset.vy<0)&&((-fixed_offset.vy) < (-fixed_offset.vz))
)) {
/* 180 horizontal, 90 vertical. */

View file

@ -1600,7 +1600,7 @@ static int VectorIntersects2dZVector(VECTORCH *vecStart,VECTORCH *vecEnd, int zE
Tries to find a floor polygon for a given world space location in
a given module
--------------------------------------------------------------------*/
int FindMyFloorPoly(VECTORCH* currentPosition, MODULE* currentModule)
static int FindMyFloorPoly(VECTORCH* currentPosition, MODULE* currentModule)
{
struct ColPolyTag polygonData;
int positionPoints[2];
@ -3226,7 +3226,7 @@ int New_NPC_IsObstructed(STRATEGYBLOCK *sbPtr, NPC_AVOIDANCEMANAGER *manager)
/* Consider explosive objects as obstructions to most things. */
if ((objectstatusptr->explosionType==0)||(manager->ClearanceDamage!=AMMO_NPC_OBSTACLE_CLEAR)) {
/* aha: an object which the npc can destroy... damage it, and return zero. */
CauseDamageToObject(nextReport->ObstacleSBPtr,&TemplateAmmo[manager->ClearanceDamage].MaxDamage, ONE_FIXED,NULL);
CauseDamageToObject(nextReport->ObstacleSBPtr,TemplateAmmo[manager->ClearanceDamage].MaxDamage, ONE_FIXED,NULL);
return(0);
/* After a few frames of that, there'll just be real obstructions. */
}

View file

@ -167,7 +167,6 @@ extern int NPCSetVelocity(STRATEGYBLOCK *sbPtr, VECTORCH* targetDirn, int in_spe
extern int NPCOrientateToVector(STRATEGYBLOCK *sbPtr, VECTORCH *zAxisVector, int turnspeed, VECTORCH *offset);
extern void NPCGetMovementTarget(STRATEGYBLOCK *sbPtr, STRATEGYBLOCK *target, VECTORCH *targetPosition, int* targetIsAirduct,int alien);
extern void NPCGetMovementDirection(STRATEGYBLOCK *sbPtr, VECTORCH *velocityDirection, VECTORCH* target, WAYPOINT_MANAGER *waypointManager);
extern int FindMyFloorPoly(VECTORCH* currentPosition, MODULE* currentModule);
extern void NPC_InitWanderData(NPC_WANDERDATA *wanderData);
extern void NPC_FindWanderTarget(STRATEGYBLOCK *sbPtr, NPC_WANDERDATA *wanderData, NPC_MOVEMENTDATA *moveData);
extern void NPC_FindAIWanderTarget(STRATEGYBLOCK *sbPtr, NPC_WANDERDATA *wanderData, NPC_MOVEMENTDATA *moveData, int alien);

View file

@ -73,18 +73,20 @@ MODULEMAPBLOCK AlienDefaultMap =
{
MapType_Sprite,
I_ShapeCube, /* default value */
0,0,0,
0,0,0,
{0,0,0},
{0,0,0},
ObFlag_NoInfLSrc|ObFlag_MultLSrc,
0,
0,
0,
0,
0,
0,0,0,
{0,0,0},
0,
0,
0,0,0,
0,
0,
0,
{0,0,0}
};
/* CDF 12/2/98 */
@ -361,7 +363,7 @@ void CreateAlienBot(VECTORCH *Position,int type)
alienStatus->EnablePounce=0;
}
alienStatus->aliensIgniterId=NULL;
alienStatus->aliensIgniterId=0;
MakeAlienNear(sbPtr);
@ -583,7 +585,7 @@ void CreateAlienDynamic(STRATEGYBLOCK *Generator, ALIEN_TYPE type_of_alien)
alienStatus->PounceDetected=0;
alienStatus->EnablePounce=0;
}
alienStatus->aliensIgniterId=NULL;
alienStatus->aliensIgniterId=0;
}
else
@ -805,7 +807,7 @@ void InitAlienBehaviour(void* bhdata, STRATEGYBLOCK *sbPtr)
alienStatus->EnablePounce=0;
}
alienStatus->aliensIgniterId=NULL;
alienStatus->aliensIgniterId=0;
}
else

View file

@ -23,6 +23,7 @@
#include "bh_marin.h"
#include "weapons.h"
#include "showcmds.h"
#include "pldnet.h"
#define UseLocalAssert Yes
#include "ourasert.h"

View file

@ -7,6 +7,7 @@
#include "module.h"
#include "stratdef.h"
#include "gamedef.h"
#include "game_statistics.h"
#include "dynblock.h"
#include "dynamics.h"
#include "comp_shp.h"

View file

@ -185,6 +185,16 @@ void * LiftBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr)
}
// this function reposts anything that would prevent
// The palyer most be in the module and nothing
// else can be
BOOL BadGuyInModuleOrNoPlayer()
{
return(0);
}
/*************************** LIFT CONTROL *****************************/
void LiftBehaveFun(STRATEGYBLOCK* sbptr)
@ -587,17 +597,6 @@ void LiftBehaveFun(STRATEGYBLOCK* sbptr)
}
// this function reposts anything that would prevent
// The palyer most be in the module and nothing
// else can be
BOOL BadGuyInModuleOrNoPlayer()
{
return(0);
}
void TeleportContents(MODULE* new_pos, MODULE* old_pos,BOOL floor_switches_fixed)
{
// this used within level - find objects in module

View file

@ -8,6 +8,7 @@
#include "dynblock.h"
#include "dynamics.h"
#include "pldghost.h"
#include "particle.h"
#define UseLocalAssert Yes
#include "ourasert.h"
@ -366,8 +367,7 @@ void MakePlacedLightNear(STRATEGYBLOCK *sbPtr)
void KillLightForRespawn(STRATEGYBLOCK *sbPtr)
{
PLACED_LIGHT_BEHAV_BLOCK* pl_bhv = sbPtr->SBdataptr;
LOCALASSERT(pl_bhv);
LOCALASSERT(sbPtr->SBdataptr);
LOCALASSERT(AvP.Network!=I_No_Network);
/* make the light invisible, and remove it from visibility management */

View file

@ -7,6 +7,7 @@
#include "dynblock.h"
#include "dynamics.h"
#include "plat_shp.h"
#define UseLocalAssert Yes

View file

@ -38,6 +38,7 @@
#include "bh_corpse.h"
#include "bh_dummy.h"
#include "scream.h"
#include "targeting.h"
#include "dxlog.h"
@ -48,6 +49,7 @@
#include "showcmds.h"
#include "extents.h"
#include "avp_userprofile.h"
#include "hud.h"
#define ALL_PULSERIFLES 0
#define MOTIONTRACKERS 0
@ -82,7 +84,6 @@ extern STRATEGYBLOCK* CreateGrenadeKernel(AVP_BEHAVIOUR_TYPE behaviourID, VECTOR
extern STRATEGYBLOCK* CreateRocketKernel(VECTORCH *position, MATRIXCH *orient,int fromplayer);
extern STRATEGYBLOCK* CreateFrisbeeKernel(VECTORCH *position, MATRIXCH *orient, int fromplayer);
extern int AlienPCIsCurrentlyVisible(int checktime,STRATEGYBLOCK *sbPtr);
extern int ObjectShouldAppearOnMotionTracker(STRATEGYBLOCK *sbPtr);
extern int SBIsEnvironment(STRATEGYBLOCK *sbPtr);
void Marine_SwitchExpression(STRATEGYBLOCK *sbPtr,int state);
@ -139,6 +140,9 @@ static STATE_RETURN_CONDITION Execute_MNS_PanicFireUnarmed(STRATEGYBLOCK *sbPtr)
void NPC_Maintain_Minigun(STRATEGYBLOCK *sbPtr, DELTA_CONTROLLER *mgd);
void Marine_AssumePanicExpression(STRATEGYBLOCK *sbPtr);
static STATE_RETURN_CONDITION Execute_MFS_Respond(STRATEGYBLOCK *sbPtr);
static STATE_RETURN_CONDITION Execute_MNS_PumpAction(STRATEGYBLOCK *sbPtr);
static STATE_RETURN_CONDITION Execute_MFS_Retreat(STRATEGYBLOCK *sbPtr);
static void Execute_Dying(STRATEGYBLOCK *sbPtr); /* used for near and far */
@ -16805,14 +16809,14 @@ static STATE_RETURN_CONDITION Execute_MNS_PanicFireUnarmed(STRATEGYBLOCK *sbPtr)
/* Stabilise sequence. */
if ((marineStatusPointer->HModelController.Sequence_Type!=HMSQT_MarineStand)
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_WildFire_0))
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_WildFire_0)
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_WildFire_45)
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_WildFire_90)) {
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_WildFire_90))) {
/* If we're not in one of the 'extreme panic' animations, are we in one of the others? */
if ((marineStatusPointer->HModelController.Sequence_Type!=HMSQT_MarineStand)
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_One))
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_Two)) {
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_One)
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_Two))) {
/* No, we're not. See which level of panic to go into... */
if (MarineRetreatsInTheFaceOfDanger(sbPtr)) {
/* It's PaNiC tImE! */
@ -16896,8 +16900,8 @@ static STATE_RETURN_CONDITION Execute_MNS_PanicFireUnarmed(STRATEGYBLOCK *sbPtr)
marineStatusPointer->using_squad_suspicion=0;
if ((marineStatusPointer->HModelController.Sequence_Type!=HMSQT_MarineStand)
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_One))
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_Two)) {
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_One)
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_Two))) {
Marine_EnterLesserPanicAnimation(sbPtr);
return(SRC_No_Change);
} else {
@ -16982,8 +16986,8 @@ static STATE_RETURN_CONDITION Execute_MNS_PanicFireUnarmed(STRATEGYBLOCK *sbPtr)
Sound_Play(marineStatusPointer->My_Weapon->EndSound,"d",&(sbPtr->DynPtr->Position));
}
if ((marineStatusPointer->HModelController.Sequence_Type!=HMSQT_MarineStand)
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_One))
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_Two)) {
||((marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_One)
&&(marineStatusPointer->HModelController.Sub_Sequence!=MSSS_Panic_Two))) {
Marine_EnterLesserPanicAnimation(sbPtr);
marineStatusPointer->internalState=1;
/* This is a bit pre-emptive, but never mind. */

View file

@ -401,6 +401,7 @@
extern void DoSquad(void);
extern void ZoneAlert(int level,AIMODULE *targetModule);
extern void Marine_CorpseSightingTest(STRATEGYBLOCK *corpse);
int MarineSight_FrustrumReject(STRATEGYBLOCK *sbPtr,VECTORCH *localOffset,STRATEGYBLOCK *target);
#ifdef __cplusplus

View file

@ -28,6 +28,7 @@ you should have seen the previous versions. */
#include "dxlog.h"
#include "avp_userprofile.h"
#include "pfarlocs.h"
#include "particle.h"
#define UseLocalAssert Yes
#include "ourasert.h"

View file

@ -45,7 +45,6 @@ int Simplify_HModel_Rendering=0;
extern enum PARTICLE_ID GetBloodType(STRATEGYBLOCK *sbPtr);
extern void DoShapeAnimation (DISPLAYBLOCK * dptr);
extern void RenderThisHierarchicalDisplayblock(DISPLAYBLOCK *dbPtr);
extern void MakeSprayOfSparks(MATRIXCH *orientationPtr, VECTORCH *positionPtr);
void MatToQuat (MATRIXCH *m, QUAT *quat);
/* protos for this file */

View file

@ -48,6 +48,7 @@
#include "game_statistics.h"
#include "pldnet.h"
#include "avp_userprofile.h"
#include "hud.h"
extern int ScanDrawMode;
@ -146,15 +147,13 @@ static void InitAlienHUD();
//static void CalcCoordsAndBLTWeapon(WEAPON_DATA* wptr);
void MaintainHUD(void);
static void DisplayHealthAndArmour(void);
static void DisplayMarinesAmmo(void);
static void DoMotionTracker(void);
static int DoMotionTrackerBlips(void);
static void UpdateMarineStatusValues(void);
//static void UpdateMarineStatusValues(void);
static void HandleMarineWeapon(void);
static void AimGunSight(int aimingSpeed, TEMPLATE_WEAPON_DATA *twPtr);
@ -167,7 +166,7 @@ void CentreGunSight(void);
static void InitPredatorHUD();
static int FindPredatorThreats(void);
//static int FindPredatorThreats(void);
#if DO_PREDATOR_OVERLAY
static void UpdatePredatorStatusValues(void);
#endif
@ -181,8 +180,6 @@ static void UpdateAlienStatusValues(void);
int Fast2dMagnitude(int dx, int dy);
void RotateVertex(VECTOR2D *vertexPtr, int theta);
/*KJL****************************************************************************************
* F U N C T I O N S *
****************************************************************************************KJL*/
@ -272,7 +269,7 @@ static void InitAlienHUD(void)
}
extern void ReInitHUD(void)
void ReInitHUD(void)
{
/* KJL 14:21:33 17/11/98 - Alien */
AlienTeethOffset = 0;
@ -574,7 +571,7 @@ void MaintainHUD(void)
}
}
extern void DoCompletedLevelStatisticsScreen(void)
void DoCompletedLevelStatisticsScreen(void)
{
extern int DebouncedGotAnyKey;
extern unsigned char DebouncedKeyboardInput[];
@ -759,7 +756,7 @@ static void DoMotionTracker(void)
/*KJL*********************************************************
* DoMotionTrackerBlips() looks a bit messy but works well. *
*********************************************************KJL*/
extern int ObjectShouldAppearOnMotionTracker(STRATEGYBLOCK *sbPtr)
int ObjectShouldAppearOnMotionTracker(STRATEGYBLOCK *sbPtr)
{
DYNAMICSBLOCK *objectDynPtr = sbPtr->DynPtr;

15
src/avp/hud.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef HUD_H
#define HUD_H
#include "stratdef.h" /* for STRATEGYBLOCK */
void InitHUD(void);
void KillHUD(void);
void ReInitHUD(void);
void MaintainHUD(void);
void DoCompletedLevelStatisticsScreen(void);
int ObjectShouldAppearOnMotionTracker(STRATEGYBLOCK *sbPtr);
void RotateVertex(VECTOR2D *vertexPtr, int theta);
void MaintainZoomingLevel(void);
#endif

View file

@ -5,6 +5,7 @@
#include "dynamics.h"
#include "hud_map.h"
#include "gamedef.h"
#include "hud.h"
#define UseLocalAssert Yes
#include "ourasert.h"
@ -47,7 +48,6 @@ static int PointInsideCircle(int x, int y);
static int IsHUDMapOn = 0;
extern int SetupPolygonAccessFromShapeIndex(int shapeIndex);
extern void RotateVertex(VECTOR2D *vertexPtr, int theta);
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
extern DISPLAYBLOCK *Player;

View file

@ -165,6 +165,7 @@ extern PARTICLE_DESC ParticleDescription[];
extern void InitialiseParticleSystem(void);
extern void MakeParticle(VECTORCH *positionPtr, VECTORCH *velocityPtr, enum PARTICLE_ID particleID);
extern void HandleParticleSystem(void);
void RenderAllParticlesFurtherAwayThan(int zThreshold);
extern void HandleRainDrops(MODULE *modulePtr,int numberOfRaindrops);
extern int EffectOfRipples(VECTORCH *point);
@ -193,6 +194,8 @@ extern void MakeDewlineTrailParticles(DYNAMICSBLOCK *dynPtr, int number);
extern void MakeBloodExplosion(VECTORCH *originPtr, int creationRadius, VECTORCH *blastPositionPtr, int noOfParticles, enum PARTICLE_ID particleID);
extern void MakeFocusedExplosion(VECTORCH *originPtr, VECTORCH *blastPositionPtr, int noOfParticles, enum PARTICLE_ID particleID);
extern void MakeElectricalExplosion(VECTORCH *positionPtr);
void MakeSprayOfSparks(MATRIXCH *orientationPtr, VECTORCH *positionPtr);
void PlayerPheromoneTrail(DYNAMICSBLOCK *dynPtr);
#define MAX_NO_OF_BLOOD_PARTICLES 500

View file

@ -28,6 +28,7 @@ so player.c is looking a bit bare at the moment. */
#include "psnd.h"
#include "psndplat.h"
#include "player.h"
/* for win 95 net support */
#if SupportWindows95

6
src/avp/player.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef PLAYER_H
#define PLAYER_H
void DeInitialisePlayer(void);
#endif

View file

@ -23,8 +23,6 @@ static SFXBLOCK *FreeSfxBlockList[MAX_NO_OF_SFX_BLOCKS];
static SFXBLOCK **FreeSfxBlockListPtr;
void HandleObjectOnFire(DISPLAYBLOCK *dispPtr);
/*KJL***************************************************************************
* FUNCTIONS TO ALLOCATE AND DEALLOCATE SFX BLOCKS - KJL 12:02:14 11/13/96 *

View file

@ -41,11 +41,13 @@ typedef struct forcefield
extern void InitialiseSfxBlocks(void);
extern SFXBLOCK* AllocateSfxBlock(void);
extern void DeallocateSfxBlock(SFXBLOCK *sfxPtr);
DISPLAYBLOCK *CreateSFXObject(enum SFX_ID sfxID);
extern struct displayblock *CreateSFXObject(enum SFX_ID sfxID);
extern void DrawSfxObject(struct displayblock *dispPtr);
extern void HandleSfxForObject(DISPLAYBLOCK *dispPtr);
void HandleObjectOnFire(DISPLAYBLOCK *dispPtr);
#endif

View file

@ -75,6 +75,8 @@ extern void UpdateWeaponShape(void);
**********************************************KJL*/
extern void GrabWeaponShape(PLAYER_WEAPON_DATA *weaponPtr);
void HandleWeaponImpact(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);
extern void GrabMuzzleFlashShape(TEMPLATE_WEAPON_DATA *twPtr);
extern void FindEndOfShape(VECTORCH* endPositionPtr, int shapeIndex);
extern void InitThisWeapon(PLAYER_WEAPON_DATA *pwPtr);

View file

@ -91,6 +91,7 @@ static void RenderConfigurationDescriptionString();
static void ActUponUsersInput(void);
static void InteractWithMenuElement(enum AVPMENU_ELEMENT_INTERACTION_ID interactionID);
static void RenderMenuElement(AVPMENU_ELEMENT *elementPtr, int e, int y);
static int HeightOfMenuElement(AVPMENU_ELEMENT *elementPtr);
void DisplayVideoModeUnavailableScreen(void);
void CheckForCredits(void);
void DoCredits(void);
@ -213,7 +214,7 @@ static const char* MultiplayerConfigurationName=0; //ditto
extern int DebuggingCommandsActive;
extern int AvP_MainMenus(void)
int AvP_MainMenus(void)
{
#if 0
SaveDefaultPrimaryConfigs();
@ -450,7 +451,8 @@ extern void AvP_TriggerInGameMenus(void)
if (IOFOCUS_AcceptTyping()) IOFOCUS_Toggle();
// SoundSys_PauseOn();
}
extern int AvP_InGameMenus(void)
int AvP_InGameMenus(void)
{
if(AvPMenus.MenusState == MENUSSTATE_INGAMEMENUS)
{
@ -463,7 +465,7 @@ extern int AvP_InGameMenus(void)
else return 0;
}
extern int InGameMenusAreRunning(void)
int InGameMenusAreRunning(void)
{
return (AvPMenus.MenusState == MENUSSTATE_INGAMEMENUS);
}
@ -2887,7 +2889,6 @@ static void InteractWithMenuElement(enum AVPMENU_ELEMENT_INTERACTION_ID interact
{
if (interactionID == AVPMENU_ELEMENT_INTERACTION_SELECT)
{
extern int MP_LevelNumber;
AvPMenus.MenusState = MENUSSTATE_STARTGAME;
netGameData.myStartFlag = 1;
// netGameData.myGameState = NGS_Playing;
@ -5402,7 +5403,7 @@ static char KeyboardEntryQueue[MAX_ITEMS_IN_KEYBOARDENTRYQUEUE];
static int NumberOfItemsInKeyboardEntryQueue;
static int KeyboardEntryQueue_ProcessingIndex;
extern void KeyboardEntryQueue_Add(char c)
void KeyboardEntryQueue_Add(char c)
{
if (c<32) return;

View file

@ -342,4 +342,13 @@ typedef struct
#define NUMBER_OF_SAVE_SLOTS 8
void KeyboardEntryQueue_Add(char c);
int AvP_MainMenus(void);
int AvP_InGameMenus(void);
int InGameMenusAreRunning(void);
#endif

View file

@ -12,10 +12,10 @@
#include "3dc.h"
#include "iofocus.h"
#include "gadget.h"
#include "avp_menus.h"
#include "psnd.h"
extern "C"
{
#include "avp_menus.h"
#define UseLocalAssert Yes
#include "ourasert.h"

View file

@ -1003,6 +1003,9 @@ extern void DoMultiplayerSpecificHud();
extern void GetNextMultiplayerObservedPlayer();
extern void TurnOffMultiplayerObserveMode();
extern void CheckStateOfObservedPlayer();
void MinimalNetCollectMessages(void);
void InitAVPNetGameForHost(int species, int gamestyle, int level);
void InitAVPNetGameForJoin(void);
/* ---------------------------------------------------------------------

View file

@ -13,16 +13,19 @@
#include "bh_far.h"
#include "pheromon.h"
#include "huddefs.h"
#include "hud.h"
//#include "hudgfx.h"
#include "font.h"
#include "bh_gener.h"
#include "pvisible.h"
#include "system.h"
#include "projload.hpp" // c++ header which ignores class definitions/member functions if __cplusplus is not defined ?
#include "chnkload.hpp" // c++ header which ignores class definitions/member functions if __cplusplus is not defined ?
#include "ffstdio.h" // fast file stdio
#include "avp_menus.h"
#include "cdplayer.h"
/*------------Patrick 1/6/97---------------
New sound system
@ -82,7 +85,7 @@ WINSCALEXY ExtentXYSubWindow;
// static
int ReadModuleMapList(MODULEMAPBLOCK *mmbptr);
static int ReadModuleMapList(MODULEMAPBLOCK *mmbptr);
RIFFHANDLE env_rif = INVALID_RIFFHANDLE;
RIFFHANDLE player_rif = INVALID_RIFFHANDLE;
RIFFHANDLE alien_weapon_rif = INVALID_RIFFHANDLE;
@ -635,7 +638,7 @@ void ProcessSystemObjects()
#endif
}
int ReadModuleMapList(MODULEMAPBLOCK *mmbptr)
static int ReadModuleMapList(MODULEMAPBLOCK *mmbptr)
{
MODULE m_temp;

View file

@ -21,6 +21,7 @@
#include "pmove.h"
#include "usr_io.h"
#include "hud_map.h"
#include "hud.h"
#include "iofocus.h"

View file

@ -6,6 +6,7 @@
#include "fixer.h"
#include "win95/cd_player.h"
#include "cdplayer.h"
static int HaveCDROM = 0;
static SDL_CD *cdrom = NULL;

8
src/cdplayer.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef CDPLAYER_H
#define CDPLAYER_H
void CDDA_Start();
void CDDA_Stop();
void CDDA_End();
#endif

View file

@ -135,7 +135,7 @@ int MoveFileA(const char *newfile, const char *oldfile);
int CopyFile(const char *newfile, const char *oldfile, int x);
int GetFileAttributes(const char *file);
int GetFileAttributesA(const char *file);
int SetFilePointer(HANDLE file, int x, int y, int z);
unsigned int SetFilePointer(HANDLE file, int x, int y, int z);
int SetEndOfFile(HANDLE file);
unsigned int timeGetTime();

View file

@ -2289,6 +2289,7 @@ void InitialiseSystem(void);
void InitialiseRenderer(void);
void ExitSystem(void);
void InitialVideoMode(void);
void RestartLevel();
void ResetFrameCounter(void);
void FrameCounterHandler(void);

View file

@ -8,6 +8,7 @@
#include "stratdef.h"
#include "gamedef.h"
#include "maths.h"
#include "kshape.h"
#include "kzsort.h"
@ -27,10 +28,13 @@
#include "vision.h"
#include "sfx.h"
#include "d3d_render.h"
#include "opengl.h"
#include "avpview.h"
#include "sphere.h"
#include "detaillevels.h"
#include "avp_userprofile.h"
#include "hud.h"
#include "weapons.h"
#define ALIENS_LIFEFORCE_GLOW_COLOUR 0x20ff8080
#define MARINES_LIFEFORCE_GLOW_COLOUR 0x208080ff
@ -198,7 +202,9 @@ HEATSOURCE HeatSourceList[MAX_NUMBER_OF_HEAT_SOURCES];
int NumberOfHeatSources;
int CloakingMode;
char CloakedPredatorIsMoving;
#if 0
static VECTORCH LocalCameraZAxis;
#endif
static int ObjectCounter;
@ -4915,7 +4921,6 @@ void RenderParticle(PARTICLE *particlePtr)
if ((particlePtr->ParticleID == PARTICLE_MUZZLEFLASH) )
{
extern void RotateVertex(VECTOR2D *vertexPtr, int theta);
int theta = FastRandom()&4095;
RotateVertex(&offset[0],theta);
RotateVertex(&offset[1],theta);
@ -4927,7 +4932,6 @@ void RenderParticle(PARTICLE *particlePtr)
||(particlePtr->ParticleID == PARTICLE_PARGEN_FLAME)
||(particlePtr->ParticleID == PARTICLE_FLAME))
{
extern void RotateVertex(VECTOR2D *vertexPtr, int theta);
int theta = (particlePtr->Offset.vx+MUL_FIXED(CloakingPhase,particlePtr->Offset.vy))&4095;
RotateVertex(&offset[0],theta);
RotateVertex(&offset[1],theta);
@ -6255,8 +6259,6 @@ void RenderPredatorTargetingSegment(int theta, int scale, int drawInRed)
if (theta)
{
extern void RotateVertex(VECTOR2D *vertexPtr, int theta);
RotateVertex(&offset[0],theta);
RotateVertex(&offset[1],theta);
RotateVertex(&offset[2],theta);

View file

@ -93,6 +93,7 @@ extern int FindHeatSourcesInHModel(DISPLAYBLOCK *dispPtr);
extern void TranslationSetup(void);
extern void TranslatePointIntoViewspace(VECTORCH *pointPtr);
void TranslatePoint(float *source, float *dest, float *matrix);
extern void CheckRenderStatesForModule(MODULE *modulePtr);

View file

@ -27,6 +27,15 @@
#include "pldnet.h"
#include "cdtrackselection.h"
#include "gammacontrol.h"
#include "opengl.h"
#include "avp_menus.h"
#include "avp_mp_config.h"
#include "npcsetup.h"
#include "cdplayer.h"
#include "hud.h"
#include "player.h"
#include "mempool.h"
#include "avpview.h"
#include "version.h"
char LevelName[] = {"predbit6\0QuiteALongNameActually"}; /* the real way to load levels */
@ -525,7 +534,7 @@ int SetOGLVideoMode(int Width, int Height)
return 0;
}
int InitialiseWindowsSystem()
int InitialiseWindowsSystem(HANDLE hInstance, int nCmdShow, int WinInitMode)
{
return 0;
}

View file

@ -1,5 +1,6 @@
#include "3dc.h"
#include "inline.h"
#include "maths.h"
#define UseTimsPinp Yes
@ -2150,7 +2151,7 @@ dx = 0; /* TODO: uninitialized?? */
/* small line -- use 32-bit values */
/* interpolate z */
t = (polyp[1] - sz) * (x - sx) - (polyp[0] - sx) * (z - sz);
if (t < 0 && sgnx < 0 || 0 < t && 0 < sgnx)
if ((t < 0 && sgnx < 0) || (0 < t && 0 < sgnx))
{
/* we have an intersection */
intersects++;

7
src/maths.h Normal file
View file

@ -0,0 +1,7 @@
#ifndef MATHS_H
#define MATHS_H
void SetSeededFastRandom(int seed);
int SeededFastRandom(void);
#endif

View file

@ -23,6 +23,7 @@
#include "hud_layout.h"
#include "avp_userprofile.h"
#include "aw.h"
#include "opengl.h"
int LightIntensityAtPoint(VECTORCH *pointPtr);

12
src/opengl.h Normal file
View file

@ -0,0 +1,12 @@
#ifndef AVP_OPENGL_H
#define AVP_OPENGL_H
#include "kshape.h"
void InitOpenGL();
void ThisFramesRenderingHasBegun();
void ThisFramesRenderingHasFinished();
void D3D_SkyPolygon_Output(POLYHEADER *inputPolyPtr, RENDERVERTEX *renderVerticesPtr);
void D3D_DrawBackdrop();
#endif

View file

@ -269,8 +269,7 @@ void Object_Animation_Sequence_Chunk::get_frames(List <Object_Animation_Sequence
for (LIF<Chunk *> cli(&cl); !cli.done(); cli.next())
{
pList->add_entry((Object_Animation_Sequence_Frame_Chunk *)cli());
}
}
}
////////////////////////////////
@ -319,9 +318,7 @@ Object_Animation_Sequence_Chunk::Object_Animation_Sequence_Chunk(Object_Animatio
break;
}
framelist.delete_first_entry();
}
}
}
Object_Animation_Sequence_Chunk * Object_Animation_Sequences_Chunk::get_sequence (int num, int subnum)
@ -346,10 +343,7 @@ Object_Animation_Sequence_Chunk * Object_Animation_Sequences_Chunk::get_sequence
{
return(sli());
}
else
{
return(0);
}
return 0;
}
int Object_Animation_Sequence_Chunk::get_sequence_time()

View file

@ -179,9 +179,9 @@ ChunkVector& ChunkVector::operator-=(const ChunkVector& a)
ChunkVector::operator VECTORCH () const
{
VECTORCH v;
v.vx = x;
v.vy = y;
v.vz = z;
v.vx = (int)x;
v.vy = (int)y;
v.vz = (int)z;
return(v);
}

View file

@ -231,8 +231,7 @@ Chunk_With_Children const * Chunk::GetRootChunk(void) const
Miscellaneous_Chunk::Miscellaneous_Chunk (Chunk_With_Children * parent, const char * identifier,
const char * _data, size_t _data_size)
: Chunk (parent, identifier),
data(NULL), data_size (_data_size)
: Chunk (parent, identifier), data_size (_data_size), data(NULL)
{
if (data_size)
{
@ -407,7 +406,7 @@ void Chunk_With_Children::lookup_child (const char * class_ident,List<Chunk*>& c
if (children)
while (child_ptr != NULL) {
if (strncmp (class_ident, child_ptr->identifier, 8) == NULL)
if (strncmp (class_ident, child_ptr->identifier, 8) == 0)
{
assert (!child_ptr->r_u_miscellaneous());
child_list.add_entry(child_ptr);
@ -426,7 +425,7 @@ unsigned Chunk_With_Children::count_children (char const * class_ident) const
if (children)
while (child_ptr != NULL) {
if (strncmp (class_ident, child_ptr->identifier, 8) == NULL)
if (strncmp (class_ident, child_ptr->identifier, 8) == 0)
{
assert (!child_ptr->r_u_miscellaneous());
++ nChildren;
@ -445,7 +444,7 @@ Chunk* Chunk_With_Children::lookup_single_child (const char * class_ident) const
Chunk * chunk_found=0;
if (children)
while (child_ptr != NULL) {
if (strncmp (class_ident, child_ptr->identifier, 8) == NULL)
if (strncmp (class_ident, child_ptr->identifier, 8) == 0)
{
assert (!child_ptr->r_u_miscellaneous());
assert(!chunk_found);

View file

@ -154,8 +154,8 @@ Preset_Palette::Preset_Palette (Preset_Palette const & c)
, reserved1(c.reserved1)
, reserved2(c.reserved2)
, startpos(c.startpos)
, pixel_data(grab_pixel_data(c.size, c.pixel_data))
, name(0)
, pixel_data(grab_pixel_data(c.size, c.pixel_data))
{
if (c.name)
{
@ -223,8 +223,8 @@ RIF_IMPLEMENT_DYNCREATE("PRSETPAL",Preset_Palette_Chunk)
Preset_Palette_Chunk::Preset_Palette_Chunk(Chunk_With_Children * const parent, char const * sdata, size_t const /*ssize*/)
: Chunk(parent,"PRSETPAL")
, version_num(*(int *)sdata)
, flags(*(int *)(sdata+4))
, version_num(*(int *)sdata)
, reserved1(*(int *)(sdata+8))
, reserved2(*(int *)(sdata+12))
, reserved3(*(int *)(sdata+16))
@ -291,7 +291,7 @@ RIF_IMPLEMENT_DYNCREATE("ENVTXLIT",Environment_TLT_Chunk)
Environment_TLT_Chunk::Environment_TLT_Chunk (Chunk_With_Children * parent, const char * sdata, size_t ssize)
: Chunk (parent, "ENVTXLIT"), width (*((int*)(sdata))),
num_levels (*((int*)(sdata+4))), flags(*(int *)(sdata+28)), table (0), filename(0)
num_levels (*((int*)(sdata+4))), flags(*(int *)(sdata+28)), filename(0), table (0)
{
int i;
@ -417,8 +417,8 @@ TLT_Config_Chunk::TLT_Config_Chunk (Chunk_With_Children * parent, const char * s
: Chunk (parent, "TLTCONFG")
, num_shades_white(*(unsigned int const *)sdata)
, table_size(*(unsigned int const *)(sdata+4))
, flags(*(unsigned int const *)(sdata+8))
, palette_size(*(unsigned int const *)(sdata+12))
, flags(*(unsigned int const *)(sdata+8))
{
if (!table_size) table_size = 256;
@ -833,8 +833,8 @@ RIF_IMPLEMENT_DYNCREATE("SETPALST",Preset_Palette_Store_Chunk)
Preset_Palette_Store_Chunk::Preset_Palette_Store_Chunk(Chunk_With_Children * const parent, char const * sdata, size_t const /*ssize*/)
: Chunk(parent,"SETPALST")
, version_num(*(int *)sdata)
, flags(*(int *)(sdata+4))
, version_num(*(int *)sdata)
, reserved1(*(int *)(sdata+8))
, reserved2(*(int *)(sdata+12))
, reserved3(*(int *)(sdata+16))

View file

@ -763,7 +763,7 @@ public:
strcpy(filename,fname);
}
}
BMP_Flags(BMP_Name const & bn) : enum_id(bn.enum_id), version_num(bn.version_num), flags((BMPN_Flags)(bn.flags & COPY_BMPN_FLAGS)), filename(0)
BMP_Flags(BMP_Name const & bn) : filename(0), flags((BMPN_Flags)(bn.flags & COPY_BMPN_FLAGS)), version_num(bn.version_num), enum_id(bn.enum_id)
{
if (bn.filename)
{
@ -771,7 +771,7 @@ public:
strcpy(filename,bn.filename);
}
}
BMP_Flags(BMP_Flags const & c) : filename(0), enum_id(c.enum_id), version_num(c.version_num), flags(c.flags)
BMP_Flags(BMP_Flags const & c) : filename(0), flags(c.flags), version_num(c.version_num), enum_id(c.enum_id)
{
if (c.filename)
{

View file

@ -137,8 +137,10 @@ static int InitialisedLog = 0;
static int db_display_type = DB_DOS;
/* For DirectDraw mode. */
#ifndef DB_NODIRECTDRAW
static struct db_dd_mode_tag dd_mode = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0};
static fontPtr FontP = NULL;
#endif
/* Volatile zero. */
static volatile int db_vol_zero = 0;
@ -150,10 +152,12 @@ static const char* db_assert_textA[ 3 ] =
"Expression: %s",
"File: %s Line: %d"
};
#if 0
static const char* db_prompt_std =
"Quit program/force e(x)ception? [y/n/x]";
static const char* db_prompt_windows =
"Quit program? [Yes/No]/force exception? [Cancel]";
#endif
static const char* db_assert_log_begin_text =
"DB: FAILED ASSERTION BEGINS";
static const char* db_assert_log_end_text =

View file

@ -18,7 +18,7 @@ Enum_Constant::Enum_Constant(char const * const _cname, int const _value) : cnam
}
}
Enum_Constant::Enum_Constant(Enum_Constant const & ec2) : reserved(ec2.reserved), value(ec2.value), cname(0)
Enum_Constant::Enum_Constant(Enum_Constant const & ec2) : cname(0), value(ec2.value), reserved(ec2.reserved)
{
if (ec2.cname)
{
@ -65,7 +65,7 @@ BOOL Enum_Constant::operator < (Enum_Constant const & ec2) const
Enum_Constant::Enum_Constant(char const * sdata)
: value(*(int *)sdata), reserved(*(int *)(sdata+4)), cname(0)
: cname(0), value(*(int *)sdata), reserved(*(int *)(sdata+4))
{
sdata+=8;
if (*sdata)
@ -95,10 +95,7 @@ void Enum_Constant::fill_data_block (char * data_start)
RIF_IMPLEMENT_DYNCREATE("BMPENUMS",BMP_Enums_Chunk)
BMP_Enums_Chunk::BMP_Enums_Chunk(Chunk_With_Children * const parent, char const * sdata, size_t const /*ssize*/)
: Chunk(parent,"BMPENUMS")
, reserved1(*(int *)sdata)
, reserved2(*(int *)(sdata+4))
, ctype(0)
: Chunk(parent,"BMPENUMS"), ctype(0), reserved1(*(int *)sdata), reserved2(*(int *)(sdata+4))
{
sdata+=8;
unsigned int const len = strlen(sdata)+1;

View file

@ -290,7 +290,7 @@ class _base_HashTable
_base_HashTable(unsigned = HT_DEFAULTTABLESIZESHIFT);
// destructor
~_base_HashTable();
virtual ~_base_HashTable();
// copy constructor and assignment not provided in v1.0
_base_HashTable(_base_HashTable<TYPE,ARG_TYPE,CMP_ARG_TYPE> const &);

View file

@ -52,7 +52,7 @@ Object_Hierarchy_Name_Chunk * Object_Hierarchy_Chunk::get_name ()
RIF_IMPLEMENT_DYNCREATE("OBJHIERD",Object_Hierarchy_Data_Chunk)
Object_Hierarchy_Data_Chunk::Object_Hierarchy_Data_Chunk (Object_Hierarchy_Chunk * parent, const char * obname)
: Chunk (parent, "OBJHIERD"), ob_name (0), object(0)
: Chunk (parent, "OBJHIERD"), object(0), ob_name (0)
{
num_extra_data=0;
extra_data=0;

View file

@ -162,7 +162,7 @@ static void MakeHuffTreeFromHuffItems(HuffNode *base, HuffItem *source, int coun
{
temp[n].bits = source[n].Count;
}
while (upperlim = --count)
while ((upperlim = --count))
{
if (temp[0].zero)
temp[0].zero->parent = temp[0].one->parent = movdest;

View file

@ -1151,7 +1151,7 @@ static int DHM_MoveBufferToQueue(int* pPosX,int* pPosY,int fZeroLeftMargin)
/* It is a standard character or a space */
DHM_AddToQueue(*pPosX,(*pPosY)+textprint_Y_offset, *pCh);
(*pPosX)+=AAFontWidths[*pCh];//CharWidthInPixels(*pCh);
(*pPosX)+=AAFontWidths[(int)*pCh];//CharWidthInPixels(*pCh);
if ((*pPosX)>LastDisplayableXForChars())
{

View file

@ -241,7 +241,7 @@ RIF_IMPLEMENT_DYNCREATE("SHPVTINT",Shape_Vertex_Intensities_Chunk)
Shape_Vertex_Intensities_Chunk::Shape_Vertex_Intensities_Chunk
(Chunk_With_Children *parent, char *lsn, int num_v, int * i_array)
: Chunk (parent, "SHPVTINT"), num_vertices(num_v), pad (0)
: Chunk (parent, "SHPVTINT"), pad (0), num_vertices(num_v)
{
strncpy (light_set_name, lsn, 8);

View file

@ -630,8 +630,7 @@ RIF_IMPLEMENT_DYNCREATE("OBJNOTES",Object_Notes_Chunk)
Object_Notes_Chunk::Object_Notes_Chunk (Chunk_With_Children * parent,
const char * _data, size_t _data_size)
: Chunk(parent, "OBJNOTES"),
data(NULL), data_size(_data_size)
: Chunk(parent, "OBJNOTES"), data_size(_data_size), data(NULL)
{
data_store = new char [data_size];

View file

@ -609,8 +609,8 @@ typedef enum {
long GetWindowsTickCount(void);
void CheckForWindowsMessages(void);
//BOOL ExitWindowsSystem(void);
//BOOL InitialiseWindowsSystem(HANDLE hInstance, int nCmdShow, int WinInitMode);
BOOL ExitWindowsSystem(void);
BOOL InitialiseWindowsSystem(HANDLE hInstance, int nCmdShow, int WinInitMode);
//void KeyboardHandlerKeyDown(WPARAM wParam);
//void KeyboardHandlerKeyUp(WPARAM wParam);
//void MouseVelocityHandler(UINT message, LPARAM lParam);

View file

@ -2265,7 +2265,7 @@ Shape_Morphing_Data_Chunk::Shape_Morphing_Data_Chunk (Shape_Chunk * parent, cons
}
Shape_Morphing_Data_Chunk::Shape_Morphing_Data_Chunk (Shape_Sub_Shape_Chunk * parent, const char *data, size_t size)
: Chunk_With_Children (parent, "SHPMORPH"), parent_sub_shape (parent), parent_shape (0)
: Chunk_With_Children (parent, "SHPMORPH"), parent_shape (0), parent_sub_shape (parent)
{
const char * buffer_ptr = data;

View file

@ -35,7 +35,7 @@
#include "awtexld.h"
//#include "alt_tab.h"
#include "alt_tab.h"
/*
#define for experimental purposes
@ -62,7 +62,6 @@ int tripc = 0;
*/
extern SHAPEHEADER **mainshapelist;
extern (*ShapeLanguageFunctions[])(SHAPEINSTR *shapeinstrptr);
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
extern unsigned char *ScreenBuffer;
extern char projectsubdirectory[];

View file

@ -200,7 +200,7 @@ int GetFileAttributesA(const char *file)
return GetFileAttributes(file);
}
int SetFilePointer(HANDLE file, int x, int y, int z)
unsigned int SetFilePointer(HANDLE file, int x, int y, int z)
{
fprintf(stderr, "SetFilePointer(%d, %d, %d, %d)\n", file, x, y, z);