mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merge branch 'master' into decideaction
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
#include "Sound Control.h"
|
||||
#include "Game Events.h"
|
||||
#include "lighting.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
// sevenfm
|
||||
#include "SmokeEffects.h"
|
||||
#include "Overhead.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "Game Clock.h"
|
||||
#include "strategic mines.h"
|
||||
#include "Strategic Mines.h"
|
||||
|
||||
AMBIENTDATA_STRUCT gAmbData[ MAX_AMBIENT_SOUNDS ];
|
||||
INT16 gsNumAmbData = 0;
|
||||
@@ -721,4 +721,4 @@ void SetSSA(void)
|
||||
|
||||
//guiCurrentSteadyStateSoundHandle = SoundPlay( zFileName, &spParms );
|
||||
guiCurrentSteadyStateSoundHandle = SoundPlayStreamedFile(zFileName, &spParms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
#include "sgp.h"
|
||||
#include "Ambient types.h"
|
||||
#include "Ambient Types.h"
|
||||
|
||||
BOOLEAN LoadAmbientControlFile( UINT8 ubAmbientID );
|
||||
|
||||
@@ -51,4 +51,4 @@ typedef struct
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "Buildings.h"
|
||||
#include "Pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Render Fun.h"
|
||||
#include "worldman.h"
|
||||
|
||||
@@ -29,4 +29,4 @@ void GenerateBuildings( void );
|
||||
INT32 FindClosestClimbPoint( SOLDIERTYPE *pSoldier, INT32 sStartGridNo, INT32 sDesiredGridNo, BOOLEAN fClimbUp );
|
||||
BOOLEAN SameBuilding( INT32 sGridNo1, INT32 sGridNo2 );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "Editor Undo.h"
|
||||
#include "StrategicMap.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "message.h"
|
||||
#include "pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Animation Control.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "SaveLoadMap.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __EXIT_GRIDS_H
|
||||
#define __EXIT_GRIDS_H
|
||||
|
||||
#include "Worlddef.h"
|
||||
#include "worlddef.h"
|
||||
|
||||
//dnl ch42 250909
|
||||
typedef struct
|
||||
|
||||
+201
-201
File diff suppressed because it is too large
Load Diff
@@ -13,20 +13,17 @@
|
||||
// Explosion Data
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiFlags;
|
||||
|
||||
UINT8 ubOwner;
|
||||
INT8 ubTypeID;
|
||||
|
||||
UINT16 usItem;
|
||||
|
||||
INT16 sX; // World X ( optional )
|
||||
INT16 sY; // World Y ( optional )
|
||||
INT16 sZ; // World Z ( optional )
|
||||
INT32 sGridNo; // World GridNo
|
||||
BOOLEAN fLocate;
|
||||
INT8 bLevel; // World level
|
||||
UINT8 ubUnsed[1];
|
||||
UINT32 uiFlags;
|
||||
SoldierID ubOwner;
|
||||
INT8 ubTypeID;
|
||||
UINT16 usItem;
|
||||
INT16 sX; // World X ( optional )
|
||||
INT16 sY; // World Y ( optional )
|
||||
INT16 sZ; // World Z ( optional )
|
||||
INT32 sGridNo; // World GridNo
|
||||
BOOLEAN fLocate;
|
||||
INT8 bLevel; // World level
|
||||
UINT8 ubUnsed[1];
|
||||
|
||||
} EXPLOSION_PARAMS;
|
||||
|
||||
@@ -34,12 +31,11 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
EXPLOSION_PARAMS Params;
|
||||
BOOLEAN fAllocated;
|
||||
INT16 sCurrentFrame;
|
||||
INT32 iID;
|
||||
INT32 iLightID;
|
||||
UINT8 ubUnsed[2];
|
||||
|
||||
BOOLEAN fAllocated;
|
||||
INT16 sCurrentFrame;
|
||||
INT32 iID;
|
||||
INT32 iLightID;
|
||||
UINT8 ubUnsed[2];
|
||||
|
||||
} EXPLOSIONTYPE;
|
||||
|
||||
@@ -100,8 +96,8 @@ extern EXPLOSIONTYPE gExplosionData[ NUM_EXPLOSION_SLOTS ];
|
||||
extern UINT8 gubElementsOnExplosionQueue;
|
||||
extern BOOLEAN gfExplosionQueueActive;
|
||||
|
||||
void IgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT, OBJECTTYPE * pObj =NULL );
|
||||
void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT, OBJECTTYPE * pObj =NULL );
|
||||
void IgniteExplosion( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT, OBJECTTYPE * pObj =NULL );
|
||||
void InternalIgniteExplosion( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection = DIRECTION_IRRELEVANT, OBJECTTYPE * pObj =NULL );
|
||||
|
||||
|
||||
void GenerateExplosion( EXPLOSION_PARAMS *pExpParams );
|
||||
@@ -110,10 +106,10 @@ void GenerateExplosion( EXPLOSION_PARAMS *pExpParams );
|
||||
void HandleExplosionWarningAnimations( );
|
||||
|
||||
void DecayBombTimers( void );
|
||||
void SetOffBombsByFrequency( UINT8 ubID, INT8 bFrequency );
|
||||
BOOLEAN SetOffBombsInGridNo( UINT8 ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8 bLevel );
|
||||
void ActivateSwitchInGridNo( UINT8 ubID, INT32 sGridNo );
|
||||
void SetOffPanicBombs( UINT8 ubID, INT8 bPanicTrigger );
|
||||
void SetOffBombsByFrequency( SoldierID ubID, INT8 bFrequency );
|
||||
BOOLEAN SetOffBombsInGridNo( SoldierID ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8 bLevel );
|
||||
void ActivateSwitchInGridNo( SoldierID ubID, INT32 sGridNo );
|
||||
void SetOffPanicBombs( SoldierID ubID, INT8 bPanicTrigger );
|
||||
|
||||
void UpdateExplosionFrame( INT32 iIndex, INT16 sCurrentFrame );
|
||||
void RemoveExplosionData( INT32 iIndex );
|
||||
@@ -136,16 +132,16 @@ void RemoveActiveExplosionMarkers();
|
||||
#define GASMASK_MIN_STATUS 70
|
||||
|
||||
// OJW - 20091028 - Explosion damage sync
|
||||
BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent , BOOL fFromRemoteClient = FALSE );
|
||||
BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, UINT8 ubOwner , BOOL fFromRemoteClient = FALSE );
|
||||
void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT8 ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectNum , BOOL fFromRemoteClient = FALSE , BOOL fNewSmokeEffect = FALSE );
|
||||
BOOLEAN DamageSoldierFromBlast( SoldierID ubPerson, SoldierID ubOwner, INT32 sBombGridNo, INT16 sWoundAmt, INT16 sBreathAmt, UINT32 uiDist, UINT16 usItem, INT16 sSubsequent, BOOL fFromRemoteClient = FALSE );
|
||||
BOOLEAN DishOutGasDamage( SOLDIERTYPE * pSoldier, EXPLOSIVETYPE * pExplosive, INT16 sSubsequent, BOOLEAN fRecompileMovementCosts, INT16 sWoundAmt, INT16 sBreathAmt, SoldierID ubOwner, BOOL fFromRemoteClient = FALSE );
|
||||
void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, SoldierID ubOwner, BOOLEAN fSubsequent, INT8 bLevel, INT32 iSmokeEffectNum, BOOL fFromRemoteClient = FALSE, BOOL fNewSmokeEffect = FALSE );
|
||||
void AddBombToQueue( UINT32 uiWorldBombIndex, UINT32 uiTimeStamp, BOOL fFromRemoteClient = FALSE );
|
||||
|
||||
// Flugente: activate everything connected to a tripwire in the surrounding if sGridNo on level bLevel with regard to the tripwire netwrok and hierarchy determined by ubFlag
|
||||
BOOLEAN ActivateSurroundingTripwire( UINT8 ubID, INT32 sGridNo, INT8 bLevel, UINT32 ubFlag );
|
||||
BOOLEAN ActivateSurroundingTripwire( SoldierID ubID, INT32 sGridNo, INT8 bLevel, UINT32 ubFlag );
|
||||
|
||||
// Flugente: A special function for tripwire gun traps. Search if pObj has a gun attached. If so, fire a shot from that gun in a specific direction. Afterwards place the gun on the ground
|
||||
void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, UINT8 ubId, UINT8 ubDirection );
|
||||
void CheckAndFireTripwireGun( OBJECTTYPE* pObj, INT32 sGridNo, INT8 bLevel, SoldierID ubId, UINT8 ubDirection );
|
||||
|
||||
extern void ToggleActionItemsByFrequency( INT8 bFrequency );
|
||||
extern void PerformItemAction( INT32 sGridNo, OBJECTTYPE * pObj );
|
||||
@@ -168,15 +164,17 @@ extern void HandleSeeingPowerGenFan( UINT32 sGridNo );
|
||||
extern void HandleSeeingFortifiedDoor( UINT32 sGridNo );//Ja25 UB
|
||||
#endif
|
||||
|
||||
void ExplosiveDamageGridNo( INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist, BOOLEAN *pfRecompileMovementCosts,
|
||||
BOOLEAN fOnlyWalls, INT8 bMultiStructSpecialFlag, BOOLEAN fSubSequentMultiTilesTransitionDamage, UINT8 ubOwner, INT8 bLevel,
|
||||
void ExplosiveDamageGridNo( INT32 sGridNo, INT16 sWoundAmt, UINT32 uiDist,
|
||||
BOOLEAN *pfRecompileMovementCosts,
|
||||
BOOLEAN fOnlyWalls, INT8 bMultiStructSpecialFlag, BOOLEAN fSubSequentMultiTilesTransitionDamage, SoldierID ubOwner,
|
||||
INT8 bLevel,
|
||||
UINT8 ubReason );
|
||||
|
||||
// Flugente: handle secondary explosive effects
|
||||
void HandleBuddyExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection );
|
||||
void HandleBuddyExplosions( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection );
|
||||
|
||||
// sevenfm: handle explosive items from attachments
|
||||
BOOLEAN HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj );
|
||||
BOOLEAN HandleAttachedExplosions( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGridNo, UINT16 usItem, BOOLEAN fLocate, INT8 bLevel, UINT8 ubDirection, OBJECTTYPE * pObj );
|
||||
void CheckForBuriedBombsAndRemoveFlags( INT32 sGridNo, INT8 bLevel );
|
||||
UINT16 CalcTotalVolatility(OBJECTTYPE * pObj);
|
||||
BOOLEAN FindBinderAttachment (OBJECTTYPE * pObj);
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
//Removes and smooths the adjacent tiles.
|
||||
void RemoveFogFromGridNo( INT32 uiGridNo );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "renderworld.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "interface cursors.h"
|
||||
#include "Interface Cursors.h"
|
||||
#include "worldman.h"
|
||||
#include "points.h"
|
||||
#include "structure wrap.h"
|
||||
#include "tile animation.h"
|
||||
#include "tile cache.h"
|
||||
#include "handle doors.h"
|
||||
#include "Points.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Tile Animation.h"
|
||||
#include "Tile Cache.h"
|
||||
#include "Handle Doors.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "english.h"
|
||||
#include "NPC.h"
|
||||
@@ -505,7 +505,7 @@ void LogMouseOverInteractiveTile( INT32 sGridNo )
|
||||
}
|
||||
|
||||
// Also, don't allow for mercs who are on upper level...
|
||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->pathing.bLevel == 1 )
|
||||
if ( gusSelectedSoldier != NOBODY && gusSelectedSoldier->pathing.bLevel == 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -789,7 +789,7 @@ BOOLEAN RefineLogicOnStruct( INT32 sGridNo, LEVELNODE *pNode )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->ubBodyType == ROBOTNOWEAPON )
|
||||
if ( gusSelectedSoldier != NOBODY && gusSelectedSoldier->ubBodyType == ROBOTNOWEAPON )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@ LEVELNODE *ConditionalGetCurInteractiveTileGridNoAndStructure( INT32 *psGridNo,
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "renderworld.h"
|
||||
#include "interface.h"
|
||||
#include "Interface.h"
|
||||
#include "worldman.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "sys globals.h"
|
||||
#include "overhead.h"
|
||||
#include "Random.h"
|
||||
#include "Pathai.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "Overhead.h"
|
||||
#include "random.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Map Information.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Meanwhile.h"
|
||||
#include "strategicmap.h"
|
||||
|
||||
UINT32 guiForceRefreshMousePositionCalculation = 0;
|
||||
@@ -1336,10 +1336,11 @@ INT32 RandomGridNo()
|
||||
BOOLEAN GridNoNearPlayerMercs( INT32 sGridNo, INT16 sRadius )
|
||||
{
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
INT32 cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
INT32 lastid = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt < lastid; ++cnt, ++pTeamSoldier)
|
||||
SoldierID cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
SoldierID lastid = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
||||
for ( ; cnt < lastid; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( pTeamSoldier && pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
||||
{
|
||||
if ( PythSpacesAway(sGridNo, pTeamSoldier->sGridNo) < sRadius )
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "animation control.h"
|
||||
#include "lighteffects.h"
|
||||
#include "isometric utils.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Animation Control.h"
|
||||
#include "LightEffects.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "lighting.h"
|
||||
#include "Game Clock.h"
|
||||
#include "opplist.h"
|
||||
@@ -537,7 +537,7 @@ void ResetLightEffects()
|
||||
}
|
||||
|
||||
// Flugente: create and destroy light sources tied to a person
|
||||
void CreatePersonalLight( INT32 sGridNo, UINT8 ubID )
|
||||
void CreatePersonalLight( INT32 sGridNo, SoldierID ubID )
|
||||
{
|
||||
INT32 iLightIndex = NewLightEffectInternal( sGridNo, 0, 1 );
|
||||
|
||||
@@ -548,7 +548,7 @@ void CreatePersonalLight( INT32 sGridNo, UINT8 ubID )
|
||||
}
|
||||
}
|
||||
|
||||
void RemovePersonalLights( UINT8 ubID )
|
||||
void RemovePersonalLights( SoldierID ubID )
|
||||
{
|
||||
LIGHTEFFECT *pLight;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ typedef struct
|
||||
|
||||
// Flugente: added variables necessary for dynamic (flash-)lighting
|
||||
INT32 flags;
|
||||
UINT8 ubOwner;
|
||||
SoldierID ubOwner;
|
||||
|
||||
} LIGHTEFFECT;
|
||||
|
||||
@@ -55,7 +55,7 @@ void ResetLightEffects();
|
||||
BOOLEAN IsLightEffectAtTile( INT32 sGridNo );
|
||||
|
||||
// Flugente: create and destroy light sources tied to a person
|
||||
void CreatePersonalLight( INT32 sGridNo, UINT8 ubID );
|
||||
void RemovePersonalLights( UINT8 ubID );
|
||||
void CreatePersonalLight( INT32 sGridNo, SoldierID ubID );
|
||||
void RemovePersonalLights(SoldierID ubID );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//#include <cmath> // added by Flugente
|
||||
#include "Map Edgepoints.h"
|
||||
|
||||
#include "pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "ai.h"
|
||||
#include "Map Information.h"
|
||||
#include "debug.h"
|
||||
#include "Random.h"
|
||||
#include "DEBUG.H"
|
||||
#include "random.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Render Fun.h"
|
||||
#include "strategicmap.h"
|
||||
|
||||
+73
-96
@@ -6,8 +6,8 @@
|
||||
#include "line.h"
|
||||
#include "renderworld.h"
|
||||
#include "lighting.h"
|
||||
#include "wcheck.h"
|
||||
#include "render dirty.h"
|
||||
#include "WCheck.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "overhead map.h"
|
||||
#include "Squads.h"
|
||||
#include "Text.h"
|
||||
@@ -493,30 +493,21 @@ void RenderRadarScreen( )
|
||||
|
||||
if( !( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) )
|
||||
{
|
||||
if(gbPixelDepth==16)
|
||||
// WANNE: Correct radar rectangle size if it is too large to fit in radar screen [2007-05-14]
|
||||
if (fAllowRadarMovementHor == FALSE)
|
||||
{
|
||||
// WANNE: Correct radar rectangle size if it is too large to fit in radar screen [2007-05-14]
|
||||
if (fAllowRadarMovementHor == FALSE)
|
||||
{
|
||||
sRadarTLX = RADAR_WINDOW_TM_X;
|
||||
sRadarBRX = RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH;
|
||||
}
|
||||
|
||||
if (fAllowRadarMovementVer == FALSE)
|
||||
{
|
||||
sRadarTLY = RADAR_WINDOW_TM_Y;
|
||||
sRadarBRY = RADAR_WINDOW_TM_Y + RADAR_WINDOW_HEIGHT;
|
||||
}
|
||||
|
||||
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
|
||||
RectangleDraw( TRUE, sRadarTLX, sRadarTLY, sRadarBRX, sRadarBRY - 1, usLineColor, pDestBuf );
|
||||
sRadarTLX = RADAR_WINDOW_TM_X;
|
||||
sRadarBRX = RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH;
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
|
||||
if (fAllowRadarMovementVer == FALSE)
|
||||
{
|
||||
// DB Need to change this to a color from the 8-but standard palette
|
||||
usLineColor = COLOR_GREEN;
|
||||
RectangleDraw8( TRUE, sRadarTLX + 1, sRadarTLY + 1, sRadarBRX + 1, sRadarBRY + 1, usLineColor, pDestBuf );
|
||||
sRadarTLY = RADAR_WINDOW_TM_Y;
|
||||
sRadarBRY = RADAR_WINDOW_TM_Y + RADAR_WINDOW_HEIGHT;
|
||||
}
|
||||
|
||||
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
|
||||
RectangleDraw( TRUE, sRadarTLX, sRadarTLY, sRadarBRX, sRadarBRY - 1, usLineColor, pDestBuf );
|
||||
}
|
||||
|
||||
// Cycle fFlash variable
|
||||
@@ -556,24 +547,20 @@ void RenderRadarScreen( )
|
||||
sXSoldRadar += RADAR_WINDOW_TM_X;
|
||||
sYSoldRadar += gsRadarY;
|
||||
|
||||
// if we are in 16 bit mode....kind of redundant
|
||||
if(gbPixelDepth==16)
|
||||
if( ( fFlashHighLightInventoryItemOnradarMap ) )
|
||||
{
|
||||
if( ( fFlashHighLightInventoryItemOnradarMap ) )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
|
||||
usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// DB Need to add a radar color for 8-bit
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// DB Need to add a radar color for 8-bit
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) );
|
||||
}
|
||||
|
||||
if( iCurrentlyHighLightedItem == iCounter )
|
||||
{
|
||||
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar + 1, sYSoldRadar + 1, usLineColor, pDestBuf );
|
||||
}
|
||||
if( iCurrentlyHighLightedItem == iCounter )
|
||||
{
|
||||
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar + 1, sYSoldRadar + 1, usLineColor, pDestBuf );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -632,77 +619,67 @@ void RenderRadarScreen( )
|
||||
sXSoldRadar += gsRadarX;
|
||||
sYSoldRadar += gsRadarY;
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
// DB Need to add a radar color for 8-bit
|
||||
|
||||
// Are we a selected guy?
|
||||
if ( pSoldier->ubID == gusSelectedSoldier )
|
||||
// Are we a selected guy?
|
||||
if ( pSoldier->ubID == gusSelectedSoldier )
|
||||
{
|
||||
if ( gfRadarCurrentGuyFlash )
|
||||
{
|
||||
if ( gfRadarCurrentGuyFlash )
|
||||
{
|
||||
usLineColor = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If on roof, make darker....
|
||||
if ( pSoldier->pathing.bLevel > 0 )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
|
||||
}
|
||||
}
|
||||
usLineColor = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
|
||||
|
||||
if ( pSoldier->bTeam == CIV_TEAM )
|
||||
{
|
||||
// Override civ team with red if hostile...
|
||||
if ( pSoldier->bSide != gbPlayerNum && !pSoldier->aiData.bNeutral )
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
|
||||
// if uncovered, different colour (so the player doesn't have to search for us)
|
||||
else if ( gGameExternalOptions.fKnownNPCsUseDifferentColour && pSoldier->ubProfile != NO_PROFILE && !zHiddenNames[pSoldier->ubProfile].Hidden )
|
||||
usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) );
|
||||
}
|
||||
|
||||
// Flugente 18-04-15: observed an odd bug: if we play with a release build and see a creature for the first time, their overhead/radar map pins do not have the correct colour.
|
||||
// Bizarrely enough, the issue seems dependent on the colour value (pink, RGB: 255/0/255) itself.
|
||||
// Saving and reloading solves the issue, but I am not sure why. As a fix we now use a slightly dampened pink.
|
||||
if ( pSoldier->bTeam == CREATURE_TEAM )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 247, 0, 247 ) );
|
||||
}
|
||||
|
||||
// Flugente: if we are a (still covert) enemy assassin, colour us like militia, so that the player wont notice us
|
||||
if ( pSoldier->usSoldierFlagMask & SOLDIER_ASSASSIN && pSoldier->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER )
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ MILITIA_TEAM ].RadarColor );
|
||||
|
||||
// Render different color if an enemy and he's unconscious
|
||||
if ( pSoldier->bTeam != gbPlayerNum && pSoldier->stats.bLife < OKLIFE )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 128, 128, 128 ) );
|
||||
}
|
||||
|
||||
// If on roof, make darker....
|
||||
if ( pSoldier->bTeam == gbPlayerNum && pSoldier->pathing.bLevel > 0 )
|
||||
if ( pSoldier->pathing.bLevel > 0 )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
|
||||
|
||||
if ( pSoldier->bTeam == CIV_TEAM )
|
||||
{
|
||||
// Override civ team with red if hostile...
|
||||
if ( pSoldier->bSide != gbPlayerNum && !pSoldier->aiData.bNeutral )
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
|
||||
// if uncovered, different colour (so the player doesn't have to search for us)
|
||||
else if ( gGameExternalOptions.fKnownNPCsUseDifferentColour && pSoldier->ubProfile != NO_PROFILE && !zHiddenNames[pSoldier->ubProfile].Hidden )
|
||||
usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) );
|
||||
}
|
||||
|
||||
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
{
|
||||
// DB Need to change this to a color from the 8-but standard palette
|
||||
usLineColor = COLOR_BLUE;
|
||||
RectangleDraw8( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
|
||||
// Flugente 18-04-15: observed an odd bug: if we play with a release build and see a creature for the first time, their overhead/radar map pins do not have the correct colour.
|
||||
// Bizarrely enough, the issue seems dependent on the colour value (pink, RGB: 255/0/255) itself.
|
||||
// Saving and reloading solves the issue, but I am not sure why. As a fix we now use a slightly dampened pink.
|
||||
if ( pSoldier->bTeam == CREATURE_TEAM )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 247, 0, 247 ) );
|
||||
}
|
||||
|
||||
// Flugente: if we are a (still covert) enemy assassin, colour us like militia, so that the player wont notice us
|
||||
if ( pSoldier->usSoldierFlagMask & SOLDIER_ASSASSIN && pSoldier->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER )
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ MILITIA_TEAM ].RadarColor );
|
||||
|
||||
// Render different color if an enemy and he's unconscious
|
||||
if ( pSoldier->bTeam != gbPlayerNum && pSoldier->stats.bLife < OKLIFE )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 128, 128, 128 ) );
|
||||
}
|
||||
|
||||
// If on roof, make darker....
|
||||
if ( pSoldier->bTeam == gbPlayerNum && pSoldier->pathing.bLevel > 0 )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
RectangleDraw( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,4 @@ void ClearOutRadarMapImage( void );
|
||||
// do we render the radar screen?..or the squad list?
|
||||
extern BOOLEAN fRenderRadarScreen;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+24
-75
@@ -6,7 +6,7 @@
|
||||
#include "vobject_blitters.h"
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
#include "Message.h"
|
||||
#include "message.h"
|
||||
#endif
|
||||
|
||||
// Forward Declarations
|
||||
@@ -604,20 +604,9 @@ BOOLEAN UpdateSaveBuffer(void)
|
||||
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
|
||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
// BLIT HERE
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, ( gsVIEWPORT_WINDOW_END_Y - gsVIEWPORT_WINDOW_START_Y ) );
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
{
|
||||
// BLIT HERE
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, gsVIEWPORT_WINDOW_END_Y );
|
||||
}
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, ( gsVIEWPORT_WINDOW_END_Y - gsVIEWPORT_WINDOW_START_Y ) );
|
||||
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
@@ -643,22 +632,11 @@ BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT1
|
||||
pDestBuf = LockVideoSurface(guiRENDERBUFFER, &uiDestPitchBYTES);
|
||||
pSrcBuf = LockVideoSurface(guiSAVEBUFFER, &uiSrcPitchBYTES);
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
{
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
|
||||
@@ -695,22 +673,11 @@ BOOLEAN RestoreExternBackgroundRectGivenID( INT32 iBack )
|
||||
pDestBuf = LockVideoSurface(guiRENDERBUFFER, &uiDestPitchBYTES);
|
||||
pSrcBuf = LockVideoSurface(guiSAVEBUFFER, &uiSrcPitchBYTES);
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
{
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
|
||||
@@ -730,22 +697,11 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
|
||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
{
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
|
||||
@@ -1342,18 +1298,11 @@ BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
usHeight = sBottom - sTop;
|
||||
usWidth = sRight - sLeft;
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
|
||||
Blt16BPPTo16BPP((UINT16 *)(UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
|
||||
sLeft, sTop,
|
||||
uiLeftSkip, uiTopSkip,
|
||||
usWidth, usHeight );
|
||||
}
|
||||
else if(gbPixelDepth==8)
|
||||
{
|
||||
}
|
||||
Blt16BPPTo16BPP((UINT16 *)(UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
|
||||
sLeft, sTop,
|
||||
uiLeftSkip, uiTopSkip,
|
||||
usWidth, usHeight );
|
||||
|
||||
// Once done, check for pending deletion
|
||||
if ( gVideoOverlays[uiCount].fDeletionPending )
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "Render Fun.h"
|
||||
#include "sysutil.h"
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "worldman.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "renderworld.h"
|
||||
#include "fov.h"
|
||||
#include "Fog Of War.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Random.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "random.h"
|
||||
|
||||
// Room Information
|
||||
//UINT8 gubWorldRoomInfo[ WORLD_MAX ];
|
||||
|
||||
@@ -34,4 +34,4 @@ void ExamineGridNoForSlantRoofExtraGraphic( INT32 sCheckGridNo );
|
||||
void SetRecalculateWireFrameFlagRadius(INT16 sX, INT16 sY, INT16 sRadius);
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+10
-12
@@ -1,22 +1,20 @@
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "OverHead.h"
|
||||
#include "Overhead.h"
|
||||
#include "FileMan.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "Debug.h"
|
||||
#include "WorldMan.h"
|
||||
#include "StrategicMap.h"
|
||||
#include "DEBUG.H"
|
||||
#include "worldman.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "RenderWorld.h"
|
||||
#include "Render Fun.h"
|
||||
#include "fov.h"
|
||||
#include "WorldDef.h"
|
||||
#include "worlddef.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "Message.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Smell.h"
|
||||
|
||||
#include <vfs/Core/vfs.h>
|
||||
//SB: make size of gpRevealedMap dependable from variable tactical map dimensions
|
||||
#define NUM_REVEALED_BYTES (WORLD_MAX/8)
|
||||
|
||||
@@ -175,7 +173,7 @@ typedef std::map<ModifiedMapFile::Key, ModifiedMapFile, ltMMF> ModifiedMapFileSe
|
||||
ModifiedMapFileSet g_mapFileSet;
|
||||
BOOLEAN g_useSaveCache;
|
||||
|
||||
void ClearTempFileSets()
|
||||
static void ClearTempFileSets()
|
||||
{
|
||||
//for (ModifiedMapFileSet::iterator itr = g_mapFileSet.begin(), end = g_mapFileSet.end(); itr != end; ++itr )
|
||||
//{
|
||||
@@ -195,7 +193,7 @@ BOOLEAN EnableModifiedFileSetCache(BOOLEAN value)
|
||||
return previousValue;
|
||||
}
|
||||
|
||||
bool TryGetModifiedMapFile( UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ, ModifiedMapFile** ppMMF )
|
||||
static bool TryGetModifiedMapFile( UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ, ModifiedMapFile** ppMMF )
|
||||
{
|
||||
if (ppMMF == NULL)
|
||||
return false;
|
||||
@@ -211,7 +209,7 @@ bool TryGetModifiedMapFile( UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ,
|
||||
return true;
|
||||
}
|
||||
|
||||
ModifiedMapFile& GetOrCreateModifiedMapFile(UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ)
|
||||
static ModifiedMapFile& GetOrCreateModifiedMapFile(UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ)
|
||||
{
|
||||
ModifiedMapFile* pResult = NULL;
|
||||
if ( TryGetModifiedMapFile(uiType, sMapX, sMapY, bMapZ, &pResult) )
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _SAVELOADMAP__H_
|
||||
#define _SAVELOADMAP__H_
|
||||
|
||||
#include "WorldDef.h"
|
||||
#include "worlddef.h"
|
||||
#include "Exit Grids.h"
|
||||
|
||||
//Used for the ubType in the MODIFY_MAP struct
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Shade Table Util.h"
|
||||
#include "video.h"
|
||||
#include "WorldDat.h"
|
||||
#include "Fileman.h"
|
||||
#include "FileMan.h"
|
||||
|
||||
#include <vfs/Core/vfs.h>
|
||||
|
||||
|
||||
@@ -13,4 +13,4 @@ extern BOOLEAN gfForceBuildShadeTables;
|
||||
BOOLEAN DeleteShadeTableDir( );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -5,4 +5,4 @@ void MarkMapIndexDirty( INT32 iMapIndex );
|
||||
void CenterScreenAtMapIndex( INT32 iMapIndex );
|
||||
void MarkWorldDirty();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#include "worlddef.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Smell.h"
|
||||
#include "worldman.h"
|
||||
#include "renderworld.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "gamesettings.h"
|
||||
#include "GameSettings.h"
|
||||
#include "message.h"
|
||||
#include "Isometric utils.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Map Information.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Overhead.h"
|
||||
#include "debug control.h"
|
||||
#include "Debug Control.h"
|
||||
|
||||
/*
|
||||
* Smell & Blood system
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "soldier control.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#define HUMAN 0
|
||||
#define CREATURE_ON_FLOOR 0x01
|
||||
|
||||
+18
-18
@@ -3,20 +3,20 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "weapons.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Weapons.h"
|
||||
#include "handle items.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "animation control.h"
|
||||
#include "tile animation.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Tile Animation.h"
|
||||
#include "handle items.h"
|
||||
#include "smokeeffects.h"
|
||||
#include "SmokeEffects.h"
|
||||
#include "message.h"
|
||||
#include "isometric utils.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "renderworld.h"
|
||||
#include "explosion control.h"
|
||||
#include "Random.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "random.h"
|
||||
#include "Game Clock.h"
|
||||
#include "opplist.h"
|
||||
#include "Campaign Types.h"
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "Render Fun.h"
|
||||
|
||||
#include "SaveLoadGame.h"
|
||||
#include "debug control.h"
|
||||
#include "Debug Control.h"
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
@@ -192,7 +192,7 @@ UINT16 FromSmokeTypeToWorldFlags( INT8 bType )
|
||||
|
||||
|
||||
|
||||
INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, BOOL fFromRemoteClient )
|
||||
INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, BOOL fFromRemoteClient )
|
||||
{
|
||||
SMOKEEFFECT *pSmoke;
|
||||
INT32 iSmokeIndex;
|
||||
@@ -204,14 +204,14 @@ INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner,
|
||||
// OJW - 20091027 - Syncronising smoke effect start for multiplayer
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = MercPtrs[ubOwner];
|
||||
SOLDIERTYPE* pSoldier = ubOwner;
|
||||
if (pSoldier != NULL)
|
||||
{
|
||||
if (pSoldier->bTeam == 0 || (pSoldier->bTeam == 1 && is_server))
|
||||
{
|
||||
// let all the other clients know we are spawning this effect
|
||||
// and align them with our random number generator
|
||||
send_newsmokeeffect(sGridNo,usItem,ubOwner,bLevel,iSmokeIndex);
|
||||
send_newsmokeeffect(sGridNo, usItem, bLevel, ubOwner, iSmokeIndex);
|
||||
}
|
||||
else if (!fFromRemoteClient)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner,
|
||||
}
|
||||
#ifdef JA2BETAVERSION
|
||||
CHAR tmpMPDbgString[512];
|
||||
sprintf(tmpMPDbgString,"NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n",sGridNo, usItem , ubOwner , bLevel , iSmokeIndex );
|
||||
sprintf(tmpMPDbgString,"NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n",sGridNo, usItem , ubOwner.i , bLevel , iSmokeIndex );
|
||||
MPDebugMsg(tmpMPDbgString);
|
||||
gfMPDebugOutputRandoms = true;
|
||||
#endif
|
||||
@@ -327,12 +327,12 @@ INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner,
|
||||
}
|
||||
|
||||
// ATE: FALSE into subsequent-- it's the first one!
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex , fFromRemoteClient , TRUE );
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex, fFromRemoteClient, TRUE );
|
||||
|
||||
return( iSmokeIndex );
|
||||
}
|
||||
|
||||
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, BOOLEAN fFromRemoteClient, UINT8 ubDuration, UINT8 ubRadius, UINT8 ubGeneration)
|
||||
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, BOOLEAN fFromRemoteClient, UINT8 ubDuration, UINT8 ubRadius, UINT8 ubGeneration)
|
||||
{
|
||||
SMOKEEFFECT *pSmoke;
|
||||
INT32 iSmokeIndex;
|
||||
@@ -348,14 +348,14 @@ INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, B
|
||||
// OJW - 20091027 - Synchronizing smoke effect start for multiplayer
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = MercPtrs[ubOwner];
|
||||
SOLDIERTYPE* pSoldier = ubOwner;
|
||||
if (pSoldier != NULL)
|
||||
{
|
||||
if (pSoldier->bTeam == 0 || (pSoldier->bTeam == 1 && is_server))
|
||||
{
|
||||
// let all the other clients know we are spawning this effect
|
||||
// and align them with our random number generator
|
||||
send_newsmokeeffect(sGridNo, usItem, ubOwner, bLevel, iSmokeIndex);
|
||||
send_newsmokeeffect(sGridNo, usItem, bLevel, ubOwner, iSmokeIndex);
|
||||
}
|
||||
else if (!fFromRemoteClient)
|
||||
{
|
||||
@@ -366,7 +366,7 @@ INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, B
|
||||
}
|
||||
#ifdef JA2BETAVERSION
|
||||
CHAR tmpMPDbgString[512];
|
||||
sprintf(tmpMPDbgString, "NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n", sGridNo, usItem, ubOwner, bLevel, iSmokeIndex);
|
||||
sprintf(tmpMPDbgString, "NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n", sGridNo, usItem, ubOwner.i, bLevel, iSmokeIndex);
|
||||
MPDebugMsg(tmpMPDbgString);
|
||||
gfMPDebugOutputRandoms = true;
|
||||
#endif
|
||||
|
||||
+11
-11
@@ -28,16 +28,16 @@ typedef struct TAG_SMOKE_EFFECT
|
||||
|
||||
UINT8 ubDuration; // the number of turns gas will remain effective
|
||||
UINT8 ubRadius; // the current radius of the cloud in map tiles
|
||||
UINT8 bFlags; // 0 - outdoors (fast spread), 1 - indoors (slow)
|
||||
UINT8 bFlags; // 0 - outdoors (fast spread), 1 - indoors (slow)
|
||||
UINT8 bAge; // the number of turns gas has been around
|
||||
BOOLEAN fAllocated;
|
||||
INT8 bType;
|
||||
UINT16 usItem;
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubGeneration;
|
||||
UINT32 uiTimeOfLastUpdate;
|
||||
INT8 iMPTeamIndex;
|
||||
INT32 iMPSmokeEffectID;
|
||||
BOOLEAN fAllocated;
|
||||
INT8 bType;
|
||||
UINT16 usItem;
|
||||
SoldierID ubOwner;
|
||||
UINT8 ubGeneration;
|
||||
UINT32 uiTimeOfLastUpdate;
|
||||
INT8 iMPTeamIndex;
|
||||
INT32 iMPSmokeEffectID;
|
||||
} SMOKEEFFECT;
|
||||
|
||||
extern SMOKEEFFECT gSmokeEffectData[ NUM_SMOKE_EFFECT_SLOTS ];
|
||||
@@ -57,7 +57,7 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT32 sGridNo, INT8
|
||||
|
||||
void RemoveSmokeEffectFromTile( INT32 sGridNo, INT8 bLevel );
|
||||
|
||||
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, BOOLEAN fFromRemoteClient = 0, UINT8 ubDuration = 0, UINT8 ubRadius = 0, UINT8 ubGeneration = 0);
|
||||
INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwner, BOOLEAN fFromRemoteClient = 0, UINT8 ubDuration = 0, UINT8 ubRadius = 0, UINT8 ubGeneration = 0);
|
||||
|
||||
BOOLEAN SaveSmokeEffectsToSaveGameFile( HWFILE hFile );
|
||||
BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile );
|
||||
@@ -77,4 +77,4 @@ BOOLEAN CheckSmokeEffect(INT32 sGridNo, INT8 bLevel, INT8 bType);
|
||||
// find smoke effect on visible screen
|
||||
BOOLEAN FindVisibleSmokeEffect(INT8 bType);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -250,4 +250,4 @@ typedef struct TAG_STRUCTURE_FILE_HEADER
|
||||
#define STRUCTURE_FILE_CONTAINS_AUXIMAGEDATA 0x01
|
||||
#define STRUCTURE_FILE_CONTAINS_STRUCTUREDATA 0x02
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
//sgp
|
||||
#include "english.h"
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "video.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "line.h"
|
||||
|
||||
//ja2
|
||||
#include "Tactical Placement GUI.h"
|
||||
#include "Overhead Map.h"
|
||||
#include "overhead map.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Interface.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "sysutil.h"
|
||||
#include "PreBattle Interface.h"
|
||||
@@ -24,10 +24,10 @@
|
||||
#include "message.h"
|
||||
#include "Map Information.h"
|
||||
#include "Soldier Add.h"
|
||||
#include "cursors.h"
|
||||
#include "Cursors.h"
|
||||
#include "Cursor Control.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "text.h"
|
||||
#include "Text.h"
|
||||
#include "WordWrap.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Isometric Utils.h"
|
||||
@@ -40,14 +40,20 @@
|
||||
typedef struct MERCPLACEMENT
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT32 uiVObjectID;
|
||||
MOUSE_REGION region;
|
||||
UINT8 ubStrategicInsertionCode;
|
||||
BOOLEAN fPlaced;
|
||||
UINT32 uiVObjectID;
|
||||
MOUSE_REGION region;
|
||||
UINT8 ubStrategicInsertionCode;
|
||||
BOOLEAN fPlaced;
|
||||
}MERCPLACEMENT;
|
||||
|
||||
MERCPLACEMENT *gMercPlacement = NULL;
|
||||
|
||||
UINT8 gfirstMercIndex = 0; // Index into gMercPlacement for the first visible merc face that is rendered
|
||||
UINT16 gFacePanelXStart; // Defines the area for mouse wheel scrolling
|
||||
UINT16 gFacePanelXEnd;
|
||||
UINT16 gFacePanelYStart;
|
||||
UINT16 gFacePanelYEnd;
|
||||
|
||||
enum
|
||||
{
|
||||
DONE_BUTTON,
|
||||
@@ -127,7 +133,7 @@ void SelectNextUnplacedUnit();
|
||||
BOOLEAN gfNorthValid, gfEastValid, gfSouthValid, gfWestValid;
|
||||
BOOLEAN gfChangedEntrySide = FALSE;
|
||||
|
||||
void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
|
||||
static void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
|
||||
{
|
||||
if( gMapInformation.sNorthGridNo == -1 &&
|
||||
gMapInformation.sEastGridNo == -1 &&
|
||||
@@ -196,7 +202,7 @@ void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
|
||||
}
|
||||
}
|
||||
|
||||
void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
|
||||
static void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
|
||||
{
|
||||
switch( *pubStrategicInsertionCode )
|
||||
{
|
||||
@@ -219,7 +225,314 @@ void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
|
||||
}
|
||||
}
|
||||
|
||||
//#endif
|
||||
|
||||
static UINT8 MaxRenderedFaces()
|
||||
{
|
||||
// Based on OverheadInterface.sti files
|
||||
if ( iResolution >= _640x480 && iResolution < _800x600 )
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
else if ( iResolution < _1024x768 )
|
||||
{
|
||||
return 26;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 34;
|
||||
}
|
||||
}
|
||||
|
||||
static void InitializeMercScrollArea()
|
||||
{
|
||||
// Based on OverheadInterface.sti files
|
||||
gFacePanelXStart = 88 + xResOffset;
|
||||
gFacePanelXEnd = SCREEN_WIDTH - xResOffset;
|
||||
gFacePanelYStart = SCREEN_HEIGHT - 120;
|
||||
gFacePanelYEnd = SCREEN_HEIGHT;
|
||||
}
|
||||
|
||||
|
||||
UINT32 gTacticalPlacementGUIPrevNextButtons[2];
|
||||
UINT32 gTacticalPlacementGUIPrevNextButtonImages[2];
|
||||
UINT32 gTacticalPlacementGUISliderBar;
|
||||
MOUSE_REGION gTacticalPlacementGUISliderBarRegion;
|
||||
UINT16 gScrollAreaXStart;
|
||||
UINT16 gScrollAreaXEnd;
|
||||
UINT16 gScrollAreaYStart;
|
||||
UINT16 gScrollAreaYEnd;
|
||||
UINT32 gScrollAreaGfx;
|
||||
|
||||
static void IncreaseMercIndex()
|
||||
{
|
||||
if ( gfirstMercIndex < (giPlacements - MaxRenderedFaces()) )
|
||||
{
|
||||
if ( gfirstMercIndex + MaxRenderedFaces() >= giPlacements - 1 )
|
||||
{
|
||||
gfirstMercIndex += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gfirstMercIndex += 2;
|
||||
}
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void DecreaseMercIndex()
|
||||
{
|
||||
if ( gfirstMercIndex > 0 )
|
||||
{
|
||||
if ( gfirstMercIndex == 1 )
|
||||
{
|
||||
gfirstMercIndex -= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gfirstMercIndex -= 2;
|
||||
}
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void BtnTacticalPlacementNextCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
{
|
||||
|
||||
if ( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
btn->uiFlags |= (BUTTON_CLICKED_ON);
|
||||
}
|
||||
else if ( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
if ( btn->uiFlags & BUTTON_CLICKED_ON )
|
||||
{
|
||||
btn->uiFlags &= ~(BUTTON_CLICKED_ON);
|
||||
|
||||
IncreaseMercIndex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void BtnTacticalPlacementPrevCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
{
|
||||
|
||||
if ( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
btn->uiFlags |= (BUTTON_CLICKED_ON);
|
||||
}
|
||||
else if ( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
if ( btn->uiFlags & BUTTON_CLICKED_ON )
|
||||
{
|
||||
btn->uiFlags &= ~(BUTTON_CLICKED_ON);
|
||||
|
||||
DecreaseMercIndex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void InitializeMercScrollButtons()
|
||||
{
|
||||
UINT16 xPrev, xNext, y;
|
||||
// Button locations based on OverheadInterface.sti files
|
||||
xNext = SCREEN_WIDTH - 17 - xResOffset;
|
||||
xPrev = 89 + xResOffset;
|
||||
y = SCREEN_HEIGHT - 19;
|
||||
|
||||
// time compression buttons
|
||||
gTacticalPlacementGUIPrevNextButtonImages[0] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti", 10, 1, -1, 3, -1 );
|
||||
gTacticalPlacementGUIPrevNextButtonImages[1] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti", 9, 0, -1, 2, -1 );
|
||||
|
||||
|
||||
gTacticalPlacementGUIPrevNextButtons[0] = QuickCreateButton( gTacticalPlacementGUIPrevNextButtonImages[0], xNext, y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 2,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTacticalPlacementNextCallback );
|
||||
|
||||
gTacticalPlacementGUIPrevNextButtons[1] = QuickCreateButton( gTacticalPlacementGUIPrevNextButtonImages[1], xPrev, y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 2,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTacticalPlacementPrevCallback );
|
||||
|
||||
|
||||
SetButtonCursor( gTacticalPlacementGUIPrevNextButtons[0], MSYS_NO_CURSOR );
|
||||
SetButtonCursor( gTacticalPlacementGUIPrevNextButtons[1], MSYS_NO_CURSOR );
|
||||
}
|
||||
|
||||
static void LoadSliderBar( void )
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
sprintf( VObjectDesc.ImageFile, "INTERFACE\\map_screen_bottom_arrows.sti" );
|
||||
if ( !AddVideoObject( &VObjectDesc, &gTacticalPlacementGUISliderBar ) )
|
||||
{
|
||||
AssertMsg( 0, "Failed to load Interface\\map_screen_bottom_arrows.sti" );
|
||||
}
|
||||
|
||||
|
||||
sprintf( VObjectDesc.ImageFile, "INTERFACE\\OverheadInterface_scrollarea.sti" );
|
||||
if ( !AddVideoObject( &VObjectDesc, &gScrollAreaGfx ) )
|
||||
{
|
||||
AssertMsg( 0, "Failed to load Interface\\OverheadInterface_scrollarea.sti" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void TacticalPlacementScrollBarCallBack( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
{
|
||||
POINT MousePos;
|
||||
UINT16 desiredMercIndex;
|
||||
const UINT8 sliderWidth = 11;
|
||||
const UINT16 sliderBarRange = gScrollAreaXEnd - gScrollAreaXStart - sliderWidth;
|
||||
|
||||
if ( iReason & MSYS_CALLBACK_REASON_INIT )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( iReason & (MSYS_CALLBACK_REASON_LBUTTON_DWN | MSYS_CALLBACK_REASON_LBUTTON_REPEAT) )
|
||||
{
|
||||
// region is supposed to be disabled if there aren't enough messages to scroll. Formulas assume this
|
||||
if ( giPlacements > MaxRenderedFaces() )
|
||||
{
|
||||
// where is the mouse?
|
||||
GetCursorPos( &MousePos );
|
||||
ScreenToClient( ghWindow, &MousePos ); // In window coords!
|
||||
|
||||
const UINT16 ubMouseXOffset = (UINT16)MousePos.x - gScrollAreaXStart;
|
||||
|
||||
// if clicking in the top 5 pixels of the slider bar
|
||||
if ( ubMouseXOffset < (sliderWidth / 2) )
|
||||
{
|
||||
// scroll all the way to the top
|
||||
desiredMercIndex = 0;
|
||||
}
|
||||
// if clicking in the bottom 6 pixels of the slider bar
|
||||
else if ( ubMouseXOffset >= ((gScrollAreaXEnd - gScrollAreaXStart) - (sliderWidth / 2)) )
|
||||
{
|
||||
// scroll all the way to the bottom
|
||||
desiredMercIndex = giPlacements - MaxRenderedFaces();
|
||||
}
|
||||
else
|
||||
{
|
||||
// somewhere in between
|
||||
const UINT16 desiredSliderOffset = ubMouseXOffset - (sliderWidth / 2);
|
||||
|
||||
Assert( desiredSliderOffset <= sliderBarRange );
|
||||
|
||||
// calculate what the index should be to place the slider at this offset (round fractions of .5+ up)
|
||||
desiredMercIndex = ((desiredSliderOffset * (giPlacements - MaxRenderedFaces())) + (sliderBarRange / 2)) / sliderBarRange;
|
||||
}
|
||||
|
||||
// if it's a change
|
||||
if ( desiredMercIndex != gfirstMercIndex )
|
||||
{
|
||||
gfirstMercIndex = desiredMercIndex;
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void CreateTacticalPlacementGUIScrollBarRegion( void )
|
||||
{
|
||||
// Locations based on OverheadInterface.sti files
|
||||
gScrollAreaXStart = 104 + xResOffset;
|
||||
gScrollAreaXEnd = SCREEN_WIDTH - 18 - xResOffset;
|
||||
gScrollAreaYStart = SCREEN_HEIGHT - 19;
|
||||
gScrollAreaYEnd = gScrollAreaYStart + 11; //SLIDER_HEIGHT / SLIDER_WIDTH in Map Screen Interface Bottom.cpp;
|
||||
|
||||
MSYS_DefineRegion( &gTacticalPlacementGUISliderBarRegion,
|
||||
gScrollAreaXStart,
|
||||
gScrollAreaYStart,
|
||||
gScrollAreaXEnd,
|
||||
gScrollAreaYEnd,
|
||||
MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, TacticalPlacementScrollBarCallBack
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
static void DisplayTacticalPlacementSlider()
|
||||
{
|
||||
// will display the scroll bar icon
|
||||
HVOBJECT hHandle;
|
||||
|
||||
// only show the slider if there are more messages than will fit on screen
|
||||
if ( giPlacements > MaxRenderedFaces() )
|
||||
{
|
||||
// Slider bar area graphics
|
||||
UINT16 imageIndex;
|
||||
if ( (iResolution >= _640x480 && iResolution < _800x600) )
|
||||
{
|
||||
imageIndex = 0;
|
||||
}
|
||||
else if ( iResolution < _1024x768 )
|
||||
{
|
||||
imageIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
imageIndex = 2;
|
||||
}
|
||||
|
||||
GetVideoObject( &hHandle, gScrollAreaGfx );
|
||||
BltVideoObject( FRAME_BUFFER, hHandle, imageIndex, gScrollAreaXStart, gScrollAreaYStart, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
|
||||
// calculate where slider should be positioned
|
||||
UINT8 sliderWidth = 11;
|
||||
UINT16 sliderBarRange = gScrollAreaXEnd - gScrollAreaXStart - sliderWidth;
|
||||
UINT16 ubSliderOffset = (sliderBarRange * gfirstMercIndex) / (giPlacements - MaxRenderedFaces());
|
||||
|
||||
GetVideoObject( &hHandle, gTacticalPlacementGUISliderBar );
|
||||
BltVideoObject( FRAME_BUFFER, hHandle, 8, gScrollAreaXStart + ubSliderOffset, gScrollAreaYStart + 1 , VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void EnableDisableTacticalPlacementScrollButtonsAndRegions( void )
|
||||
{
|
||||
// if no scrolling required, or already showing the first merc
|
||||
if ( (giPlacements <= MaxRenderedFaces()) || (gfirstMercIndex == 0) )
|
||||
{
|
||||
DisableButton( gTacticalPlacementGUIPrevNextButtons[1] );
|
||||
ButtonList[gTacticalPlacementGUIPrevNextButtons[1]]->uiFlags &= ~(BUTTON_CLICKED_ON);
|
||||
}
|
||||
else
|
||||
{
|
||||
EnableButton( gTacticalPlacementGUIPrevNextButtons[1] );
|
||||
ShowButton( gTacticalPlacementGUIPrevNextButtons[1] );
|
||||
}
|
||||
|
||||
// if no scrolling required, or already showing the last merc
|
||||
if ( giPlacements <= MaxRenderedFaces() ||
|
||||
((gfirstMercIndex + MaxRenderedFaces()) >= giPlacements) )
|
||||
{
|
||||
DisableButton( gTacticalPlacementGUIPrevNextButtons[0] );
|
||||
ButtonList[gTacticalPlacementGUIPrevNextButtons[0]]->uiFlags &= ~(BUTTON_CLICKED_ON);
|
||||
}
|
||||
else
|
||||
{
|
||||
EnableButton( gTacticalPlacementGUIPrevNextButtons[0] );
|
||||
ShowButton( gTacticalPlacementGUIPrevNextButtons[0] );
|
||||
}
|
||||
|
||||
if ( giPlacements <= MaxRenderedFaces())
|
||||
{
|
||||
MSYS_DisableRegion( &gTacticalPlacementGUISliderBarRegion );
|
||||
HideButton( gTacticalPlacementGUIPrevNextButtons[0] );
|
||||
HideButton( gTacticalPlacementGUIPrevNextButtons[1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
MSYS_EnableRegion( &gTacticalPlacementGUISliderBarRegion );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern BOOLEAN gfTacticalDoHeliRun;
|
||||
|
||||
@@ -227,12 +540,13 @@ void InitTacticalPlacementGUI()
|
||||
{
|
||||
islocked=0;//hayden
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
INT32 i, xp, yp;
|
||||
INT32 xp, yp;
|
||||
UINT8 ubFaceIndex;
|
||||
gfTacticalPlacementGUIActive = TRUE;
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
gfValidLocationsChanged = TRUE;
|
||||
gfTacticalPlacementFirstTime = TRUE;
|
||||
gfirstMercIndex = 0;
|
||||
|
||||
// WANNE - MP: Center
|
||||
gfCenter = FALSE;
|
||||
@@ -247,6 +561,10 @@ void InitTacticalPlacementGUI()
|
||||
//Enter overhead map
|
||||
GoIntoOverheadMap();
|
||||
|
||||
MSYS_DisableRegion( &gRadarRegion ); // So it doesn't interfere with selecting mercs
|
||||
InitializeMercScrollArea();
|
||||
LoadSliderBar();
|
||||
|
||||
//Load the images
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
@@ -325,17 +643,17 @@ void InitTacticalPlacementGUI()
|
||||
//First pass: Count the number of mercs that are going to be placed by the player.
|
||||
// This determines the size of the array we will allocate.
|
||||
giPlacements = 0;
|
||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||
{
|
||||
|
||||
if( MercPtrs[ i ]->bActive && !MercPtrs[ i ]->flags.fBetweenSectors &&
|
||||
CurrentBattleSectorIs( MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY, MercPtrs[i]->bSectorZ ) &&
|
||||
!( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW &&
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||
!( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT )
|
||||
SOLDIERTYPE *pSoldier = i;
|
||||
if( pSoldier->bActive && !pSoldier->flags.fBetweenSectors &&
|
||||
CurrentBattleSectorIs( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) &&
|
||||
!( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||
!( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
||||
pSoldier->bAssignment != IN_TRANSIT )
|
||||
{
|
||||
++giPlacements;
|
||||
}
|
||||
@@ -345,60 +663,61 @@ void InitTacticalPlacementGUI()
|
||||
Assert( gMercPlacement );
|
||||
//Second pass: Assign the mercs to their respective slots.
|
||||
giPlacements = 0;
|
||||
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||
for( SoldierID i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++i )
|
||||
{
|
||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !MercPtrs[ i ]->flags.fBetweenSectors &&
|
||||
CurrentBattleSectorIs( MercPtrs[i]->sSectorX, MercPtrs[i]->sSectorY, MercPtrs[i]->bSectorZ ) &&
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW &&
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||
!( MercPtrs[i]->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT &&
|
||||
!( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) ) // ATE Ignore vehicles
|
||||
SOLDIERTYPE *pSoldier = i;
|
||||
if( pSoldier->bActive && pSoldier->stats.bLife && !pSoldier->flags.fBetweenSectors &&
|
||||
CurrentBattleSectorIs( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_POW &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_MINIEVENT &&
|
||||
pSoldier->bAssignment != ASSIGNMENT_REBELCOMMAND &&
|
||||
!( pSoldier->usSoldierFlagMask2 & SOLDIER_CONCEALINSERTION ) &&
|
||||
pSoldier->bAssignment != IN_TRANSIT &&
|
||||
!( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) ) // ATE Ignore vehicles
|
||||
{
|
||||
// Flugente: if options allow it and we entered this sector - in combat - via helicopter, then allow us free selection of our entry point, and drop us from the helicopter
|
||||
if ( MercPtrs[ i ]->bTeam == gbPlayerNum && (gGameExternalOptions.ubSkyriderHotLZ == 1 || gGameExternalOptions.ubSkyriderHotLZ == 3) && MercPtrs[ i ]->usSoldierFlagMask & SOLDIER_AIRDROP )
|
||||
if ( pSoldier->bTeam == gbPlayerNum && (gGameExternalOptions.ubSkyriderHotLZ == 1 || gGameExternalOptions.ubSkyriderHotLZ == 3) && pSoldier->usSoldierFlagMask & SOLDIER_AIRDROP )
|
||||
{
|
||||
AddMercToHeli( MercPtrs[ i ]->ubID );
|
||||
AddMercToHeli( pSoldier->ubID );
|
||||
DisableButton(iTPButtons[SPREAD_BUTTON]);
|
||||
|
||||
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
||||
MercPtrs[ i ]->ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
||||
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CHOPPER;
|
||||
gfCenter = TRUE;
|
||||
}
|
||||
|
||||
if ( GetEnemyEncounterCode() == ENEMY_AMBUSH_DEPLOYMENT_CODE )
|
||||
{
|
||||
gMercPlacement[giPlacements].ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
||||
MercPtrs[i]->ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
||||
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_CENTER;
|
||||
gfCenter = TRUE;
|
||||
}
|
||||
|
||||
// WANNE - MP: Check if the desired insertion direction is valid on the map. If not, choose another entry direction!
|
||||
if (is_networked)
|
||||
{
|
||||
MercPtrs[ i ]->ubStrategicInsertionCode = GetValidInsertionDirectionForMP(MercPtrs[ i ]->ubStrategicInsertionCode);
|
||||
pSoldier->ubStrategicInsertionCode = GetValidInsertionDirectionForMP(pSoldier->ubStrategicInsertionCode);
|
||||
}
|
||||
// ATE: If we are in a vehicle - remove ourselves from it!
|
||||
//if ( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
|
||||
//if ( pSoldier->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
|
||||
//{
|
||||
// RemoveSoldierFromVehicle( MercPtrs[ i ], MercPtrs[ i ]->bVehicleID );
|
||||
// RemoveSoldierFromVehicle( pSoldier, pSoldier->bVehicleID );
|
||||
//}
|
||||
|
||||
if( MercPtrs[ i ]->ubStrategicInsertionCode == INSERTION_CODE_PRIMARY_EDGEINDEX ||
|
||||
MercPtrs[ i ]->ubStrategicInsertionCode == INSERTION_CODE_SECONDARY_EDGEINDEX )
|
||||
if( pSoldier->ubStrategicInsertionCode == INSERTION_CODE_PRIMARY_EDGEINDEX ||
|
||||
pSoldier->ubStrategicInsertionCode == INSERTION_CODE_SECONDARY_EDGEINDEX )
|
||||
{
|
||||
MercPtrs[ i ]->ubStrategicInsertionCode = (UINT8)MercPtrs[ i ]->usStrategicInsertionData;
|
||||
pSoldier->ubStrategicInsertionCode = (UINT8)pSoldier->usStrategicInsertionData;
|
||||
}
|
||||
gMercPlacement[ giPlacements ].pSoldier = MercPtrs[ i ];
|
||||
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = MercPtrs[ i ]->ubStrategicInsertionCode;
|
||||
gMercPlacement[ giPlacements ].pSoldier = pSoldier;
|
||||
gMercPlacement[ giPlacements ].ubStrategicInsertionCode = pSoldier->ubStrategicInsertionCode;
|
||||
gMercPlacement[ giPlacements ].fPlaced = FALSE;
|
||||
|
||||
// WANNE: We always want to have edgepoints
|
||||
CheckForValidMapEdge( &MercPtrs[ i ]->ubStrategicInsertionCode );
|
||||
CheckForValidMapEdge( &pSoldier->ubStrategicInsertionCode );
|
||||
|
||||
// Flugente: campaign stats
|
||||
switch( MercPtrs[ i ]->ubStrategicInsertionCode )
|
||||
switch( pSoldier->ubStrategicInsertionCode )
|
||||
{
|
||||
case INSERTION_CODE_NORTH:
|
||||
gCurrentIncident.usIncidentFlags |= INCIDENT_ATTACKDIR_NORTH;
|
||||
@@ -415,7 +734,7 @@ void InitTacticalPlacementGUI()
|
||||
}
|
||||
|
||||
// WANNE - MP: Center
|
||||
if (is_networked && MercPtrs[ i ]->ubStrategicInsertionCode == INSERTION_CODE_CENTER)
|
||||
if (is_networked && pSoldier->ubStrategicInsertionCode == INSERTION_CODE_CENTER)
|
||||
{
|
||||
gfCenter = TRUE;
|
||||
}
|
||||
@@ -425,7 +744,7 @@ void InitTacticalPlacementGUI()
|
||||
}
|
||||
|
||||
//add all the faces now
|
||||
for( i = 0; i < giPlacements; ++i )
|
||||
for( INT32 i = 0; i < giPlacements; ++i )
|
||||
{
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
@@ -472,7 +791,7 @@ void InitTacticalPlacementGUI()
|
||||
}
|
||||
|
||||
//yp = (i % 2) ? 412 : 361;
|
||||
MSYS_DefineRegion( &gMercPlacement[ i ].region, (UINT16)xp, (UINT16)yp, (UINT16)(xp + 54), (UINT16)(yp + 62), MSYS_PRIORITY_HIGH, 0, MercMoveCallback, MercClickCallback );
|
||||
MSYS_DefineRegion( &gMercPlacement[ i ].region, (UINT16)xp, (UINT16)yp, (UINT16)(xp + 54), (UINT16)(yp + 51), MSYS_PRIORITY_HIGH, 0, MercMoveCallback, MercClickCallback );
|
||||
}
|
||||
|
||||
if(!is_client)
|
||||
@@ -482,7 +801,7 @@ void InitTacticalPlacementGUI()
|
||||
{
|
||||
ButtonList[ iTPButtons[ GROUP_BUTTON ] ]->uiFlags |= BUTTON_CLICKED_ON;
|
||||
|
||||
for( i = 0; i < giPlacements; ++i )
|
||||
for( INT32 i = 0; i < giPlacements; ++i )
|
||||
{ //go from the currently selected soldier to the end
|
||||
if( !gMercPlacement[ i ].fPlaced )
|
||||
{ //Found an unplaced merc. Select him.
|
||||
@@ -496,6 +815,9 @@ void InitTacticalPlacementGUI()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InitializeMercScrollButtons();
|
||||
CreateTacticalPlacementGUIScrollBarRegion();
|
||||
}
|
||||
|
||||
// WANNE - MP: This method checks, if the desired entry direction (N, E, S, W) on the map is valid. If not it chooses the next valid diretion
|
||||
@@ -609,6 +931,15 @@ UINT8 GetValidInsertionDirectionForMP(UINT8 currentInsertionPoint)
|
||||
return validInsertionDirection;
|
||||
}
|
||||
|
||||
|
||||
static void DisableFaceMouseRegions()
|
||||
{
|
||||
for ( size_t i = 0; i < giPlacements; i++ )
|
||||
{
|
||||
MSYS_DisableRegion( &gMercPlacement[i].region );
|
||||
}
|
||||
}
|
||||
|
||||
void RenderTacticalPlacementGUI()
|
||||
{
|
||||
INT32 i, xp, yp, width, height;
|
||||
@@ -619,26 +950,31 @@ void RenderTacticalPlacementGUI()
|
||||
CHAR16 str[ 128 ];
|
||||
UINT8 *pDestBuf;
|
||||
UINT8 ubColor;
|
||||
const UINT8 maxFaces = MaxRenderedFaces();
|
||||
|
||||
if( gfTacticalPlacementFirstTime )
|
||||
{
|
||||
gfTacticalPlacementFirstTime = FALSE;
|
||||
DisableScrollMessages();
|
||||
}
|
||||
EnableDisableTacticalPlacementScrollButtonsAndRegions();
|
||||
|
||||
//Check to make sure that if we have a hilighted merc (not selected) and the mouse has moved out
|
||||
//of it's region, then we will clear the hilighted ID, and refresh the display.
|
||||
if( !gfTacticalPlacementGUIDirty && gbHilightedMercID != -1 )
|
||||
{
|
||||
xp = xResOffset + 91 + (gbHilightedMercID / 2) * 54;
|
||||
// Shift the index so we render the faces at the right locations
|
||||
UINT8 highlightedMercIndex = gbHilightedMercID - gfirstMercIndex;
|
||||
|
||||
if (gbHilightedMercID % 2)
|
||||
xp = xResOffset + 91 + (highlightedMercIndex / 2) * 54;
|
||||
|
||||
if ( highlightedMercIndex % 2)
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 68;
|
||||
yp = SCREEN_HEIGHT - 71;
|
||||
}
|
||||
else
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 119;
|
||||
yp = SCREEN_HEIGHT - 122;
|
||||
}
|
||||
|
||||
//yp = (gbHilightedMercID % 2) ? 412 : 361;
|
||||
@@ -656,33 +992,46 @@ void RenderTacticalPlacementGUI()
|
||||
if( gfTacticalPlacementGUIDirty )
|
||||
{
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, giOverheadPanelImage, 0, xResOffset, SCREEN_HEIGHT - 160, VO_BLT_SRCTRANSPARENCY, 0 );
|
||||
InvalidateRegion( 0 + xResOffset, SCREEN_HEIGHT - 160, 320 + xResOffset, SCREEN_HEIGHT );
|
||||
InvalidateRegion( 0 + xResOffset, SCREEN_HEIGHT - 160, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
gfTacticalPlacementGUIDirty = FALSE;
|
||||
MarkButtonsDirty();
|
||||
//DisableHilightsAndHelpText();
|
||||
//RenderButtons();
|
||||
//EnableHilightsAndHelpText();
|
||||
for( i = 0; i < giPlacements; ++i )
|
||||
|
||||
DisableFaceMouseRegions();
|
||||
UINT8 end = min(giPlacements, gfirstMercIndex + maxFaces);
|
||||
for( UINT8 j = gfirstMercIndex; j < end; ++j )
|
||||
{
|
||||
//Render the mercs
|
||||
pSoldier = gMercPlacement[ i ].pSoldier;
|
||||
|
||||
pSoldier = gMercPlacement[ j ].pSoldier;
|
||||
|
||||
// Shift the index so we render the faces at the right locations
|
||||
i = j - gfirstMercIndex;
|
||||
|
||||
xp = xResOffset + 95 + (i / 2) * 54;
|
||||
|
||||
if (i % 2)
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 58;
|
||||
yp = SCREEN_HEIGHT - 61;
|
||||
}
|
||||
else
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 109;
|
||||
yp = SCREEN_HEIGHT - 112;
|
||||
}
|
||||
|
||||
// Shift the mouse region as well
|
||||
gMercPlacement[j].region.RegionTopLeftX = xp;
|
||||
gMercPlacement[j].region.RegionTopLeftY = yp;
|
||||
gMercPlacement[j].region.RegionBottomRightX = xp + 54;
|
||||
gMercPlacement[j].region.RegionBottomRightY = yp + 51;
|
||||
MSYS_EnableRegion( &gMercPlacement[j].region );
|
||||
|
||||
//yp = (i % 2) ? 422 : 371;
|
||||
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, yp+2, xp+44, yp+30, 0 );
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, giMercPanelImage, 0, xp, yp, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, gMercPlacement[ i ].uiVObjectID, 0, xp+2, yp+2, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, gMercPlacement[ j ].uiVObjectID, 0, xp+2, yp+2, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
//HEALTH BAR
|
||||
|
||||
if( !pSoldier->stats.bLife )
|
||||
@@ -724,6 +1073,8 @@ void RenderTacticalPlacementGUI()
|
||||
|
||||
//Shade out the part of the tactical map that isn't considered placable.
|
||||
BlitBufferToBuffer(FRAME_BUFFER, guiSAVEBUFFER, 0, SCREEN_HEIGHT - 160, SCREEN_WIDTH, 160);
|
||||
|
||||
DisplayTacticalPlacementSlider();
|
||||
}
|
||||
|
||||
if( gfValidLocationsChanged )
|
||||
@@ -1053,31 +1404,35 @@ void RenderTacticalPlacementGUI()
|
||||
UnLockVideoSurface( FRAME_BUFFER );
|
||||
}
|
||||
|
||||
for( i = 0; i < giPlacements; ++i )
|
||||
UINT8 end = min( giPlacements, gfirstMercIndex + maxFaces );
|
||||
for ( UINT8 j = gfirstMercIndex; j < end; ++j )
|
||||
{
|
||||
//Render the merc's names
|
||||
pSoldier = gMercPlacement[ i ].pSoldier;
|
||||
//Render the mercs
|
||||
pSoldier = gMercPlacement[j].pSoldier;
|
||||
|
||||
// Shift the index so we render the faces at the right locations
|
||||
i = j - gfirstMercIndex;
|
||||
|
||||
xp = xResOffset + 95 + (i / 2) * 54;
|
||||
|
||||
if (i % 2)
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 58;
|
||||
yp = SCREEN_HEIGHT - 61;
|
||||
}
|
||||
else
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 109;
|
||||
yp = SCREEN_HEIGHT - 112;
|
||||
}
|
||||
|
||||
//yp = (i % 2) ? 422 : 371;
|
||||
//NAME
|
||||
if( gubDefaultButton == GROUP_BUTTON && gMercPlacement[ i ].pSoldier->ubGroupID == gubSelectedGroupID ||
|
||||
gubDefaultButton != GROUP_BUTTON && i == gbSelectedMercID )
|
||||
if( gubDefaultButton == GROUP_BUTTON && gMercPlacement[ j ].pSoldier->ubGroupID == gubSelectedGroupID ||
|
||||
gubDefaultButton != GROUP_BUTTON && j == gbSelectedMercID )
|
||||
{
|
||||
ubColor = FONT_YELLOW;
|
||||
}
|
||||
else if( gubDefaultButton == GROUP_BUTTON && gMercPlacement[ i ].pSoldier->ubGroupID == gubHilightedGroupID ||
|
||||
gubDefaultButton != GROUP_BUTTON && i == gbHilightedMercID )
|
||||
else if( gubDefaultButton == GROUP_BUTTON && gMercPlacement[ j ].pSoldier->ubGroupID == gubHilightedGroupID ||
|
||||
gubDefaultButton != GROUP_BUTTON && j == gbHilightedMercID )
|
||||
{
|
||||
ubColor = FONT_WHITE;
|
||||
}
|
||||
@@ -1090,7 +1445,7 @@ void RenderTacticalPlacementGUI()
|
||||
SetFontShadow( 141 );
|
||||
|
||||
//Render the question mark over the face if the merc hasn't yet been placed.
|
||||
if( gMercPlacement[ i ].fPlaced )
|
||||
if( gMercPlacement[ j ].fPlaced )
|
||||
{
|
||||
RegisterBackgroundRect( BGND_FLAG_SINGLE, NULL, (INT16)(xp + 16), (INT16)(yp + 14), (INT16)(xp + 24), (INT16)(yp + 22) );
|
||||
}
|
||||
@@ -1109,7 +1464,7 @@ void RenderTacticalPlacementGUI()
|
||||
}
|
||||
}
|
||||
|
||||
void EnsureDoneButtonStatus()
|
||||
static void EnsureDoneButtonStatus()
|
||||
{
|
||||
INT32 i;
|
||||
//static BOOLEAN fInside = FALSE;
|
||||
@@ -1165,6 +1520,29 @@ void lockui (bool unlock) //lock onluck ui for lan //hayden
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleMouseWheelScroll( void )
|
||||
{
|
||||
// Scroll through pages with regular mouse wheel
|
||||
SGPPoint MousePos;
|
||||
GetMousePos( &MousePos );
|
||||
const auto x = MousePos.iX;
|
||||
const auto y = MousePos.iY;
|
||||
if ( (gFacePanelXStart < x && x < gFacePanelXEnd) && (gFacePanelYStart < y && y < gFacePanelYEnd) )
|
||||
{
|
||||
const auto Wheelstate = _WheelValue * (gGameSettings.fOptions[TOPTION_INVERT_WHEEL] ? -1 : 1);
|
||||
if ( Wheelstate < 0 )
|
||||
{
|
||||
IncreaseMercIndex();
|
||||
}
|
||||
else if ( Wheelstate > 0 )
|
||||
{
|
||||
DecreaseMercIndex();
|
||||
}
|
||||
_WheelValue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void TacticalPlacementHandle()
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
@@ -1330,6 +1708,7 @@ void TacticalPlacementHandle()
|
||||
}
|
||||
|
||||
ScrollOverheadMap();//dnl ch45 021009
|
||||
HandleMouseWheelScroll();
|
||||
}
|
||||
|
||||
void KillTacticalPlacementGUI()
|
||||
@@ -1364,6 +1743,16 @@ void KillTacticalPlacementGUI()
|
||||
MSYS_RemoveRegion( &gMercPlacement[ i ].region );
|
||||
}
|
||||
|
||||
for ( size_t i = 0; i < 2; i++ )
|
||||
{
|
||||
UnloadButtonImage( gTacticalPlacementGUIPrevNextButtonImages[i] );
|
||||
RemoveButton( gTacticalPlacementGUIPrevNextButtons[i] );
|
||||
}
|
||||
MSYS_RemoveRegion( &gTacticalPlacementGUISliderBarRegion );
|
||||
DeleteVideoObjectFromIndex( gTacticalPlacementGUISliderBar );
|
||||
DeleteVideoObjectFromIndex( gScrollAreaGfx );
|
||||
|
||||
|
||||
if( gsCurInterfacePanel < 0 || gsCurInterfacePanel >= NUM_UI_PANELS )
|
||||
gsCurInterfacePanel = TEAM_PANEL;
|
||||
|
||||
@@ -1394,7 +1783,7 @@ void KillTacticalPlacementGUI()
|
||||
MemFree( gMercPlacement);
|
||||
}
|
||||
|
||||
void ChooseRandomEdgepoints()
|
||||
static void ChooseRandomEdgepoints()
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 lastValidICode = INSERTION_CODE_GRIDNO;
|
||||
|
||||
@@ -26,4 +26,4 @@ extern SOLDIERTYPE *gpTacticalPlacementHilightedSoldier;
|
||||
//Saved value. Contains the last choice for future battles.
|
||||
extern UINT8 gubDefaultButton;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#include "worlddef.h"
|
||||
#include "tile animation.h"
|
||||
#include "debug.h"
|
||||
#include "Tile Animation.h"
|
||||
#include "DEBUG.H"
|
||||
#include "worldman.h"
|
||||
#include "lighting.h"
|
||||
#include "renderworld.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "ai.h"
|
||||
#include "Sound Control.h"
|
||||
#include "tile cache.h"
|
||||
#include "explosion control.h"
|
||||
#include "Tile Cache.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "Keys.h"
|
||||
#include "bullets.h"
|
||||
#include "Bullets.h"
|
||||
#include "LightEffects.h"
|
||||
#include "SmokeEffects.h"
|
||||
|
||||
@@ -572,11 +572,11 @@ void UpdateAniTiles( )
|
||||
{
|
||||
// Do sound....
|
||||
// PlayJA2Sample( AIR_ESCAPING_1, RATE_11025, SoundVolume( HIGHVOLUME, pNode->sGridNo ), 1, SoundDir( pNode->sGridNo ) );
|
||||
NewSmokeEffect( pNode->sGridNo, (UINT16)pNode->uiUserData, gExplosionData[ pNode->uiUserData3 ].Params.bLevel, (UINT8)pNode->ubUserData2 );
|
||||
NewSmokeEffect( pNode->sGridNo, (UINT16)pNode->uiUserData, gExplosionData[ pNode->uiUserData3 ].Params.bLevel, pNode->ubUserData2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
SpreadEffect( pNode->sGridNo, (UINT8)Explosive[ Item[ (UINT16)pNode->uiUserData ].ubClassIndex ].ubRadius, (UINT16)pNode->uiUserData, (UINT8)pNode->ubUserData2, FALSE, gExplosionData[ pNode->uiUserData3 ].Params.bLevel, -1 );
|
||||
SpreadEffect( pNode->sGridNo, (UINT8)Explosive[ Item[ (UINT16)pNode->uiUserData ].ubClassIndex ].ubRadius, (UINT16)pNode->uiUserData, pNode->ubUserData2, FALSE, gExplosionData[ pNode->uiUserData3 ].Params.bLevel, -1 );
|
||||
}
|
||||
// Forfait any other animations this frame....
|
||||
return;
|
||||
|
||||
+50
-50
@@ -38,70 +38,70 @@
|
||||
|
||||
typedef struct TAG_anitile
|
||||
{
|
||||
struct TAG_anitile *pNext;
|
||||
UINT32 uiFlags; // flags struct
|
||||
UINT32 uiTimeLastUpdate; // Stuff for animated tiles
|
||||
struct TAG_anitile *pNext;
|
||||
UINT32 uiFlags; // flags struct
|
||||
UINT32 uiTimeLastUpdate; // Stuff for animated tiles
|
||||
|
||||
LEVELNODE *pLevelNode;
|
||||
UINT8 ubLevelID;
|
||||
INT16 sCurrentFrame;
|
||||
INT16 sStartFrame;
|
||||
INT16 sDelay;
|
||||
UINT16 usTileType;
|
||||
UINT16 usNumFrames;
|
||||
LEVELNODE *pLevelNode;
|
||||
UINT8 ubLevelID;
|
||||
INT16 sCurrentFrame;
|
||||
INT16 sStartFrame;
|
||||
INT16 sDelay;
|
||||
UINT16 usTileType;
|
||||
UINT16 usNumFrames;
|
||||
|
||||
UINT16 usMissAnimationPlayed;
|
||||
UINT16 ubAttackerMissed;
|
||||
INT16 sRelativeX;
|
||||
INT16 sRelativeY;
|
||||
INT16 sRelativeZ;
|
||||
INT32 sGridNo;
|
||||
UINT16 usTileIndex;
|
||||
UINT16 usMissAnimationPlayed;
|
||||
SoldierID ubAttackerMissed;
|
||||
INT16 sRelativeX;
|
||||
INT16 sRelativeY;
|
||||
INT16 sRelativeZ;
|
||||
INT32 sGridNo;
|
||||
UINT16 usTileIndex;
|
||||
|
||||
UINT16 usCachedTileSubIndex; // sub Index
|
||||
INT16 sCachedTileID; // Index into cached tile ID
|
||||
UINT16 usCachedTileSubIndex; // sub Index
|
||||
INT16 sCachedTileID; // Index into cached tile ID
|
||||
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubKeyFrame1;
|
||||
UINT32 uiKeyFrame1Code;
|
||||
UINT8 ubKeyFrame2;
|
||||
UINT32 uiKeyFrame2Code;
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubKeyFrame1;
|
||||
UINT32 uiKeyFrame1Code;
|
||||
UINT8 ubKeyFrame2;
|
||||
UINT32 uiKeyFrame2Code;
|
||||
|
||||
UINT32 uiUserData;
|
||||
UINT8 ubUserData2;
|
||||
UINT32 uiUserData3;
|
||||
UINT32 uiUserData;
|
||||
UINT16 ubUserData2; // NOTE: Expanded the type due to SoldierID
|
||||
UINT32 uiUserData3;
|
||||
|
||||
INT8 bFrameCountAfterStart;
|
||||
INT32 lightSprite;
|
||||
INT8 bFrameCountAfterStart;
|
||||
INT32 lightSprite;
|
||||
} ANITILE;
|
||||
|
||||
|
||||
typedef struct TAG_anitile_params
|
||||
{
|
||||
UINT32 uiFlags; // flags struct
|
||||
UINT8 ubLevelID; // Level ID for rendering layer
|
||||
INT16 sStartFrame; // Start frame
|
||||
INT16 sDelay; // Delay time
|
||||
UINT16 usTileType; // Tile databse type ( optional )
|
||||
UINT16 usTileIndex; // Tile database index ( optional )
|
||||
INT16 sX; // World X ( optional )
|
||||
INT16 sY; // World Y ( optional )
|
||||
INT16 sZ; // World Z ( optional )
|
||||
INT32 sGridNo; // World GridNo
|
||||
UINT32 uiFlags; // flags struct
|
||||
UINT8 ubLevelID; // Level ID for rendering layer
|
||||
INT16 sStartFrame; // Start frame
|
||||
INT16 sDelay; // Delay time
|
||||
UINT16 usTileType; // Tile databse type ( optional )
|
||||
UINT16 usTileIndex; // Tile database index ( optional )
|
||||
INT16 sX; // World X ( optional )
|
||||
INT16 sY; // World Y ( optional )
|
||||
INT16 sZ; // World Z ( optional )
|
||||
INT32 sGridNo; // World GridNo
|
||||
|
||||
LEVELNODE *pGivenLevelNode; // Levelnode for existing tile ( optional )
|
||||
CHAR8 zCachedFile[ 100 ]; // Filename for cached tile name ( optional )
|
||||
LEVELNODE *pGivenLevelNode; // Levelnode for existing tile ( optional )
|
||||
CHAR8 zCachedFile[ 100 ]; // Filename for cached tile name ( optional )
|
||||
|
||||
UINT8 ubOwner; // UBID for the owner
|
||||
UINT8 ubKeyFrame1; // Key frame 1
|
||||
UINT32 uiKeyFrame1Code; // Key frame code
|
||||
UINT8 ubKeyFrame2; // Key frame 2
|
||||
UINT32 uiKeyFrame2Code; // Key frame code
|
||||
UINT8 ubOwner; // UBID for the owner
|
||||
UINT8 ubKeyFrame1; // Key frame 1
|
||||
UINT32 uiKeyFrame1Code; // Key frame code
|
||||
UINT8 ubKeyFrame2; // Key frame 2
|
||||
UINT32 uiKeyFrame2Code; // Key frame code
|
||||
|
||||
UINT32 uiUserData;
|
||||
UINT8 ubUserData2;
|
||||
UINT32 uiUserData3;
|
||||
INT32 lightSprite;
|
||||
UINT32 uiUserData;
|
||||
UINT16 ubUserData2; // NOTE: Expanded the type due to SoldierID
|
||||
UINT32 uiUserData3;
|
||||
INT32 lightSprite;
|
||||
} ANITILE_PARAMS;
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Debug Control.h"
|
||||
#include "tile surface.h"
|
||||
#include "tile cache.h"
|
||||
#include "Tile Surface.h"
|
||||
#include "Tile Cache.h"
|
||||
#ifdef JA2TESTVERSION
|
||||
#include "sys globals.h"
|
||||
#include "Sys Globals.h"
|
||||
#endif
|
||||
|
||||
UINT32 guiNumTileCacheStructs = 0;
|
||||
|
||||
@@ -45,4 +45,4 @@ void CheckForAndDeleteTileCacheStructInfo( LEVELNODE *pNode, UINT16 usIndex );
|
||||
|
||||
void GetRootName( STR8 pDestStr, const STR8 pSrcStr );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "sys globals.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Sys Globals.h"
|
||||
|
||||
#include "XML.h"
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ void DeleteTileSurface( PTILE_IMAGERY pTileSurf );
|
||||
void SetRaisedObjectFlag( char *cFilename, TILE_IMAGERY *pTileSurf );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -170,4 +170,4 @@ enum
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "worlddat.h"
|
||||
#include "sys globals.h"
|
||||
#include "tile surface.h"
|
||||
#include "Debug.h"
|
||||
#include "WorldDat.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "Tile Surface.h"
|
||||
#include "DEBUG.H"
|
||||
|
||||
#include <vfs/Core/vfs.h>
|
||||
#include <vfs/Core/vfs_file_raii.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define WORLD_DAT_H
|
||||
|
||||
#include "types.h"
|
||||
#include "tiledat.h"
|
||||
#include "TileDat.h"
|
||||
#include "World Tileset Enums.h"
|
||||
|
||||
typedef void (*TILESET_CALLBACK)( void );
|
||||
@@ -34,4 +34,4 @@ void SetTilesetTwoTerrainValues( );
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "explosion control.h"
|
||||
#include "Debug.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "DEBUG.H"
|
||||
#include "FileMan.h"
|
||||
#include "Debug Control.h"
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#include "environment.h"
|
||||
#include "renderworld.h"
|
||||
#include "Sound Control.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Ambient Control.h"
|
||||
#include "Game Events.h"
|
||||
#include "message.h"
|
||||
#include "opplist.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Points.h" // added by Flugente
|
||||
#include "Campaign.h" // added by Flugente
|
||||
#include "Isometric Utils.h" // added by Flugente
|
||||
|
||||
+23
-23
@@ -19,14 +19,14 @@
|
||||
#include "worlddef.h"
|
||||
#include "renderworld.h"
|
||||
#include "sysutil.h"
|
||||
#include "debug.h"
|
||||
#include "wcheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "WCheck.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "lighting.h"
|
||||
#include "structure wrap.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Shade Table Util.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "PATHAI.H"
|
||||
|
||||
#define LVL1_L1_PER (50)
|
||||
@@ -460,36 +460,36 @@ UINT16 usNumNodes;
|
||||
***************************************************************************************/
|
||||
BOOLEAN LightTileBlocked(INT16 iSrcX, INT16 iSrcY, INT16 iX, INT16 iY)
|
||||
{
|
||||
UINT16 usTileNo, usSrcTileNo;
|
||||
UINT32 uiTileNo, uiSrcTileNo;
|
||||
|
||||
Assert(gpWorldLevelData!=NULL);
|
||||
|
||||
usTileNo=MAPROWCOLTOPOS(iY, iX);
|
||||
usSrcTileNo=MAPROWCOLTOPOS(iSrcY, iSrcX);
|
||||
uiTileNo=MAPROWCOLTOPOS(iY, iX);
|
||||
uiSrcTileNo=MAPROWCOLTOPOS(iSrcY, iSrcX);
|
||||
|
||||
if (TileIsOutOfBounds(usTileNo))
|
||||
if (TileIsOutOfBounds(uiTileNo))
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if (TileIsOutOfBounds(usSrcTileNo))
|
||||
if (TileIsOutOfBounds(uiSrcTileNo))
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if(gpWorldLevelData[ usTileNo ].sHeight > gpWorldLevelData[ usSrcTileNo ].sHeight)
|
||||
if(gpWorldLevelData[ uiTileNo ].sHeight > gpWorldLevelData[ uiSrcTileNo ].sHeight)
|
||||
return(TRUE);
|
||||
{
|
||||
UINT16 usTileNo;
|
||||
UINT32 uiTileNo;
|
||||
LEVELNODE *pStruct;
|
||||
|
||||
usTileNo=MAPROWCOLTOPOS(iY, iX);
|
||||
uiTileNo=MAPROWCOLTOPOS(iY, iX);
|
||||
|
||||
pStruct = gpWorldLevelData[ usTileNo ].pStructHead;
|
||||
pStruct = gpWorldLevelData[ uiTileNo ].pStructHead;
|
||||
if ( pStruct != NULL )
|
||||
{
|
||||
// IF WE ARE A WINDOW, DO NOT BLOCK!
|
||||
if ( FindStructure( usTileNo, STRUCTURE_WALLNWINDOW ) != NULL )
|
||||
if ( FindStructure( uiTileNo, STRUCTURE_WALLNWINDOW ) != NULL )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -509,8 +509,8 @@ BOOLEAN LightTileHasWall( INT16 iSrcX, INT16 iSrcY, INT16 iX, INT16 iY)
|
||||
{
|
||||
//LEVELNODE *pStruct;
|
||||
//UINT32 uiType;
|
||||
UINT16 usTileNo;
|
||||
UINT16 usSrcTileNo;
|
||||
UINT32 uiTileNo;
|
||||
UINT32 uiSrcTileNo;
|
||||
INT8 bDirection;
|
||||
UINT8 ubTravelCost;
|
||||
//INT8 bWallCount = 0;
|
||||
@@ -518,20 +518,20 @@ UINT8 ubTravelCost;
|
||||
|
||||
Assert(gpWorldLevelData!=NULL);
|
||||
|
||||
usTileNo=MAPROWCOLTOPOS(iY, iX);
|
||||
usSrcTileNo=MAPROWCOLTOPOS(iSrcY, iSrcX);
|
||||
uiTileNo=MAPROWCOLTOPOS(iY, iX);
|
||||
uiSrcTileNo=MAPROWCOLTOPOS(iSrcY, iSrcX);
|
||||
|
||||
if ( usTileNo == usSrcTileNo )
|
||||
if ( uiTileNo == uiSrcTileNo )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if ( TileIsOutOfBounds(usTileNo))
|
||||
if ( TileIsOutOfBounds(uiTileNo))
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if ( TileIsOutOfBounds(usSrcTileNo))
|
||||
if ( TileIsOutOfBounds(uiSrcTileNo))
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -541,7 +541,7 @@ UINT8 ubTravelCost;
|
||||
bDirection = atan8( iSrcX, iSrcY, iX, iY );
|
||||
|
||||
|
||||
ubTravelCost = gubWorldMovementCosts[ usTileNo ][ bDirection ][ 0 ];
|
||||
ubTravelCost = gubWorldMovementCosts[ uiTileNo ][ bDirection ][ 0 ];
|
||||
|
||||
if ( ubTravelCost == TRAVELCOST_WALL )
|
||||
{
|
||||
@@ -550,7 +550,7 @@ UINT8 ubTravelCost;
|
||||
|
||||
if ( IS_TRAVELCOST_DOOR( ubTravelCost ) )
|
||||
{
|
||||
ubTravelCost = DoorTravelCost( NULL, usTileNo, ubTravelCost, TRUE, NULL );
|
||||
ubTravelCost = DoorTravelCost( NULL, uiTileNo, ubTravelCost, TRUE, NULL );
|
||||
|
||||
if ( ubTravelCost == TRAVELCOST_OBSTACLE || ubTravelCost == TRAVELCOST_DOOR )
|
||||
{
|
||||
|
||||
+18
-19
@@ -1,21 +1,22 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "sysutil.h"
|
||||
#include "utilities.h"
|
||||
#include "WorldDat.h"
|
||||
#include "sysutil.h"
|
||||
#include "Utilities.h"
|
||||
#include "renderworld.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "overhead map.h"
|
||||
#include "interface control.h"
|
||||
#include "overhead.h"
|
||||
#include "radar screen.h"
|
||||
#include "cursors.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Overhead.h"
|
||||
#include "Radar Screen.h"
|
||||
#include "Cursors.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "render dirty.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Game Clock.h"
|
||||
#include "interface panels.h"
|
||||
#include "Interface Panels.h"
|
||||
#include "english.h"
|
||||
#include "line.h"
|
||||
#include "map information.h"
|
||||
#include "Map Information.h"
|
||||
#include "Tactical Placement GUI.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "gameloop.h"
|
||||
@@ -567,7 +568,7 @@ void HandleOverheadMap( )
|
||||
|
||||
if( !gfEditMode && !gfTacticalPlacementGUIActive && gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
pSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
pSoldier = gusSelectedSoldier;
|
||||
|
||||
DisplayMercNameInOverhead( pSoldier );
|
||||
}
|
||||
@@ -747,7 +748,7 @@ void GoIntoOverheadMap( )
|
||||
// Make sure we are in team panel mode...
|
||||
gfSwitchPanel = TRUE;
|
||||
gbNewPanel = TEAM_PANEL;
|
||||
gubNewPanelParam = (UINT8)gusSelectedSoldier;
|
||||
gubNewPanelParam = gusSelectedSoldier;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
// Disable tactical buttons......
|
||||
@@ -768,7 +769,7 @@ void HandleOverheadUI(void)
|
||||
{
|
||||
INT32 sMousePos = 0;
|
||||
InputAtom InputEvent;
|
||||
UINT8 ubID;
|
||||
SoldierID ubID;
|
||||
|
||||
// CHECK FOR MOUSE OVER REGIONS...
|
||||
if(GetOverheadMouseGridNo(&sMousePos))
|
||||
@@ -1367,8 +1368,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
GetCurrentVideoSettings(&usWidth, &usHeight, &ubBitDepth);
|
||||
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
|
||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||
if(gbPixelDepth == 16)// BLIT HERE
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0, 0, 0, 0, usWidth, usHeight);
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0, 0, 0, 0, usWidth, usHeight);
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
}
|
||||
@@ -1378,11 +1378,10 @@ void RenderOverheadOverlays()
|
||||
{
|
||||
UINT32 uiDestPitchBYTES;
|
||||
WORLDITEM *pWorldItem;
|
||||
UINT32 i;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
HVOBJECT hVObject;
|
||||
INT16 sX, sY;
|
||||
UINT16 end;
|
||||
SoldierID id, end;
|
||||
UINT16 usLineColor=0;
|
||||
UINT8 *pDestBuf;
|
||||
UINT8 ubPassengers = 0;
|
||||
@@ -1416,10 +1415,10 @@ void RenderOverheadOverlays()
|
||||
|| RebelCommand::ShowApproximateEnemyLocations())
|
||||
marklastenemy = TRUE;
|
||||
|
||||
for( i = 0; i < end; ++i )
|
||||
for( id = 0; id < end; ++id )
|
||||
{
|
||||
//First, check to see if the soldier exists and is in the sector.
|
||||
pSoldier = MercPtrs[ i ];
|
||||
pSoldier = id;
|
||||
if( !pSoldier->bActive || !pSoldier->bInSector )
|
||||
continue;
|
||||
//Soldier is here. Calculate his screen position based on his current gridno.
|
||||
@@ -1695,7 +1694,7 @@ void RenderOverheadOverlays()
|
||||
FLOAT radius_inner = radius - thickness / 2;
|
||||
FLOAT radius_outer = radius + thickness / 2;
|
||||
|
||||
for( i = 0 ; i < guiNumWorldItems; ++i )
|
||||
for( UINT32 i = 0 ; i < guiNumWorldItems; ++i )
|
||||
{
|
||||
pWorldItem = &gWorldItems[ i ];
|
||||
if( !pWorldItem || !pWorldItem->fExists )
|
||||
|
||||
+35
-35
@@ -1,20 +1,20 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "physics.h"
|
||||
#include "wcheck.h"
|
||||
#include "isometric utils.h"
|
||||
#include "WCheck.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "worldman.h"
|
||||
#include "Sound Control.h"
|
||||
#include "interface.h"
|
||||
#include "interface items.h"
|
||||
#include "explosion control.h"
|
||||
#include "Interface.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "Debug Control.h"
|
||||
#include "message.h"
|
||||
#include "structure wrap.h"
|
||||
#include "animation control.h"
|
||||
#include "text.h"
|
||||
#include "Random.h"
|
||||
#include "lighteffects.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Text.h"
|
||||
#include "random.h"
|
||||
#include "LightEffects.h"
|
||||
#include "opplist.h"
|
||||
#include "Buildings.h"
|
||||
#include "Dialogue Control.h" // added by Flugente
|
||||
@@ -160,7 +160,7 @@ REAL_OBJECT& REAL_OBJECT::operator =(OLD_REAL_OBJECT_101 &src)
|
||||
this->dLifeSpan = src.dLifeSpan;
|
||||
this->fFirstTimeMoved = src.fFirstTimeMoved;
|
||||
this->sFirstGridNo = src.sFirstGridNo;
|
||||
this->ubOwner = src.ubOwner;
|
||||
this->ubOwner = static_cast<UINT16>(src.ubOwner);
|
||||
this->ubActionCode = src.ubActionCode;
|
||||
this->uiActionData = src.uiActionData;
|
||||
this->fDropItem = src.fDropItem;
|
||||
@@ -175,7 +175,7 @@ REAL_OBJECT& REAL_OBJECT::operator =(OLD_REAL_OBJECT_101 &src)
|
||||
this->fPotentialForDebug = src.fPotentialForDebug;
|
||||
this->sLevelNodeGridNo = src.sLevelNodeGridNo;
|
||||
this->iSoundID = src.iSoundID;
|
||||
this->ubLastTargetTakenDamage = src.ubLastTargetTakenDamage;
|
||||
this->ubLastTargetTakenDamage = static_cast<UINT16>(src.ubLastTargetTakenDamage);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ void RecountObjectSlots(void)
|
||||
}
|
||||
|
||||
|
||||
INT32 CreatePhysicalObject( OBJECTTYPE *pGameObj, real dLifeLength, real xPos, real yPos, real zPos, real xForce, real yForce, real zForce, UINT8 ubOwner, UINT8 ubActionCode, UINT32 uiActionData, BOOLEAN fTestObject )
|
||||
INT32 CreatePhysicalObject( OBJECTTYPE *pGameObj, real dLifeLength, real xPos, real yPos, real zPos, real xForce, real yForce, real zForce, SoldierID ubOwner, UINT8 ubActionCode, UINT32 uiActionData, BOOLEAN fTestObject )
|
||||
{
|
||||
INT32 iObjectIndex;
|
||||
FLOAT mass;
|
||||
@@ -258,7 +258,7 @@ INT32 CreatePhysicalObject( OBJECTTYPE *pGameObj, real dLifeLength, real xPos, r
|
||||
pObject->Position.z = zPos;
|
||||
pObject->fVisible = TRUE;
|
||||
pObject->fTestObject = fTestObject;
|
||||
pObject->ubOwner = ubOwner;
|
||||
pObject->ubOwner = ubOwner;
|
||||
pObject->ubActionCode = ubActionCode;
|
||||
pObject->uiActionData = uiActionData;
|
||||
pObject->fDropItem = TRUE;
|
||||
@@ -531,8 +531,7 @@ BOOLEAN PhysicsUpdateLife( REAL_OBJECT *pObject, real DeltaTime )
|
||||
else
|
||||
{
|
||||
// If we are in water, and we are a sinkable item...
|
||||
// if ( !pObject->fInWater || !( Item[ pObject->Obj.usItem ].fFlags & ITEM_SINKS ) )
|
||||
if ( !pObject->fInWater || !( Item[ pObject->Obj.usItem ].sinks ) )
|
||||
if ( !pObject->fInWater || !ItemSinks(pObject->Obj.usItem) )
|
||||
{
|
||||
if ( pObject->fDropItem )
|
||||
{
|
||||
@@ -547,7 +546,7 @@ BOOLEAN PhysicsUpdateLife( REAL_OBJECT *pObject, real DeltaTime )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
pSoldier = MercPtrs[ pObject->ubLastTargetTakenDamage ];
|
||||
pSoldier = pObject->ubLastTargetTakenDamage;
|
||||
|
||||
bLevel = pSoldier->pathing.bLevel;
|
||||
}
|
||||
@@ -562,7 +561,7 @@ BOOLEAN PhysicsUpdateLife( REAL_OBJECT *pObject, real DeltaTime )
|
||||
}
|
||||
|
||||
// Make impact noise....
|
||||
if ( Item[pObject->Obj.usItem].rock )
|
||||
if (ItemIsRock(pObject->Obj.usItem))
|
||||
{
|
||||
MakeNoise( pObject->ubOwner, pObject->sGridNo, 0, gpWorldLevelData[ pObject->sGridNo ].ubTerrainID, (UINT8) (9 + PreRandom( 9 ) ), NOISE_ROCK_IMPACT );
|
||||
}
|
||||
@@ -1013,10 +1012,11 @@ BOOLEAN PhysicsCheckForCollisions( REAL_OBJECT *pObject, INT32 *piCollisionID )
|
||||
if ( iCollisionCode == COLLISION_WINDOW_NORTHWEST || iCollisionCode == COLLISION_WINDOW_NORTHEAST || iCollisionCode == COLLISION_WINDOW_SOUTHWEST || iCollisionCode == COLLISION_WINDOW_SOUTHEAST )
|
||||
{
|
||||
// sevenfm: added requirements for object to break window
|
||||
if (Item[pObject->Obj.usItem].ubWeight >= 4 &&
|
||||
Item[pObject->Obj.usItem].sinks &&
|
||||
!Item[pObject->Obj.usItem].unaerodynamic &&
|
||||
(Item[pObject->Obj.usItem].metal || Item[pObject->Obj.usItem].rock))
|
||||
UINT16 usItem = pObject->Obj.usItem;
|
||||
if (Item[usItem].ubWeight >= 4 &&
|
||||
ItemSinks(usItem) &&
|
||||
!ItemIsUnaerodynamic(usItem) &&
|
||||
(ItemIsMetal(usItem) || ItemIsRock(usItem)))
|
||||
{
|
||||
if (!pObject->fTestObject)
|
||||
{
|
||||
@@ -1120,10 +1120,10 @@ BOOLEAN PhysicsCheckForCollisions( REAL_OBJECT *pObject, INT32 *piCollisionID )
|
||||
{
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugAttackBusy( String( "Incrementing attack busy because of delayed water explosion. Now %d\n", gTacticalStatus.ubAttackBusyCount ) );
|
||||
AniParams.ubKeyFrame1 = 11;
|
||||
AniParams.ubKeyFrame1 = 11;
|
||||
AniParams.uiKeyFrame1Code = ANI_KEYFRAME_CHAIN_WATER_EXPLOSION;
|
||||
AniParams.uiUserData = pObject->Obj.usItem;
|
||||
AniParams.ubUserData2 = pObject->ubOwner;
|
||||
AniParams.ubUserData2 = pObject->ubOwner;
|
||||
}
|
||||
|
||||
pNode = CreateAnimationTile( &AniParams );
|
||||
@@ -1927,7 +1927,7 @@ void CalculateLaunchItemBasicParams( SOLDIERTYPE *pSoldier, OBJECTTYPE *pItem, I
|
||||
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1741"));
|
||||
if ( fArmed && ( Item[usLauncher].mortar || Item[pItem->usItem].mortar ) )
|
||||
if ( fArmed && (ItemIsMortar(usLauncher) || ItemIsMortar(pItem->usItem)) )
|
||||
{
|
||||
// Start at 0....
|
||||
sStartZ = ( pSoldier->pathing.bLevel * 256 );
|
||||
@@ -1937,7 +1937,7 @@ void CalculateLaunchItemBasicParams( SOLDIERTYPE *pSoldier, OBJECTTYPE *pItem, I
|
||||
}
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1750"));
|
||||
|
||||
if ( fArmed && ( Item[usLauncher].grenadelauncher || Item[pItem->usItem].grenadelauncher ) )
|
||||
if ( fArmed && (ItemIsGrenadeLauncher(usLauncher) || ItemIsGrenadeLauncher(pItem->usItem)) )
|
||||
{
|
||||
// OK, look at target level and decide angle to use...
|
||||
if ( ubLevel == 1 )
|
||||
@@ -2188,7 +2188,7 @@ BOOLEAN CalculateLaunchItemChanceToGetThrough( SOLDIERTYPE *pSoldier, OBJECTTYPE
|
||||
|
||||
if ( pSoldier->sGridNo == sGridNo )
|
||||
{
|
||||
printf("Warning! Soldier #%d attempted to launch item at himself\n", pSoldier->ubID);
|
||||
printf("Warning! Soldier #%d attempted to launch item at himself\n", pSoldier->ubID.i);
|
||||
return FALSE;
|
||||
}
|
||||
// Ge7t basic launch params...
|
||||
@@ -2327,7 +2327,7 @@ void CalculateLaunchItemParamsForThrow( SOLDIERTYPE *pSoldier, INT32 sGridNo, UI
|
||||
}
|
||||
|
||||
// set the max miss radius
|
||||
if ( Item[usItemNum].mortar )
|
||||
if (ItemIsMortar(usItemNum))
|
||||
{
|
||||
bMaxRadius = gItemSettings.usMissMaxRadiusMortar;
|
||||
}
|
||||
@@ -2413,7 +2413,7 @@ void CalculateLaunchItemParamsForThrow( SOLDIERTYPE *pSoldier, INT32 sGridNo, UI
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 2103"));
|
||||
|
||||
if ( fArmed && Item[usLauncher].mortar )
|
||||
if ( fArmed && ItemIsMortar(usLauncher))
|
||||
{
|
||||
// Start at 0....
|
||||
sStartZ = ( pSoldier->pathing.bLevel * 256 ) + 50;
|
||||
@@ -2471,7 +2471,7 @@ void CheckForObjectHittingMerc( REAL_OBJECT *pObject, UINT16 usStructureID )
|
||||
// Is it a guy?
|
||||
if ( usStructureID < INVALID_STRUCTURE_ID )
|
||||
{
|
||||
if ( pObject->ubLastTargetTakenDamage != (UINT8)usStructureID )
|
||||
if ( pObject->ubLastTargetTakenDamage != usStructureID )
|
||||
{
|
||||
// Flugente: if this fails, something is very wrong indeed
|
||||
Assert(usStructureID<TOTAL_SOLDIERS);
|
||||
@@ -2488,7 +2488,7 @@ void CheckForObjectHittingMerc( REAL_OBJECT *pObject, UINT16 usStructureID )
|
||||
|
||||
pSoldier->EVENT_SoldierGotHit( NOTHING, sDamage, sBreath, pSoldier->ubDirection, 0, pObject->ubOwner, FIRE_WEAPON_TOSSED_OBJECT_SPECIAL, 0, 0, NOWHERE );
|
||||
|
||||
pObject->ubLastTargetTakenDamage = (UINT8)( usStructureID );
|
||||
pObject->ubLastTargetTakenDamage = usStructureID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2665,7 +2665,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
||||
{
|
||||
fCheckForDuds = TRUE;
|
||||
|
||||
if (CanDelayGrenadeExplosion(pObj->usItem) && (Item[pObj->usItem].ubCursor == TOSSCURS || Item[pObj->usItem].glgrenade))
|
||||
if (CanDelayGrenadeExplosion(pObj->usItem) && (Item[pObj->usItem].ubCursor == TOSSCURS || ItemIsGLgrenade(pObj->usItem)))
|
||||
{
|
||||
fCanDelayExplosion = TRUE;
|
||||
}
|
||||
@@ -2734,7 +2734,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
||||
(*pObj)[0]->data.misc.bDelay = 1;
|
||||
|
||||
// for non-player grenades, add turn so player could disarm grenade or run away
|
||||
if ( pObject->ubOwner != NOBODY && MercPtrs[pObject->ubOwner]->bTeam != gbPlayerNum )
|
||||
if ( pObject->ubOwner != NOBODY && pObject->ubOwner->bTeam != gbPlayerNum )
|
||||
{
|
||||
(*pObj)[0]->data.misc.bDelay++;
|
||||
}
|
||||
@@ -2762,7 +2762,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
||||
|
||||
if ( pObject->ubOwner != NOBODY && !fGoodStatus )
|
||||
{
|
||||
MercPtrs[ pObject->ubOwner ]->DoMercBattleSound( (INT8)( BATTLE_SOUND_CURSE1 ) );
|
||||
pObject->ubOwner->DoMercBattleSound( (INT8)( BATTLE_SOUND_CURSE1 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2780,7 +2780,7 @@ void HandleArmedObjectImpact( REAL_OBJECT *pObject )
|
||||
|
||||
if ( fDoImpact )
|
||||
{
|
||||
if ( Item[pObject->Obj.usItem].flare )
|
||||
if (ItemIsFlare(pObject->Obj.usItem))
|
||||
{
|
||||
//if the light object will be created OFF the ground
|
||||
if( pObject->Position.z > 0 && FindBuilding(pObject->sGridNo) )
|
||||
|
||||
@@ -118,8 +118,8 @@ public:
|
||||
FLOAT dLifeSpan;
|
||||
BOOLEAN fFirstTimeMoved;
|
||||
INT32 sFirstGridNo;
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubActionCode;
|
||||
SoldierID ubOwner;
|
||||
UINT8 ubActionCode;
|
||||
UINT32 uiActionData;
|
||||
BOOLEAN fDropItem;
|
||||
UINT32 uiNumTilesMoved;
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
BOOLEAN fPotentialForDebug;
|
||||
INT32 sLevelNodeGridNo;
|
||||
INT32 iSoundID;
|
||||
UINT8 ubLastTargetTakenDamage;
|
||||
SoldierID ubLastTargetTakenDamage;
|
||||
// OJW - 20091002 - mp explosives
|
||||
UINT8 mpTeam; // the intiating clients team
|
||||
INT32 mpRealObjectID; // ID from the initiating client
|
||||
@@ -153,7 +153,7 @@ extern REAL_OBJECT ObjectSlots[ NUM_OBJECT_SLOTS ];
|
||||
|
||||
|
||||
// OBJECT LIST STUFF
|
||||
INT32 CreatePhysicalObject( OBJECTTYPE *pGameObj, real dLifeLength, real xPos, real yPos, real zPos, real xForce, real yForce, real zForce, UINT8 ubOwner, UINT8 ubActionCode, UINT32 uiActionData, BOOLEAN fTestObject );
|
||||
INT32 CreatePhysicalObject( OBJECTTYPE *pGameObj, real dLifeLength, real xPos, real yPos, real zPos, real xForce, real yForce, real zForce, SoldierID ubOwner, UINT8 ubActionCode, UINT32 uiActionData, BOOLEAN fTestObject );
|
||||
BOOLEAN RemoveObjectSlot( INT32 iObject );
|
||||
void RemoveAllPhysicsObjects( );
|
||||
// OJW - 20091002 - mp explosives
|
||||
@@ -183,4 +183,4 @@ INT32 RandomGridFromRadius( INT32 sSweetGridNo, INT8 ubMinRadius, INT8 ubMaxRad
|
||||
UINT32 GetArtilleryTargetGridNo( UINT32 sTargetGridNo, INT8 bRadius );
|
||||
BOOLEAN GetArtilleryLaunchParams(UINT32 sStartingGridNo, UINT32 sTargetGridNo, UINT8 ubTargetLevel, INT16 sStartZ, INT16 sEndZ, UINT16 usLauncher, OBJECTTYPE* pObj, FLOAT* pdForce, FLOAT* pdDegrees);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+5
-5
@@ -8,7 +8,7 @@
|
||||
#include "strategicmap.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Sound Control.h"
|
||||
#include "animation control.h"
|
||||
#include "Animation Control.h"
|
||||
#include "strategic.h"
|
||||
#include "Action Items.h"
|
||||
|
||||
@@ -207,7 +207,7 @@ void RemoveAllPits()
|
||||
void SearchForOtherMembersWithinPitRadiusAndMakeThemFall( INT32 sGridNo, INT16 sRadius )
|
||||
{
|
||||
INT32 x, y, sNewGridNo;
|
||||
UINT8 ubID;
|
||||
SoldierID ubID;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ void SearchForOtherMembersWithinPitRadiusAndMakeThemFall( INT32 sGridNo, INT16 s
|
||||
{
|
||||
// OK, make guy fall...
|
||||
// Set data to look for exit grid....
|
||||
pSoldier = MercPtrs[ ubID ];
|
||||
pSoldier = ubID;
|
||||
|
||||
pSoldier->aiData.uiPendingActionData4 = sNewGridNo;
|
||||
|
||||
@@ -237,9 +237,9 @@ void SearchForOtherMembersWithinPitRadiusAndMakeThemFall( INT32 sGridNo, INT16 s
|
||||
}
|
||||
}
|
||||
|
||||
void HandleFallIntoPitFromAnimation( UINT8 ubID )
|
||||
void HandleFallIntoPitFromAnimation( SoldierID ubID )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = MercPtrs[ ubID ];
|
||||
SOLDIERTYPE *pSoldier = ubID;
|
||||
EXITGRID ExitGrid;
|
||||
INT32 sPitGridNo;
|
||||
// OK, get exit grid...
|
||||
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
#ifndef __PITS_H
|
||||
#define __PITS_H
|
||||
|
||||
#include "Overhead Types.h"
|
||||
|
||||
void Add3X3Pit( INT32 iMapIndex );
|
||||
void Add5X5Pit( INT32 iMapIndex );
|
||||
void Remove3X3Pit( INT32 iMapIndex );
|
||||
@@ -14,7 +16,7 @@ void RemoveAllPits();
|
||||
extern BOOLEAN gfShowPits;
|
||||
extern BOOLEAN gfLoadPitsWithoutArming;
|
||||
|
||||
void HandleFallIntoPitFromAnimation( UINT8 ubID );
|
||||
void HandleFallIntoPitFromAnimation( SoldierID ubID );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+502
-593
File diff suppressed because it is too large
Load Diff
+78
-94
@@ -1,52 +1,39 @@
|
||||
#include <string.h>
|
||||
#include "types.h"
|
||||
#include "wcheck.h"
|
||||
#include "debug.h"
|
||||
#include "FileMan.h"
|
||||
#include "MemMan.h"
|
||||
#include "structure.h"
|
||||
#include "tiledef.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
|
||||
#include "interface.h"
|
||||
|
||||
#include "isometric utils.h"
|
||||
#include "font.h"
|
||||
#include "font control.h"
|
||||
#include "los.h"
|
||||
|
||||
#include "lighting.h"
|
||||
#include "Smell.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "strategicmap.h"
|
||||
#include "sgp_logger.h"
|
||||
|
||||
#include "Sys Globals.h" //for access to gfEditMode flag
|
||||
|
||||
//Kris:
|
||||
#ifdef JA2EDITOR
|
||||
#include "Editor Undo.h" //for access to AddToUndoList( iMapIndex )
|
||||
#endif
|
||||
|
||||
#include "explosion control.h"
|
||||
#include "Sound Control.h"
|
||||
|
||||
#include "Buildings.h"
|
||||
|
||||
#include "Random.h"
|
||||
|
||||
#include "Tile Animation.h"
|
||||
#include "Explosion Control.h" // added by Flugente
|
||||
|
||||
// anv: for ramming people with vehicles
|
||||
#include "Soldier macros.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier Functions.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Soldier Ani.h"
|
||||
#include "ASD.h" // added by Flugente
|
||||
#include "renderworld.h" // added by Flugente for SetRenderFlags( RENDER_FLAG_FULL );
|
||||
#include <string.h>
|
||||
#include "types.h"
|
||||
#include "WCheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "FileMan.h"
|
||||
#include "MemMan.h"
|
||||
#include "structure.h"
|
||||
#include "tiledef.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "Interface.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Font.h"
|
||||
#include "Font Control.h"
|
||||
#include "Smell.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "strategicmap.h"
|
||||
#include "sgp_logger.h"
|
||||
#include "Sys Globals.h" //for access to gfEditMode flag
|
||||
//Kris:
|
||||
#ifdef JA2EDITOR
|
||||
#include "Editor Undo.h" //for access to AddToUndoList( iMapIndex )
|
||||
#endif
|
||||
#include "Explosion Control.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Buildings.h"
|
||||
#include "random.h"
|
||||
#include "Tile Animation.h"
|
||||
// anv: for ramming people with vehicles
|
||||
#include "Soldier macros.h"
|
||||
#include "Overhead.h"
|
||||
#include "Animation Control.h"
|
||||
#include "ASD.h" // added by Flugente
|
||||
#include "renderworld.h" // added by Flugente for SetRenderFlags( RENDER_FLAG_FULL );
|
||||
#include <vfs/Core/vfs.h>
|
||||
#include "XML_StructureData.hpp"
|
||||
|
||||
#ifdef COUNT_PATHS
|
||||
extern UINT32 guiSuccessfulPathChecks;
|
||||
@@ -162,7 +149,7 @@ index 25, indestructable metal
|
||||
};
|
||||
|
||||
// Function operating on a structure tile
|
||||
UINT8 FilledTilePositions( DB_STRUCTURE_TILE * pTile )
|
||||
static UINT8 FilledTilePositions( DB_STRUCTURE_TILE * pTile )
|
||||
{
|
||||
UINT8 ubFilled = 0, ubShapeValue;
|
||||
INT8 bLoopX, bLoopY, bLoopZ;
|
||||
@@ -267,7 +254,7 @@ BOOLEAN FreeStructureFile( STRUCTURE_FILE_REF * pStructureFile )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32 * puiStructureDataSize )
|
||||
static BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32 * puiStructureDataSize )
|
||||
//UINT8 **ppubStructureData, UINT32 * puiDataSize, STRUCTURE_FILE_HEADER * pHeader )
|
||||
{
|
||||
// Loads a structure file's data as a honking chunk o' memory
|
||||
@@ -367,7 +354,7 @@ BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataSize )
|
||||
static BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataSize )
|
||||
{
|
||||
// Based on a file chunk, creates all the dynamic arrays for the
|
||||
// structure definitions contained within
|
||||
@@ -438,11 +425,8 @@ BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataS
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
#include <vfs/Core/vfs_file_raii.h>
|
||||
#include <vfs/Core/vfs.h>
|
||||
#include "XML_StructureData.hpp"
|
||||
|
||||
void checkStructureValidity(STRUCTURE_FILE_REF *str1, STRUCTURE_FILE_REF* str2, UINT32 size1, UINT32 size2)
|
||||
static void checkStructureValidity(STRUCTURE_FILE_REF *str1, STRUCTURE_FILE_REF* str2, UINT32 size1, UINT32 size2)
|
||||
{
|
||||
if(str1 == str2 && str1 == NULL)
|
||||
{
|
||||
@@ -579,7 +563,7 @@ STRUCTURE_FILE_REF * LoadStructureFile( STR szFileName )
|
||||
//
|
||||
|
||||
|
||||
STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileNum )
|
||||
static STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileNum )
|
||||
{
|
||||
// Creates a STRUCTURE struct for one tile of a structure
|
||||
STRUCTURE * pStructure;
|
||||
@@ -630,9 +614,9 @@ STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubT
|
||||
return( pStructure );
|
||||
}
|
||||
|
||||
extern UINT16 gusTempDragBuildSoldierID;
|
||||
extern SoldierID gusTempDragBuildSoldierID;
|
||||
|
||||
BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, INT16 sSoldierID = NOBODY )
|
||||
static BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, SoldierID sSoldierID = NOBODY )
|
||||
{
|
||||
// Verifies whether a structure is blocked from being added to the map at a particular point
|
||||
DB_STRUCTURE * pDBStructure;
|
||||
@@ -646,15 +630,15 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
BOOLEAN fIgnorePeople = (BOOLEAN)(sExclusionID == IGNORE_PEOPLE_STRUCTURE_ID);
|
||||
|
||||
BOOLEAN fVehicleIgnoreObstacles = (BOOLEAN)(sExclusionID == VEHICLE_IGNORE_OBSTACLES_STRUCTURE_ID);
|
||||
if( gGameExternalOptions.ubCarsRammingMaxStructureArmour && sSoldierID != NOBODY && MercPtrs[ sSoldierID ]->usSoldierFlagMask2 & SOLDIER_RAM_THROUGH_OBSTACLES )
|
||||
if( gGameExternalOptions.ubCarsRammingMaxStructureArmour && sSoldierID != NOBODY && sSoldierID->usSoldierFlagMask2 & SOLDIER_RAM_THROUGH_OBSTACLES )
|
||||
{
|
||||
fVehicleIgnoreObstacles = TRUE;
|
||||
}
|
||||
else if ( gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour && sSoldierID != NOBODY && COMBAT_JEEP( MercPtrs[sSoldierID] ) )
|
||||
else if ( gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour && sSoldierID != NOBODY && COMBAT_JEEP( sSoldierID ) )
|
||||
{
|
||||
fVehicleIgnoreObstacles = TRUE;
|
||||
}
|
||||
else if ( gGameExternalOptions.ubTanksRammingMaxStructureArmour && sSoldierID != NOBODY && TANK( MercPtrs[sSoldierID] ) )
|
||||
else if ( gGameExternalOptions.ubTanksRammingMaxStructureArmour && sSoldierID != NOBODY && TANK( sSoldierID ) )
|
||||
{
|
||||
fVehicleIgnoreObstacles = TRUE;
|
||||
}
|
||||
@@ -736,25 +720,25 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
// but not monsters and such (they can't fall down due to lack of animations)
|
||||
// also make sure AI won't flatten their allies
|
||||
if( !( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE | SOLDIER_ROBOT | SOLDIER_MONSTER ) ) &&
|
||||
((!ARMED_VEHICLE( MercPtrs[sSoldierID] ) && gGameExternalOptions.fAllowCarsDrivingOverPeople) ||
|
||||
(ARMED_VEHICLE( MercPtrs[sSoldierID] ) && gGameExternalOptions.fAllowTanksDrivingOverPeople)) &&
|
||||
( MercPtrs[ sSoldierID ]->bTeam == gbPlayerNum || MercPtrs[ sSoldierID ]->bTeam != pSoldier->bTeam ) )
|
||||
((!ARMED_VEHICLE( sSoldierID ) && gGameExternalOptions.fAllowCarsDrivingOverPeople) ||
|
||||
(ARMED_VEHICLE( sSoldierID ) && gGameExternalOptions.fAllowTanksDrivingOverPeople)) &&
|
||||
( sSoldierID->bTeam == gbPlayerNum || sSoldierID->bTeam != pSoldier->bTeam ) )
|
||||
{
|
||||
pExistingStructure = pExistingStructure->pNext;
|
||||
// damage people when driving on them
|
||||
if( fAddingForReal )
|
||||
{
|
||||
if ( TANK( MercPtrs[sSoldierID] ) )
|
||||
if ( TANK( sSoldierID ) )
|
||||
{
|
||||
pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), MercPtrs[ sSoldierID ]->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
|
||||
pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), sSoldierID->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
|
||||
}
|
||||
else if( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE && MercPtrs[ sSoldierID ]->IsFastMovement() )
|
||||
else if( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE && sSoldierID->IsFastMovement() )
|
||||
{
|
||||
pSoldier->EVENT_SoldierGotHit( 0, Random(5), Random(100)+Random(100), MercPtrs[ sSoldierID ]->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
|
||||
pSoldier->EVENT_SoldierGotHit( 0, Random(5), Random(100)+Random(100), sSoldierID->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), MercPtrs[ sSoldierID ]->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
|
||||
pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), sSoldierID->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@@ -770,9 +754,9 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
else
|
||||
{
|
||||
// only if structure is weak enough
|
||||
if ( (!ARMED_VEHICLE( MercPtrs[sSoldierID] ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubCarsRammingMaxStructureArmour) ||
|
||||
(COMBAT_JEEP( MercPtrs[sSoldierID] ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour) ||
|
||||
(TANK( MercPtrs[sSoldierID] ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubTanksRammingMaxStructureArmour) )
|
||||
if ( (!ARMED_VEHICLE( sSoldierID ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubCarsRammingMaxStructureArmour) ||
|
||||
(COMBAT_JEEP( sSoldierID ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour) ||
|
||||
(TANK( sSoldierID ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubTanksRammingMaxStructureArmour) )
|
||||
{
|
||||
// when not just plotting path, really destroy structure
|
||||
if( fAddingForReal )
|
||||
@@ -911,7 +895,7 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
{
|
||||
if( MercPtrs[ pExistingStructure->usStructureID ] != NULL && MercPtrs[ pExistingStructure->usStructureID ]->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
if( MercPtrs[ sSoldierID ]->flags.fInNonintAnim == TRUE || gAnimControl[ MercPtrs[ sSoldierID ]->usAnimState ].ubEndHeight == ANIM_PRONE )
|
||||
if( sSoldierID->flags.fInNonintAnim == TRUE || gAnimControl[ sSoldierID->usAnimState ].ubEndHeight == ANIM_PRONE )
|
||||
{
|
||||
pExistingStructure = pExistingStructure->pNext;
|
||||
continue;
|
||||
@@ -942,7 +926,7 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
{
|
||||
// Flugente: we allow this if this structure is being dragged by a soldier, otherwise we can't move containers our of rooms (and are likely to unintenionally bar rooms)
|
||||
if (pExistingStructure->fFlags & STRUCTURE_OPENABLE
|
||||
&& !( gusTempDragBuildSoldierID != NOBODY && MercPtrs[gusTempDragBuildSoldierID]->sDragGridNo ) )
|
||||
&& !( gusTempDragBuildSoldierID != NOBODY && gusTempDragBuildSoldierID->sDragGridNo ) )
|
||||
{
|
||||
// don't allow two openable structures in the same tile or things will screw
|
||||
// up on an interface level
|
||||
@@ -958,7 +942,7 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, INT16 sSoldierID )
|
||||
BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, SoldierID sSoldierID )
|
||||
{
|
||||
UINT8 ubLoop;
|
||||
INT16 sCubeOffset;
|
||||
@@ -1001,12 +985,12 @@ BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_ST
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, INT16 sSoldierID )
|
||||
BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, SoldierID sSoldierID )
|
||||
{
|
||||
return( InternalOkayToAddStructureToWorld( sBaseGridNo, bLevel, pDBStructureRef, sExclusionID, fAddingForReal, sSoldierID ) );
|
||||
}
|
||||
|
||||
BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, UINT16 usStructureID )
|
||||
static BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, UINT16 usStructureID )
|
||||
{
|
||||
// adds a STRUCTURE to a MAP_ELEMENT (adds part of a structure to a location on the map)
|
||||
STRUCTURE * pStructureTail;
|
||||
@@ -1033,18 +1017,18 @@ BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, U
|
||||
}
|
||||
|
||||
|
||||
STRUCTURE * InternalAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, LEVELNODE * pLevelNode )
|
||||
static STRUCTURE * InternalAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, LEVELNODE * pLevelNode )
|
||||
{
|
||||
// Adds a complete structure to the world at a location plus all other locations covered by the structure
|
||||
INT32 sGridNo;
|
||||
STRUCTURE ** ppStructure;
|
||||
STRUCTURE * pBaseStructure;
|
||||
DB_STRUCTURE * pDBStructure;
|
||||
DB_STRUCTURE_TILE ** ppTile;
|
||||
UINT8 ubLoop;
|
||||
UINT8 ubLoop2;
|
||||
INT16 sBaseTileHeight=-1;
|
||||
UINT16 usStructureID;
|
||||
INT32 sGridNo;
|
||||
STRUCTURE **ppStructure;
|
||||
STRUCTURE *pBaseStructure;
|
||||
DB_STRUCTURE *pDBStructure;
|
||||
DB_STRUCTURE_TILE **ppTile;
|
||||
UINT8 ubLoop;
|
||||
UINT8 ubLoop2;
|
||||
INT16 sBaseTileHeight=-1;
|
||||
UINT16 usStructureID;
|
||||
|
||||
CHECKF( pDBStructureRef );
|
||||
CHECKF( pLevelNode );
|
||||
@@ -1335,7 +1319,7 @@ BOOLEAN DeleteStructureFromWorld( STRUCTURE * pStructure )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
STRUCTURE * InternalSwapStructureForPartner( INT32 sGridNo, STRUCTURE * pStructure, BOOLEAN fFlipSwitches, BOOLEAN fStoreInMap )
|
||||
static STRUCTURE * InternalSwapStructureForPartner( INT32 sGridNo, STRUCTURE * pStructure, BOOLEAN fFlipSwitches, BOOLEAN fStoreInMap )
|
||||
{
|
||||
// switch structure
|
||||
LEVELNODE * pLevelNode;
|
||||
@@ -1764,7 +1748,7 @@ BOOLEAN StructureDensity( STRUCTURE * pStructure, UINT8 * pubLevel0, UINT8 * pub
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, UINT8 ubOwner, INT32 sAntiMaterialImpact )
|
||||
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, SoldierID ubOwner, INT32 sAntiMaterialImpact )
|
||||
{
|
||||
// do damage to a structure; returns TRUE if the structure should be removed
|
||||
STRUCTURE *pBase;
|
||||
@@ -1915,9 +1899,9 @@ INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, IN
|
||||
gpWorldLevelData[ tmpgridno ].uiFlags |= MAPELEMENT_STRUCTURE_DAMAGED;
|
||||
|
||||
// handle structure revenge - damage to vehicle - to be resolved after movement
|
||||
if ( ubOwner != NOBODY && MercPtrs[ubOwner] && !ARMED_VEHICLE( MercPtrs[ubOwner] ) )
|
||||
if ( ubOwner != NOBODY && !ARMED_VEHICLE( ubOwner ) )
|
||||
{
|
||||
MercPtrs[ubOwner]->SoldierTakeDelayedDamage(0, Random(max(0,(ubBaseArmour-10)/5)) + max(0,(ubBaseArmour-10)/5), 0, TAKE_DAMAGE_STRUCTURE_EXPLOSION, NOBODY, MercPtrs[ ubOwner ]->sGridNo, 0, TRUE);
|
||||
ubOwner->SoldierTakeDelayedDamage(0, Random(max(0,(ubBaseArmour-10)/5)) + max(0,(ubBaseArmour-10)/5), 0, TAKE_DAMAGE_STRUCTURE_EXPLOSION, NOBODY, ubOwner->sGridNo, 0, TRUE);
|
||||
}
|
||||
|
||||
// recompile = TRUE means that we destroyed something
|
||||
@@ -2519,13 +2503,13 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN InitStructureDB( void )
|
||||
static BOOLEAN InitStructureDB( void )
|
||||
{
|
||||
gusNextAvailableStructureID = FIRST_AVAILABLE_STRUCTURE_ID;
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN FiniStructureDB( void )
|
||||
static BOOLEAN FiniStructureDB( void )
|
||||
{
|
||||
gusNextAvailableStructureID = FIRST_AVAILABLE_STRUCTURE_ID;
|
||||
return( TRUE );
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "Structure Internals.h"
|
||||
#include "tiledef.h"
|
||||
#include "overhead types.h"
|
||||
#include "Overhead Types.h"
|
||||
|
||||
#define NOTHING_BLOCKING 0
|
||||
#define BLOCKING_REDUCE_RANGE 1
|
||||
@@ -37,7 +37,7 @@ BOOLEAN FreeStructureFile( STRUCTURE_FILE_REF * pStructureFile );
|
||||
//
|
||||
// functions at the structure instance level
|
||||
//
|
||||
BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, INT16 sSoldierID = NOBODY );
|
||||
BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, SoldierID sSoldierID = NOBODY );
|
||||
|
||||
// for the PTR argument of AddStructureToWorld, pass in a LEVELNODE * please!
|
||||
BOOLEAN AddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, PTR pLevelN );
|
||||
@@ -91,7 +91,7 @@ STRUCTURE* GetTallestStructureOnGridnoDrag( INT32 sGridNo, INT8 bLevel );
|
||||
// FUNCTIONS FOR DETERMINING STUFF THAT BLOCKS VIEW FOR TILE_bASED LOS
|
||||
INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLevel, INT8 *pStructHeight, STRUCTURE ** ppTallestStructure, BOOLEAN fWallsBlock );
|
||||
|
||||
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, UINT8 ubOwner, INT32 sAntiMaterialImpact = 0 );
|
||||
INT8 DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT32 sGridNo, INT16 sX, INT16 sY, SoldierID ubOwner, INT32 sAntiMaterialImpact = 0 );
|
||||
|
||||
// Material armour type enumeration
|
||||
enum
|
||||
@@ -136,4 +136,4 @@ UINT8 StructureFlagToType( UINT32 uiFlag );
|
||||
|
||||
UINT32 GetStructureOpenSound( STRUCTURE *pStructure, BOOLEAN fClose );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "sgp.h"
|
||||
#include "wcheck.h"
|
||||
#include "WCheck.h"
|
||||
#include "sysutil.h"
|
||||
|
||||
UINT32 guiBOTTOMPANEL = 0;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef __SYSTEM_UTILS
|
||||
#define __SYSTEM_UTILS
|
||||
|
||||
#include "font.h"
|
||||
#include "Font.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "interface.h"
|
||||
#include "Interface.h"
|
||||
|
||||
// Global variables for video objects
|
||||
extern UINT32 guiBOTTOMPANEL;
|
||||
@@ -18,4 +18,4 @@ BOOLEAN InitializeSystemVideoObjects( );
|
||||
BOOLEAN InitializeGameVideoObjects( );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "tiledef.h"
|
||||
#include "worlddef.h"
|
||||
#include "wcheck.h"
|
||||
#include "debug.h"
|
||||
#include "WCheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "worldman.h"
|
||||
#include "edit_sys.h"
|
||||
#include "pathai.h"
|
||||
#include "tile surface.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Tile Surface.h"
|
||||
#include "Tactical Save.h"
|
||||
|
||||
//#include "editscreen.h"
|
||||
|
||||
+27
-32
@@ -1,26 +1,26 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
#include "worlddef.h"
|
||||
#include "worlddat.h"
|
||||
#include "wcheck.h"
|
||||
#include "debug.h"
|
||||
#include "WorldDat.h"
|
||||
#include "WCheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "worldman.h"
|
||||
#include "sys globals.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "Render Fun.h"
|
||||
#include "lighting.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "utilities.h"
|
||||
#include "overhead.h"
|
||||
#include "Utilities.h"
|
||||
#include "Overhead.h"
|
||||
#include "opplist.h"
|
||||
#include "renderworld.h"
|
||||
#include "Radar Screen.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "tile surface.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "Tile Surface.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "Keys.h"
|
||||
#include "Map Information.h"
|
||||
#include "Animated ProgressBar.h"
|
||||
#include "pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "EditorBuildings.h"
|
||||
#include "Map Edgepoints.h"
|
||||
#include "Shade Table Util.h"
|
||||
@@ -34,13 +34,13 @@
|
||||
#include "overhead map.h"
|
||||
#include "SmokeEffects.h"
|
||||
#include "LightEffects.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Meanwhile.h"
|
||||
#include "LoadScreen.h"//dnl ch30 150909
|
||||
#include "Interface Cursors.h"
|
||||
#include "Simple Render Utils.h"//dnl ch54 111009
|
||||
#include "Interface.h"
|
||||
///ddd
|
||||
#include "gamesettings.h"
|
||||
#include "GameSettings.h"
|
||||
#include "editscreen.h"
|
||||
#include "Editor Taskbar Utils.h"
|
||||
|
||||
@@ -122,7 +122,6 @@ BOOLEAN gfInitAnimateLoading = FALSE;
|
||||
BOOLEAN LoadTileSurfaces( char pTileSurfaceFilenames[][32], UINT8 ubTilesetID );
|
||||
BOOLEAN AddTileSurface( SGPFILENAME cFilename, UINT32 ubType, UINT8 ubTilesetID, BOOLEAN fGetFromRoot );
|
||||
void DestroyTileSurfaces( void );
|
||||
void ProcessTilesetNamesForBPP(void);
|
||||
BOOLEAN IsRoofVisibleForWireframe( INT32 sMapPos );
|
||||
|
||||
#ifdef JA2UBMAPS
|
||||
@@ -225,7 +224,7 @@ BOOLEAN GridNoIndoors( INT32 iMapIndex )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DOIT( )
|
||||
static void DOIT( )
|
||||
{
|
||||
// LEVELNODE * pLand;
|
||||
//LEVELNODE * pObject;
|
||||
@@ -272,9 +271,6 @@ BOOLEAN InitializeWorld( )
|
||||
|
||||
SetNumberOfTiles();
|
||||
|
||||
// DB Adds the _8 to the names if we're in 8 bit mode.
|
||||
//ProcessTilesetNamesForBPP();
|
||||
|
||||
// Memset tileset list
|
||||
memset( TileSurfaceFilenames, '\0', sizeof( TileSurfaceFilenames ) );
|
||||
|
||||
@@ -341,7 +337,7 @@ void DeinitializeWorld()
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ReloadTilesetSlot( INT32 iSlot )
|
||||
static BOOLEAN ReloadTilesetSlot( INT32 iSlot )
|
||||
{
|
||||
return(TRUE);
|
||||
}
|
||||
@@ -770,7 +766,7 @@ void DestroyTileSurfaces( )
|
||||
}
|
||||
}
|
||||
|
||||
void CompileWorldTerrainIDs( void )
|
||||
static void CompileWorldTerrainIDs( void )
|
||||
{
|
||||
INT32 sGridNo;
|
||||
INT32 sTempGridNo;
|
||||
@@ -825,7 +821,7 @@ void CompileWorldTerrainIDs( void )
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN IsNotRestrictedWindow(STRUCTURE * pStructure)
|
||||
static BOOLEAN IsNotRestrictedWindow(STRUCTURE * pStructure)
|
||||
{
|
||||
|
||||
if ( (pStructure->fFlags & STRUCTURE_WALLNWINDOW) && gGameExternalOptions.fCanJumpThroughWindows
|
||||
@@ -863,7 +859,7 @@ BOOLEAN IsNotRestrictedWindow(STRUCTURE * pStructure)
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
void CompileTileMovementCosts( INT32 usGridNo )
|
||||
static void CompileTileMovementCosts( INT32 usGridNo )
|
||||
{
|
||||
UINT8 ubTerrainID;
|
||||
TILE_ELEMENT TileElem;
|
||||
@@ -2322,7 +2318,7 @@ INT8 bDirectionsForShadowSearch[ NUM_DIR_SEARCHES ] =
|
||||
EAST
|
||||
};
|
||||
|
||||
void OptimizeMapForShadows( )
|
||||
static void OptimizeMapForShadows( )
|
||||
{
|
||||
INT32 cnt, dir;
|
||||
INT32 sNewGridNo;
|
||||
@@ -2352,7 +2348,7 @@ void OptimizeMapForShadows( )
|
||||
}
|
||||
}
|
||||
|
||||
void SetBlueFlagFlags( void )
|
||||
static void SetBlueFlagFlags( void )
|
||||
{
|
||||
INT32 cnt;
|
||||
LEVELNODE * pNode;
|
||||
@@ -2927,7 +2923,7 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
|
||||
SetWorldSize(iRowSize, iColSize);
|
||||
|
||||
// We still have the "normal" map size AND the map is saved in vanilla format
|
||||
if ((iRowSize <= OLD_WORLD_ROWS && iRowSize <= OLD_WORLD_COLS) && (dMajorMapVersion == VANILLA_MAJOR_MAP_VERSION && ubMinorMapVersion == VANILLA_MINOR_MAP_VERSION))
|
||||
if ((iRowSize <= OLD_WORLD_ROWS && iColSize <= OLD_WORLD_COLS) && (dMajorMapVersion == VANILLA_MAJOR_MAP_VERSION && ubMinorMapVersion == VANILLA_MINOR_MAP_VERSION))
|
||||
{
|
||||
// Check "vanilla map saving"
|
||||
gfVanillaMode = TRUE;//dnl ch74 191013
|
||||
@@ -3289,10 +3285,9 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
|
||||
// CHECK IF OUR SELECTED GUY IS GONE!
|
||||
if(gusSelectedSoldier != NOBODY)
|
||||
{
|
||||
if(MercPtrs[gusSelectedSoldier]->bActive == FALSE)
|
||||
if(gusSelectedSoldier->bActive == FALSE)
|
||||
gusSelectedSoldier = NOBODY;
|
||||
}
|
||||
AdjustSoldierCreationStartValues();
|
||||
RenderProgressBar(0, 60);
|
||||
InvalidateWorldRedundency();
|
||||
// SAVE FILENAME
|
||||
@@ -3325,9 +3320,6 @@ BOOLEAN NewWorld( INT32 nMapRows, INT32 nMapCols )
|
||||
UINT16 NewIndex;
|
||||
INT32 cnt;
|
||||
|
||||
gusSelectedSoldier = gusOldSelectedSoldier = NOBODY;
|
||||
|
||||
AdjustSoldierCreationStartValues( );
|
||||
|
||||
TrashWorld();
|
||||
|
||||
@@ -3422,7 +3414,10 @@ void TrashWorld( void )
|
||||
//Remove the schedules
|
||||
DestroyAllSchedules();
|
||||
#ifdef JA2UB
|
||||
//Ja25 no meanwhiles
|
||||
//Ja25 no meanwhiles
|
||||
// But DO turn off powergen fan sound
|
||||
extern void HandleRemovingPowerGenFanSound();
|
||||
HandleRemovingPowerGenFanSound();
|
||||
#else
|
||||
// on trash world sheck if we have to set up the first meanwhile
|
||||
HandleFirstMeanWhileSetUpWithTrashWorld( );
|
||||
@@ -3529,7 +3524,7 @@ void TrashWorld( void )
|
||||
|
||||
|
||||
|
||||
void TrashMapTile(INT16 MapTile)
|
||||
void TrashMapTile(INT32 MapTile)
|
||||
{
|
||||
MAP_ELEMENT *pMapTile;
|
||||
LEVELNODE *pLandNode;
|
||||
@@ -3717,7 +3712,7 @@ void SetLoadOverrideParams( BOOLEAN fForceLoad, BOOLEAN fForceFile, CHAR8 *zLoad
|
||||
}
|
||||
|
||||
|
||||
void AddWireFrame( INT32 sGridNo, UINT16 usIndex, BOOLEAN fForced )
|
||||
static void AddWireFrame( INT32 sGridNo, UINT16 usIndex, BOOLEAN fForced )
|
||||
{
|
||||
LEVELNODE *pTopmost, *pTopmostTail;
|
||||
|
||||
@@ -3744,7 +3739,7 @@ void AddWireFrame( INT32 sGridNo, UINT16 usIndex, BOOLEAN fForced )
|
||||
}
|
||||
|
||||
|
||||
UINT16 GetWireframeGraphicNumToUseForWall( INT32 sGridNo, STRUCTURE *pStructure )
|
||||
static UINT16 GetWireframeGraphicNumToUseForWall( INT32 sGridNo, STRUCTURE *pStructure )
|
||||
{
|
||||
LEVELNODE *pNode = NULL;
|
||||
UINT8 ubWallOrientation;
|
||||
|
||||
@@ -36,7 +36,7 @@ class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
// SB: new map version, with map dimensions added
|
||||
#define MAJOR_MAP_VERSION 7.0
|
||||
#define MAJOR_MAP_VERSION 8.0 // 7.0 -> 8.0 Due to increased teamsizes.
|
||||
//Current minor map version updater.
|
||||
#define MINOR_MAP_OVERHEATING 28 // 27 -> 28: Flugente:: increased to 28 because of included weapon overheated and tripwire feature. See ObjectClass for the new Tags!
|
||||
//#define MINOR_MAP_VERSION 29 // 28 -> 29: increased range of roomnumbers to full UINT16 by DBrot
|
||||
@@ -273,7 +273,7 @@ typedef struct
|
||||
UINT8 ubAdjacentSoldierCnt;
|
||||
UINT8 ubTerrainID;
|
||||
|
||||
UINT8 ubReservedSoldierID;
|
||||
UINT16 ubReservedSoldierID;
|
||||
UINT8 ubBloodInfo;
|
||||
UINT8 ubSmellInfo;
|
||||
} MAP_ELEMENT;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "wcheck.h"
|
||||
#include "debug.h"
|
||||
#include "WCheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "lighting.h"
|
||||
#include "renderworld.h"
|
||||
#include "ai.h"
|
||||
#include "animation control.h"
|
||||
#include "Animation Control.h"
|
||||
#include "message.h"
|
||||
#include "tile cache.h"
|
||||
#include "Tile Cache.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "random.h"
|
||||
// sevenfm
|
||||
@@ -3750,7 +3750,7 @@ BOOLEAN IsRoofVisible2( INT32 sMapPos )
|
||||
}
|
||||
|
||||
|
||||
UINT8 WhoIsThere2( INT32 sGridNo, INT8 bLevel )
|
||||
SoldierID WhoIsThere2( INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
STRUCTURE * pStructure;
|
||||
|
||||
@@ -3774,7 +3774,7 @@ UINT8 WhoIsThere2( INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
// found a person, on the right level!
|
||||
// structure ID and merc ID are identical for merc structures
|
||||
return( (UINT8) pStructure->usStructureID );
|
||||
return( pStructure->usStructureID );
|
||||
}
|
||||
}
|
||||
pStructure = pStructure->pNext;
|
||||
@@ -3782,7 +3782,7 @@ UINT8 WhoIsThere2( INT32 sGridNo, INT8 bLevel )
|
||||
|
||||
}
|
||||
|
||||
return( (UINT8)NOBODY );
|
||||
return( NOBODY );
|
||||
}
|
||||
|
||||
UINT8 GetTerrainType( INT32 sGridNo )
|
||||
@@ -4159,7 +4159,7 @@ void UpdateTreeVisibility()
|
||||
// find visible soldier near spot
|
||||
if (!TileIsOutOfBounds(sSpot) && !fHideTree)
|
||||
{
|
||||
for (UINT8 uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
|
||||
for (UINT16 uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
|
||||
{
|
||||
pOpponent = MercSlots[uiLoop];
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ BOOLEAN RemoveShadowFromLevelNode( INT32 iMapIndex, LEVELNODE *pNode );
|
||||
|
||||
BOOLEAN AddMercToHead( INT32 iMapIndex, SOLDIERTYPE *pSoldier, BOOLEAN fAddStructInfo );
|
||||
BOOLEAN RemoveMerc( INT32 iMapIndex, SOLDIERTYPE *pSoldier, BOOLEAN fPlaceHolder );
|
||||
UINT8 WhoIsThere2( INT32 sGridNo, INT8 bLevel );
|
||||
SoldierID WhoIsThere2( INT32 sGridNo, INT8 bLevel );
|
||||
BOOLEAN AddMercStructureInfo( INT32 sGridNo, SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN AddMercStructureInfoFromAnimSurface( INT32 sGridNo, SOLDIERTYPE *pSoldier, UINT16 usAnimSurface, UINT16 usAnimState );
|
||||
BOOLEAN UpdateMercStructureInfo( SOLDIERTYPE *pSoldier );
|
||||
@@ -179,4 +179,4 @@ BOOLEAN IsLegionLevel( INT32 sGridNo );
|
||||
BOOLEAN FindStruct(INT32 sSpot, INT8 bLevel, UINT16 usIndex);
|
||||
BOOLEAN FindStructFlag(INT32 sSpot, INT8 bLevel, UINT32 uiFlag);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user