diff --git a/src/avp/ai_sight.c b/src/avp/ai_sight.c index 7663e8a..d9ad1d7 100644 --- a/src/avp/ai_sight.c +++ b/src/avp/ai_sight.c @@ -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) diff --git a/src/avp/ai_sight.h b/src/avp/ai_sight.h index 089bc83..a048abb 100644 --- a/src/avp/ai_sight.h +++ b/src/avp/ai_sight.h @@ -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 diff --git a/src/avp/avpview.c b/src/avp/avpview.c index 7786a92..c566b4c 100644 --- a/src/avp/avpview.c +++ b/src/avp/avpview.c @@ -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); diff --git a/src/avp/avpview.h b/src/avp/avpview.h index d9a5420..942a43e 100644 --- a/src/avp/avpview.h +++ b/src/avp/avpview.h @@ -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 diff --git a/src/avp/bh_agun.c b/src/avp/bh_agun.c index ad66084..dc84931 100644 --- a/src/avp/bh_agun.c +++ b/src/avp/bh_agun.c @@ -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. */ diff --git a/src/avp/bh_ais.c b/src/avp/bh_ais.c index e16bbf8..6e5f55e 100644 --- a/src/avp/bh_ais.c +++ b/src/avp/bh_ais.c @@ -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. */ } diff --git a/src/avp/bh_ais.h b/src/avp/bh_ais.h index ae5cd18..da35472 100644 --- a/src/avp/bh_ais.h +++ b/src/avp/bh_ais.h @@ -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); diff --git a/src/avp/bh_alien.c b/src/avp/bh_alien.c index 3e1e1ba..b06996e 100644 --- a/src/avp/bh_alien.c +++ b/src/avp/bh_alien.c @@ -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 diff --git a/src/avp/bh_far.c b/src/avp/bh_far.c index 32a6177..a3538d9 100644 --- a/src/avp/bh_far.c +++ b/src/avp/bh_far.c @@ -23,6 +23,7 @@ #include "bh_marin.h" #include "weapons.h" #include "showcmds.h" +#include "pldnet.h" #define UseLocalAssert Yes #include "ourasert.h" diff --git a/src/avp/bh_fhug.c b/src/avp/bh_fhug.c index 87e9f9f..1328b82 100644 --- a/src/avp/bh_fhug.c +++ b/src/avp/bh_fhug.c @@ -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" diff --git a/src/avp/bh_lift.c b/src/avp/bh_lift.c index 865b819..ca34e4d 100644 --- a/src/avp/bh_lift.c +++ b/src/avp/bh_lift.c @@ -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 diff --git a/src/avp/bh_light.c b/src/avp/bh_light.c index 4bc4ac1..d43cd3e 100644 --- a/src/avp/bh_light.c +++ b/src/avp/bh_light.c @@ -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 */ diff --git a/src/avp/bh_ltfx.c b/src/avp/bh_ltfx.c index 617e7c8..5ae5b82 100644 --- a/src/avp/bh_ltfx.c +++ b/src/avp/bh_ltfx.c @@ -7,6 +7,7 @@ #include "dynblock.h" #include "dynamics.h" +#include "plat_shp.h" #define UseLocalAssert Yes diff --git a/src/avp/bh_marin.c b/src/avp/bh_marin.c index cad6e0c..572a20c 100644 --- a/src/avp/bh_marin.c +++ b/src/avp/bh_marin.c @@ -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. */ diff --git a/src/avp/bh_marin.h b/src/avp/bh_marin.h index 26569e9..a6537f5 100644 --- a/src/avp/bh_marin.h +++ b/src/avp/bh_marin.h @@ -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 diff --git a/src/avp/dynamics.c b/src/avp/dynamics.c index 1cbeb18..96afed8 100644 --- a/src/avp/dynamics.c +++ b/src/avp/dynamics.c @@ -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" diff --git a/src/avp/hmodel.c b/src/avp/hmodel.c index efb3721..c7f4d2a 100644 --- a/src/avp/hmodel.c +++ b/src/avp/hmodel.c @@ -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 */ diff --git a/src/avp/hud.c b/src/avp/hud.c index 238eafa..68efcf3 100644 --- a/src/avp/hud.c +++ b/src/avp/hud.c @@ -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; diff --git a/src/avp/hud.h b/src/avp/hud.h new file mode 100644 index 0000000..70903a5 --- /dev/null +++ b/src/avp/hud.h @@ -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 diff --git a/src/avp/hud_map.c b/src/avp/hud_map.c index 01a10e1..c80175e 100644 --- a/src/avp/hud_map.c +++ b/src/avp/hud_map.c @@ -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; diff --git a/src/avp/particle.h b/src/avp/particle.h index f5ec688..9043d06 100644 --- a/src/avp/particle.h +++ b/src/avp/particle.h @@ -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 diff --git a/src/avp/player.c b/src/avp/player.c index 9a3791f..d89476c 100644 --- a/src/avp/player.c +++ b/src/avp/player.c @@ -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 diff --git a/src/avp/player.h b/src/avp/player.h new file mode 100644 index 0000000..d46a942 --- /dev/null +++ b/src/avp/player.h @@ -0,0 +1,6 @@ +#ifndef PLAYER_H +#define PLAYER_H + +void DeInitialisePlayer(void); + +#endif diff --git a/src/avp/sfx.c b/src/avp/sfx.c index ecccd0f..722fbe0 100644 --- a/src/avp/sfx.c +++ b/src/avp/sfx.c @@ -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 * diff --git a/src/avp/sfx.h b/src/avp/sfx.h index a238008..d789946 100644 --- a/src/avp/sfx.h +++ b/src/avp/sfx.h @@ -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 diff --git a/src/avp/weapons.h b/src/avp/weapons.h index f79f22f..6cc078b 100644 --- a/src/avp/weapons.h +++ b/src/avp/weapons.h @@ -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); diff --git a/src/avp/win95/frontend/avp_menus.c b/src/avp/win95/frontend/avp_menus.c index 1e4004a..20919c6 100644 --- a/src/avp/win95/frontend/avp_menus.c +++ b/src/avp/win95/frontend/avp_menus.c @@ -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; diff --git a/src/avp/win95/frontend/avp_menus.h b/src/avp/win95/frontend/avp_menus.h index 41d8966..0461923 100644 --- a/src/avp/win95/frontend/avp_menus.h +++ b/src/avp/win95/frontend/avp_menus.h @@ -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 diff --git a/src/avp/win95/iofocus.cpp b/src/avp/win95/iofocus.cpp index 541ac98..6a9513e 100644 --- a/src/avp/win95/iofocus.cpp +++ b/src/avp/win95/iofocus.cpp @@ -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" diff --git a/src/avp/win95/pldnet.h b/src/avp/win95/pldnet.h index 9c57715..f616054 100644 --- a/src/avp/win95/pldnet.h +++ b/src/avp/win95/pldnet.h @@ -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); /* --------------------------------------------------------------------- diff --git a/src/avp/win95/system.c b/src/avp/win95/system.c index d0b6b7d..df5bbe3 100644 --- a/src/avp/win95/system.c +++ b/src/avp/win95/system.c @@ -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; diff --git a/src/avp/win95/usr_io.c b/src/avp/win95/usr_io.c index ac6ef97..49099af 100644 --- a/src/avp/win95/usr_io.c +++ b/src/avp/win95/usr_io.c @@ -21,6 +21,7 @@ #include "pmove.h" #include "usr_io.h" #include "hud_map.h" +#include "hud.h" #include "iofocus.h" diff --git a/src/cdplayer.c b/src/cdplayer.c index 55dbcde..953e988 100644 --- a/src/cdplayer.c +++ b/src/cdplayer.c @@ -6,6 +6,7 @@ #include "fixer.h" #include "win95/cd_player.h" +#include "cdplayer.h" static int HaveCDROM = 0; static SDL_CD *cdrom = NULL; diff --git a/src/cdplayer.h b/src/cdplayer.h new file mode 100644 index 0000000..e55b671 --- /dev/null +++ b/src/cdplayer.h @@ -0,0 +1,8 @@ +#ifndef CDPLAYER_H +#define CDPLAYER_H + +void CDDA_Start(); +void CDDA_Stop(); +void CDDA_End(); + +#endif diff --git a/src/fixer.h b/src/fixer.h index 2881e83..d0259f3 100644 --- a/src/fixer.h +++ b/src/fixer.h @@ -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(); diff --git a/src/include/prototyp.h b/src/include/prototyp.h index 2954480..f982f77 100644 --- a/src/include/prototyp.h +++ b/src/include/prototyp.h @@ -2289,6 +2289,7 @@ void InitialiseSystem(void); void InitialiseRenderer(void); void ExitSystem(void); void InitialVideoMode(void); +void RestartLevel(); void ResetFrameCounter(void); void FrameCounterHandler(void); diff --git a/src/kshape.c b/src/kshape.c index 124f58a..16df603 100644 --- a/src/kshape.c +++ b/src/kshape.c @@ -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); diff --git a/src/kshape.h b/src/kshape.h index 3f74956..4361e7f 100644 --- a/src/kshape.h +++ b/src/kshape.h @@ -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); diff --git a/src/main.c b/src/main.c index 065f194..c30e194 100644 --- a/src/main.c +++ b/src/main.c @@ -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; } diff --git a/src/maths.c b/src/maths.c index 711d4b4..6cdbc54 100644 --- a/src/maths.c +++ b/src/maths.c @@ -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++; diff --git a/src/maths.h b/src/maths.h new file mode 100644 index 0000000..ed59793 --- /dev/null +++ b/src/maths.h @@ -0,0 +1,7 @@ +#ifndef MATHS_H +#define MATHS_H + +void SetSeededFastRandom(int seed); +int SeededFastRandom(void); + +#endif diff --git a/src/opengl.c b/src/opengl.c index 351c9c8..d799d18 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -23,6 +23,7 @@ #include "hud_layout.h" #include "avp_userprofile.h" #include "aw.h" +#include "opengl.h" int LightIntensityAtPoint(VECTORCH *pointPtr); diff --git a/src/opengl.h b/src/opengl.h new file mode 100644 index 0000000..86e68c4 --- /dev/null +++ b/src/opengl.h @@ -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 diff --git a/src/win95/animobs.cpp b/src/win95/animobs.cpp index 847361c..e8b4bb1 100644 --- a/src/win95/animobs.cpp +++ b/src/win95/animobs.cpp @@ -269,8 +269,7 @@ void Object_Animation_Sequence_Chunk::get_frames(List 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() diff --git a/src/win95/chnktype.cpp b/src/win95/chnktype.cpp index d09728e..754dc7d 100644 --- a/src/win95/chnktype.cpp +++ b/src/win95/chnktype.cpp @@ -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); } diff --git a/src/win95/chunk.cpp b/src/win95/chunk.cpp index a068f87..6e61338 100644 --- a/src/win95/chunk.cpp +++ b/src/win95/chunk.cpp @@ -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& 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); diff --git a/src/win95/chunkpal.cpp b/src/win95/chunkpal.cpp index 8bf84da..1e98413 100644 --- a/src/win95/chunkpal.cpp +++ b/src/win95/chunkpal.cpp @@ -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)) diff --git a/src/win95/chunkpal.hpp b/src/win95/chunkpal.hpp index 8bb3c6e..534eff9 100644 --- a/src/win95/chunkpal.hpp +++ b/src/win95/chunkpal.hpp @@ -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) { diff --git a/src/win95/db.c b/src/win95/db.c index 13fc187..228bb1b 100644 --- a/src/win95/db.c +++ b/src/win95/db.c @@ -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 = diff --git a/src/win95/enumsch.cpp b/src/win95/enumsch.cpp index 0138cab..73f8626 100644 --- a/src/win95/enumsch.cpp +++ b/src/win95/enumsch.cpp @@ -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; diff --git a/src/win95/hash_tem.hpp b/src/win95/hash_tem.hpp index 190402c..8eb6fdb 100644 --- a/src/win95/hash_tem.hpp +++ b/src/win95/hash_tem.hpp @@ -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 const &); diff --git a/src/win95/hierchnk.cpp b/src/win95/hierchnk.cpp index 3f48e48..22d4844 100644 --- a/src/win95/hierchnk.cpp +++ b/src/win95/hierchnk.cpp @@ -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; diff --git a/src/win95/huffman.cpp b/src/win95/huffman.cpp index 64100e1..b9523d9 100644 --- a/src/win95/huffman.cpp +++ b/src/win95/huffman.cpp @@ -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; diff --git a/src/win95/io.c b/src/win95/io.c index a021f34..1e5c2fa 100644 --- a/src/win95/io.c +++ b/src/win95/io.c @@ -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()) { diff --git a/src/win95/ltchunk.cpp b/src/win95/ltchunk.cpp index b000a9c..2446830 100644 --- a/src/win95/ltchunk.cpp +++ b/src/win95/ltchunk.cpp @@ -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); diff --git a/src/win95/obchunk.cpp b/src/win95/obchunk.cpp index e90c7ce..67fb263 100644 --- a/src/win95/obchunk.cpp +++ b/src/win95/obchunk.cpp @@ -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]; diff --git a/src/win95/platform.h b/src/win95/platform.h index 0c3bcab..f8f6331 100644 --- a/src/win95/platform.h +++ b/src/win95/platform.h @@ -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); diff --git a/src/win95/shpchunk.cpp b/src/win95/shpchunk.cpp index 0514de0..0fe1811 100644 --- a/src/win95/shpchunk.cpp +++ b/src/win95/shpchunk.cpp @@ -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; diff --git a/src/win95/texio.c b/src/win95/texio.c index 39ba97c..3e23805 100644 --- a/src/win95/texio.c +++ b/src/win95/texio.c @@ -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[]; diff --git a/src/winapi.c b/src/winapi.c index 40449bf..08aef47 100644 --- a/src/winapi.c +++ b/src/winapi.c @@ -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);