mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+160
-160
@@ -19,131 +19,131 @@ AMBIENTDATA_STRUCT gAmbData[ MAX_AMBIENT_SOUNDS ];
|
||||
INT16 gsNumAmbData = 0;
|
||||
|
||||
|
||||
UINT8 gubCurrentSteadyStateAmbience = SSA_NONE;
|
||||
UINT8 gubCurrentSteadyStateSound = 0;
|
||||
UINT32 guiCurrentSteadyStateSoundHandle = NO_SAMPLE;
|
||||
STEADY_STATE_AMBIENCE gSteadyStateAmbientTable[ NUM_STEADY_STATE_AMBIENCES ] =
|
||||
UINT8 gubCurrentSteadyStateAmbience = SSA_NONE;
|
||||
UINT8 gubCurrentSteadyStateSound = 0;
|
||||
UINT32 guiCurrentSteadyStateSoundHandle = NO_SAMPLE;
|
||||
STEADY_STATE_AMBIENCE gSteadyStateAmbientTable[ NUM_STEADY_STATE_AMBIENCES ] =
|
||||
{
|
||||
// NONE
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// COUNTRYSIZE
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\insects Day 01.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\night_crickets_01D.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_01B.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_01C.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_01A.wav",
|
||||
// NEAR WATER
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\swamp_day_01a.wav",
|
||||
"SOUNDS\\SSA\\swamp_day_01b.wav",
|
||||
"SOUNDS\\SSA\\swamp_day_01c.wav",
|
||||
"SOUNDS\\SSA\\swamp_day_01d.wav",
|
||||
//NIGHT
|
||||
"SOUNDS\\SSA\\marsh_at_night_01a.wav",
|
||||
"SOUNDS\\SSA\\marsh_at_night_01b.wav",
|
||||
"SOUNDS\\SSA\\marsh_at_night_01c.wav",
|
||||
"SOUNDS\\SSA\\marsh_at_night_01d.wav",
|
||||
//INWATER
|
||||
//DAY
|
||||
"SOUNDS\\SSA\\middle_of_water_01d.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01c.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01b.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01a.wav",
|
||||
// night
|
||||
"SOUNDS\\SSA\\middle_of_water_01d.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01c.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01b.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01a.wav",
|
||||
// HEAVY FOREST
|
||||
// day
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01a.wav",
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01b.wav",
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01c.wav",
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01d.wav",
|
||||
// night
|
||||
"SOUNDS\\SSA\\night_crickets_03a.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_03b.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_03c.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_03d.wav",
|
||||
// PINE FOREST
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\pine_forest_01a.wav",
|
||||
"SOUNDS\\SSA\\pine_forest_01b.wav",
|
||||
"SOUNDS\\SSA\\pine_forest_01c.wav",
|
||||
"SOUNDS\\SSA\\pine_forest_01d.wav",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\night_crickets_02a.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_02b.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_02c.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_02d.wav",
|
||||
// ABANDANDED
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\metal_wind_01a.wav",
|
||||
"SOUNDS\\SSA\\metal_wind_01b.wav",
|
||||
"SOUNDS\\SSA\\metal_wind_01c.wav",
|
||||
"SOUNDS\\SSA\\metal_wind_01d.wav",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\night_insects_01a.wav",
|
||||
"SOUNDS\\SSA\\night_insects_01b.wav",
|
||||
"SOUNDS\\SSA\\night_insects_01c.wav",
|
||||
"SOUNDS\\SSA\\night_insects_01d.wav",
|
||||
// AIRPORT
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\rotating radar dish.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\rotating radar dish.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// WASTE LAND
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\gentle_wind.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\insects_at_night_04.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// UNDERGROUND
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\low ominous ambience.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\low ominous ambience.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// OCEAN
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\sea_01a.wav",
|
||||
"SOUNDS\\SSA\\sea_01b.wav",
|
||||
"SOUNDS\\SSA\\sea_01c.wav",
|
||||
"SOUNDS\\SSA\\sea_01d.wav",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\ocean_waves_01a.wav",
|
||||
"SOUNDS\\SSA\\ocean_waves_01b.wav",
|
||||
"SOUNDS\\SSA\\ocean_waves_01c.wav",
|
||||
"SOUNDS\\SSA\\ocean_waves_01d.wav",
|
||||
// NONE
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// COUNTRYSIZE
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\insects Day 01.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\night_crickets_01D.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_01B.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_01C.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_01A.wav",
|
||||
// NEAR WATER
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\swamp_day_01a.wav",
|
||||
"SOUNDS\\SSA\\swamp_day_01b.wav",
|
||||
"SOUNDS\\SSA\\swamp_day_01c.wav",
|
||||
"SOUNDS\\SSA\\swamp_day_01d.wav",
|
||||
//NIGHT
|
||||
"SOUNDS\\SSA\\marsh_at_night_01a.wav",
|
||||
"SOUNDS\\SSA\\marsh_at_night_01b.wav",
|
||||
"SOUNDS\\SSA\\marsh_at_night_01c.wav",
|
||||
"SOUNDS\\SSA\\marsh_at_night_01d.wav",
|
||||
//INWATER
|
||||
//DAY
|
||||
"SOUNDS\\SSA\\middle_of_water_01d.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01c.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01b.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01a.wav",
|
||||
// night
|
||||
"SOUNDS\\SSA\\middle_of_water_01d.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01c.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01b.wav",
|
||||
"SOUNDS\\SSA\\middle_of_water_01a.wav",
|
||||
// HEAVY FOREST
|
||||
// day
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01a.wav",
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01b.wav",
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01c.wav",
|
||||
"SOUNDS\\SSA\\JUNGLE_DAY_01d.wav",
|
||||
// night
|
||||
"SOUNDS\\SSA\\night_crickets_03a.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_03b.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_03c.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_03d.wav",
|
||||
// PINE FOREST
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\pine_forest_01a.wav",
|
||||
"SOUNDS\\SSA\\pine_forest_01b.wav",
|
||||
"SOUNDS\\SSA\\pine_forest_01c.wav",
|
||||
"SOUNDS\\SSA\\pine_forest_01d.wav",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\night_crickets_02a.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_02b.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_02c.wav",
|
||||
"SOUNDS\\SSA\\night_crickets_02d.wav",
|
||||
// ABANDANDED
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\metal_wind_01a.wav",
|
||||
"SOUNDS\\SSA\\metal_wind_01b.wav",
|
||||
"SOUNDS\\SSA\\metal_wind_01c.wav",
|
||||
"SOUNDS\\SSA\\metal_wind_01d.wav",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\night_insects_01a.wav",
|
||||
"SOUNDS\\SSA\\night_insects_01b.wav",
|
||||
"SOUNDS\\SSA\\night_insects_01c.wav",
|
||||
"SOUNDS\\SSA\\night_insects_01d.wav",
|
||||
// AIRPORT
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\rotating radar dish.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\rotating radar dish.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// WASTE LAND
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\gentle_wind.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\insects_at_night_04.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// UNDERGROUND
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\low ominous ambience.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\low ominous ambience.wav",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
// OCEAN
|
||||
// DAY
|
||||
"SOUNDS\\SSA\\sea_01a.wav",
|
||||
"SOUNDS\\SSA\\sea_01b.wav",
|
||||
"SOUNDS\\SSA\\sea_01c.wav",
|
||||
"SOUNDS\\SSA\\sea_01d.wav",
|
||||
// NIGHT
|
||||
"SOUNDS\\SSA\\ocean_waves_01a.wav",
|
||||
"SOUNDS\\SSA\\ocean_waves_01b.wav",
|
||||
"SOUNDS\\SSA\\ocean_waves_01c.wav",
|
||||
"SOUNDS\\SSA\\ocean_waves_01d.wav",
|
||||
};
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ void HandleNewSectorAmbience( UINT8 ubAmbientID )
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_0, String("Cannot load Ambient data for tileset" ) );
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_0, String("Cannot load Ambient data for tileset" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,8 +232,8 @@ UINT32 SetupNewAmbientSound( UINT32 uiAmbientID )
|
||||
{
|
||||
RANDOMPARMS rpParms;
|
||||
|
||||
//SoundLog((CHAR8 *)String(" SetupNewAmbientSound()1: uiAmbientID: '%d'", uiAmbientID ) );
|
||||
|
||||
//SoundLog((CHAR8 *)String(" SetupNewAmbientSound()1: uiAmbientID: '%d'", uiAmbientID ) );
|
||||
|
||||
memset(&rpParms, 0xff, sizeof(RANDOMPARMS));
|
||||
|
||||
rpParms.uiTimeMin = gAmbData[ uiAmbientID ].uiMinTime;
|
||||
@@ -242,9 +242,9 @@ UINT32 SetupNewAmbientSound( UINT32 uiAmbientID )
|
||||
rpParms.uiVolMax = CalculateSoundEffectsVolume( gAmbData[ uiAmbientID ].uiVol );
|
||||
rpParms.uiPriority = GROUP_AMBIENT;
|
||||
|
||||
//SoundLog((CHAR8 *)String(" SetupNewAmbientSound()2: gAmbData[ uiAmbientID ].zFilename: '%s', Params: '%s'", gAmbData[ uiAmbientID ].zFilename, &rpParms ) );
|
||||
|
||||
return SoundPlayRandom( gAmbData[ uiAmbientID ].zFilename, &rpParms ); //bug Nr14
|
||||
//SoundLog((CHAR8 *)String(" SetupNewAmbientSound()2: gAmbData[ uiAmbientID ].zFilename: '%s', Params: '%s'", gAmbData[ uiAmbientID ].zFilename, &rpParms ) );
|
||||
|
||||
return SoundPlayRandom( gAmbData[ uiAmbientID ].zFilename, &rpParms ); //bug Nr14
|
||||
}
|
||||
|
||||
|
||||
@@ -265,48 +265,48 @@ SOUNDPARMS spParms;
|
||||
|
||||
BOOLEAN SetSteadyStateAmbience( UINT8 ubAmbience )
|
||||
{
|
||||
BOOLEAN fInNight = FALSE;
|
||||
INT32 cnt;
|
||||
UINT8 ubNumSounds = 0;
|
||||
UINT8 ubChosenSound;
|
||||
BOOLEAN fInNight = FALSE;
|
||||
INT32 cnt;
|
||||
UINT8 ubNumSounds = 0;
|
||||
UINT8 ubChosenSound;
|
||||
|
||||
// Stop all ambients...
|
||||
// Stop all ambients...
|
||||
if ( guiCurrentSteadyStateSoundHandle != NO_SAMPLE )
|
||||
{
|
||||
SoundStop( guiCurrentSteadyStateSoundHandle );
|
||||
guiCurrentSteadyStateSoundHandle = NO_SAMPLE;
|
||||
}
|
||||
|
||||
// Determine what time of day we are in ( day/night)
|
||||
// Determine what time of day we are in ( day/night)
|
||||
if( gubEnvLightValue >= LIGHT_DUSK_CUTOFF)
|
||||
{
|
||||
fInNight = TRUE;
|
||||
}
|
||||
fInNight = TRUE;
|
||||
}
|
||||
|
||||
// loop through listing to get num sounds...
|
||||
for ( cnt = ( fInNight * 4 ); cnt < ( NUM_SOUNDS_PER_TIMEFRAME / 2 ); cnt++ )
|
||||
{
|
||||
if ( gSteadyStateAmbientTable[ ubAmbience ].zSoundNames[ cnt ][ 0 ] == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ubNumSounds++;
|
||||
}
|
||||
// loop through listing to get num sounds...
|
||||
for ( cnt = ( fInNight * 4 ); cnt < ( NUM_SOUNDS_PER_TIMEFRAME / 2 ); cnt++ )
|
||||
{
|
||||
if ( gSteadyStateAmbientTable[ ubAmbience ].zSoundNames[ cnt ][ 0 ] == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ubNumSounds == 0 )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
ubNumSounds++;
|
||||
}
|
||||
|
||||
// Pick one
|
||||
ubChosenSound = (UINT8) Random( ubNumSounds );
|
||||
if ( ubNumSounds == 0 )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// Set!
|
||||
gubCurrentSteadyStateAmbience = ubAmbience;
|
||||
gubCurrentSteadyStateSound = ubChosenSound;
|
||||
// Pick one
|
||||
ubChosenSound = (UINT8) Random( ubNumSounds );
|
||||
|
||||
guiCurrentSteadyStateSoundHandle = StartSteadyStateAmbient( LOWVOLUME, 0 );
|
||||
// Set!
|
||||
gubCurrentSteadyStateAmbience = ubAmbience;
|
||||
gubCurrentSteadyStateSound = ubChosenSound;
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
guiCurrentSteadyStateSoundHandle = StartSteadyStateAmbient( LOWVOLUME, 0 );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -19,30 +19,30 @@ extern INT16 gsNumAmbData;
|
||||
BOOLEAN SetSteadyStateAmbience( UINT8 ubAmbience );
|
||||
|
||||
|
||||
#define SOUND_NAME_SIZE 256
|
||||
#define NUM_SOUNDS_PER_TIMEFRAME 8
|
||||
#define SOUND_NAME_SIZE 256
|
||||
#define NUM_SOUNDS_PER_TIMEFRAME 8
|
||||
|
||||
enum
|
||||
{
|
||||
SSA_NONE,
|
||||
SSA_COUNTRYSIZE,
|
||||
SSA_NEAR_WATER,
|
||||
SSA_IN_WATER,
|
||||
SSA_HEAVY_FOREST,
|
||||
SSA_PINE_FOREST,
|
||||
SSA_ABANDONED,
|
||||
SSA_AIRPORT,
|
||||
SSA_WASTELAND,
|
||||
SSA_UNDERGROUND,
|
||||
SSA_OCEAN,
|
||||
NUM_STEADY_STATE_AMBIENCES
|
||||
SSA_NONE,
|
||||
SSA_COUNTRYSIZE,
|
||||
SSA_NEAR_WATER,
|
||||
SSA_IN_WATER,
|
||||
SSA_HEAVY_FOREST,
|
||||
SSA_PINE_FOREST,
|
||||
SSA_ABANDONED,
|
||||
SSA_AIRPORT,
|
||||
SSA_WASTELAND,
|
||||
SSA_UNDERGROUND,
|
||||
SSA_OCEAN,
|
||||
NUM_STEADY_STATE_AMBIENCES
|
||||
};
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CHAR8 zSoundNames[ NUM_SOUNDS_PER_TIMEFRAME ][ SOUND_NAME_SIZE ];
|
||||
|
||||
CHAR8 zSoundNames[ NUM_SOUNDS_PER_TIMEFRAME ][ SOUND_NAME_SIZE ];
|
||||
|
||||
} STEADY_STATE_AMBIENCE;
|
||||
|
||||
|
||||
|
||||
+12
-15
@@ -69,17 +69,14 @@ BUILDING * GenerateBuilding( INT16 sDesiredSpot )
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
// WDS - Clean up inventory handling
|
||||
// set up fake soldier for location testing
|
||||
// memset( &FakeSoldier, 0, SIZEOF_SOLDIERTYPE );
|
||||
#if 0
|
||||
FakeSoldier.initialize();
|
||||
FakeSoldier.sGridNo = sDesiredSpot;
|
||||
FakeSoldier.bLevel = 1;
|
||||
FakeSoldier.pathing.bLevel = 1;
|
||||
FakeSoldier.bTeam = 1;
|
||||
#endif
|
||||
|
||||
// Set reachable
|
||||
// Set reachable
|
||||
RoofReachableTest( sDesiredSpot, ubBuildingID );
|
||||
|
||||
// 0verhaul: The RoofReachableTest now finds ALL of the climb points for each climbable building, instead of a max of
|
||||
@@ -90,8 +87,8 @@ BUILDING * GenerateBuilding( INT16 sDesiredSpot )
|
||||
// From sGridNo, search until we find a spot that isn't part of the building
|
||||
ubDirection = NORTHWEST;
|
||||
sTempGridNo = sDesiredSpot;
|
||||
// using diagonal directions to hopefully prevent picking a
|
||||
// spot that
|
||||
// using diagonal directions to hopefully prevent picking a
|
||||
// spot that
|
||||
while( (gpWorldLevelData[ sTempGridNo ].uiFlags & MAPELEMENT_REACHABLE ) )
|
||||
{
|
||||
sNextTempGridNo = NewGridNo( sTempGridNo, DirectionInc( ubDirection ) );
|
||||
@@ -104,7 +101,7 @@ BUILDING * GenerateBuilding( INT16 sDesiredSpot )
|
||||
{
|
||||
sTempGridNo = sNextTempGridNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// we've got our spot
|
||||
sStartGridNo = sTempGridNo;
|
||||
@@ -222,8 +219,8 @@ BUILDING * GenerateBuilding( INT16 sDesiredSpot )
|
||||
|
||||
gubBuildingInfo[ sCurrGridNo ] = ubBuildingID;
|
||||
|
||||
// consider this location as possible climb gridno
|
||||
// there must be a regular wall adjacent to this for us to consider it a
|
||||
// consider this location as possible climb gridno
|
||||
// there must be a regular wall adjacent to this for us to consider it a
|
||||
// climb gridno
|
||||
|
||||
// if the direction is east or north, the wall would be in our gridno;
|
||||
@@ -283,7 +280,7 @@ BUILDING * GenerateBuilding( INT16 sDesiredSpot )
|
||||
bSkipSpots--;
|
||||
}
|
||||
else if ( Random( uiChanceIn ) == 0 )
|
||||
{
|
||||
{
|
||||
// don't consider people as obstacles
|
||||
//if ( NewOKDestination( &FakeSoldier, sCurrGridNo, FALSE, 0 ) )
|
||||
{
|
||||
@@ -309,13 +306,13 @@ BUILDING * GenerateBuilding( INT16 sDesiredSpot )
|
||||
//{
|
||||
// if location is not added, 100% chance of handling next location
|
||||
// and the next until we can add one
|
||||
// uiChanceIn = 1;
|
||||
//uiChanceIn = 1;
|
||||
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
// didn't pick this location, so increase chance that next location
|
||||
// didn't pick this location, so increase chance that next location
|
||||
// will be considered
|
||||
if (uiChanceIn > 2)
|
||||
{
|
||||
@@ -396,7 +393,7 @@ BUILDING * FindBuilding( INT16 sGridNo )
|
||||
{
|
||||
return( NULL );
|
||||
/*
|
||||
// need extra checks to see if is valid spot...
|
||||
// need extra checks to see if is valid spot...
|
||||
// must have valid room information and be a flat-roofed
|
||||
// building
|
||||
if ( InARoom( sGridNo, &ubRoomNo ) && (FindStructure( sGridNo, STRUCTURE_NORMAL_ROOF ) != NULL) )
|
||||
@@ -582,4 +579,4 @@ BOOLEAN SameBuilding( INT16 sGridNo1, INT16 sGridNo2 )
|
||||
return( FALSE );
|
||||
}
|
||||
return( (BOOLEAN) (gubBuildingInfo[ sGridNo1] == gubBuildingInfo[ sGridNo2 ]) );
|
||||
}
|
||||
}
|
||||
|
||||
+43
-45
@@ -33,10 +33,10 @@ BOOLEAN gfOverrideInsertionWithExitGrid = FALSE;
|
||||
INT32 ConvertExitGridToINT32( EXITGRID *pExitGrid )
|
||||
{
|
||||
INT32 iExitGridInfo;
|
||||
iExitGridInfo = (pExitGrid->ubGotoSectorX-1)<< 28;
|
||||
iExitGridInfo = (pExitGrid->ubGotoSectorX-1)<< 28;
|
||||
iExitGridInfo += (pExitGrid->ubGotoSectorY-1)<< 24;
|
||||
iExitGridInfo += pExitGrid->ubGotoSectorZ << 20;
|
||||
iExitGridInfo += pExitGrid->usGridNo & 0x0000ffff;
|
||||
iExitGridInfo += pExitGrid->ubGotoSectorZ << 20;
|
||||
iExitGridInfo += pExitGrid->sGridNo & 0x0000ffff;
|
||||
return iExitGridInfo;
|
||||
}
|
||||
|
||||
@@ -46,13 +46,13 @@ void ConvertINT32ToExitGrid( INT32 iExitGridInfo, EXITGRID *pExitGrid )
|
||||
pExitGrid->ubGotoSectorX = (UINT8)(((iExitGridInfo & 0xf0000000)>>28)+1);
|
||||
pExitGrid->ubGotoSectorY = (UINT8)(((iExitGridInfo & 0x0f000000)>>24)+1);
|
||||
pExitGrid->ubGotoSectorZ = (UINT8)((iExitGridInfo & 0x00f00000)>>20);
|
||||
pExitGrid->usGridNo = (UINT16)(iExitGridInfo & 0x0000ffff);
|
||||
pExitGrid->sGridNo = (INT16)(iExitGridInfo & 0x0000ffff);
|
||||
}
|
||||
|
||||
BOOLEAN GetExitGrid( UINT16 usMapIndex, EXITGRID *pExitGrid )
|
||||
BOOLEAN GetExitGrid( INT16 sMapIndex, EXITGRID *pExitGrid )
|
||||
{
|
||||
LEVELNODE *pShadow;
|
||||
pShadow = gpWorldLevelData[ usMapIndex ].pShadowHead;
|
||||
pShadow = gpWorldLevelData[ sMapIndex ].pShadowHead;
|
||||
//Search through object layer for an exitgrid
|
||||
while( pShadow )
|
||||
{
|
||||
@@ -66,14 +66,14 @@ BOOLEAN GetExitGrid( UINT16 usMapIndex, EXITGRID *pExitGrid )
|
||||
pExitGrid->ubGotoSectorX = 0;
|
||||
pExitGrid->ubGotoSectorY = 0;
|
||||
pExitGrid->ubGotoSectorZ = 0;
|
||||
pExitGrid->usGridNo = 0;
|
||||
return FALSE;
|
||||
pExitGrid->sGridNo = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN ExitGridAtGridNo( UINT16 usMapIndex )
|
||||
BOOLEAN ExitGridAtGridNo( INT16 sMapIndex )
|
||||
{
|
||||
LEVELNODE *pShadow;
|
||||
pShadow = gpWorldLevelData[ usMapIndex ].pShadowHead;
|
||||
pShadow = gpWorldLevelData[ sMapIndex ].pShadowHead;
|
||||
//Search through object layer for an exitgrid
|
||||
while( pShadow )
|
||||
{
|
||||
@@ -83,13 +83,13 @@ BOOLEAN ExitGridAtGridNo( UINT16 usMapIndex )
|
||||
}
|
||||
pShadow = pShadow->pNext;
|
||||
}
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN GetExitGridLevelNode( UINT16 usMapIndex, LEVELNODE **ppLevelNode )
|
||||
BOOLEAN GetExitGridLevelNode( INT16 sMapIndex, LEVELNODE **ppLevelNode )
|
||||
{
|
||||
LEVELNODE *pShadow;
|
||||
pShadow = gpWorldLevelData[ usMapIndex ].pShadowHead;
|
||||
pShadow = gpWorldLevelData[ sMapIndex ].pShadowHead;
|
||||
//Search through object layer for an exitgrid
|
||||
while( pShadow )
|
||||
{
|
||||
@@ -100,7 +100,7 @@ BOOLEAN GetExitGridLevelNode( UINT16 usMapIndex, LEVELNODE **ppLevelNode )
|
||||
}
|
||||
pShadow = pShadow->pNext;
|
||||
}
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ void AddExitGridToWorld( INT32 iMapIndex, EXITGRID *pExitGrid )
|
||||
if( pShadow->uiFlags & LEVELNODE_EXITGRID )
|
||||
{ //we have found an existing exitgrid in this node, so replace it with the new information.
|
||||
pShadow->iExitGridInfo = ConvertExitGridToINT32( pExitGrid );
|
||||
//SmoothExitGridRadius( (UINT16)iMapIndex, 0 );
|
||||
//SmoothExitGridRadius( (INT16)iMapIndex, 0 );
|
||||
return;
|
||||
}
|
||||
pShadow = pShadow->pNext;
|
||||
@@ -134,7 +134,7 @@ void AddExitGridToWorld( INT32 iMapIndex, EXITGRID *pExitGrid )
|
||||
//Add the exit grid to the sector, only if we call ApplyMapChangesToMapTempFile() first.
|
||||
if( !gfEditMode && !gfLoadingExitGrids )
|
||||
{
|
||||
AddExitGridToMapTempFile( (UINT16)iMapIndex, pExitGrid, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
AddExitGridToMapTempFile( (INT16)iMapIndex, pExitGrid, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,17 +172,17 @@ void LoadExitGrids( INT8 **hBuffer )
|
||||
EXITGRID exitGrid;
|
||||
UINT16 x;
|
||||
UINT16 usNumSaved;
|
||||
UINT16 usMapIndex;
|
||||
INT16 sMapIndex;
|
||||
gfLoadingExitGrids = TRUE;
|
||||
LOADDATA( &usNumSaved, *hBuffer, 2 );
|
||||
//FileRead( hfile, &usNumSaved, 2, NULL);
|
||||
for( x = 0; x < usNumSaved; x++ )
|
||||
{
|
||||
LOADDATA( &usMapIndex, *hBuffer, 2 );
|
||||
//FileRead( hfile, &usMapIndex, 2, NULL);
|
||||
LOADDATA( &sMapIndex, *hBuffer, 2 );
|
||||
//FileRead( hfile, &sMapIndex, 2, NULL);
|
||||
LOADDATA( &exitGrid, *hBuffer, 5 );
|
||||
//FileRead( hfile, &exitGrid, 5, NULL);
|
||||
AddExitGridToWorld( usMapIndex, &exitGrid );
|
||||
AddExitGridToWorld( sMapIndex, &exitGrid );
|
||||
}
|
||||
gfLoadingExitGrids = FALSE;
|
||||
}
|
||||
@@ -230,11 +230,11 @@ void AttemptToChangeFloorLevel( INT8 bRelativeZLevel )
|
||||
}
|
||||
|
||||
|
||||
UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSweetGridNo, INT8 ubRadius, UINT8 *pubDirection )
|
||||
INT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSweetGridNo, INT8 ubRadius, UINT8 *pubDirection )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sGridNo;
|
||||
INT32 uiRange, uiLowestRange = 999999;
|
||||
INT16 sLowestGridNo=0;
|
||||
@@ -246,24 +246,21 @@ UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSwe
|
||||
EXITGRID ExitGrid;
|
||||
UINT8 ubGotoSectorX, ubGotoSectorY, ubGotoSectorZ;
|
||||
|
||||
//Save AI pathing vars. changing the distlimit restricts how
|
||||
//Save AI pathing vars. changing the distlimit restricts how
|
||||
//far away the pathing will consider.
|
||||
ubSaveNPCAPBudget = gubNPCAPBudget;
|
||||
ubSaveNPCDistLimit = gubNPCDistLimit;
|
||||
gubNPCAPBudget = 0;
|
||||
gubNPCDistLimit = ubRadius;
|
||||
|
||||
// WDS - Clean up inventory handling
|
||||
//create dummy soldier, and use the pathing to determine which nearby slots are
|
||||
//reachable.
|
||||
// memset( &soldier, 0, SIZEOF_SOLDIERTYPE );
|
||||
soldier.initialize();
|
||||
soldier.bLevel = 0;
|
||||
soldier.pathing.bLevel = 0;
|
||||
soldier.bTeam = 1;
|
||||
soldier.sGridNo = pSoldier->sGridNo;
|
||||
|
||||
// OK, Get an exit grid ( if possible )
|
||||
if ( !GetExitGrid( sSweetGridNo, &ExitGrid ) )
|
||||
if ( !GetExitGrid( sSweetGridNo, &ExitGrid ) )
|
||||
{
|
||||
return( NOWHERE );
|
||||
}
|
||||
@@ -276,8 +273,8 @@ UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSwe
|
||||
|
||||
sTop = ubRadius;
|
||||
sBottom = -ubRadius;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
//clear the mapelements of potential residue MAPELEMENT_REACHABLE flags
|
||||
//in the square region.
|
||||
@@ -295,11 +292,11 @@ UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSwe
|
||||
|
||||
gfPlotPathToExitGrid = TRUE;
|
||||
|
||||
//Now, find out which of these gridnos are reachable
|
||||
//Now, find out which of these gridnos are reachable
|
||||
//(use the fake soldier and the pathing settings)
|
||||
FindBestPath( &soldier, NOWHERE, 0, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE );
|
||||
|
||||
uiLowestRange = 999999;
|
||||
|
||||
uiLowestRange = 999999;
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
{
|
||||
@@ -308,13 +305,13 @@ UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSwe
|
||||
for( cnt2 = sLeft; cnt2 <= sRight; cnt2++ )
|
||||
{
|
||||
sGridNo = pSoldier->sGridNo + ( WORLD_COLS * cnt1 ) + cnt2;
|
||||
if ( sGridNo >=0 && sGridNo < WORLD_MAX && sGridNo >= leftmost && sGridNo < ( leftmost + WORLD_COLS ) &&
|
||||
if ( sGridNo >=0 && sGridNo < WORLD_MAX && sGridNo >= leftmost && sGridNo < ( leftmost + WORLD_COLS ) &&
|
||||
gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE )
|
||||
{
|
||||
// Go on sweet stop
|
||||
// ATE: Added this check because for all intensive purposes, cavewalls will be not an OKDEST
|
||||
// but we want thenm too...
|
||||
if ( NewOKDestination( pSoldier, sGridNo, TRUE, pSoldier->bLevel ) )
|
||||
if ( NewOKDestination( pSoldier, sGridNo, TRUE, pSoldier->pathing.bLevel ) )
|
||||
{
|
||||
if ( GetExitGrid( sGridNo, &ExitGrid ) )
|
||||
{
|
||||
@@ -343,7 +340,7 @@ UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSwe
|
||||
if ( fFound )
|
||||
{
|
||||
// Set direction to center of map!
|
||||
*pubDirection = (UINT8)GetDirectionToGridNoFromGridNo( sLowestGridNo, ( ( ( WORLD_ROWS / 2 ) * WORLD_COLS ) + ( WORLD_COLS / 2 ) ) );
|
||||
*pubDirection = (UINT8)GetDirectionToGridNoFromGridNo( sLowestGridNo, ( ( ( WORLD_ROWS / 2 ) * WORLD_COLS ) + ( WORLD_COLS / 2 ) ) );
|
||||
return( sLowestGridNo );
|
||||
}
|
||||
else
|
||||
@@ -353,11 +350,11 @@ UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSwe
|
||||
}
|
||||
|
||||
|
||||
UINT16 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT16 sSrcGridNo, INT8 ubRadius )
|
||||
INT16 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT16 sSrcGridNo, INT8 ubRadius )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sGridNo;
|
||||
INT32 uiRange, uiLowestRange = 999999;
|
||||
INT16 sLowestGridNo=0;
|
||||
@@ -368,11 +365,11 @@ UINT16 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT16 sSrcGridNo, INT8 ubRadi
|
||||
|
||||
sTop = ubRadius;
|
||||
sBottom = -ubRadius;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
//clear the mapelements of potential residue MAPELEMENT_REACHABLE flags
|
||||
uiLowestRange = 999999;
|
||||
uiLowestRange = 999999;
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
{
|
||||
@@ -409,3 +406,4 @@ UINT16 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT16 sSrcGridNo, INT8 ubRadi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,17 +5,18 @@
|
||||
#include "Worlddef.h"
|
||||
|
||||
typedef struct //for exit grids (object level)
|
||||
{ //if an item pool is also in same gridno, then this would be a separate levelnode
|
||||
{
|
||||
//if an item pool is also in same gridno, then this would be a separate levelnode
|
||||
//in the object level list
|
||||
UINT16 usGridNo; //sweet spot for placing mercs in new sector.
|
||||
INT16 sGridNo; //sweet spot for placing mercs in new sector.
|
||||
UINT8 ubGotoSectorX;
|
||||
UINT8 ubGotoSectorY;
|
||||
UINT8 ubGotoSectorZ;
|
||||
}EXITGRID;
|
||||
|
||||
BOOLEAN ExitGridAtGridNo( UINT16 usMapIndex );
|
||||
BOOLEAN GetExitGridLevelNode( UINT16 usMapIndex, LEVELNODE **ppLevelNode );
|
||||
BOOLEAN GetExitGrid( UINT16 usMapIndex, EXITGRID *pExitGrid );
|
||||
BOOLEAN ExitGridAtGridNo( INT16 sMapIndex );
|
||||
BOOLEAN GetExitGridLevelNode( INT16 sMapIndex, LEVELNODE **ppLevelNode );
|
||||
BOOLEAN GetExitGrid( INT16 sMapIndex, EXITGRID *pExitGrid );
|
||||
|
||||
void AddExitGridToWorld( INT32 iMapIndex, EXITGRID *pExitGrid );
|
||||
void RemoveExitGridFromWorld( INT32 iMapIndex );
|
||||
@@ -28,10 +29,10 @@ void AttemptToChangeFloorLevel( INT8 bRelativeZLevel );
|
||||
extern EXITGRID gExitGrid;
|
||||
extern BOOLEAN gfOverrideInsertionWithExitGrid;
|
||||
|
||||
// Finds closest ExitGrid of same type as is at gridno, within a radius. Checks
|
||||
// Finds closest ExitGrid of same type as is at gridno, within a radius. Checks
|
||||
// valid paths, destinations, etc.
|
||||
UINT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSweetGridNo, INT8 ubRadius, UINT8 *pubDirection );
|
||||
INT16 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT16 sSweetGridNo, INT8 ubRadius, UINT8 *pubDirection );
|
||||
|
||||
UINT16 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 ubRadius );
|
||||
INT16 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 ubRadius );
|
||||
|
||||
#endif
|
||||
|
||||
+369
-362
File diff suppressed because it is too large
Load Diff
@@ -67,12 +67,12 @@ enum EXPLOSION_TYPES
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubTransKeyFrame;
|
||||
UINT8 ubDamageKeyFrame;
|
||||
UINT32 uiExplosionSoundID;
|
||||
UINT32 uiAltExplosionSoundID;
|
||||
CHAR8 zBlastFilename[MAX_BLAST_FILENAME_LEN];
|
||||
CHAR8 sBlastSpeed;
|
||||
UINT8 ubTransKeyFrame;
|
||||
UINT8 ubDamageKeyFrame;
|
||||
UINT32 uiExplosionSoundID;
|
||||
UINT32 uiAltExplosionSoundID;
|
||||
CHAR8 zBlastFilename[MAX_BLAST_FILENAME_LEN];
|
||||
CHAR8 sBlastSpeed;
|
||||
} EXPLOSION_DATA;
|
||||
|
||||
extern EXPLOSION_DATA gExpAniData[NUM_EXP_TYPES];
|
||||
@@ -118,7 +118,7 @@ void UpdateExplosionFrame( INT32 iIndex, INT16 sCurrentFrame );
|
||||
void RemoveExplosionData( INT32 iIndex );
|
||||
|
||||
void UpdateAndDamageSAMIfFound( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, INT16 sGridNo, UINT8 ubDamage );
|
||||
void UpdateSAMDoneRepair( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
void UpdateSAMDoneRepair( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ );
|
||||
|
||||
|
||||
BOOLEAN SaveExplosionTableToSaveGameFile( HWFILE hFile );
|
||||
|
||||
@@ -16,7 +16,6 @@ void RemoveFogFromGridNo( UINT32 uiGridNo )
|
||||
{
|
||||
INT32 i;
|
||||
INT32 x, y;
|
||||
UINT32 uiAdjacentGridNo = 0;
|
||||
x = uiGridNo % WORLD_COLS;
|
||||
y = uiGridNo / WORLD_COLS;
|
||||
for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
|
||||
@@ -32,4 +31,4 @@ void RemoveFogFromGridNo( UINT32 uiGridNo )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define __FOG_OF_WAR_H
|
||||
|
||||
|
||||
//Called after a map is loaded. By keying on the MAPELEMENT_REVEALED value, we can easily
|
||||
//Called after a map is loaded. By keying on the MAPELEMENT_REVEALED value, we can easily
|
||||
//determine what is hidden by the fog.
|
||||
void InitializeFogInWorld();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ typedef struct
|
||||
|
||||
} INTERACTIVE_TILE_STACK_TYPE;
|
||||
|
||||
|
||||
|
||||
INTERACTIVE_TILE_STACK_TYPE gCurIntTileStack;
|
||||
BOOLEAN gfCycleIntTile = FALSE;
|
||||
|
||||
@@ -106,12 +106,12 @@ BOOLEAN StartInteractiveObject( INT16 sGridNo, UINT16 usStructureID, SOLDIERTYPE
|
||||
{
|
||||
STRUCTURE * pStructure;
|
||||
|
||||
// ATE: Patch fix: Don't allow if alreay in animation
|
||||
if ( pSoldier->usAnimState == OPEN_STRUCT || pSoldier->usAnimState == OPEN_STRUCT_CROUCHED ||
|
||||
pSoldier->usAnimState == BEGIN_OPENSTRUCT || pSoldier->usAnimState == BEGIN_OPENSTRUCT_CROUCHED )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
// ATE: Patch fix: Don't allow if alreay in animation
|
||||
if ( pSoldier->usAnimState == OPEN_STRUCT || pSoldier->usAnimState == OPEN_STRUCT_CROUCHED ||
|
||||
pSoldier->usAnimState == BEGIN_OPENSTRUCT || pSoldier->usAnimState == BEGIN_OPENSTRUCT_CROUCHED )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
pStructure = FindStructureByID( sGridNo, usStructureID );
|
||||
if (pStructure == NULL)
|
||||
@@ -121,22 +121,22 @@ BOOLEAN StartInteractiveObject( INT16 sGridNo, UINT16 usStructureID, SOLDIERTYPE
|
||||
if (pStructure->fFlags & STRUCTURE_ANYDOOR)
|
||||
{
|
||||
// Add soldier event for opening door....
|
||||
pSoldier->ubPendingAction = MERC_OPENDOOR;
|
||||
pSoldier->uiPendingActionData1 = usStructureID;
|
||||
pSoldier->sPendingActionData2 = sGridNo;
|
||||
pSoldier->bPendingActionData3 = ubDirection;
|
||||
pSoldier->ubPendingActionAnimCount = 0;
|
||||
pSoldier->aiData.ubPendingAction = MERC_OPENDOOR;
|
||||
pSoldier->aiData.uiPendingActionData1 = usStructureID;
|
||||
pSoldier->aiData.sPendingActionData2 = sGridNo;
|
||||
pSoldier->aiData.bPendingActionData3 = ubDirection;
|
||||
pSoldier->aiData.ubPendingActionAnimCount = 0;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add soldier event for opening door....
|
||||
pSoldier->ubPendingAction = MERC_OPENSTRUCT;
|
||||
pSoldier->uiPendingActionData1 = usStructureID;
|
||||
pSoldier->sPendingActionData2 = sGridNo;
|
||||
pSoldier->bPendingActionData3 = ubDirection;
|
||||
pSoldier->ubPendingActionAnimCount = 0;
|
||||
pSoldier->aiData.ubPendingAction = MERC_OPENSTRUCT;
|
||||
pSoldier->aiData.uiPendingActionData1 = usStructureID;
|
||||
pSoldier->aiData.sPendingActionData2 = sGridNo;
|
||||
pSoldier->aiData.bPendingActionData3 = ubDirection;
|
||||
pSoldier->aiData.ubPendingActionAnimCount = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ BOOLEAN CalcInteractiveObjectAPs( INT16 sGridNo, STRUCTURE * pStructure, INT16 *
|
||||
// *psAPCost = 0;
|
||||
// *psBPCost = 0;
|
||||
//}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*psAPCost = AP_OPEN_DOOR;
|
||||
@@ -187,7 +187,7 @@ BOOLEAN InteractWithInteractiveObject( SOLDIERTYPE *pSoldier, STRUCTURE *pStruct
|
||||
if (pStructure->fFlags & STRUCTURE_ANYDOOR)
|
||||
{
|
||||
fDoor = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
InteractWithOpenableStruct( pSoldier, pStructure, ubDirection, fDoor );
|
||||
|
||||
@@ -200,10 +200,10 @@ BOOLEAN SoldierHandleInteractiveObject( SOLDIERTYPE *pSoldier )
|
||||
STRUCTURE *pStructure;
|
||||
UINT16 usStructureID;
|
||||
INT16 sGridNo;
|
||||
|
||||
|
||||
sGridNo = pSoldier->sPendingActionData2;
|
||||
usStructureID = (UINT16)pSoldier->uiPendingActionData1;
|
||||
|
||||
sGridNo = pSoldier->aiData.sPendingActionData2;
|
||||
usStructureID = (UINT16)pSoldier->aiData.uiPendingActionData1;
|
||||
|
||||
// HANDLE SOLDIER ACTIONS
|
||||
pStructure = FindStructureByID( sGridNo, usStructureID );
|
||||
@@ -212,23 +212,22 @@ BOOLEAN SoldierHandleInteractiveObject( SOLDIERTYPE *pSoldier )
|
||||
//DEBUG MSG!
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( HandleOpenableStruct( pSoldier, sGridNo, pStructure ) );
|
||||
|
||||
return( HandleOpenableStruct( pSoldier, sGridNo, pStructure ) );
|
||||
}
|
||||
|
||||
void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
{
|
||||
STRUCTURE *pStructure, *pNewStructure;
|
||||
//INT16 sAPCost = 0, sBPCost = 0;
|
||||
ITEM_POOL *pItemPool;
|
||||
BOOLEAN fDidMissingQuote = FALSE;
|
||||
BOOLEAN fDidMissingQuote = FALSE;
|
||||
|
||||
pStructure = FindStructure( sGridNo, STRUCTURE_OPENABLE );
|
||||
|
||||
if ( pStructure == NULL )
|
||||
{
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"ERROR: Told to handle struct that does not exist at %d.", sGridNo );
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"ERROR: Told to handle struct that does not exist at %d.", sGridNo );
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -237,12 +236,12 @@ void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
if ( !( pStructure->fFlags & STRUCTURE_OPEN ) )
|
||||
{
|
||||
// Play Opening sound...
|
||||
PlayJA2Sample( GetStructureOpenSound( pStructure, FALSE ), RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
PlayJA2Sample( GetStructureOpenSound( pStructure, FALSE ), RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Play Opening sound...
|
||||
PlayJA2Sample( ( GetStructureOpenSound( pStructure, TRUE ) ), RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
PlayJA2Sample( ( GetStructureOpenSound( pStructure, TRUE ) ), RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
|
||||
// ATE: Don't handle switches!
|
||||
@@ -255,7 +254,7 @@ void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
SetFactFalse( 38); // Reset whether we punched Pablo lately
|
||||
SetFactFalse( FACT_PABLO_RETURNED_GOODS);
|
||||
SayQuoteFromNearbyMercInSector( BOBBYR_SHIPPING_DEST_GRIDNO, 3, QUOTE_STUFF_MISSING_DRASSEN );
|
||||
fDidMissingQuote = TRUE;
|
||||
fDidMissingQuote = TRUE;
|
||||
}
|
||||
}
|
||||
else if ( pSoldier->bTeam == CIV_TEAM )
|
||||
@@ -268,7 +267,7 @@ void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
|
||||
|
||||
// LOOK for item pool here...
|
||||
if ( GetItemPool( (INT16)sGridNo, &pItemPool, pSoldier->bLevel ) )
|
||||
if ( GetItemPool( (INT16)sGridNo, &pItemPool, pSoldier->pathing.bLevel ) )
|
||||
{
|
||||
// Update visiblity....
|
||||
if ( !( pStructure->fFlags & STRUCTURE_OPEN ) )
|
||||
@@ -283,7 +282,7 @@ void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
}
|
||||
|
||||
// Look for ownership here....
|
||||
if ( gWorldItems[ pItemPool->iItemIndex ].o.usItem == OWNERSHIP )
|
||||
if ( gWorldItems[ pItemPool->iItemIndex ].object.usItem == OWNERSHIP )
|
||||
{
|
||||
fDoHumm = FALSE;
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_DO_BATTLE_SND, BATTLE_SOUND_NOTHING , 500 );
|
||||
@@ -296,24 +295,24 @@ void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
//TacticalCharacterDialogue( pSoldier, (UINT16)( QUOTE_SPOTTED_SOMETHING_ONE + Random( 2 ) ) );
|
||||
|
||||
// ATE: Check now many things in pool.....
|
||||
if ( !fDidMissingQuote )
|
||||
{
|
||||
if ( pItemPool->pNext != NULL )
|
||||
{
|
||||
if ( pItemPool->pNext->pNext != NULL )
|
||||
{
|
||||
fDoHumm = FALSE;
|
||||
if ( !fDidMissingQuote )
|
||||
{
|
||||
if ( pItemPool->pNext != NULL )
|
||||
{
|
||||
if ( pItemPool->pNext->pNext != NULL )
|
||||
{
|
||||
fDoHumm = FALSE;
|
||||
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_DO_BATTLE_SND, BATTLE_SOUND_COOL1 , 500 );
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_DO_BATTLE_SND, BATTLE_SOUND_COOL1 , 500 );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( fDoHumm )
|
||||
{
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_DO_BATTLE_SND, BATTLE_SOUND_HUMM , 500 );
|
||||
}
|
||||
}
|
||||
if ( fDoHumm )
|
||||
{
|
||||
TacticalCharacterDialogueWithSpecialEvent( pSoldier, 0, DIALOGUE_SPECIAL_EVENT_DO_BATTLE_SND, BATTLE_SOUND_HUMM , 500 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -352,10 +351,10 @@ void HandleStructChangeFromGridNo( SOLDIERTYPE *pSoldier, INT16 sGridNo )
|
||||
|
||||
|
||||
UINT32 GetInteractiveTileCursor( UINT32 uiOldCursor, BOOLEAN fConfirm )
|
||||
{
|
||||
LEVELNODE *pIntNode;
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sGridNo;
|
||||
{
|
||||
LEVELNODE *pIntNode;
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sGridNo;
|
||||
|
||||
// OK, first see if we have an in tile...
|
||||
pIntNode = GetCurInteractiveTileGridNoAndStructure( &sGridNo, &pStructure );
|
||||
@@ -378,11 +377,11 @@ UINT32 GetInteractiveTileCursor( UINT32 uiOldCursor, BOOLEAN fConfirm )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pStructure->fFlags & STRUCTURE_SWITCH )
|
||||
{
|
||||
wcscpy( gzIntTileLocation, gzLateLocalizedString[ 25 ] );
|
||||
gfUIIntTileLocation = TRUE;
|
||||
}
|
||||
if( pStructure->fFlags & STRUCTURE_SWITCH )
|
||||
{
|
||||
wcscpy( gzIntTileLocation, gzLateLocalizedString[ 25 ] );
|
||||
gfUIIntTileLocation = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if ( fConfirm )
|
||||
@@ -399,18 +398,18 @@ UINT32 GetInteractiveTileCursor( UINT32 uiOldCursor, BOOLEAN fConfirm )
|
||||
|
||||
return( uiOldCursor );
|
||||
}
|
||||
|
||||
void SetActionModeDoorCursorText( )
|
||||
{
|
||||
LEVELNODE *pIntNode;
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sGridNo;
|
||||
|
||||
// If we are over a merc, don't
|
||||
if ( gfUIFullTargetFound )
|
||||
{
|
||||
return;
|
||||
}
|
||||
void SetActionModeDoorCursorText( )
|
||||
{
|
||||
LEVELNODE *pIntNode;
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sGridNo;
|
||||
|
||||
// If we are over a merc, don't
|
||||
if ( gfUIFullTargetFound )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// OK, first see if we have an in tile...
|
||||
pIntNode = GetCurInteractiveTileGridNoAndStructure( &sGridNo, &pStructure );
|
||||
@@ -433,7 +432,7 @@ void GetLevelNodeScreenRect( LEVELNODE *pNode, SGPRect *pRect, INT16 sXPos, INT1
|
||||
ETRLEObject *pTrav;
|
||||
UINT32 usHeight, usWidth;
|
||||
TILE_ELEMENT *TileElem;
|
||||
|
||||
|
||||
|
||||
|
||||
// Get 'TRUE' merc position
|
||||
@@ -449,7 +448,7 @@ void GetLevelNodeScreenRect( LEVELNODE *pNode, SGPRect *pRect, INT16 sXPos, INT1
|
||||
else
|
||||
{
|
||||
TileElem = &(gTileDatabase[pNode->usIndex]);
|
||||
|
||||
|
||||
//Adjust for current frames and animations....
|
||||
if ( TileElem->uiFlags & ANIMATED_TILE)
|
||||
{
|
||||
@@ -458,7 +457,7 @@ void GetLevelNodeScreenRect( LEVELNODE *pNode, SGPRect *pRect, INT16 sXPos, INT1
|
||||
}
|
||||
else if( ( pNode->uiFlags & LEVELNODE_ANIMATION ) )
|
||||
{
|
||||
if ( pNode->sCurrentFrame != -1 )
|
||||
if ( pNode->sCurrentFrame != -1 )
|
||||
{
|
||||
Assert( TileElem->pAnimData != NULL );
|
||||
TileElem = &gTileDatabase[TileElem->pAnimData->pusFrames[pNode->sCurrentFrame]];
|
||||
@@ -525,7 +524,7 @@ void LogMouseOverInteractiveTile( INT16 sGridNo )
|
||||
}
|
||||
|
||||
// Also, don't allow for mercs who are on upper level...
|
||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->bLevel == 1 )
|
||||
if ( gusSelectedSoldier != NOBODY && MercPtrs[ gusSelectedSoldier ]->pathing.bLevel == 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -653,7 +652,7 @@ LEVELNODE *GetCurInteractiveTile( )
|
||||
LEVELNODE *GetCurInteractiveTileGridNo( INT16 *psGridNo )
|
||||
{
|
||||
LEVELNODE *pNode;
|
||||
|
||||
|
||||
pNode = GetCurInteractiveTile( );
|
||||
|
||||
if ( pNode != NULL )
|
||||
@@ -676,7 +675,7 @@ LEVELNODE *ConditionalGetCurInteractiveTileGridNoAndStructure( INT16 *psGridNo,
|
||||
STRUCTURE *pStructure;
|
||||
|
||||
*ppStructure = NULL;
|
||||
|
||||
|
||||
pNode = InternalGetCurInteractiveTile( fRejectOnTopItems );
|
||||
|
||||
if ( pNode != NULL )
|
||||
@@ -751,16 +750,16 @@ void EndCurInteractiveTileCheck( )
|
||||
}
|
||||
|
||||
gCurIntTile.sGridNo = pCurIntTile->sFoundGridNo;
|
||||
gCurIntTile.sTileIndex = pCurIntTile->pFoundNode->usIndex;
|
||||
gCurIntTile.sTileIndex = pCurIntTile->pFoundNode->usIndex;
|
||||
|
||||
if ( pCurIntTile->pFoundNode->pStructureData != NULL )
|
||||
{
|
||||
gCurIntTile.usStructureID = pCurIntTile->pFoundNode->pStructureData->usStructureID;
|
||||
gCurIntTile.fStructure = TRUE;
|
||||
gCurIntTile.fStructure = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurIntTile.fStructure = FALSE;
|
||||
gCurIntTile.fStructure = FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -781,8 +780,8 @@ void EndCurInteractiveTileCheck( )
|
||||
BOOLEAN RefineLogicOnStruct( INT16 sGridNo, LEVELNODE *pNode )
|
||||
{
|
||||
TILE_ELEMENT *TileElem;
|
||||
STRUCTURE *pStructure;
|
||||
|
||||
STRUCTURE *pStructure;
|
||||
|
||||
|
||||
if ( pNode->uiFlags & LEVELNODE_CACHEDANITILE )
|
||||
{
|
||||
@@ -839,7 +838,7 @@ BOOLEAN RefineLogicOnStruct( INT16 sGridNo, LEVELNODE *pNode )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -885,7 +884,7 @@ BOOLEAN RefineLogicOnStruct( INT16 sGridNo, LEVELNODE *pNode )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if it's a hidden struct and we have not revealed anything!
|
||||
if ( TileElem->uiFlags & HIDDEN_TILE )
|
||||
{
|
||||
@@ -908,7 +907,7 @@ BOOLEAN RefinePointCollisionOnStruct( INT16 sGridNo, INT16 sTestX, INT16 sTestY,
|
||||
if ( pNode->uiFlags & LEVELNODE_CACHEDANITILE )
|
||||
{
|
||||
//Check it!
|
||||
return ( CheckVideoObjectScreenCoordinateInData( gpTileCache[ pNode->pAniTile->sCachedTileID ].pImagery->vo, pNode->pAniTile->sCurrentFrame, (INT32)( sTestX - sSrcX ), (INT32)( -1 * ( sTestY - sSrcY ) ) ) );
|
||||
return ( CheckVideoObjectScreenCoordinateInData( gpTileCache[ pNode->pAniTile->sCachedTileID ].pImagery->vo, pNode->pAniTile->sCurrentFrame, (INT32)( sTestX - sSrcX ), (INT32)( -1 * ( sTestY - sSrcY ) ) ) );
|
||||
|
||||
}
|
||||
else
|
||||
@@ -923,7 +922,7 @@ BOOLEAN RefinePointCollisionOnStruct( INT16 sGridNo, INT16 sTestX, INT16 sTestY,
|
||||
}
|
||||
else if( ( pNode->uiFlags & LEVELNODE_ANIMATION ) )
|
||||
{
|
||||
if ( pNode->sCurrentFrame != -1 )
|
||||
if ( pNode->sCurrentFrame != -1 )
|
||||
{
|
||||
Assert( TileElem->pAnimData != NULL );
|
||||
TileElem = &gTileDatabase[TileElem->pAnimData->pusFrames[pNode->sCurrentFrame]];
|
||||
@@ -931,7 +930,7 @@ BOOLEAN RefinePointCollisionOnStruct( INT16 sGridNo, INT16 sTestX, INT16 sTestY,
|
||||
}
|
||||
|
||||
//Check it!
|
||||
return ( CheckVideoObjectScreenCoordinateInData( TileElem->hTileSurface, TileElem->usRegionIndex, (INT32)( sTestX - sSrcX ), (INT32)( -1 * ( sTestY - sSrcY ) ) ) );
|
||||
return ( CheckVideoObjectScreenCoordinateInData( TileElem->hTileSurface, TileElem->usRegionIndex, (INT32)( sTestX - sSrcX ), (INT32)( -1 * ( sTestY - sSrcY ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -942,12 +941,12 @@ BOOLEAN CheckVideoObjectScreenCoordinateInData( HVOBJECT hSrcVObject, UINT16 usI
|
||||
{
|
||||
UINT32 uiOffset;
|
||||
UINT32 usHeight, usWidth;
|
||||
UINT8 *SrcPtr;
|
||||
UINT8 *SrcPtr;
|
||||
UINT32 LineSkip;
|
||||
ETRLEObject *pTrav;
|
||||
BOOLEAN fDataFound = FALSE;
|
||||
INT32 iTestPos, iStartPos;
|
||||
|
||||
BOOLEAN fDataFound = FALSE;
|
||||
INT32 iTestPos, iStartPos;
|
||||
|
||||
// Assertions
|
||||
Assert( hSrcVObject != NULL );
|
||||
|
||||
@@ -962,7 +961,7 @@ BOOLEAN CheckVideoObjectScreenCoordinateInData( HVOBJECT hSrcVObject, UINT16 usI
|
||||
// Calculate from 0, 0 at top left!
|
||||
iTestPos = ( ( usHeight - iTestY ) * usWidth ) + iTestX;
|
||||
iStartPos = 0;
|
||||
LineSkip = usWidth;
|
||||
LineSkip = usWidth;
|
||||
|
||||
SrcPtr= (UINT8 *)hSrcVObject->pPixData + uiOffset;
|
||||
|
||||
@@ -989,7 +988,7 @@ BlitDispatch:
|
||||
jnc BlitNTL2
|
||||
|
||||
inc esi
|
||||
|
||||
|
||||
// Check
|
||||
cmp edi, iTestPos
|
||||
je BlitFound
|
||||
@@ -1029,7 +1028,7 @@ BlitNTL4:
|
||||
cmp edi, iTestPos
|
||||
je BlitFound
|
||||
add edi, 1
|
||||
|
||||
|
||||
// Check
|
||||
cmp edi, iTestPos
|
||||
je BlitFound
|
||||
@@ -1059,7 +1058,7 @@ BlitTransparent:
|
||||
|
||||
|
||||
BlitDoneLine:
|
||||
|
||||
|
||||
// Here check if we have passed!
|
||||
cmp edi, iTestPos
|
||||
jge BlitDone
|
||||
@@ -1079,7 +1078,7 @@ BlitDone:
|
||||
|
||||
return(fDataFound);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ShouldCheckForMouseDetections( )
|
||||
@@ -1087,8 +1086,8 @@ BOOLEAN ShouldCheckForMouseDetections( )
|
||||
BOOLEAN fOK = FALSE;
|
||||
|
||||
if ( gsINTOldRenderCenterX != gsRenderCenterX || gsINTOldRenderCenterY != gsRenderCenterY ||
|
||||
gusINTOldMousePosX != gusMouseXPos || gusINTOldMousePosY != gusMouseYPos )
|
||||
{
|
||||
gusINTOldMousePosX != gusMouseXPos || gusINTOldMousePosY != gusMouseYPos )
|
||||
{
|
||||
fOK = TRUE;
|
||||
}
|
||||
|
||||
@@ -1103,7 +1102,7 @@ BOOLEAN ShouldCheckForMouseDetections( )
|
||||
}
|
||||
|
||||
|
||||
void CycleIntTileFindStack( UINT16 usMapPos )
|
||||
void CycleIntTileFindStack( INT16 sMapPos )
|
||||
{
|
||||
gfCycleIntTile = TRUE;
|
||||
|
||||
@@ -1117,4 +1116,4 @@ void CycleIntTileFindStack( UINT16 usMapPos )
|
||||
{
|
||||
gCurIntTileStack.bCur = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ BOOLEAN AddInteractiveTile( INT16 sGridNo, LEVELNODE *pLevelNode, UINT32 uiFlags
|
||||
BOOLEAN StartInteractiveObject( INT16 sGridNo, UINT16 usStructureID, SOLDIERTYPE *pSoldier, UINT8 ubDirection );
|
||||
BOOLEAN StartInteractiveObjectFromMouse( SOLDIERTYPE *pSoldier, UINT8 ubDirection );
|
||||
void CompileInteractiveTiles( );
|
||||
UINT32 GetInteractiveTileCursor( UINT32 uiOldCursor, BOOLEAN fConfirm );
|
||||
UINT32 GetInteractiveTileCursor( UINT32 uiOldCursor, BOOLEAN fConfirm );
|
||||
BOOLEAN InteractWithInteractiveObject( SOLDIERTYPE *pSoldier, STRUCTURE *pStructure, UINT8 ubDirection );
|
||||
BOOLEAN SoldierHandleInteractiveObject( SOLDIERTYPE *pSoldier );
|
||||
|
||||
@@ -35,7 +35,7 @@ void EndCurInteractiveTileCheck( );
|
||||
void LogMouseOverInteractiveTile( INT16 sGridNo );
|
||||
BOOLEAN ShouldCheckForMouseDetections( );
|
||||
|
||||
void CycleIntTileFindStack( UINT16 usMapPos );
|
||||
void CycleIntTileFindStack( INT16 sMapPos );
|
||||
void SetActionModeDoorCursorText( );
|
||||
|
||||
LEVELNODE *GetCurInteractiveTile( );
|
||||
|
||||
+143
-143
@@ -25,19 +25,19 @@ UINT32 guiForceRefreshMousePositionCalculation = 0;
|
||||
// GLOBALS
|
||||
INT16 DirIncrementer[8] =
|
||||
{
|
||||
-MAPWIDTH, //N
|
||||
1-MAPWIDTH, //NE
|
||||
1, //E
|
||||
1+MAPWIDTH, //SE
|
||||
MAPWIDTH, //S
|
||||
MAPWIDTH-1, //SW
|
||||
-1, //W
|
||||
-MAPWIDTH-1 //NW
|
||||
-MAPWIDTH, //N
|
||||
1-MAPWIDTH, //NE
|
||||
1, //E
|
||||
1+MAPWIDTH, //SE
|
||||
MAPWIDTH, //S
|
||||
MAPWIDTH-1, //SW
|
||||
-1, //W
|
||||
-MAPWIDTH-1 //NW
|
||||
|
||||
};
|
||||
|
||||
// Opposite directions
|
||||
UINT8 gOppositeDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
UINT8 gOppositeDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
{
|
||||
SOUTH,
|
||||
SOUTHWEST,
|
||||
@@ -50,7 +50,7 @@ UINT8 gOppositeDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
|
||||
};
|
||||
|
||||
UINT8 gTwoCCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
UINT8 gTwoCCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
{
|
||||
WEST,
|
||||
NORTHWEST,
|
||||
@@ -63,7 +63,7 @@ UINT8 gTwoCCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
|
||||
};
|
||||
|
||||
UINT8 gTwoCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
UINT8 gTwoCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
{
|
||||
EAST,
|
||||
SOUTHEAST,
|
||||
@@ -77,7 +77,7 @@ UINT8 gTwoCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
};
|
||||
|
||||
|
||||
UINT8 gOneCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
UINT8 gOneCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
{
|
||||
NORTHEAST,
|
||||
EAST,
|
||||
@@ -89,7 +89,7 @@ UINT8 gOneCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
NORTH
|
||||
};
|
||||
|
||||
UINT8 gOneCCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
UINT8 gOneCCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
{
|
||||
NORTHWEST,
|
||||
NORTH,
|
||||
@@ -101,7 +101,7 @@ UINT8 gOneCCDirection[ NUM_WORLD_DIRECTIONS ] =
|
||||
WEST
|
||||
};
|
||||
|
||||
// DIRECTION FACING DIRECTION WE WANT TO GOTO
|
||||
// DIRECTION FACING DIRECTION WE WANT TO GOTO
|
||||
UINT8 gPurpendicularDirection[ NUM_WORLD_DIRECTIONS ][ NUM_WORLD_DIRECTIONS ] =
|
||||
{
|
||||
// NORTH
|
||||
@@ -198,8 +198,8 @@ void FromCellToScreenCoordinates( INT16 sCellX, INT16 sCellY, INT16 *psScreenX,
|
||||
|
||||
void FromScreenToCellCoordinates( INT16 sScreenX, INT16 sScreenY, INT16 *psCellX, INT16 *psCellY )
|
||||
{
|
||||
*psCellX = ( ( sScreenX + ( 2 * sScreenY ) ) / 4 );
|
||||
*psCellY = ( ( 2 * sScreenY ) - sScreenX ) / 4;
|
||||
*psCellX = ( ( sScreenX + ( 2 * sScreenY ) ) / 4 );
|
||||
*psCellY = ( ( 2 * sScreenY ) - sScreenX ) / 4;
|
||||
}
|
||||
|
||||
// These two functions take into account that our world is projected and attached
|
||||
@@ -209,7 +209,7 @@ void FromScreenToCellCoordinates( INT16 sScreenX, INT16 sScreenY, INT16 *psCellX
|
||||
void FloatFromCellToScreenCoordinates( FLOAT dCellX, FLOAT dCellY, FLOAT *pdScreenX, FLOAT *pdScreenY )
|
||||
{
|
||||
FLOAT dScreenX, dScreenY;
|
||||
|
||||
|
||||
dScreenX = ( 2 * dCellX ) - ( 2 * dCellY );
|
||||
dScreenY = dCellX + dCellY;
|
||||
|
||||
@@ -221,14 +221,14 @@ void FloatFromScreenToCellCoordinates( FLOAT dScreenX, FLOAT dScreenY, FLOAT *pd
|
||||
{
|
||||
FLOAT dCellX, dCellY;
|
||||
|
||||
dCellX = ( ( dScreenX + ( 2 * dScreenY ) ) / 4 );
|
||||
dCellY = ( ( 2 * dScreenY ) - dScreenX ) / 4;
|
||||
dCellX = ( ( dScreenX + ( 2 * dScreenY ) ) / 4 );
|
||||
dCellY = ( ( 2 * dScreenY ) - dScreenX ) / 4;
|
||||
|
||||
*pdCellX = dCellX;
|
||||
*pdCellY = dCellY;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOLEAN GetMouseXY( INT16 *psMouseX, INT16 *psMouseY )
|
||||
{
|
||||
INT16 sWorldX, sWorldY;
|
||||
@@ -274,9 +274,9 @@ BOOLEAN GetMouseWorldCoords( INT16 *psMouseX, INT16 *psMouseY )
|
||||
INT16 sOffsetX, sOffsetY;
|
||||
INT16 sTempPosX_W, sTempPosY_W;
|
||||
INT16 sStartPointX_W, sStartPointY_W;
|
||||
|
||||
|
||||
// Convert mouse screen coords into offset from center
|
||||
if ( ! ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA ) )
|
||||
if ( ! ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA ) )
|
||||
{
|
||||
*psMouseX = 0;
|
||||
*psMouseY = 0;
|
||||
@@ -301,7 +301,7 @@ BOOLEAN GetMouseWorldCoords( INT16 *psMouseX, INT16 *psMouseY )
|
||||
|
||||
|
||||
// check if we are out of bounds..
|
||||
if ( sStartPointX_W < 0 || sStartPointX_W >= WORLD_COORD_ROWS || sStartPointY_W < 0 || sStartPointY_W >= WORLD_COORD_COLS )
|
||||
if ( sStartPointX_W < 0 || sStartPointX_W >= WORLD_COORD_ROWS || sStartPointY_W < 0 || sStartPointY_W >= WORLD_COORD_COLS )
|
||||
{
|
||||
*psMouseX = 0;
|
||||
*psMouseY = 0;
|
||||
@@ -329,8 +329,8 @@ BOOLEAN GetMouseWorldCoordsInCenter( INT16 *psMouseX, INT16 *psMouseY )
|
||||
}
|
||||
|
||||
// Now adjust these cell coords into world coords
|
||||
*psMouseX = ( ( sMouseX ) * CELL_X_SIZE ) + ( CELL_X_SIZE / 2 );
|
||||
*psMouseY = ( ( sMouseY ) * CELL_Y_SIZE ) + ( CELL_Y_SIZE / 2 );
|
||||
*psMouseX = ( ( sMouseX ) * CELL_X_SIZE ) + ( CELL_X_SIZE / 2 );
|
||||
*psMouseY = ( ( sMouseY ) * CELL_Y_SIZE ) + ( CELL_Y_SIZE / 2 );
|
||||
|
||||
|
||||
return( TRUE );
|
||||
@@ -338,62 +338,62 @@ BOOLEAN GetMouseWorldCoordsInCenter( INT16 *psMouseX, INT16 *psMouseY )
|
||||
|
||||
#if 0
|
||||
// 0verhaul
|
||||
// I did that (or actually uncasted a bunch of stuff and re-typed others to correct them), so
|
||||
// I did that (or actually uncasted a bunch of stuff and re-typed others to correct them), so
|
||||
// no worries
|
||||
// (jonathanl) to save me having to cast all the previous code
|
||||
BOOLEAN GetMouseMapPos( UINT16 *psMapPos )
|
||||
BOOLEAN GetMouseMapPos( INT16 *psMapPos )
|
||||
{
|
||||
return GetMouseMapPos( (INT16 *)psMapPos );
|
||||
return GetMouseMapPos( (INT16 *)psMapPos );
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOLEAN GetMouseMapPos( UINT16 *pusMapPos )
|
||||
BOOLEAN GetMouseMapPos( INT16 *pusMapPos )
|
||||
{
|
||||
INT16 sWorldX, sWorldY;
|
||||
static INT16 sSameCursorPos;
|
||||
static UINT32 uiOldFrameNumber = 99999;
|
||||
INT16 sWorldX, sWorldY;
|
||||
static INT16 sSameCursorPos;
|
||||
static UINT32 uiOldFrameNumber = 99999;
|
||||
|
||||
// Check if this is the same frame as before, return already calculated value if so!
|
||||
if ( uiOldFrameNumber == guiGameCycleCounter && !guiForceRefreshMousePositionCalculation )
|
||||
{
|
||||
( *pusMapPos ) = sSameCursorPos;
|
||||
// Check if this is the same frame as before, return already calculated value if so!
|
||||
if ( uiOldFrameNumber == guiGameCycleCounter && !guiForceRefreshMousePositionCalculation )
|
||||
{
|
||||
( *pusMapPos ) = sSameCursorPos;
|
||||
|
||||
if ( sSameCursorPos == 0 )
|
||||
{
|
||||
if ( sSameCursorPos == 0 )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
uiOldFrameNumber = guiGameCycleCounter;
|
||||
guiForceRefreshMousePositionCalculation = FALSE;
|
||||
uiOldFrameNumber = guiGameCycleCounter;
|
||||
guiForceRefreshMousePositionCalculation = FALSE;
|
||||
|
||||
|
||||
if ( GetMouseXY( &sWorldX, &sWorldY ) )
|
||||
{
|
||||
if ( GetMouseXY( &sWorldX, &sWorldY ) )
|
||||
{
|
||||
*pusMapPos = MAPROWCOLTOPOS( sWorldY, sWorldX );
|
||||
sSameCursorPos = (*pusMapPos);
|
||||
return( TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
*pusMapPos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pusMapPos = 0;
|
||||
sSameCursorPos = (*pusMapPos);
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOLEAN ConvertMapPosToWorldTileCenter( UINT16 usMapPos, INT16 *psXPos, INT16 *psYPos )
|
||||
BOOLEAN ConvertMapPosToWorldTileCenter( INT16 sMapPos, INT16 *psXPos, INT16 *psYPos )
|
||||
{
|
||||
INT16 sWorldX, sWorldY;
|
||||
INT16 sCellX, sCellY;
|
||||
|
||||
// Get X, Y world GRID Coordinates
|
||||
sWorldY = ( usMapPos / WORLD_COLS );
|
||||
sWorldX = usMapPos - ( sWorldY * WORLD_COLS );
|
||||
sWorldY = ( sMapPos / WORLD_COLS );
|
||||
sWorldX = sMapPos - ( sWorldY * WORLD_COLS );
|
||||
|
||||
// Convert into cell coords
|
||||
sCellY = sWorldY * CELL_Y_SIZE;
|
||||
@@ -402,7 +402,7 @@ BOOLEAN ConvertMapPosToWorldTileCenter( UINT16 usMapPos, INT16 *psXPos, INT16 *p
|
||||
// Add center tile positions
|
||||
*psXPos = sCellX + ( CELL_X_SIZE / 2 );
|
||||
*psYPos = sCellY + ( CELL_Y_SIZE / 2 );
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ void GetScreenXYWorldCoords( INT16 sScreenX, INT16 sScreenY, INT16 *psWorldX, IN
|
||||
INT16 sOffsetX, sOffsetY;
|
||||
INT16 sTempPosX_W, sTempPosY_W;
|
||||
INT16 sStartPointX_W, sStartPointY_W;
|
||||
|
||||
|
||||
// Convert mouse screen coords into offset from center
|
||||
sOffsetX = sScreenX - ( gsVIEWPORT_END_X - gsVIEWPORT_START_X ) /2;
|
||||
sOffsetY = sScreenY - ( gsVIEWPORT_END_Y - gsVIEWPORT_START_Y ) /2;
|
||||
@@ -430,7 +430,7 @@ void GetScreenXYWorldCoords( INT16 sScreenX, INT16 sScreenY, INT16 *psWorldX, IN
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GetScreenXYWorldCell( INT16 sScreenX, INT16 sScreenY, INT16 *psWorldCellX, INT16 *psWorldCellY )
|
||||
{
|
||||
INT16 sWorldX, sWorldY;
|
||||
@@ -451,18 +451,18 @@ void GetScreenXYGridNo( INT16 sScreenX, INT16 sScreenY, INT16 *psMapPos )
|
||||
GetScreenXYWorldCell( sScreenX, sScreenY, &sWorldX, &sWorldY );
|
||||
|
||||
*psMapPos = MAPROWCOLTOPOS( sWorldY, sWorldX );
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GetWorldXYAbsoluteScreenXY( INT32 sWorldCellX, INT32 sWorldCellY, INT16 *psWorldScreenX, INT16 *psWorldScreenY )
|
||||
{
|
||||
INT16 sScreenCenterX, sScreenCenterY;
|
||||
INT16 sDistToCenterY, sDistToCenterX;
|
||||
|
||||
|
||||
// Find the diustance from render center to true world center
|
||||
sDistToCenterX = (INT16) ( ( sWorldCellX * CELL_X_SIZE ) - gCenterWorldX);
|
||||
sDistToCenterY = (INT16) ( ( sWorldCellY * CELL_Y_SIZE ) - gCenterWorldY);
|
||||
|
||||
|
||||
|
||||
// From render center in world coords, convert to render center in "screen" coords
|
||||
|
||||
@@ -482,24 +482,24 @@ void GetFromAbsoluteScreenXYWorldXY( INT32 *psWorldCellX, INT32* psWorldCellY, I
|
||||
{
|
||||
INT16 sWorldCenterX, sWorldCenterY;
|
||||
INT16 sDistToCenterY, sDistToCenterX;
|
||||
|
||||
|
||||
// Subtract screen center
|
||||
sDistToCenterX = sWorldScreenX - gsCX + gsTLX;
|
||||
sDistToCenterY = sWorldScreenY - gsCY + gsTLY;
|
||||
|
||||
|
||||
// From render center in world coords, convert to render center in "screen" coords
|
||||
|
||||
// ATE: We should call the fowllowing function but I'm putting it here verbatim for speed
|
||||
//FromCellToScreenCoordinates( sDistToCenterX , sDistToCenterY, &sScreenCenterX, &sScreenCenterY );
|
||||
sWorldCenterX = ( ( sDistToCenterX + ( 2 * sDistToCenterY ) ) / 4 );
|
||||
sWorldCenterY = ( ( 2 * sDistToCenterY ) - sDistToCenterX ) / 4;
|
||||
sWorldCenterX = ( ( sDistToCenterX + ( 2 * sDistToCenterY ) ) / 4 );
|
||||
sWorldCenterY = ( ( 2 * sDistToCenterY ) - sDistToCenterX ) / 4;
|
||||
|
||||
// Goto center again
|
||||
*psWorldCellX = sWorldCenterX + gCenterWorldX;
|
||||
*psWorldCellY = sWorldCenterY + gCenterWorldY;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// UTILITY FUNTIONS
|
||||
|
||||
@@ -510,31 +510,31 @@ INT32 OutOfBounds(INT16 sGridno, INT16 sProposedGridno)
|
||||
// get modulas of our origin
|
||||
sMod = sGridno % MAXCOL;
|
||||
|
||||
if (sMod != 0) // if we're not on leftmost grid
|
||||
if (sMod != RIGHTMOSTGRID) // if we're not on rightmost grid
|
||||
if (sGridno < LASTROWSTART) // if we're above bottom row
|
||||
if (sGridno > MAXCOL) // if we're below top row
|
||||
// Everything's OK - we're not on the edge of the map
|
||||
return(FALSE);
|
||||
if (sMod != 0) // if we're not on leftmost grid
|
||||
if (sMod != RIGHTMOSTGRID) // if we're not on rightmost grid
|
||||
if (sGridno < LASTROWSTART) // if we're above bottom row
|
||||
if (sGridno > MAXCOL) // if we're below top row
|
||||
// Everything's OK - we're not on the edge of the map
|
||||
return(FALSE);
|
||||
|
||||
|
||||
// if we've got this far, there's a potential problem - check it out!
|
||||
// if we've got this far, there's a potential problem - check it out!
|
||||
|
||||
if (sProposedGridno < 0)
|
||||
return(TRUE);
|
||||
return(TRUE);
|
||||
|
||||
sPropMod = sProposedGridno % MAXCOL;
|
||||
|
||||
if (sMod == 0 && sPropMod == RIGHTMOSTGRID)
|
||||
return(TRUE);
|
||||
else
|
||||
if (sMod == RIGHTMOSTGRID && sPropMod == 0)
|
||||
return(TRUE);
|
||||
else
|
||||
if (sGridno >= LASTROWSTART && sProposedGridno >= GRIDSIZE)
|
||||
if (sMod == RIGHTMOSTGRID && sPropMod == 0)
|
||||
return(TRUE);
|
||||
else
|
||||
return(FALSE);
|
||||
else
|
||||
if (sGridno >= LASTROWSTART && sProposedGridno >= GRIDSIZE)
|
||||
return(TRUE);
|
||||
else
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -543,7 +543,7 @@ INT16 NewGridNo(INT16 sGridno, INT16 sDirInc)
|
||||
{
|
||||
INT16 sProposedGridno = sGridno + sDirInc;
|
||||
|
||||
// now check for out-of-bounds
|
||||
// now check for out-of-bounds
|
||||
if (OutOfBounds(sGridno,sProposedGridno))
|
||||
// return ORIGINAL gridno to user
|
||||
sProposedGridno = sGridno;
|
||||
@@ -555,17 +555,17 @@ INT16 NewGridNo(INT16 sGridno, INT16 sDirInc)
|
||||
INT16 DirectionInc(UINT8 ubDirection)
|
||||
{
|
||||
if (ubDirection > 7)
|
||||
{
|
||||
{
|
||||
|
||||
//#ifdef BETAVERSION
|
||||
// NumMessage("DirectionInc: Invalid direction received, = ",direction);
|
||||
// NumMessage("DirectionInc: Invalid direction received, = ",direction);
|
||||
//#endif
|
||||
|
||||
//direction = random(8); // replace garbage with random direction
|
||||
//direction = random(8); // replace garbage with random direction
|
||||
ubDirection = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(DirIncrementer[ubDirection]);
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ INT32 GetRangeFromGridNoDiff( INT16 sGridNo1, INT16 sGridNo2 )
|
||||
// Convert our grid-not into an XY
|
||||
ConvertGridNoToXY( sGridNo2, &sXPos2, &sYPos2 );
|
||||
|
||||
uiDist = (INT16)sqrt((double) ( sXPos2 - sXPos )*( sXPos2 - sXPos ) + ( sYPos2 - sYPos ) * ( sYPos2 - sYPos ) );
|
||||
uiDist = (INT16)sqrt((double) ( sXPos2 - sXPos )*( sXPos2 - sXPos ) + ( sYPos2 - sYPos ) * ( sYPos2 - sYPos ) );
|
||||
|
||||
return( uiDist );
|
||||
}
|
||||
@@ -636,7 +636,7 @@ INT32 GetRangeInCellCoordsFromGridNoDiff( INT16 sGridNo1, INT16 sGridNo2 )
|
||||
// Convert our grid-not into an XY
|
||||
ConvertGridNoToXY( sGridNo2, &sXPos2, &sYPos2 );
|
||||
|
||||
return( (INT32)( sqrt((double) ( sXPos2 - sXPos ) * ( sXPos2 - sXPos ) + ( sYPos2 - sYPos ) * ( sYPos2 - sYPos ) ) ) * CELL_X_SIZE );
|
||||
return( (INT32)( sqrt((double) ( sXPos2 - sXPos ) * ( sXPos2 - sXPos ) + ( sYPos2 - sYPos ) * ( sYPos2 - sYPos ) ) ) * CELL_X_SIZE );
|
||||
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ INT16 PythSpacesAway(INT16 sOrigin, INT16 sDest)
|
||||
sRows = (INT16) abs((sOrigin / MAXCOL) - (sDest / MAXCOL));
|
||||
sCols = (INT16) abs((sOrigin % MAXROW) - (sDest % MAXROW));
|
||||
|
||||
|
||||
|
||||
// apply Pythagoras's theorem for right-handed triangle:
|
||||
// dist^2 = rows^2 + cols^2, so use the square root to get the distance
|
||||
sResult = (INT16)sqrt((double) (sRows * sRows) + (sCols * sCols));
|
||||
@@ -694,7 +694,7 @@ INT16 SpacesAway(INT16 sOrigin, INT16 sDest)
|
||||
return( __max( sRows, sCols ) );
|
||||
}
|
||||
|
||||
INT16 CardinalSpacesAway(INT16 sOrigin, INT16 sDest)
|
||||
INT16 CardinalSpacesAway(INT16 sOrigin, INT16 sDest)
|
||||
// distance away, ignoring diagonals!
|
||||
{
|
||||
INT16 sRows,sCols;
|
||||
@@ -709,7 +709,7 @@ INT8 FindNumTurnsBetweenDirs( INT8 sDir1, INT8 sDir2 )
|
||||
{
|
||||
INT16 sDirection;
|
||||
INT16 sNumTurns = 0;
|
||||
|
||||
|
||||
sDirection = sDir1;
|
||||
|
||||
do
|
||||
@@ -719,7 +719,7 @@ INT8 FindNumTurnsBetweenDirs( INT8 sDir1, INT8 sDir2 )
|
||||
|
||||
if (sDirection > 7)
|
||||
{
|
||||
sDirection = 0;
|
||||
sDirection = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -763,12 +763,12 @@ BOOLEAN FindHeigherLevel( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bStartingDi
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
// LOOP THROUGH ALL 8 DIRECTIONS
|
||||
for ( cnt = 0; cnt < 8; cnt+= 2 )
|
||||
{
|
||||
sNewGridNo = NewGridNo( (UINT16)sGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
|
||||
sNewGridNo = NewGridNo( (INT16)sGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
|
||||
if ( NewOKDestination( pSoldier, sNewGridNo, TRUE, 1 ) )
|
||||
{
|
||||
// Check if this tile has a higher level
|
||||
@@ -777,7 +777,7 @@ BOOLEAN FindHeigherLevel( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bStartingDi
|
||||
fFound = TRUE;
|
||||
|
||||
// FInd how many turns we should go to get here
|
||||
bNumTurns = FindNumTurnsBetweenDirs( (INT8)cnt, bStartingDir );
|
||||
bNumTurns = FindNumTurnsBetweenDirs( (INT8)cnt, bStartingDir );
|
||||
|
||||
if ( bNumTurns < bMinNumTurns )
|
||||
{
|
||||
@@ -809,8 +809,8 @@ BOOLEAN FindLowerLevel( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bStartingDir,
|
||||
// LOOP THROUGH ALL 8 DIRECTIONS
|
||||
for ( cnt = 0; cnt < 8; cnt+= 2 )
|
||||
{
|
||||
sNewGridNo = NewGridNo( (UINT16)sGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
|
||||
sNewGridNo = NewGridNo( (INT16)sGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
|
||||
// Make sure there is NOT a roof here...
|
||||
// Check OK destination
|
||||
if ( NewOKDestination( pSoldier, sNewGridNo, TRUE, 0 ) )
|
||||
@@ -821,7 +821,7 @@ BOOLEAN FindLowerLevel( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bStartingDir,
|
||||
fFound = TRUE;
|
||||
|
||||
// FInd how many turns we should go to get here
|
||||
bNumTurns = FindNumTurnsBetweenDirs( (INT8)cnt, bStartingDir );
|
||||
bNumTurns = FindNumTurnsBetweenDirs( (INT8)cnt, bStartingDir );
|
||||
|
||||
if ( bNumTurns < bMinNumTurns )
|
||||
{
|
||||
@@ -849,29 +849,29 @@ INT16 QuickestDirection(INT16 origin, INT16 dest)
|
||||
INT16 v1,v2;
|
||||
|
||||
if (origin==dest)
|
||||
return(0);
|
||||
return(0);
|
||||
|
||||
if ((abs(origin - dest)) == 4)
|
||||
return(1); // this could be made random
|
||||
return(1); // this could be made random
|
||||
else
|
||||
if (origin > dest)
|
||||
{
|
||||
if (origin > dest)
|
||||
{
|
||||
v1 = (INT16) abs(origin - dest);
|
||||
v2 = (8 - origin) + dest;
|
||||
if (v1 > v2)
|
||||
return(1);
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
v2 = (8 - origin) + dest;
|
||||
if (v1 > v2)
|
||||
return(1);
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
v1 = (INT16) abs(origin - dest);
|
||||
v2 = (8 - dest) + origin;
|
||||
if (v1 > v2)
|
||||
return(-1);
|
||||
else
|
||||
return(1);
|
||||
}
|
||||
v2 = (8 - dest) + origin;
|
||||
if (v1 > v2)
|
||||
return(-1);
|
||||
else
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -880,34 +880,34 @@ INT16 ExtQuickestDirection(INT16 origin, INT16 dest)
|
||||
INT16 v1,v2;
|
||||
|
||||
if (origin==dest)
|
||||
return(0);
|
||||
return(0);
|
||||
|
||||
if ((abs(origin - dest)) == 16)
|
||||
return(1); // this could be made random
|
||||
return(1); // this could be made random
|
||||
else
|
||||
if (origin > dest)
|
||||
{
|
||||
if (origin > dest)
|
||||
{
|
||||
v1 = (INT16) abs(origin - dest);
|
||||
v2 = (32 - origin) + dest;
|
||||
if (v1 > v2)
|
||||
return(1);
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
v2 = (32 - origin) + dest;
|
||||
if (v1 > v2)
|
||||
return(1);
|
||||
else
|
||||
return(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
v1 = (INT16) abs(origin - dest);
|
||||
v2 = (32 - dest) + origin;
|
||||
if (v1 > v2)
|
||||
return(-1);
|
||||
else
|
||||
return(1);
|
||||
}
|
||||
v2 = (32 - dest) + origin;
|
||||
if (v1 > v2)
|
||||
return(-1);
|
||||
else
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Returns the (center ) cell coordinates in X
|
||||
INT16 CenterX( INT16 sGridNo )
|
||||
INT16 CenterX( INT16 sGridNo )
|
||||
{
|
||||
INT16 sYPos, sXPos;
|
||||
|
||||
@@ -919,7 +919,7 @@ INT16 CenterX( INT16 sGridNo )
|
||||
|
||||
|
||||
// Returns the (center ) cell coordinates in Y
|
||||
INT16 CenterY( INT16 sGridNo )
|
||||
INT16 CenterY( INT16 sGridNo )
|
||||
{
|
||||
INT16 sYPos, sXPos;
|
||||
|
||||
@@ -930,7 +930,7 @@ INT16 CenterY( INT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
INT16 MapX( INT16 sGridNo )
|
||||
INT16 MapX( INT16 sGridNo )
|
||||
{
|
||||
INT16 sYPos, sXPos;
|
||||
|
||||
@@ -941,7 +941,7 @@ INT16 MapX( INT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
INT16 MapY( INT16 sGridNo )
|
||||
INT16 MapY( INT16 sGridNo )
|
||||
{
|
||||
INT16 sYPos, sXPos;
|
||||
|
||||
@@ -966,7 +966,7 @@ BOOLEAN GridNoOnVisibleWorldTile( INT16 sGridNo )
|
||||
GetWorldXYAbsoluteScreenXY( sXMapPos, sYMapPos, &sWorldX, &sWorldY);
|
||||
|
||||
if ( sWorldX > 0 && sWorldX < ( gsTRX - gsTLX - 20 ) &&
|
||||
sWorldY > 20 && sWorldY < ( gsBLY - gsTLY - 20 ) )
|
||||
sWorldY > 20 && sWorldY < ( gsBLY - gsTLY - 20 ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -991,7 +991,7 @@ BOOLEAN GridNoOnVisibleWorldTileGivenYLimits( INT16 sGridNo )
|
||||
GetWorldXYAbsoluteScreenXY( sXMapPos, sYMapPos, &sWorldX, &sWorldY);
|
||||
|
||||
if ( sWorldX > 0 && sWorldX < ( gsTRX - gsTLX - 20 ) &&
|
||||
sWorldY > 40 && sWorldY < ( gsBLY - gsTLY - 20 ) )
|
||||
sWorldY > 40 && sWorldY < ( gsBLY - gsTLY - 20 ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -1038,9 +1038,9 @@ BOOLEAN FindFenceJumpDirection( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bStar
|
||||
for ( cnt = 0; cnt < 8; cnt+= 2 )
|
||||
{
|
||||
// go out *2* tiles
|
||||
sNewGridNo = NewGridNo( (UINT16)sGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
sOtherSideOfFence = NewGridNo( (UINT16)sNewGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
|
||||
sNewGridNo = NewGridNo( (INT16)sGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
sOtherSideOfFence = NewGridNo( (INT16)sNewGridNo, (UINT16)DirectionInc( (UINT8)cnt ) );
|
||||
|
||||
if ( NewOKDestination( pSoldier, sOtherSideOfFence, TRUE, 0 ) )
|
||||
{
|
||||
// ATE: Check if there is somebody waiting here.....
|
||||
@@ -1052,7 +1052,7 @@ BOOLEAN FindFenceJumpDirection( SOLDIERTYPE *pSoldier, INT16 sGridNo, INT8 bStar
|
||||
fFound = TRUE;
|
||||
|
||||
// FInd how many turns we should go to get here
|
||||
bNumTurns = FindNumTurnsBetweenDirs( (INT8)cnt, bStartingDir );
|
||||
bNumTurns = FindNumTurnsBetweenDirs( (INT8)cnt, bStartingDir );
|
||||
|
||||
if ( bNumTurns < bMinNumTurns )
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
//DEFINES
|
||||
#define MAXCOL WORLD_COLS
|
||||
#define MAXROW WORLD_ROWS
|
||||
#define GRIDSIZE (MAXCOL * MAXROW)
|
||||
#define RIGHTMOSTGRID (MAXCOL - 1)
|
||||
#define LASTROWSTART (GRIDSIZE - MAXCOL)
|
||||
#define NOWHERE (GRIDSIZE + 1)
|
||||
#define GRIDSIZE (MAXCOL * MAXROW)
|
||||
#define RIGHTMOSTGRID (MAXCOL - 1)
|
||||
#define LASTROWSTART (GRIDSIZE - MAXCOL)
|
||||
#define NOWHERE (GRIDSIZE + 1)
|
||||
//#define NO_MAP_POS NOWHERE
|
||||
#define MAPWIDTH (WORLD_COLS)
|
||||
#define MAPHEIGHT (WORLD_ROWS)
|
||||
@@ -30,7 +30,7 @@ extern UINT8 gPurpendicularDirection[ NUM_WORLD_DIRECTIONS ][ NUM_WORLD_DIRECTIO
|
||||
// Macros
|
||||
|
||||
|
||||
// |Check for map bounds------------------------------------------| |Invalid-| |Valid-------------------|
|
||||
// |Check for map bounds------------------------------------------| |Invalid-| |Valid-------------------|
|
||||
#define MAPROWCOLTOPOS( r, c ) ( ( (r < 0) || (r >= WORLD_ROWS) || (c < 0) || (c >= WORLD_COLS) ) ? ( 0xffff ) : ( (r) * WORLD_COLS + (c) ) )
|
||||
|
||||
#define GETWORLDINDEXFROMWORLDCOORDS( y, x ) ( (INT16) ( x / CELL_X_SIZE ) ) + WORLD_COLS * ( (INT16) ( y / CELL_Y_SIZE ) )
|
||||
@@ -50,7 +50,7 @@ INT32 OutOfBounds(INT16 sGridno, INT16 sProposedGridno);
|
||||
BOOLEAN GetMouseCell( INT32 *piMouseMapPos );
|
||||
BOOLEAN GetMouseXY( INT16 *psMouseX, INT16 *psMouseY );
|
||||
BOOLEAN GetMouseWorldCoords( INT16 *psMouseX, INT16 *psMouseY );
|
||||
BOOLEAN GetMouseMapPos( UINT16 *psMapPos );
|
||||
BOOLEAN GetMouseMapPos( INT16 *psMapPos );
|
||||
BOOLEAN GetMouseWorldCoordsInCenter( INT16 *psMouseX, INT16 *psMouseY );
|
||||
BOOLEAN GetMouseXYWithRemainder( INT16 *psMouseX, INT16 *psMouseY, INT16 *psCellX, INT16 *psCellY );
|
||||
|
||||
@@ -74,7 +74,7 @@ BOOLEAN GridNoOnVisibleWorldTile( INT16 sGridNo );
|
||||
BOOLEAN GridNoOnVisibleWorldTileGivenYLimits( INT16 sGridNo );
|
||||
BOOLEAN GridNoOnEdgeOfMap( INT16 sGridNo, INT8 * pbDirection );
|
||||
|
||||
BOOLEAN ConvertMapPosToWorldTileCenter( UINT16 usMapPos, INT16 *psXPos, INT16 *psYPos );
|
||||
BOOLEAN ConvertMapPosToWorldTileCenter( INT16 sMapPos, INT16 *psXPos, INT16 *psYPos );
|
||||
|
||||
BOOLEAN CellXYToScreenXY(INT16 sCellX, INT16 sCellY, INT16 *sScreenX, INT16 *sScreenY);
|
||||
|
||||
|
||||
+37
-33
@@ -8,10 +8,10 @@
|
||||
#include "wcheck.h"
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "soldier control.h"
|
||||
//#include "soldier control.h"
|
||||
#include "weapons.h"
|
||||
#include "handle items.h"
|
||||
#include "worlddef.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "animation control.h"
|
||||
#include "tile animation.h"
|
||||
@@ -32,6 +32,11 @@
|
||||
#include "SaveLoadGame.h"
|
||||
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
#define NUM_LIGHT_EFFECT_SLOTS 25
|
||||
|
||||
|
||||
@@ -85,7 +90,7 @@ void UpdateLightingSprite( LIGHTEFFECT *pLight )
|
||||
// Delete old one if one exists...
|
||||
if( pLight->iLight!=(-1) )
|
||||
{
|
||||
LightSpriteDestroy( pLight->iLight );
|
||||
LightSpriteDestroy( pLight->iLight );
|
||||
pLight->iLight = -1;
|
||||
}
|
||||
|
||||
@@ -103,7 +108,7 @@ void UpdateLightingSprite( LIGHTEFFECT *pLight )
|
||||
|
||||
|
||||
INT32 NewLightEffect( INT16 sGridNo, UINT8 ubDuration, UINT8 ubStartRadius )
|
||||
{
|
||||
{
|
||||
LIGHTEFFECT *pLight;
|
||||
INT32 iLightIndex;
|
||||
|
||||
@@ -120,18 +125,18 @@ INT32 NewLightEffect( INT16 sGridNo, UINT8 ubDuration, UINT8 ubStartRadius )
|
||||
pLight->uiTimeOfLastUpdate = GetWorldTotalSeconds( );
|
||||
|
||||
pLight->ubDuration = ubDuration;
|
||||
pLight->bRadius = ubStartRadius;
|
||||
pLight->bRadius = ubStartRadius;
|
||||
pLight->bAge = 0;
|
||||
pLight->fAllocated = TRUE;
|
||||
pLight->fAllocated = TRUE;
|
||||
|
||||
UpdateLightingSprite( pLight );
|
||||
|
||||
// Handle sight here....
|
||||
// Handle sight here....
|
||||
AllTeamsLookForAll( FALSE );
|
||||
|
||||
//Play the breaklight sound
|
||||
// PlayJA2Sample( BREAK_LIGHT_IGNITING, RATE_11025, SoundVolume( LOWVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
// MAdd: for some reason this crashes the game!
|
||||
// MAdd: for some reason this crashes the game!
|
||||
return( pLight->iLight );
|
||||
}
|
||||
|
||||
@@ -143,10 +148,10 @@ void RemoveLightEffectFromTile( INT16 sGridNo )
|
||||
UINT32 cnt;
|
||||
|
||||
// Set to unallocated....
|
||||
for ( cnt = 0; cnt < guiNumLightEffects; cnt++ )
|
||||
{
|
||||
for ( cnt = 0; cnt < guiNumLightEffects; cnt++ )
|
||||
{
|
||||
pLight = &gLightEffectData[ cnt ];
|
||||
|
||||
|
||||
if ( pLight->fAllocated )
|
||||
{
|
||||
if ( pLight->sGridNo == sGridNo )
|
||||
@@ -156,7 +161,7 @@ void RemoveLightEffectFromTile( INT16 sGridNo )
|
||||
// Remove light....
|
||||
if( pLight->iLight != (-1) )
|
||||
{
|
||||
LightSpriteDestroy( pLight->iLight );
|
||||
LightSpriteDestroy( pLight->iLight );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -171,10 +176,10 @@ BOOLEAN IsLightEffectAtTile( INT16 sGridNo )
|
||||
UINT32 cnt;
|
||||
|
||||
// Set to unallocated....
|
||||
for ( cnt = 0; cnt < guiNumLightEffects; cnt++ )
|
||||
{
|
||||
for ( cnt = 0; cnt < guiNumLightEffects; cnt++ )
|
||||
{
|
||||
pLight = &gLightEffectData[ cnt ];
|
||||
|
||||
|
||||
if ( pLight->fAllocated )
|
||||
{
|
||||
if ( pLight->sGridNo == sGridNo )
|
||||
@@ -184,27 +189,27 @@ BOOLEAN IsLightEffectAtTile( INT16 sGridNo )
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DecayLightEffects( UINT32 uiTime )
|
||||
{
|
||||
LIGHTEFFECT *pLight;
|
||||
UINT32 cnt, cnt2;
|
||||
BOOLEAN fDelete = FALSE;
|
||||
UINT16 usNumUpdates = 1;
|
||||
BOOLEAN fDelete = FALSE;
|
||||
UINT16 usNumUpdates = 1;
|
||||
|
||||
// age all active tear gas clouds, deactivate those that are just dispersing
|
||||
for ( cnt = 0; cnt < guiNumLightEffects; cnt++ )
|
||||
{
|
||||
// age all active tear gas clouds, deactivate those that are just dispersing
|
||||
for ( cnt = 0; cnt < guiNumLightEffects; cnt++ )
|
||||
{
|
||||
pLight = &gLightEffectData[ cnt ];
|
||||
|
||||
|
||||
fDelete = FALSE;
|
||||
|
||||
if ( pLight->fAllocated )
|
||||
{
|
||||
// ATE: Do this every so ofte, to acheive the effect we want...
|
||||
if ( ( uiTime - pLight->uiTimeOfLastUpdate ) > 10 )
|
||||
if ( ( uiTime - pLight->uiTimeOfLastUpdate ) > 10 )
|
||||
{
|
||||
usNumUpdates = ( UINT16 ) ( ( uiTime - pLight->uiTimeOfLastUpdate ) / 10 );
|
||||
|
||||
@@ -246,20 +251,20 @@ void DecayLightEffects( UINT32 uiTime )
|
||||
|
||||
if ( fDelete )
|
||||
{
|
||||
pLight->fAllocated = FALSE;
|
||||
pLight->fAllocated = FALSE;
|
||||
|
||||
if( pLight->iLight != (-1) )
|
||||
{
|
||||
LightSpriteDestroy( pLight->iLight );
|
||||
LightSpriteDestroy( pLight->iLight );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Handle sight here....
|
||||
AllTeamsLookForAll( FALSE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -315,10 +320,10 @@ BOOLEAN LoadLightEffectsFromLoadGameFile( HWFILE hFile )
|
||||
UINT32 uiNumBytesRead;
|
||||
UINT32 uiCount;
|
||||
|
||||
//no longer need to load Light effects. They are now in temp files
|
||||
if( guiSaveGameVersion < 76 )
|
||||
//no longer need to load Light effects. They are now in temp files
|
||||
if( guiCurrentSaveGameVersion < 76 )
|
||||
{
|
||||
memset( gLightEffectData, 0, sizeof( LIGHTEFFECT ) * NUM_LIGHT_EFFECT_SLOTS );
|
||||
memset( gLightEffectData, 0, sizeof( LIGHTEFFECT ) * NUM_LIGHT_EFFECT_SLOTS );
|
||||
|
||||
//Load the Number of Light Effects
|
||||
FileRead( hFile, &guiNumLightEffects, sizeof( UINT32 ), &uiNumBytesRead );
|
||||
@@ -347,7 +352,7 @@ BOOLEAN LoadLightEffectsFromLoadGameFile( HWFILE hFile )
|
||||
for(uiCount=0; uiCount < guiNumLightEffects; uiCount++)
|
||||
{
|
||||
if( gLightEffectData[uiCount].fAllocated )
|
||||
UpdateLightingSprite( &( gLightEffectData[uiCount] ) );
|
||||
UpdateLightingSprite( &( gLightEffectData[uiCount] ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +445,6 @@ BOOLEAN LoadLightEffectsFromMapTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCnt=0;
|
||||
HWFILE hFile;
|
||||
UINT32 uiNumBytesWritten=0;
|
||||
CHAR8 zMapName[ 128 ];
|
||||
|
||||
GetMapTempFileName( SF_LIGHTING_EFFECTS_TEMP_FILE_EXISTS, zMapName, sMapX, sMapY, bMapZ );
|
||||
@@ -482,7 +486,7 @@ BOOLEAN LoadLightEffectsFromMapTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
for(uiCount=0; uiCount < guiNumLightEffects; uiCount++)
|
||||
{
|
||||
if( gLightEffectData[uiCount].fAllocated )
|
||||
UpdateLightingSprite( &( gLightEffectData[uiCount] ) );
|
||||
UpdateLightingSprite( &( gLightEffectData[uiCount] ) );
|
||||
}
|
||||
|
||||
FileClose( hFile );
|
||||
|
||||
@@ -13,11 +13,11 @@ enum
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT16 sGridNo; // gridno at which the tear gas cloud is centered
|
||||
INT16 sGridNo; // gridno at which the tear gas cloud is centered
|
||||
|
||||
UINT8 ubDuration; // the number of turns will remain effective
|
||||
UINT8 bRadius; // the current radius
|
||||
UINT8 bAge; // the number of turns light has been around
|
||||
UINT8 ubDuration; // the number of turns will remain effective
|
||||
UINT8 bRadius; // the current radius
|
||||
UINT8 bAge; // the number of turns light has been around
|
||||
BOOLEAN fAllocated;
|
||||
INT8 bType;
|
||||
INT32 iLight;
|
||||
|
||||
+180
-187
@@ -3,7 +3,7 @@
|
||||
#else
|
||||
#include <memory.h>
|
||||
#include "Map Edgepoints.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#include "pathai.h"
|
||||
#include "ai.h"
|
||||
#include "Map Information.h"
|
||||
@@ -19,6 +19,11 @@
|
||||
#include "worldman.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
//dynamic arrays that contain the valid gridno's for each edge
|
||||
INT16 *gps1stNorthEdgepointArray = NULL;
|
||||
INT16 *gps1stEastEdgepointArray = NULL;
|
||||
@@ -122,10 +127,6 @@ void ValidateEdgepoints()
|
||||
INT32 i;
|
||||
UINT16 usValidEdgepoints;
|
||||
SOLDIERTYPE Soldier;
|
||||
|
||||
// WDS - Clean up inventory handling
|
||||
// memset( &Soldier, 0, SIZEOF_SOLDIERTYPE );
|
||||
Soldier.initialize();
|
||||
Soldier.bTeam = 1;
|
||||
|
||||
//north
|
||||
@@ -316,9 +317,9 @@ void CompactEdgepointArray( INT16 **psArray, UINT16 *pusMiddleIndex, UINT16 *pus
|
||||
Assert( *psArray );
|
||||
}
|
||||
|
||||
void InternallyClassifyEdgepoints( SOLDIERTYPE *pSoldier, INT16 sGridNo,
|
||||
INT16 **psArray1, UINT16 *pusMiddleIndex1, UINT16 *pusArraySize1,
|
||||
INT16 **psArray2, UINT16 *pusMiddleIndex2, UINT16 *pusArraySize2 )
|
||||
void InternallyClassifyEdgepoints( SOLDIERTYPE *pSoldier, INT16 sGridNo,
|
||||
INT16 **psArray1, UINT16 *pusMiddleIndex1, UINT16 *pusArraySize1,
|
||||
INT16 **psArray2, UINT16 *pusMiddleIndex2, UINT16 *pusArraySize2 )
|
||||
{
|
||||
INT32 i;
|
||||
UINT16 us1stBenchmarkID, us2ndBenchmarkID;
|
||||
@@ -360,8 +361,8 @@ void InternallyClassifyEdgepoints( SOLDIERTYPE *pSoldier, INT16 sGridNo,
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Now we have found the two benchmarks, so go in both directions for each one to determine which entrypoints
|
||||
//are going to be used in the primary array. All rejections will be positioned in the secondary array for
|
||||
//Now we have found the two benchmarks, so go in both directions for each one to determine which entrypoints
|
||||
//are going to be used in the primary array. All rejections will be positioned in the secondary array for
|
||||
//use for isolated entry when tactically traversing.
|
||||
if( us1stBenchmarkID != 0xffff )
|
||||
{
|
||||
@@ -401,7 +402,7 @@ void InternallyClassifyEdgepoints( SOLDIERTYPE *pSoldier, INT16 sGridNo,
|
||||
for( i = us2ndBenchmarkID; i > *pusMiddleIndex1; i-- )
|
||||
{
|
||||
if( !EdgepointsClose( pSoldier, (*psArray1)[ i ], (*psArray1)[ i-1 ] ) )
|
||||
{ //All edgepoints from 1st middle index to i-1 are rejected.
|
||||
{ //All edgepoints from 1st middle index to i-1 are rejected.
|
||||
while( i > *pusMiddleIndex1 )
|
||||
{
|
||||
i--;
|
||||
@@ -437,9 +438,6 @@ void ClassifyEdgepoints()
|
||||
SOLDIERTYPE Soldier;
|
||||
INT16 sGridNo = -1;
|
||||
|
||||
// WDS - Clean up inventory handling
|
||||
// memset( &Soldier, 0, SIZEOF_SOLDIERTYPE );
|
||||
Soldier.initialize();
|
||||
Soldier.bTeam = 1;
|
||||
|
||||
//north
|
||||
@@ -447,8 +445,8 @@ void ClassifyEdgepoints()
|
||||
{
|
||||
sGridNo = FindNearestEdgepointOnSpecifiedEdge( gMapInformation.sNorthGridNo, NORTH_EDGEPOINT_SEARCH );
|
||||
if( sGridNo != NOWHERE )
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
&gps1stNorthEdgepointArray, &gus1stNorthEdgepointMiddleIndex, &gus1stNorthEdgepointArraySize,
|
||||
&gps2ndNorthEdgepointArray, &gus2ndNorthEdgepointMiddleIndex, &gus2ndNorthEdgepointArraySize );
|
||||
}
|
||||
@@ -458,8 +456,8 @@ void ClassifyEdgepoints()
|
||||
{
|
||||
sGridNo = FindNearestEdgepointOnSpecifiedEdge( gMapInformation.sEastGridNo, EAST_EDGEPOINT_SEARCH );
|
||||
if( sGridNo != NOWHERE )
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
&gps1stEastEdgepointArray, &gus1stEastEdgepointMiddleIndex, &gus1stEastEdgepointArraySize,
|
||||
&gps2ndEastEdgepointArray, &gus2ndEastEdgepointMiddleIndex, &gus2ndEastEdgepointArraySize );
|
||||
}
|
||||
@@ -469,8 +467,8 @@ void ClassifyEdgepoints()
|
||||
{
|
||||
sGridNo = FindNearestEdgepointOnSpecifiedEdge( gMapInformation.sSouthGridNo, SOUTH_EDGEPOINT_SEARCH );
|
||||
if( sGridNo != NOWHERE )
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
&gps1stSouthEdgepointArray, &gus1stSouthEdgepointMiddleIndex, &gus1stSouthEdgepointArraySize,
|
||||
&gps2ndSouthEdgepointArray, &gus2ndSouthEdgepointMiddleIndex, &gus2ndSouthEdgepointArraySize );
|
||||
}
|
||||
@@ -480,8 +478,8 @@ void ClassifyEdgepoints()
|
||||
{
|
||||
sGridNo = FindNearestEdgepointOnSpecifiedEdge( gMapInformation.sWestGridNo, WEST_EDGEPOINT_SEARCH );
|
||||
if( sGridNo != NOWHERE )
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
{
|
||||
InternallyClassifyEdgepoints( &Soldier, sGridNo,
|
||||
&gps1stWestEdgepointArray, &gus1stWestEdgepointMiddleIndex, &gus1stWestEdgepointArraySize,
|
||||
&gps2ndWestEdgepointArray, &gus2ndWestEdgepointMiddleIndex, &gus2ndWestEdgepointArraySize );
|
||||
}
|
||||
@@ -493,8 +491,6 @@ void GenerateMapEdgepoints()
|
||||
INT32 i=-1;
|
||||
INT16 sGridNo=-1;
|
||||
INT16 sVGridNo[400];
|
||||
UINT8 gubSaveNPCAPBudget=0;
|
||||
UINT8 gubSaveNPCDistLimit=0;
|
||||
|
||||
//Get rid of the current edgepoint lists.
|
||||
TrashMapEdgepoints();
|
||||
@@ -521,39 +517,39 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsTLGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stNorthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsTRGridNo )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stNorthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stNorthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus1stNorthEdgepointMiddleIndex = gus1stNorthEdgepointArraySize;
|
||||
sGridNo = gsTLGridNo + 161;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stNorthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsTRGridNo + 161 )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stNorthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stNorthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus1stNorthEdgepointArraySize )
|
||||
{
|
||||
{
|
||||
//Allocate and copy over the valid gridnos.
|
||||
gps1stNorthEdgepointArray = (INT16*)MemAlloc( gus1stNorthEdgepointArraySize * sizeof( INT16) );
|
||||
for( i = 0; i < gus1stNorthEdgepointArraySize; i++ )
|
||||
@@ -565,35 +561,35 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsTRGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stEastEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBRGridNo )
|
||||
{
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stEastEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stEastEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus1stEastEdgepointMiddleIndex = gus1stEastEdgepointArraySize;
|
||||
sGridNo = gsTRGridNo + 159;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stEastEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBRGridNo + 159 )
|
||||
{
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stEastEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stEastEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus1stEastEdgepointArraySize )
|
||||
@@ -608,35 +604,35 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsBLGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stSouthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsBRGridNo )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stSouthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stSouthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus1stSouthEdgepointMiddleIndex = gus1stSouthEdgepointArraySize;
|
||||
sGridNo = gsBLGridNo - 161;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stSouthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsBRGridNo - 161 )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stSouthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stSouthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus1stSouthEdgepointArraySize )
|
||||
@@ -651,35 +647,35 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsTLGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stWestEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBLGridNo )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stWestEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stWestEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus1stWestEdgepointMiddleIndex = gus1stWestEdgepointArraySize;
|
||||
sGridNo = gsTLGridNo - 159;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stWestEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBLGridNo - 159 )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stWestEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus1stWestEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus1stWestEdgepointArraySize )
|
||||
@@ -698,39 +694,39 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsTLGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndNorthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsTRGridNo )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndNorthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndNorthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus2ndNorthEdgepointMiddleIndex = gus2ndNorthEdgepointArraySize;
|
||||
sGridNo = gsTLGridNo + 161;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndNorthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsTRGridNo + 161 )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndNorthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndNorthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus2ndNorthEdgepointArraySize )
|
||||
{
|
||||
{
|
||||
//Allocate and copy over the valid gridnos.
|
||||
gps2ndNorthEdgepointArray = (INT16*)MemAlloc( gus2ndNorthEdgepointArraySize * sizeof( INT16) );
|
||||
for( i = 0; i < gus2ndNorthEdgepointArraySize; i++ )
|
||||
@@ -742,35 +738,35 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsTRGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndEastEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBRGridNo )
|
||||
{
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndEastEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndEastEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus2ndEastEdgepointMiddleIndex = gus2ndEastEdgepointArraySize;
|
||||
sGridNo = gsTRGridNo + 159;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndEastEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBRGridNo + 159 )
|
||||
{
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndEastEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndEastEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus2ndEastEdgepointArraySize )
|
||||
@@ -785,35 +781,35 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsBLGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndSouthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsBRGridNo )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndSouthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndSouthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus2ndSouthEdgepointMiddleIndex = gus2ndSouthEdgepointArraySize;
|
||||
sGridNo = gsBLGridNo - 161;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndSouthEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo > gsBRGridNo - 161 )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndSouthEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo -= 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndSouthEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus2ndSouthEdgepointArraySize )
|
||||
@@ -828,35 +824,35 @@ void GenerateMapEdgepoints()
|
||||
{
|
||||
//1st row
|
||||
sGridNo = gsTLGridNo;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndWestEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBLGridNo )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndWestEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndWestEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
//2nd row
|
||||
gus2ndWestEdgepointMiddleIndex = gus2ndWestEdgepointArraySize;
|
||||
sGridNo = gsTLGridNo - 159;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndWestEdgepointArraySize++ ] = sGridNo;
|
||||
while( sGridNo < gsBLGridNo - 159 )
|
||||
{
|
||||
sGridNo++;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndWestEdgepointArraySize++ ] = sGridNo;
|
||||
sGridNo += 160;
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
if( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REACHABLE &&
|
||||
(!gubWorldRoomInfo[ sGridNo ] || gfBasement) )
|
||||
sVGridNo[ gus2ndWestEdgepointArraySize++ ] = sGridNo;
|
||||
}
|
||||
if( gus2ndWestEdgepointArraySize )
|
||||
@@ -867,18 +863,18 @@ void GenerateMapEdgepoints()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Eliminates any edgepoints not accessible to the edge of the world. This is done to the primary edgepoints
|
||||
|
||||
//Eliminates any edgepoints not accessible to the edge of the world. This is done to the primary edgepoints
|
||||
ValidateEdgepoints();
|
||||
//Second step is to process the primary edgepoints and determine if any of the edgepoints aren't accessible from
|
||||
//the associated entrypoint. These edgepoints that are rejected are placed in the secondary list.
|
||||
//the associated entrypoint. These edgepoints that are rejected are placed in the secondary list.
|
||||
if( gMapInformation.sIsolatedGridNo != -1 )
|
||||
{ //only if there is an isolated gridno in the map. There is a flaw in the design of this system. The classification
|
||||
{ //only if there is an isolated gridno in the map. There is a flaw in the design of this system. The classification
|
||||
//process will automatically assign areas to be isolated if there is an obstacle between one normal edgepoint and another
|
||||
//causing a 5 tile connection check to fail. So, all maps with isolated edgepoints will need to be checked manually to
|
||||
//causing a 5 tile connection check to fail. So, all maps with isolated edgepoints will need to be checked manually to
|
||||
//make sure there are no obstacles causing this to happen (except for obstacles between normal areas and the isolated area)
|
||||
|
||||
//Good thing most maps don't have isolated sections. This is one expensive function to call! Maybe 200MI!
|
||||
//Good thing most maps don't have isolated sections. This is one expensive function to call! Maybe 200MI!
|
||||
ClassifyEdgepoints();
|
||||
}
|
||||
|
||||
@@ -904,7 +900,7 @@ void SaveMapEdgepoints( HWFILE fp )
|
||||
FileWrite( fp, &gus1stWestEdgepointMiddleIndex, 2, NULL );
|
||||
if( gus1stWestEdgepointArraySize )
|
||||
FileWrite( fp, gps1stWestEdgepointArray, gus1stWestEdgepointArraySize * sizeof( INT16 ), NULL );
|
||||
//2nd priority edgepoints -- for isolated areas. Okay to be zero
|
||||
//2nd priority edgepoints -- for isolated areas. Okay to be zero
|
||||
FileWrite( fp, &gus2ndNorthEdgepointArraySize, 2, NULL );
|
||||
FileWrite( fp, &gus2ndNorthEdgepointMiddleIndex, 2, NULL );
|
||||
if( gus2ndNorthEdgepointArraySize )
|
||||
@@ -963,8 +959,8 @@ BOOLEAN LoadMapEdgepoints( INT8 **hBuffer )
|
||||
{
|
||||
TrashMapEdgepoints();
|
||||
if( gMapInformation.ubMapVersion < 17 )
|
||||
{ //To prevent invalidation of older maps, which only used one layer of edgepoints, and a UINT8 for
|
||||
//containing the size, we will preserve that paradigm, then kill the loaded edgepoints and
|
||||
{ //To prevent invalidation of older maps, which only used one layer of edgepoints, and a UINT8 for
|
||||
//containing the size, we will preserve that paradigm, then kill the loaded edgepoints and
|
||||
//regenerate them.
|
||||
OldLoadMapEdgepoints( hBuffer );
|
||||
TrashMapEdgepoints();
|
||||
@@ -1071,7 +1067,7 @@ UINT16 ChooseMapEdgepoint( UINT8 ubStrategicInsertionCode )
|
||||
usArraySize = gus1stWestEdgepointArraySize;
|
||||
break;
|
||||
default:
|
||||
AssertMsg( 0, "ChooseMapEdgepoints: Failed to pass a valid strategic insertion code." );
|
||||
AssertMsg( 0, "ChooseMapEdgepoints: Failed to pass a valid strategic insertion code." );
|
||||
break;
|
||||
}
|
||||
if( !usArraySize )
|
||||
@@ -1089,8 +1085,8 @@ void ChooseMapEdgepoints( MAPEDGEPOINTINFO *pMapEdgepointInfo, UINT8 ubStrategic
|
||||
UINT16 usSlots, usCurrSlot;
|
||||
INT16 *psTempArray = NULL;
|
||||
|
||||
AssertMsg( ubNumDesiredPoints > 0 && ubNumDesiredPoints <= 32,
|
||||
String( "ChooseMapEdgepoints: Desired points = %d, valid range is 1-32", ubNumDesiredPoints ) );
|
||||
AssertMsg( ubNumDesiredPoints > 0 && ubNumDesiredPoints <= 32,
|
||||
String( "ChooseMapEdgepoints: Desired points = %d, valid range is 1-32", ubNumDesiredPoints ) );
|
||||
//First validate and get access to the correct array based on strategic direction.
|
||||
//We will use the selected array to choose insertion gridno's.
|
||||
switch( ubStrategicInsertionCode )
|
||||
@@ -1112,7 +1108,7 @@ void ChooseMapEdgepoints( MAPEDGEPOINTINFO *pMapEdgepointInfo, UINT8 ubStrategic
|
||||
usArraySize = gus1stWestEdgepointArraySize;
|
||||
break;
|
||||
default:
|
||||
AssertMsg( 0, "ChooseMapEdgepoints: Failed to pass a valid strategic insertion code." );
|
||||
AssertMsg( 0, "ChooseMapEdgepoints: Failed to pass a valid strategic insertion code." );
|
||||
break;
|
||||
}
|
||||
pMapEdgepointInfo->ubStrategicInsertionCode = ubStrategicInsertionCode;
|
||||
@@ -1120,18 +1116,18 @@ void ChooseMapEdgepoints( MAPEDGEPOINTINFO *pMapEdgepointInfo, UINT8 ubStrategic
|
||||
if( !psArray || !usArraySize )
|
||||
{
|
||||
if( gMapInformation.sNorthGridNo == -1 && gMapInformation.sEastGridNo == -1 &&
|
||||
gMapInformation.sSouthGridNo == -1 && gMapInformation.sWestGridNo == -1 &&
|
||||
gMapInformation.sSouthGridNo == -1 && gMapInformation.sWestGridNo == -1 &&
|
||||
gMapInformation.sCenterGridNo == -1 )
|
||||
{
|
||||
if( gbWorldSectorZ )
|
||||
{
|
||||
AssertMsg( 0,
|
||||
AssertMsg( 0,
|
||||
String( "Map %c%d_b%d(_a) doesn't have ANY entry points which means that it is impossible to generate map edgepoints. (LC : 1)",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertMsg( 0,
|
||||
AssertMsg( 0,
|
||||
String( "Map %c%d(_a) doesn't have ANY entry points which means that it is impossible to generate map edgepoints. (LC : 1)",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX ) );
|
||||
}
|
||||
@@ -1139,16 +1135,16 @@ void ChooseMapEdgepoints( MAPEDGEPOINTINFO *pMapEdgepointInfo, UINT8 ubStrategic
|
||||
else switch( ubStrategicInsertionCode )
|
||||
{
|
||||
case INSERTION_CODE_NORTH:
|
||||
AssertMsg( 0, "This map doesn't have any north mapedgepoints. Possibly because there is no north entry point. (LC : 1)" );
|
||||
AssertMsg( 0, "This map doesn't have any north mapedgepoints. Possibly because there is no north entry point. (LC : 1)" );
|
||||
break;
|
||||
case INSERTION_CODE_EAST:
|
||||
AssertMsg( 0, "This map doesn't have any east mapedgepoints. Possibly because there is no east entry point. (LC : 1)" );
|
||||
AssertMsg( 0, "This map doesn't have any east mapedgepoints. Possibly because there is no east entry point. (LC : 1)" );
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
AssertMsg( 0, "This map doesn't have any south mapedgepoints. Possibly because there is no south entry point. (LC : 1)" );
|
||||
AssertMsg( 0, "This map doesn't have any south mapedgepoints. Possibly because there is no south entry point. (LC : 1)" );
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
AssertMsg( 0, "This map doesn't have any west mapedgepoints. Possibly because there is no west entry point. NOTE: Teleportation always uses the west entrypoint. Some maps shouldn't have west entrypoints. (LC : 1)" );
|
||||
AssertMsg( 0, "This map doesn't have any west mapedgepoints. Possibly because there is no west entry point. NOTE: Teleportation always uses the west entrypoint. Some maps shouldn't have west entrypoints. (LC : 1)" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1237,12 +1233,12 @@ void BeginMapEdgepointSearch()
|
||||
sGridNo = gMapInformation.sSouthGridNo;
|
||||
else if( gMapInformation.sWestGridNo != -1 )
|
||||
sGridNo = gMapInformation.sWestGridNo;
|
||||
else
|
||||
else
|
||||
return;
|
||||
|
||||
GlobalReachableTest( sGridNo );
|
||||
|
||||
//Now, we have the path values calculated. Now, we can check for closest edgepoints.
|
||||
//Now, we have the path values calculated. Now, we can check for closest edgepoints.
|
||||
}
|
||||
|
||||
void EndMapEdgepointSearch()
|
||||
@@ -1264,8 +1260,8 @@ INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode
|
||||
BOOLEAN fReserved;
|
||||
|
||||
if( gsReservedIndex >= 20 )
|
||||
{ //Everything is reserved.
|
||||
AssertMsg( 0, "All closest map edgepoints have been reserved. We should only have 20 soldiers maximum...");
|
||||
{ //Everything is reserved.
|
||||
AssertMsg( 0, "All closest map edgepoints have been reserved. We should only have 20 soldiers maximum...");
|
||||
}
|
||||
switch( ubInsertionCode )
|
||||
{
|
||||
@@ -1273,29 +1269,29 @@ INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode
|
||||
psArray = gps1stNorthEdgepointArray;
|
||||
usArraySize = gus1stNorthEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any north mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any north mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
case INSERTION_CODE_EAST:
|
||||
psArray = gps1stEastEdgepointArray;
|
||||
usArraySize = gus1stEastEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any east mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any east mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
psArray = gps1stSouthEdgepointArray;
|
||||
usArraySize = gus1stSouthEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any south mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any south mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
psArray = gps1stWestEdgepointArray;
|
||||
usArraySize = gus1stWestEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any west mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any west mapedgepoints. LC:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
}
|
||||
if( !usArraySize )
|
||||
@@ -1352,7 +1348,7 @@ INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode
|
||||
{
|
||||
sGridNo += sDirection;
|
||||
if( sGridNo < 0 || sGridNo >= WORLD_MAX )
|
||||
continue;
|
||||
continue;
|
||||
//Check the gridno, to see if it is available and an edgepoint.
|
||||
fReserved = FALSE;
|
||||
for( i = 0; i < gsReservedIndex; i++ )
|
||||
@@ -1391,8 +1387,8 @@ INT16 SearchForClosestSecondaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCod
|
||||
BOOLEAN fReserved;
|
||||
|
||||
if( gsReservedIndex >= 20 )
|
||||
{ //Everything is reserved.
|
||||
AssertMsg( 0, "All closest map edgepoints have been reserved. We should only have 20 soldiers maximum...");
|
||||
{ //Everything is reserved.
|
||||
AssertMsg( 0, "All closest map edgepoints have been reserved. We should only have 20 soldiers maximum...");
|
||||
}
|
||||
switch( ubInsertionCode )
|
||||
{
|
||||
@@ -1400,29 +1396,29 @@ INT16 SearchForClosestSecondaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCod
|
||||
psArray = gps2ndNorthEdgepointArray;
|
||||
usArraySize = gus2ndNorthEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated north mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated north mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
case INSERTION_CODE_EAST:
|
||||
psArray = gps2ndEastEdgepointArray;
|
||||
usArraySize = gus2ndEastEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated east mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated east mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
psArray = gps2ndSouthEdgepointArray;
|
||||
usArraySize = gus2ndSouthEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated south mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated south mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
psArray = gps2ndWestEdgepointArray;
|
||||
usArraySize = gus2ndWestEdgepointArraySize;
|
||||
if( !usArraySize )
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated west mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
AssertMsg( 0, String( "Sector %c%d level %d doesn't have any isolated west mapedgepoints. KM:1",
|
||||
gWorldSectorY + 'A' - 1, gWorldSectorX, gbWorldSectorZ ) );
|
||||
break;
|
||||
}
|
||||
if( !usArraySize )
|
||||
@@ -1479,7 +1475,7 @@ INT16 SearchForClosestSecondaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCod
|
||||
{
|
||||
sGridNo += sDirection;
|
||||
if( sGridNo < 0 || sGridNo >= WORLD_MAX )
|
||||
continue;
|
||||
continue;
|
||||
//Check the gridno, to see if it is available and an edgepoint.
|
||||
fReserved = FALSE;
|
||||
for( i = 0; i < gsReservedIndex; i++ )
|
||||
@@ -1522,18 +1518,18 @@ BOOLEAN VerifyEdgepoint( SOLDIERTYPE * pSoldier, INT16 sEdgepoint )
|
||||
iSearchRange = EDGE_OF_MAP_SEARCH;
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
// walk into within range. We have to set some things up first...
|
||||
// walk into within range. We have to set some things up first...
|
||||
|
||||
// set the distance limit of the square region
|
||||
gubNPCDistLimit = EDGE_OF_MAP_SEARCH;
|
||||
@@ -1548,7 +1544,7 @@ BOOLEAN VerifyEdgepoint( SOLDIERTYPE * pSoldier, INT16 sEdgepoint )
|
||||
}
|
||||
}
|
||||
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->bLevel, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE );
|
||||
FindBestPath( pSoldier, NOWHERE, pSoldier->pathing.bLevel, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE );
|
||||
|
||||
// Turn off the "reachable" flag for the current location
|
||||
// so we don't consider it
|
||||
@@ -1588,7 +1584,7 @@ BOOLEAN EdgepointsClose( SOLDIERTYPE *pSoldier, INT16 sEdgepoint1, INT16 sEdgepo
|
||||
pSoldier->sGridNo = sEdgepoint1;
|
||||
|
||||
if( gWorldSectorX == 14 && gWorldSectorY == 9 && !gbWorldSectorZ )
|
||||
{ //BRUTAL CODE -- special case map.
|
||||
{ //BRUTAL CODE -- special case map.
|
||||
iSearchRange = 250;
|
||||
}
|
||||
else
|
||||
@@ -1597,18 +1593,18 @@ BOOLEAN EdgepointsClose( SOLDIERTYPE *pSoldier, INT16 sEdgepoint1, INT16 sEdgepo
|
||||
}
|
||||
|
||||
// determine maximum horizontal limits
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
sMaxLeft = min( iSearchRange, (pSoldier->sGridNo % MAXCOL));
|
||||
//NumMessage("sMaxLeft = ",sMaxLeft);
|
||||
sMaxRight = min( iSearchRange, MAXCOL - ((pSoldier->sGridNo % MAXCOL) + 1));
|
||||
//NumMessage("sMaxRight = ",sMaxRight);
|
||||
|
||||
// determine maximum vertical limits
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
sMaxUp = min( iSearchRange, (pSoldier->sGridNo / MAXROW));
|
||||
//NumMessage("sMaxUp = ",sMaxUp);
|
||||
sMaxDown = min( iSearchRange, MAXROW - ((pSoldier->sGridNo / MAXROW) + 1));
|
||||
|
||||
// Call FindBestPath to set flags in all locations that we can
|
||||
// walk into within range. We have to set some things up first...
|
||||
// walk into within range. We have to set some things up first...
|
||||
|
||||
// set the distance limit of the square region
|
||||
gubNPCDistLimit = (UINT8)iSearchRange;
|
||||
@@ -1623,7 +1619,7 @@ BOOLEAN EdgepointsClose( SOLDIERTYPE *pSoldier, INT16 sEdgepoint1, INT16 sEdgepo
|
||||
}
|
||||
}
|
||||
|
||||
if( FindBestPath( pSoldier, sEdgepoint2, pSoldier->bLevel, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE ) )
|
||||
if( FindBestPath( pSoldier, sEdgepoint2, pSoldier->pathing.bLevel, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1640,13 +1636,10 @@ UINT8 CalcMapEdgepointClassInsertionCode( INT16 sGridNo )
|
||||
INT16 sClosestSpot2 = NOWHERE, sClosestDist2 = 0x7FFF;
|
||||
BOOLEAN fPrimaryValid = FALSE, fSecondaryValid = FALSE;
|
||||
|
||||
// WDS - Clean up inventory handling
|
||||
// memset( &Soldier, 0, SIZEOF_SOLDIERTYPE );
|
||||
Soldier.initialize();
|
||||
Soldier.bTeam = 1;
|
||||
Soldier.sGridNo = sGridNo;
|
||||
|
||||
if( gMapInformation.sIsolatedGridNo == -1 )
|
||||
if( gMapInformation.sIsolatedGridNo == -1 )
|
||||
{ //If the map has no isolated area, then all edgepoints are primary.
|
||||
return INSERTION_CODE_PRIMARY_EDGEINDEX;
|
||||
}
|
||||
@@ -1682,7 +1675,7 @@ UINT8 CalcMapEdgepointClassInsertionCode( INT16 sGridNo )
|
||||
return INSERTION_CODE_PRIMARY_EDGEINDEX;
|
||||
}
|
||||
|
||||
// Do a 2D search to find the closest map edgepoint and
|
||||
// Do a 2D search to find the closest map edgepoint and
|
||||
// try to create a path there
|
||||
for ( iLoop = 0; iLoop < iEdgepointArraySize1; iLoop++ )
|
||||
{
|
||||
@@ -1833,11 +1826,11 @@ void ShowMapEdgepoints()
|
||||
{
|
||||
ScreenMsg( 0, MSG_TESTVERSION, L"Showing display of map edgepoints (%d illegal primary, %d illegal secondary)" );
|
||||
}
|
||||
ScreenMsg( 0, MSG_TESTVERSION, L"N:%d:%d E:%d:%d S:%d:%d W:%d:%d",
|
||||
gus1stNorthEdgepointArraySize, gus2ndNorthEdgepointArraySize,
|
||||
gus1stEastEdgepointArraySize, gus2ndEastEdgepointArraySize,
|
||||
gus1stSouthEdgepointArraySize, gus2ndSouthEdgepointArraySize,
|
||||
gus1stWestEdgepointArraySize, gus2ndWestEdgepointArraySize );
|
||||
ScreenMsg( 0, MSG_TESTVERSION, L"N:%d:%d E:%d:%d S:%d:%d W:%d:%d",
|
||||
gus1stNorthEdgepointArraySize, gus2ndNorthEdgepointArraySize,
|
||||
gus1stEastEdgepointArraySize, gus2ndEastEdgepointArraySize,
|
||||
gus1stSouthEdgepointArraySize, gus2ndSouthEdgepointArraySize,
|
||||
gus1stWestEdgepointArraySize, gus2ndWestEdgepointArraySize );
|
||||
}
|
||||
|
||||
void HideMapEdgepoints()
|
||||
@@ -1872,7 +1865,7 @@ void HideMapEdgepoints()
|
||||
RemoveAllTopmostsOfTypeRange( gps1stWestEdgepointArray[ i ], FIRSTPOINTERS, FIRSTPOINTERS );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for( i = 0 ; i < gus2ndNorthEdgepointArraySize; i++ )
|
||||
{
|
||||
if( gps2ndNorthEdgepointArray[ i ] != -1 )
|
||||
@@ -1902,4 +1895,4 @@ void HideMapEdgepoints()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,7 @@ typedef struct MAPEDGEPOINTINFO
|
||||
{
|
||||
UINT8 ubNumPoints;
|
||||
UINT8 ubStrategicInsertionCode;
|
||||
UINT16 sGridNo[ 32 ];
|
||||
INT16 sGridNo[ 32 ];
|
||||
}MAPEDGEPOINTINFO;
|
||||
|
||||
UINT16 ChooseMapEdgepoint( UINT8 ubStrategicInsertionCode );
|
||||
@@ -55,10 +55,10 @@ extern UINT16 gus2ndSouthEdgepointMiddleIndex;
|
||||
extern UINT16 gus2ndWestEdgepointMiddleIndex;
|
||||
|
||||
//This is the search code that will determine the closest map edgepoint to a given gridno and
|
||||
//a strategic insertion code. You must call the begin...() first, the call SearchForClosestMapEdgepoint()
|
||||
//for each soldier that is looking. After you are completely finished, call the end..(). The return value
|
||||
//a strategic insertion code. You must call the begin...() first, the call SearchForClosestMapEdgepoint()
|
||||
//for each soldier that is looking. After you are completely finished, call the end..(). The return value
|
||||
//will return NOWHERE if the information is invalid (no edgepoint info for that particular side, or all
|
||||
//spots are reserved. There are only 20 spots that can be reserved (one for each player soldier). This
|
||||
//spots are reserved. There are only 20 spots that can be reserved (one for each player soldier). This
|
||||
//code shouldn't be used for enemies or anybody else.
|
||||
void BeginMapEdgepointSearch();
|
||||
void EndMapEdgepointSearch();
|
||||
@@ -66,10 +66,10 @@ INT16 SearchForClosestPrimaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode
|
||||
INT16 SearchForClosestSecondaryMapEdgepoint( INT16 sGridNo, UINT8 ubInsertionCode );
|
||||
|
||||
//There are two classes of edgepoints.
|
||||
//PRIMARY : The default list of edgepoints. This list includes edgepoints that are easily accessible from the
|
||||
//PRIMARY : The default list of edgepoints. This list includes edgepoints that are easily accessible from the
|
||||
// strategic level.
|
||||
//SECONDARY : The isolated list of edgepoints. Certain areas of the game are blocked off, but tactically traversing
|
||||
// to these areas is possible. Examples would be isolated sections of Grumm or Alma, which you can't
|
||||
//SECONDARY : The isolated list of edgepoints. Certain areas of the game are blocked off, but tactically traversing
|
||||
// to these areas is possible. Examples would be isolated sections of Grumm or Alma, which you can't
|
||||
// immediately
|
||||
//
|
||||
UINT8 CalcMapEdgepointClassInsertionCode( INT16 sGridNo );
|
||||
|
||||
+183
-137
@@ -32,8 +32,14 @@
|
||||
#include "meanwhile.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Animation Data.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
extern INT32 iCurrentMapSectorZ;
|
||||
|
||||
void AdjustWorldCenterFromRadarCoords( INT16 sRadarX, INT16 sRadarY );
|
||||
@@ -49,7 +55,7 @@ void TacticalSquadListBtnCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
// the squad list font
|
||||
#define SQUAD_FONT COMPFONT
|
||||
|
||||
#define SQUAD_REGION_HEIGHT 2 * RADAR_WINDOW_HEIGHT
|
||||
#define SQUAD_REGION_HEIGHT 2 * RADAR_WINDOW_HEIGHT
|
||||
#define SQUAD_WINDOW_TM_Y RADAR_WINDOW_TM_Y + GetFontHeight( SQUAD_FONT )
|
||||
|
||||
// subtractor for squad list from size of radar view region height
|
||||
@@ -60,12 +66,22 @@ INT16 gsRadarX;
|
||||
INT16 gsRadarY;
|
||||
UINT32 gusRadarImage;
|
||||
BOOLEAN fImageLoaded = FALSE;
|
||||
BOOLEAN fRenderRadarScreen = TRUE;
|
||||
BOOLEAN fRenderRadarScreen = TRUE;
|
||||
INT16 sSelectedSquadLine = -1;
|
||||
|
||||
// CHRISL: Moved radar coords from header file
|
||||
INT16 RADAR_WINDOW_TM_X;
|
||||
INT16 RADAR_WINDOW_SM_X;
|
||||
INT16 RADAR_WINDOW_TM_Y;
|
||||
INT16 RADAR_WINDOW_SM_Y;
|
||||
INT16 RADAR_WINDOW_WIDTH;
|
||||
INT16 RADAR_WINDOW_HEIGHT;
|
||||
INT16 RADAR_WINDOW_STRAT_X;
|
||||
INT16 RADAR_WINDOW_STRAT_Y;
|
||||
|
||||
BOOLEAN gfRadarCurrentGuyFlash = FALSE;
|
||||
|
||||
// WANNE: Are we allowed to scroll in radar map?
|
||||
// WANNE: Are we allowed to scroll in radar map?
|
||||
// (E.g: It is not allowed to scroll, if the whole tactical map fits in the radar map) [2007-05-14]
|
||||
BOOLEAN fAllowRadarMovementHor = TRUE;
|
||||
BOOLEAN fAllowRadarMovementVer = TRUE;
|
||||
@@ -73,15 +89,29 @@ BOOLEAN fAllowRadarMovementVer = TRUE;
|
||||
|
||||
MOUSE_REGION gRadarRegionSquadList[ NUMBER_OF_SQUADS ];
|
||||
|
||||
void InitRadarScreenCoords( )
|
||||
{
|
||||
RADAR_WINDOW_TM_X = (SCREEN_WIDTH - 97);
|
||||
RADAR_WINDOW_SM_X = (SCREEN_WIDTH - 97);
|
||||
RADAR_WINDOW_TM_Y = (INTERFACE_START_Y + 13);
|
||||
RADAR_WINDOW_SM_Y = ((UsingNewInventorySystem() == false)) ? (INV_INTERFACE_START_Y + 33) : (INV_INTERFACE_START_Y + 116);
|
||||
RADAR_WINDOW_WIDTH = 88;
|
||||
RADAR_WINDOW_HEIGHT = 44;
|
||||
RADAR_WINDOW_STRAT_X = (SCREEN_WIDTH - 97);
|
||||
RADAR_WINDOW_STRAT_Y = (SCREEN_HEIGHT - 107);
|
||||
}
|
||||
|
||||
BOOLEAN InitRadarScreen( )
|
||||
{
|
||||
// CHRISL: Move screen coord setup to it's own function
|
||||
InitRadarScreenCoords();
|
||||
// Add region for radar
|
||||
MSYS_DefineRegion( &gRadarRegion, RADAR_WINDOW_X, RADAR_WINDOW_TM_Y,
|
||||
RADAR_WINDOW_X + RADAR_WINDOW_WIDTH,
|
||||
RADAR_WINDOW_TM_Y + RADAR_WINDOW_HEIGHT,
|
||||
MSYS_PRIORITY_HIGHEST, 0,
|
||||
RadarRegionMoveCallback,
|
||||
RadarRegionButtonCallback );
|
||||
MSYS_DefineRegion( &gRadarRegion, RADAR_WINDOW_TM_X, RADAR_WINDOW_TM_Y,
|
||||
RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH,
|
||||
RADAR_WINDOW_TM_Y + RADAR_WINDOW_HEIGHT,
|
||||
MSYS_PRIORITY_HIGHEST, 0,
|
||||
RadarRegionMoveCallback,
|
||||
RadarRegionButtonCallback );
|
||||
|
||||
// Add region
|
||||
MSYS_AddRegion( &gRadarRegion );
|
||||
@@ -89,7 +119,7 @@ BOOLEAN InitRadarScreen( )
|
||||
//disable the radar map
|
||||
MSYS_DisableRegion(&gRadarRegion);
|
||||
|
||||
gsRadarX = RADAR_WINDOW_X;
|
||||
gsRadarX = RADAR_WINDOW_TM_X;
|
||||
gsRadarY = RADAR_WINDOW_TM_Y;
|
||||
|
||||
return( TRUE );
|
||||
@@ -104,46 +134,46 @@ BOOLEAN LoadRadarScreenBitmap(CHAR8 * aFilename )
|
||||
|
||||
strcpy( zFilename, aFilename );
|
||||
|
||||
// If we have loaded, remove old one
|
||||
if ( fImageLoaded )
|
||||
{
|
||||
DeleteVideoObjectFromIndex( gusRadarImage );
|
||||
|
||||
fImageLoaded = FALSE;
|
||||
}
|
||||
// If we have loaded, remove old one
|
||||
if ( fImageLoaded )
|
||||
{
|
||||
DeleteVideoObjectFromIndex( gusRadarImage );
|
||||
|
||||
/* ARM - Restriction removed Nov.29/98. Must be able to view different radar maps from map screen while underground!
|
||||
// If we are in a cave or basement..... dont get a new one...
|
||||
if( !gfBasement && !gfCaves )
|
||||
fImageLoaded = FALSE;
|
||||
}
|
||||
|
||||
/* ARM - Restriction removed Nov.29/98. Must be able to view different radar maps from map screen while underground!
|
||||
// If we are in a cave or basement..... dont get a new one...
|
||||
if( !gfBasement && !gfCaves )
|
||||
*/
|
||||
{
|
||||
// Remove extension
|
||||
for ( cnt = strlen( zFilename )-1; cnt >=0; cnt-- )
|
||||
{
|
||||
if ( zFilename[ cnt ] == '.' )
|
||||
{
|
||||
zFilename[ cnt ] = '\0';
|
||||
}
|
||||
}
|
||||
{
|
||||
// Remove extension
|
||||
for ( cnt = strlen( zFilename )-1; cnt >=0; cnt-- )
|
||||
{
|
||||
if ( zFilename[ cnt ] == '.' )
|
||||
{
|
||||
zFilename[ cnt ] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
// Grab the Map image
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
sprintf( VObjectDesc.ImageFile, "RADARMAPS\\%s.STI", zFilename );
|
||||
// Grab the Map image
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
sprintf( VObjectDesc.ImageFile, "RADARMAPS\\%s.STI", zFilename );
|
||||
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &gusRadarImage));
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &gusRadarImage));
|
||||
|
||||
fImageLoaded = TRUE;
|
||||
fImageLoaded = TRUE;
|
||||
|
||||
if( GetVideoObject( &hVObject, gusRadarImage ) )
|
||||
{
|
||||
if( GetVideoObject( &hVObject, gusRadarImage ) )
|
||||
{
|
||||
// ATE: Add a shade table!
|
||||
hVObject->pShades[ 0 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 255, 255, 255, FALSE );
|
||||
hVObject->pShades[ 1 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 100, 100, 100, FALSE );
|
||||
}
|
||||
}
|
||||
hVObject->pShades[ 0 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 255, 255, 255, FALSE );
|
||||
hVObject->pShades[ 1 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 100, 100, 100, FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
// Dirty interface
|
||||
fInterfacePanelDirty = TRUE;
|
||||
// Dirty interface
|
||||
fInterfacePanelDirty = TRUE;
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -151,11 +181,11 @@ BOOLEAN LoadRadarScreenBitmap(CHAR8 * aFilename )
|
||||
void ClearOutRadarMapImage( void )
|
||||
{
|
||||
// If we have loaded, remove old one
|
||||
if ( fImageLoaded )
|
||||
{
|
||||
DeleteVideoObjectFromIndex( gusRadarImage );
|
||||
fImageLoaded = FALSE;
|
||||
}
|
||||
if ( fImageLoaded )
|
||||
{
|
||||
DeleteVideoObjectFromIndex( gusRadarImage );
|
||||
fImageLoaded = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -173,23 +203,29 @@ void MoveRadarScreen()
|
||||
|
||||
// Add new one
|
||||
|
||||
// Move based on inventory panel
|
||||
// CHRISL: Reset coords
|
||||
InitRadarScreenCoords();
|
||||
// Move based on inventory panel
|
||||
if( guiCurrentScreen == MAP_SCREEN )
|
||||
{
|
||||
gsRadarX = RADAR_WINDOW_STRAT_X;
|
||||
gsRadarY = RADAR_WINDOW_STRAT_Y;
|
||||
}
|
||||
else if ( gsCurInterfacePanel == SM_PANEL )
|
||||
{
|
||||
gsRadarY = RADAR_WINDOW_TM_Y;
|
||||
gsRadarX = RADAR_WINDOW_SM_X;
|
||||
gsRadarY = RADAR_WINDOW_SM_Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
gsRadarX = RADAR_WINDOW_TM_X;
|
||||
gsRadarY = RADAR_WINDOW_TM_Y;
|
||||
}
|
||||
|
||||
// Add region for radar
|
||||
MSYS_DefineRegion( &gRadarRegion, RADAR_WINDOW_X, (UINT16)(gsRadarY),
|
||||
RADAR_WINDOW_X + RADAR_WINDOW_WIDTH,
|
||||
// CHRISL:
|
||||
MSYS_DefineRegion( &gRadarRegion, (UINT16) (gsRadarX), (UINT16)(gsRadarY),
|
||||
(UINT16) (gsRadarX + RADAR_WINDOW_WIDTH),
|
||||
(UINT16)(gsRadarY + RADAR_WINDOW_HEIGHT),
|
||||
MSYS_PRIORITY_HIGHEST, 0,
|
||||
RadarRegionMoveCallback,
|
||||
@@ -218,7 +254,7 @@ void RadarRegionMoveCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// WANNE: If the tactical map fits in the whole radar map, disable scrolling in radar map. [2007-05-14]
|
||||
if (fAllowRadarMovementHor)
|
||||
// Use relative coordinates to set center of viewport
|
||||
sRadarX = pRegion->RelativeXPos - ( RADAR_WINDOW_WIDTH / 2 );
|
||||
sRadarX = pRegion->RelativeXPos - ( RADAR_WINDOW_WIDTH / 2 );
|
||||
else
|
||||
sRadarX = 0;
|
||||
|
||||
@@ -253,7 +289,7 @@ void RadarRegionButtonCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// WANNE: If the tactical map fits in the whole radar map, disable scrolling in radar map. [2007-05-14]
|
||||
if (fAllowRadarMovementHor)
|
||||
// Use relative coordinates to set center of viewport
|
||||
sRadarX = pRegion->RelativeXPos - ( RADAR_WINDOW_WIDTH / 2 );
|
||||
sRadarX = pRegion->RelativeXPos - ( RADAR_WINDOW_WIDTH / 2 );
|
||||
else
|
||||
sRadarX = 0;
|
||||
|
||||
@@ -265,7 +301,7 @@ void RadarRegionButtonCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
if (fAllowRadarMovementHor || fAllowRadarMovementVer)
|
||||
{
|
||||
AdjustWorldCenterFromRadarCoords( sRadarX, sRadarY );
|
||||
|
||||
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
}
|
||||
@@ -311,12 +347,12 @@ void RenderRadarScreen( )
|
||||
|
||||
INT16 sXSoldPos, sYSoldPos, sXSoldScreen, sYSoldScreen, sXSoldRadar, sYSoldRadar;
|
||||
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
UINT32 cnt;
|
||||
INT16 sHeight, sWidth, sX, sY;
|
||||
INT32 iCounter = 0;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
UINT32 cnt;
|
||||
INT16 sHeight, sWidth, sX, sY;
|
||||
INT32 iCounter = 0;
|
||||
|
||||
|
||||
// create / destroy squad list regions as nessacary
|
||||
@@ -350,18 +386,20 @@ void RenderRadarScreen( )
|
||||
}
|
||||
}
|
||||
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, gusRadarImage, 0, RADAR_WINDOW_X, gsRadarY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
// CHRISL:
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, gusRadarImage, 0, gsRadarX, gsRadarY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
// FIRST DELETE WHAT'S THERE
|
||||
RestoreExternBackgroundRect( RADAR_WINDOW_X, gsRadarY, RADAR_WINDOW_WIDTH + 1 , RADAR_WINDOW_HEIGHT + 1 );
|
||||
// CHRISL:
|
||||
RestoreExternBackgroundRect( gsRadarX, gsRadarY, RADAR_WINDOW_WIDTH + 1 , RADAR_WINDOW_HEIGHT + 1 );
|
||||
|
||||
// Determine scale factors
|
||||
|
||||
// Find the diustance from render center to true world center
|
||||
sDistToCenterX = gsRenderCenterX - gCenterWorldX;
|
||||
sDistToCenterY = gsRenderCenterY - gCenterWorldY;
|
||||
|
||||
|
||||
// From render center in world coords, convert to render center in "screen" coords
|
||||
FromCellToScreenCoordinates( sDistToCenterX , sDistToCenterY, &sScreenCenterX, &sScreenCenterY );
|
||||
|
||||
@@ -374,17 +412,17 @@ void RenderRadarScreen( )
|
||||
sX_S = ( ( gsVIEWPORT_END_X - gsVIEWPORT_START_X ) /2 );
|
||||
sY_S = ( ( gsVIEWPORT_END_Y - gsVIEWPORT_START_Y ) /2 );
|
||||
|
||||
sTopLeftWorldX = sScreenCenterX - sX_S;
|
||||
sTopLeftWorldY = sScreenCenterY - sY_S;
|
||||
sTopLeftWorldX = sScreenCenterX - sX_S;
|
||||
sTopLeftWorldY = sScreenCenterY - sY_S;
|
||||
|
||||
sTopRightWorldX = sScreenCenterX + sX_S;
|
||||
sTopRightWorldY = sScreenCenterY - sY_S;
|
||||
|
||||
sBottomLeftWorldX = sScreenCenterX - sX_S;
|
||||
sBottomLeftWorldY = sScreenCenterY + sY_S;
|
||||
sTopRightWorldX = sScreenCenterX + sX_S;
|
||||
sTopRightWorldY = sScreenCenterY - sY_S;
|
||||
|
||||
sBottomRightWorldX = sScreenCenterX + sX_S;
|
||||
sBottomRightWorldY = sScreenCenterY + sY_S;
|
||||
sBottomLeftWorldX = sScreenCenterX - sX_S;
|
||||
sBottomLeftWorldY = sScreenCenterY + sY_S;
|
||||
|
||||
sBottomRightWorldX = sScreenCenterX + sX_S;
|
||||
sBottomRightWorldY = sScreenCenterY + sY_S;
|
||||
|
||||
|
||||
// Determine radar coordinates
|
||||
@@ -394,12 +432,12 @@ void RenderRadarScreen( )
|
||||
|
||||
sWidth = ( RADAR_WINDOW_WIDTH );
|
||||
sHeight = ( RADAR_WINDOW_HEIGHT );
|
||||
sX = RADAR_WINDOW_X;
|
||||
sX = RADAR_WINDOW_TM_X;
|
||||
sY = gsRadarY;
|
||||
|
||||
|
||||
sRadarTLX = (INT16)( ( sTopLeftWorldX * gdScaleX ) - sRadarCX + sX + ( sWidth /2 ) );
|
||||
sRadarTLY = (INT16)( ( sTopLeftWorldY * gdScaleY ) - sRadarCY + gsRadarY + ( sHeight /2 ) );
|
||||
sRadarTLX = (INT16)( ( sTopLeftWorldX * gdScaleX ) - sRadarCX + sX + ( sWidth /2 ) );
|
||||
sRadarTLY = (INT16)( ( sTopLeftWorldY * gdScaleY ) - sRadarCY + gsRadarY + ( sHeight /2 ) );
|
||||
sRadarBRX = (INT16)( ( sBottomRightWorldX * gdScaleX ) - sRadarCX + sX + ( sWidth /2 ) );
|
||||
sRadarBRY = (INT16)( ( sBottomRightWorldY * gdScaleY ) - sRadarCY + gsRadarY + ( sHeight /2 ) );
|
||||
|
||||
@@ -419,7 +457,8 @@ void RenderRadarScreen( )
|
||||
|
||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, RADAR_WINDOW_X, gsRadarY, ( RADAR_WINDOW_X + RADAR_WINDOW_WIDTH - 1 ), ( gsRadarY + RADAR_WINDOW_HEIGHT - 1 ) );
|
||||
// CHRISL:
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, gsRadarX, gsRadarY, ( gsRadarX + RADAR_WINDOW_WIDTH - 1 ), ( gsRadarY + RADAR_WINDOW_HEIGHT - 1 ) );
|
||||
|
||||
if( !( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) )
|
||||
{
|
||||
@@ -428,8 +467,8 @@ void RenderRadarScreen( )
|
||||
// WANNE: Correct radar rectangle size if it is too large to fit in radar screen [2007-05-14]
|
||||
if (fAllowRadarMovementHor == FALSE)
|
||||
{
|
||||
sRadarTLX = RADAR_WINDOW_X;
|
||||
sRadarBRX = RADAR_WINDOW_X + RADAR_WINDOW_WIDTH;
|
||||
sRadarTLX = RADAR_WINDOW_TM_X;
|
||||
sRadarBRX = RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH;
|
||||
}
|
||||
|
||||
if (fAllowRadarMovementVer == FALSE)
|
||||
@@ -468,7 +507,7 @@ void RenderRadarScreen( )
|
||||
|
||||
iItemNumber = iCounter + iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
// stolen item
|
||||
if( ( pInventoryPoolList[ iItemNumber ].o.ubNumberOfObjects == 0 )||( pInventoryPoolList[ iItemNumber ].sGridNo == 0 ) )
|
||||
if( ( pInventoryPoolList[ iItemNumber ].object.exists() == false )||( pInventoryPoolList[ iItemNumber ].sGridNo == 0 ) )
|
||||
{
|
||||
// yep, continue on
|
||||
continue;
|
||||
@@ -483,7 +522,7 @@ void RenderRadarScreen( )
|
||||
|
||||
|
||||
// Add starting relative to interface
|
||||
sXSoldRadar += RADAR_WINDOW_X;
|
||||
sXSoldRadar += RADAR_WINDOW_TM_X;
|
||||
sYSoldRadar += gsRadarY;
|
||||
|
||||
// if we are in 16 bit mode....kind of redundant
|
||||
@@ -491,13 +530,13 @@ void RenderRadarScreen( )
|
||||
{
|
||||
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 ) );
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) );
|
||||
}
|
||||
|
||||
if( iCurrentlyHighLightedItem == iCounter )
|
||||
@@ -507,7 +546,7 @@ void RenderRadarScreen( )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( !( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) )
|
||||
{
|
||||
// RE-RENDER RADAR
|
||||
@@ -516,7 +555,7 @@ void RenderRadarScreen( )
|
||||
pSoldier = MercSlots[ cnt ];
|
||||
|
||||
if ( pSoldier != NULL )
|
||||
{
|
||||
{
|
||||
// Don't place guys in radar until visible!
|
||||
if ( pSoldier->bVisible == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) && !(pSoldier->ubMiscSoldierFlags & SOLDIER_MISC_XRAYED) )
|
||||
{
|
||||
@@ -524,7 +563,7 @@ void RenderRadarScreen( )
|
||||
}
|
||||
|
||||
// Don't render guys if they are dead!
|
||||
if ( ( pSoldier->uiStatusFlags & SOLDIER_DEAD ) )
|
||||
if ( ( pSoldier->flags.uiStatusFlags & SOLDIER_DEAD ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -549,13 +588,13 @@ void RenderRadarScreen( )
|
||||
}
|
||||
|
||||
// Add starting relative to interface
|
||||
sXSoldRadar += RADAR_WINDOW_X;
|
||||
sXSoldRadar += RADAR_WINDOW_TM_X;
|
||||
sYSoldRadar += gsRadarY;
|
||||
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
// DB Need to add a radar color for 8-bit
|
||||
// DB Need to add a radar color for 8-bit
|
||||
|
||||
// Are we a selected guy?
|
||||
if ( pSoldier->ubID == gusSelectedSoldier )
|
||||
@@ -566,47 +605,47 @@ void RenderRadarScreen( )
|
||||
}
|
||||
else
|
||||
{
|
||||
// If on roof, make darker....
|
||||
if ( pSoldier->bLevel > 0 )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
usLineColor = Get16BPPColor( gTacticalStatus.Team[ pSoldier->bTeam ].RadarColor );
|
||||
}
|
||||
}
|
||||
// If on roof, make darker....
|
||||
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 );
|
||||
|
||||
// Override civ team with red if hostile...
|
||||
if ( pSoldier->bTeam == CIV_TEAM && !pSoldier->bNeutral && ( pSoldier->bSide != gbPlayerNum ) )
|
||||
{
|
||||
// Override civ team with red if hostile...
|
||||
if ( pSoldier->bTeam == CIV_TEAM && !pSoldier->aiData.bNeutral && ( pSoldier->bSide != gbPlayerNum ) )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Render different color if an enemy and he's unconscious
|
||||
if ( pSoldier->bTeam != gbPlayerNum && pSoldier->bLife < OKLIFE )
|
||||
if ( pSoldier->bTeam != gbPlayerNum && pSoldier->stats.bLife < OKLIFE )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 128, 128, 128 ) );
|
||||
}
|
||||
|
||||
// If on roof, make darker....
|
||||
if ( pSoldier->bTeam == gbPlayerNum && pSoldier->bLevel > 0 )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 150, 150, 0 ) );
|
||||
}
|
||||
// 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 );
|
||||
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 );
|
||||
RectangleDraw8( TRUE, sXSoldRadar, sYSoldRadar, sXSoldRadar+1, sYSoldRadar+1, usLineColor, pDestBuf );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -616,8 +655,9 @@ void RenderRadarScreen( )
|
||||
|
||||
if( ( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) && ( fShowMapInventoryPool == TRUE ) )
|
||||
{
|
||||
InvalidateRegion( RADAR_WINDOW_X, gsRadarY,
|
||||
RADAR_WINDOW_X + RADAR_WINDOW_WIDTH,
|
||||
// CHRISL:
|
||||
InvalidateRegion( gsRadarX, gsRadarY,
|
||||
gsRadarX + RADAR_WINDOW_WIDTH,
|
||||
gsRadarY + RADAR_WINDOW_HEIGHT );
|
||||
}
|
||||
|
||||
@@ -643,15 +683,15 @@ void AdjustWorldCenterFromRadarCoords( INT16 sRadarX, INT16 sRadarY )
|
||||
sScreenY -= ( ( gsVIEWPORT_END_Y - gsVIEWPORT_START_Y ) /2 );
|
||||
|
||||
//Make sure these coordinates are multiples of scroll steps
|
||||
sNumXSteps = sScreenX / SCROLL_X_STEP;
|
||||
sNumXSteps = sScreenX / SCROLL_X_STEP;
|
||||
sNumYSteps = sScreenY / SCROLL_Y_STEP;
|
||||
|
||||
sScreenX = ( sNumXSteps * SCROLL_X_STEP );
|
||||
sScreenY = ( sNumYSteps * SCROLL_Y_STEP );
|
||||
|
||||
// Adjust back
|
||||
sScreenX += ( ( gsVIEWPORT_END_X - gsVIEWPORT_START_X ) /2 );
|
||||
sScreenY += ( ( gsVIEWPORT_END_Y - gsVIEWPORT_START_Y ) /2 );
|
||||
sScreenX += ( ( gsVIEWPORT_END_X - gsVIEWPORT_START_X ) /2 );
|
||||
sScreenY += ( ( gsVIEWPORT_END_Y - gsVIEWPORT_START_Y ) /2 );
|
||||
|
||||
// Subtract world center
|
||||
//sScreenX += gsCX;
|
||||
@@ -688,10 +728,10 @@ void ToggleRadarScreenRender( void )
|
||||
|
||||
BOOLEAN CreateDestroyMouseRegionsForSquadList( void )
|
||||
{
|
||||
// will check the state of renderradarscreen flag and decide if we need to create mouse regions for
|
||||
// will check the state of renderradarscreen flag and decide if we need to create mouse regions for
|
||||
static BOOLEAN fCreated = FALSE;
|
||||
INT16 sCounter = 0;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
HVOBJECT hHandle;
|
||||
UINT32 uiHandle;
|
||||
|
||||
@@ -699,16 +739,16 @@ BOOLEAN CreateDestroyMouseRegionsForSquadList( void )
|
||||
{
|
||||
// create regions
|
||||
// load graphics
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("INTERFACE\\squadpanel.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiHandle));
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("INTERFACE\\squadpanel.sti", VObjectDesc.ImageFile);
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &uiHandle));
|
||||
|
||||
GetVideoObject(&hHandle, uiHandle);
|
||||
|
||||
|
||||
GetVideoObject(&hHandle, uiHandle);
|
||||
|
||||
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,(SCREEN_WIDTH - 102 - 1), gsVIEWPORT_END_Y, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
RestoreExternBackgroundRect ((SCREEN_WIDTH - 102 - 1), gsVIEWPORT_END_Y, 102,( INT16 ) ( SCREEN_HEIGHT - gsVIEWPORT_END_Y ) );
|
||||
|
||||
|
||||
for( sCounter = 0; sCounter < NUMBER_OF_SQUADS; sCounter++ )
|
||||
{
|
||||
// run through list of squads and place appropriatly
|
||||
@@ -716,14 +756,16 @@ BOOLEAN CreateDestroyMouseRegionsForSquadList( void )
|
||||
{
|
||||
|
||||
// left half of list
|
||||
MSYS_DefineRegion( &gRadarRegionSquadList[ sCounter ], RADAR_WINDOW_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / ( NUMBER_OF_SQUADS / 2 ) ) ) ), RADAR_WINDOW_X + RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter + 1 ) * ( ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / ( NUMBER_OF_SQUADS / 2 ) ) ) ) ,MSYS_PRIORITY_HIGHEST,
|
||||
// CHRISL:
|
||||
MSYS_DefineRegion( &gRadarRegionSquadList[ sCounter ], RADAR_WINDOW_TM_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / ( NUMBER_OF_SQUADS / 2 ) ) ) ), RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter + 1 ) * ( ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / ( NUMBER_OF_SQUADS / 2 ) ) ) ) ,MSYS_PRIORITY_HIGHEST,
|
||||
0, TacticalSquadListMvtCallback, TacticalSquadListBtnCallBack );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// right half of list
|
||||
MSYS_DefineRegion( &gRadarRegionSquadList[ sCounter ], RADAR_WINDOW_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_X + RADAR_WINDOW_WIDTH - 1, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( ( sCounter + 1 ) - ( NUMBER_OF_SQUADS / 2) )* ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), MSYS_PRIORITY_HIGHEST,
|
||||
// CHRISL:
|
||||
MSYS_DefineRegion( &gRadarRegionSquadList[ sCounter ], RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH - 1, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( ( sCounter + 1 ) - ( NUMBER_OF_SQUADS / 2) )* ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), MSYS_PRIORITY_HIGHEST,
|
||||
0, TacticalSquadListMvtCallback, TacticalSquadListBtnCallBack );
|
||||
}
|
||||
|
||||
@@ -746,20 +788,20 @@ BOOLEAN CreateDestroyMouseRegionsForSquadList( void )
|
||||
|
||||
for( sCounter = 0; sCounter < NUMBER_OF_SQUADS; sCounter++ )
|
||||
{
|
||||
MSYS_RemoveRegion( &gRadarRegionSquadList[ sCounter ] );
|
||||
MSYS_RemoveRegion( &gRadarRegionSquadList[ sCounter ] );
|
||||
}
|
||||
|
||||
// set fact regions are destroyed
|
||||
fCreated = FALSE;
|
||||
|
||||
|
||||
|
||||
if ( guiCurrentScreen == GAME_SCREEN )
|
||||
{
|
||||
// dirty region
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
|
||||
MarkButtonsDirty( );
|
||||
|
||||
|
||||
// re render region
|
||||
RenderTacticalInterface( );
|
||||
|
||||
@@ -782,10 +824,12 @@ void RenderSquadList( void )
|
||||
INT16 sX, sY;
|
||||
|
||||
// clear region
|
||||
RestoreExternBackgroundRect( RADAR_WINDOW_X, gsRadarY, RADAR_WINDOW_WIDTH , SQUAD_REGION_HEIGHT );
|
||||
// CHRISL:
|
||||
RestoreExternBackgroundRect( gsRadarX, gsRadarY, RADAR_WINDOW_WIDTH , SQUAD_REGION_HEIGHT );
|
||||
|
||||
// fill area
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, RADAR_WINDOW_X, RADAR_WINDOW_TM_Y, RADAR_WINDOW_X + RADAR_WINDOW_WIDTH, RADAR_WINDOW_TM_Y + SQUAD_REGION_HEIGHT , Get16BPPColor( FROMRGB(0,0,0) ) );
|
||||
// CHRISL:
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, RADAR_WINDOW_TM_X, RADAR_WINDOW_TM_Y, RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH, RADAR_WINDOW_TM_Y + SQUAD_REGION_HEIGHT , Get16BPPColor( FROMRGB(0,0,0) ) );
|
||||
|
||||
// set font
|
||||
SetFont( SQUAD_FONT );
|
||||
@@ -795,11 +839,13 @@ void RenderSquadList( void )
|
||||
// run through list of squads and place appropriatly
|
||||
if( sCounter < NUMBER_OF_SQUADS / 2 )
|
||||
{
|
||||
FindFontCenterCoordinates( RADAR_WINDOW_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ) ,pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
||||
// CHRISL:
|
||||
FindFontCenterCoordinates( RADAR_WINDOW_TM_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ) ,pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
||||
}
|
||||
else
|
||||
{
|
||||
FindFontCenterCoordinates(RADAR_WINDOW_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
||||
// CHRISL:
|
||||
FindFontCenterCoordinates(RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter - ( NUMBER_OF_SQUADS / 2) ) * ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( ( ( 2 * ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / NUMBER_OF_SQUADS ) ) ), pSquadMenuStrings[ sCounter ] , SQUAD_FONT, &sX, &sY);
|
||||
}
|
||||
|
||||
// highlight line?
|
||||
@@ -817,7 +863,7 @@ void RenderSquadList( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
SetFontForeground( FONT_DKGREEN);
|
||||
SetFontForeground( FONT_DKGREEN);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -830,11 +876,11 @@ void RenderSquadList( void )
|
||||
|
||||
if( sCounter < NUMBER_OF_SQUADS / 2 )
|
||||
{
|
||||
sX = RADAR_WINDOW_X + 2;
|
||||
sX = RADAR_WINDOW_TM_X + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
sX = RADAR_WINDOW_X + ( RADAR_WINDOW_WIDTH / 2 ) - 2;
|
||||
sX = RADAR_WINDOW_TM_X + ( RADAR_WINDOW_WIDTH / 2 ) - 2;
|
||||
}
|
||||
mprintf( sX, sY , pSquadMenuStrings[ sCounter ]);
|
||||
}
|
||||
@@ -850,7 +896,7 @@ void TacticalSquadListMvtCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if( IsSquadOnCurrentTacticalMap( iValue ) == TRUE )
|
||||
{
|
||||
sSelectedSquadLine = ( INT16 )iValue;
|
||||
sSelectedSquadLine = ( INT16 )iValue;
|
||||
}
|
||||
}
|
||||
if (iReason & MSYS_CALLBACK_REASON_LOST_MOUSE )
|
||||
|
||||
@@ -9,13 +9,16 @@ void RadarRegionButtonCallback( MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
BOOLEAN LoadRadarScreenBitmap( CHAR8 * aFilename );
|
||||
|
||||
// CHRISL: Changed radar coord defines to standard variables and moved definition to radar screen.cpp
|
||||
// RADAR WINDOW DEFINES
|
||||
#define RADAR_WINDOW_X (SCREEN_WIDTH - 97) //543
|
||||
#define RADAR_WINDOW_TM_Y INTERFACE_START_Y + 13
|
||||
#define RADAR_WINDOW_SM_Y INV_INTERFACE_START_Y + 13
|
||||
#define RADAR_WINDOW_WIDTH 88
|
||||
#define RADAR_WINDOW_HEIGHT 44
|
||||
#define RADAR_WINDOW_STRAT_Y (SCREEN_HEIGHT - 107) //373
|
||||
extern INT16 RADAR_WINDOW_TM_X;
|
||||
extern INT16 RADAR_WINDOW_SM_X;
|
||||
extern INT16 RADAR_WINDOW_TM_Y;
|
||||
extern INT16 RADAR_WINDOW_SM_Y;
|
||||
extern INT16 RADAR_WINDOW_WIDTH;
|
||||
extern INT16 RADAR_WINDOW_HEIGHT;
|
||||
extern INT16 RADAR_WINDOW_STRAT_X;
|
||||
extern INT16 RADAR_WINDOW_STRAT_Y;
|
||||
|
||||
BOOLEAN InitRadarScreen( );
|
||||
void RenderRadarScreen( );
|
||||
@@ -37,6 +40,6 @@ BOOLEAN CreateDestroyMouseRegionsForSquadList( void );
|
||||
void ClearOutRadarMapImage( void );
|
||||
|
||||
// do we render the radar screen?..or the squad list?
|
||||
extern BOOLEAN fRenderRadarScreen;
|
||||
extern BOOLEAN fRenderRadarScreen;
|
||||
|
||||
#endif
|
||||
+140
-145
@@ -2,7 +2,7 @@
|
||||
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "TileEngine All.h"
|
||||
#include "winfont.h"
|
||||
#include "winfont.h"
|
||||
|
||||
#else
|
||||
#include "math.h"
|
||||
@@ -104,7 +104,7 @@ void AddBaseDirtyRect( INT32 iLeft, INT32 iTop, INT32 iRight, INT32 iBottom )
|
||||
iBottom = SCREEN_HEIGHT;
|
||||
}
|
||||
|
||||
if ( ( iRight - iLeft ) == 0 || ( iBottom - iTop ) == 0 )
|
||||
if ( ( iRight - iLeft ) == 0 || ( iBottom - iTop ) == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void AddBaseDirtyRect( INT32 iLeft, INT32 iTop, INT32 iRight, INT32 iBottom )
|
||||
InvalidateRegionEx( aRect.iLeft, aRect.iTop, aRect.iRight, aRect.iBottom, 0 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ExecuteBaseDirtyRectQueue( )
|
||||
{
|
||||
if(gfViewportDirty)
|
||||
@@ -169,7 +169,7 @@ UINT32 uiCount;
|
||||
else
|
||||
{
|
||||
//else display an error message
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("ERROR! GetFreeBackgroundBuffer(): Trying to allocate more saves then there is room: guiCurrentScreen = %d", guiCurrentScreen ) );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("ERROR! GetFreeBackgroundBuffer(): Trying to allocate more saves then there is room: guiCurrentScreen = %d", guiCurrentScreen ) );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -197,10 +197,10 @@ INT32 RegisterBackgroundRect(UINT32 uiFlags, INT16 *pSaveArea, INT16 sLeft, INT1
|
||||
{
|
||||
UINT32 uiBufSize;
|
||||
INT32 iBackIndex;
|
||||
INT32 ClipX1, ClipY1, ClipX2, ClipY2;
|
||||
INT32 ClipX1, ClipY1, ClipX2, ClipY2;
|
||||
INT32 uiLeftSkip, uiRightSkip, uiTopSkip, uiBottomSkip;
|
||||
UINT32 usHeight, usWidth;
|
||||
INT32 iTempX, iTempY;
|
||||
INT32 iTempX, iTempY;
|
||||
|
||||
|
||||
// Don't register if we are rendering and we are below the viewport
|
||||
@@ -215,7 +215,7 @@ INT32 iTempX, iTempY;
|
||||
ClipY2= gDirtyClipRect.iBottom;
|
||||
|
||||
usHeight = sBottom - sTop;
|
||||
usWidth = sRight - sLeft;
|
||||
usWidth = sRight - sLeft;
|
||||
|
||||
//if((sClipLeft >= sClipRight) || (sClipTop >= sClipBottom))
|
||||
// return(-1);
|
||||
@@ -229,25 +229,20 @@ INT32 iTempX, iTempY;
|
||||
uiBottomSkip=__min(__max(ClipY2, (iTempY+(INT32)usHeight)) - ClipY2, (INT32)usHeight);
|
||||
|
||||
// check if whole thing is clipped
|
||||
if((uiLeftSkip >=(INT32)usWidth) || (uiRightSkip >=(INT32)usWidth))
|
||||
if((uiLeftSkip >=(INT32)usWidth) || (uiRightSkip >=(INT32)usWidth))
|
||||
return(-1 );
|
||||
|
||||
// check if whole thing is clipped
|
||||
if((uiTopSkip >=(INT32)usHeight) || (uiBottomSkip >=(INT32)usHeight))
|
||||
if((uiTopSkip >=(INT32)usHeight) || (uiBottomSkip >=(INT32)usHeight))
|
||||
return(-1 );
|
||||
|
||||
// Set re-set values given based on clipping
|
||||
sLeft = sLeft + (INT16)uiLeftSkip;
|
||||
sLeft = sLeft + (INT16)uiLeftSkip;
|
||||
sRight = sRight - (INT16)uiRightSkip;
|
||||
sTop = sTop + (INT16)uiTopSkip;
|
||||
sTop = sTop + (INT16)uiTopSkip;
|
||||
sBottom = sBottom - (INT16)uiBottomSkip;
|
||||
|
||||
|
||||
if ( sLeft == 192 || sLeft == 188 )
|
||||
{
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
if((iBackIndex=GetFreeBackgroundBuffer())==(-1))
|
||||
return(-1);
|
||||
|
||||
@@ -258,10 +253,10 @@ if ( sLeft == 192 || sLeft == 188 )
|
||||
if(pSaveArea==NULL)
|
||||
{
|
||||
uiBufSize=((sRight-sLeft)*2)*(sBottom-sTop);
|
||||
|
||||
|
||||
if(uiBufSize==0)
|
||||
return(-1);
|
||||
|
||||
|
||||
if ( uiFlags & BGND_FLAG_SAVERECT )
|
||||
{
|
||||
if((gBackSaves[iBackIndex].pSaveArea = (INT16 *) MemAlloc(uiBufSize))==NULL)
|
||||
@@ -289,7 +284,7 @@ if ( sLeft == 192 || sLeft == 188 )
|
||||
gBackSaves[iBackIndex].sBottom=sBottom;
|
||||
gBackSaves[iBackIndex].sWidth=(sRight-sLeft);
|
||||
gBackSaves[iBackIndex].sHeight=(sBottom-sTop);
|
||||
|
||||
|
||||
gBackSaves[iBackIndex].fFilled=FALSE;
|
||||
|
||||
return(iBackIndex);
|
||||
@@ -307,7 +302,7 @@ void SetBackgroundRectFilled( UINT32 uiBackgroundID )
|
||||
BOOLEAN RestoreBackgroundRects(void)
|
||||
{
|
||||
UINT32 uiCount, uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
|
||||
pDestBuf = LockVideoSurface(guiRENDERBUFFER, &uiDestPitchBYTES);
|
||||
pSrcBuf = LockVideoSurface(guiSAVEBUFFER, &uiSrcPitchBYTES);
|
||||
@@ -322,8 +317,8 @@ UINT8 *pDestBuf, *pSrcBuf;
|
||||
if ( gBackSaves[uiCount].pSaveArea != NULL )
|
||||
{
|
||||
Blt16BPPTo16BPP( (UINT16*)pDestBuf, uiDestPitchBYTES, (UINT16 *)gBackSaves[uiCount].pSaveArea, gBackSaves[uiCount].sWidth*2,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sWidth, gBackSaves[uiCount].sHeight);
|
||||
|
||||
AddBaseDirtyRect(gBackSaves[uiCount].sLeft, gBackSaves[uiCount].sTop,
|
||||
@@ -336,17 +331,17 @@ UINT8 *pDestBuf, *pSrcBuf;
|
||||
if ( gBackSaves[uiCount].fZBuffer )
|
||||
{
|
||||
Blt16BPPTo16BPP( (UINT16*)gpZBuffer, uiDestPitchBYTES, (UINT16 *)gBackSaves[uiCount].pZSaveArea, gBackSaves[uiCount].sWidth*2,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sWidth, gBackSaves[uiCount].sHeight);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
gBackSaves[uiCount].sWidth, gBackSaves[uiCount].sHeight);
|
||||
|
||||
AddBaseDirtyRect(gBackSaves[uiCount].sLeft, gBackSaves[uiCount].sTop,
|
||||
@@ -405,7 +400,7 @@ BOOLEAN EmptyBackgroundRects(void)
|
||||
{
|
||||
if ( gBackSaves[uiCount].pSaveArea != NULL )
|
||||
{
|
||||
MemFree(gBackSaves[uiCount].pSaveArea);
|
||||
MemFree(gBackSaves[uiCount].pSaveArea);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,7 +426,7 @@ BOOLEAN EmptyBackgroundRects(void)
|
||||
BOOLEAN SaveBackgroundRects(void)
|
||||
{
|
||||
UINT32 uiCount, uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
|
||||
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiDestPitchBYTES );
|
||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiSrcPitchBYTES);
|
||||
@@ -446,19 +441,19 @@ UINT8 *pDestBuf, *pSrcBuf;
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)gBackSaves[uiCount].pSaveArea, gBackSaves[uiCount].sWidth*2,
|
||||
(UINT16 *)pSrcBuf, uiDestPitchBYTES,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
gBackSaves[uiCount].sWidth, gBackSaves[uiCount].sHeight);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if(gBackSaves[uiCount].fZBuffer)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)gBackSaves[uiCount].pZSaveArea, gBackSaves[uiCount].sWidth*2,
|
||||
(UINT16 *)gpZBuffer, uiDestPitchBYTES,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
Blt16BPPTo16BPP((UINT16 *)gBackSaves[uiCount].pZSaveArea, gBackSaves[uiCount].sWidth*2,
|
||||
(UINT16 *)gpZBuffer, uiDestPitchBYTES,
|
||||
0, 0,
|
||||
gBackSaves[uiCount].sLeft , gBackSaves[uiCount].sTop,
|
||||
gBackSaves[uiCount].sWidth, gBackSaves[uiCount].sHeight);
|
||||
}
|
||||
else
|
||||
@@ -479,7 +474,7 @@ UINT8 *pDestBuf, *pSrcBuf;
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOLEAN FreeBackgroundRect(INT32 iIndex)
|
||||
{
|
||||
if ( iIndex != -1 )
|
||||
@@ -488,14 +483,14 @@ BOOLEAN FreeBackgroundRect(INT32 iIndex)
|
||||
|
||||
RecountBackgrounds();
|
||||
}
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN FreeBackgroundRectPending(INT32 iIndex)
|
||||
{
|
||||
gBackSaves[iIndex].fPendingDelete = TRUE;
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -543,7 +538,7 @@ UINT32 uiCount;
|
||||
}
|
||||
|
||||
RecountBackgrounds();
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -586,11 +581,11 @@ void DisableBackgroundRect( INT32 iIndex, BOOLEAN fDisabled )
|
||||
BOOLEAN UpdateSaveBuffer(void)
|
||||
{
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT16 usWidth, usHeight;
|
||||
UINT8 ubBitDepth;
|
||||
UINT8 ubBitDepth;
|
||||
|
||||
|
||||
|
||||
// Update saved buffer - do for the viewport size ony!
|
||||
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
|
||||
|
||||
@@ -600,15 +595,15 @@ BOOLEAN UpdateSaveBuffer(void)
|
||||
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 ) );
|
||||
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,
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
0, gsVIEWPORT_WINDOW_START_Y, 0, gsVIEWPORT_WINDOW_START_Y, usWidth, gsVIEWPORT_WINDOW_END_Y );
|
||||
}
|
||||
|
||||
@@ -624,7 +619,7 @@ BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT1
|
||||
{
|
||||
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
|
||||
|
||||
Assert( ( sLeft >= 0 ) && ( sTop >= 0 ) && ( sLeft + sWidth <= SCREEN_WIDTH ) && ( sTop + sHeight <= SCREEN_HEIGHT ) );
|
||||
@@ -634,18 +629,18 @@ BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT1
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
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,
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
@@ -662,7 +657,7 @@ BOOLEAN RestoreExternBackgroundRectGivenID( INT32 iBack )
|
||||
{
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
INT16 sLeft, sTop, sWidth, sHeight;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
|
||||
|
||||
if( !gBackSaves[iBack].fAllocated )
|
||||
@@ -682,18 +677,18 @@ BOOLEAN RestoreExternBackgroundRectGivenID( INT32 iBack )
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
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,
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
@@ -710,7 +705,7 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
|
||||
{
|
||||
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
|
||||
|
||||
Assert( ( sLeft >= 0 ) && ( sTop >= 0 ) && ( sLeft + sWidth <= SCREEN_WIDTH ) && ( sTop + sHeight <= SCREEN_HEIGHT ) );
|
||||
@@ -720,18 +715,18 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
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,
|
||||
Blt8BPPTo8BPP(pDestBuf, uiDestPitchBYTES,
|
||||
pSrcBuf, uiSrcPitchBYTES,
|
||||
sLeft , sTop,
|
||||
sLeft , sTop,
|
||||
sWidth, sHeight);
|
||||
}
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
@@ -748,7 +743,7 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
|
||||
// background for a given call to gprintf. Note that this must be called before
|
||||
// the backgrounds are saved, and before the actual call to gprintf that writes
|
||||
// to the video buffer.
|
||||
//
|
||||
//
|
||||
//*****************************************************************************
|
||||
UINT16 gprintfdirty(INT16 x, INT16 y, STR16 pFontString, ...)
|
||||
{
|
||||
@@ -759,24 +754,24 @@ INT32 iBack;
|
||||
|
||||
Assert(pFontString!=NULL);
|
||||
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
if ( USE_WINFONTS( ) )
|
||||
{
|
||||
uiStringLength=WinFontStringPixLength( string, GET_WINFONT( ) );
|
||||
uiStringHeight=GetWinFontHeight( string, GET_WINFONT( ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
uiStringLength=StringPixLength(string, FontDefault);
|
||||
uiStringHeight=GetFontHeight(FontDefault);
|
||||
}
|
||||
if ( USE_WINFONTS( ) )
|
||||
{
|
||||
uiStringLength=WinFontStringPixLength( string, GET_WINFONT( ) );
|
||||
uiStringHeight=GetWinFontHeight( string, GET_WINFONT( ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
uiStringLength=StringPixLength(string, FontDefault);
|
||||
uiStringHeight=GetFontHeight(FontDefault);
|
||||
}
|
||||
|
||||
if ( uiStringLength > 0 )
|
||||
{
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, x, y, (INT16)(x + uiStringLength), (INT16)(y + uiStringHeight));
|
||||
iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, x, y, (INT16)(x + uiStringLength), (INT16)(y + uiStringHeight));
|
||||
|
||||
if ( iBack != -1 )
|
||||
{
|
||||
@@ -795,7 +790,7 @@ UINT16 uiStringLength, uiStringHeight;
|
||||
|
||||
Assert(pFontString!=NULL);
|
||||
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
@@ -804,7 +799,7 @@ UINT16 uiStringLength, uiStringHeight;
|
||||
|
||||
if ( uiStringLength > 0 )
|
||||
{
|
||||
InvalidateRegionEx( x, y, (INT16)(x + uiStringLength), (INT16)(y + uiStringHeight), 0 );
|
||||
InvalidateRegionEx( x, y, (INT16)(x + uiStringLength), (INT16)(y + uiStringHeight), 0 );
|
||||
}
|
||||
return(uiStringLength);
|
||||
}
|
||||
@@ -817,7 +812,7 @@ UINT16 uiStringLength, uiStringHeight;
|
||||
|
||||
Assert(pFontString!=NULL);
|
||||
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
va_start(argptr, pFontString); // Set up variable argument pointer
|
||||
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
|
||||
va_end(argptr);
|
||||
|
||||
@@ -826,7 +821,7 @@ UINT16 uiStringLength, uiStringHeight;
|
||||
|
||||
if ( uiStringLength > 0 )
|
||||
{
|
||||
RestoreExternBackgroundRect( x, y, uiStringLength, uiStringHeight );
|
||||
RestoreExternBackgroundRect( x, y, uiStringLength, uiStringHeight );
|
||||
}
|
||||
|
||||
return(uiStringLength);
|
||||
@@ -836,7 +831,7 @@ UINT16 uiStringLength, uiStringHeight;
|
||||
// OVERLAY STUFF
|
||||
INT32 GetFreeVideoOverlay(void)
|
||||
{
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCount;
|
||||
|
||||
for(uiCount=0; uiCount < guiNumVideoOverlays; uiCount++)
|
||||
{
|
||||
@@ -853,7 +848,7 @@ INT32 GetFreeVideoOverlay(void)
|
||||
|
||||
void RecountVideoOverlays(void)
|
||||
{
|
||||
INT32 uiCount;
|
||||
INT32 uiCount;
|
||||
|
||||
for(uiCount=guiNumVideoOverlays-1; (uiCount >=0) ; uiCount--)
|
||||
{
|
||||
@@ -906,18 +901,18 @@ INT32 RegisterVideoOverlay( UINT32 uiFlags, VIDEO_OVERLAY_DESC *pTopmostDesc )
|
||||
// Init new blitter
|
||||
memset(&gVideoOverlays[ iBlitterIndex ], 0, sizeof( VIDEO_OVERLAY ) );
|
||||
|
||||
gVideoOverlays[ iBlitterIndex ].uiFlags = uiFlags;
|
||||
gVideoOverlays[ iBlitterIndex ].fAllocated = 2;
|
||||
gVideoOverlays[ iBlitterIndex ].uiFlags = uiFlags;
|
||||
gVideoOverlays[ iBlitterIndex ].fAllocated = 2;
|
||||
gVideoOverlays[ iBlitterIndex ].uiBackground = iBackIndex;
|
||||
gVideoOverlays[ iBlitterIndex ].pBackground = &( gBackSaves[ iBackIndex ] );
|
||||
gVideoOverlays[ iBlitterIndex ].BltCallback = pTopmostDesc->BltCallback;
|
||||
gVideoOverlays[ iBlitterIndex ].pBackground = &( gBackSaves[ iBackIndex ] );
|
||||
gVideoOverlays[ iBlitterIndex ].BltCallback = pTopmostDesc->BltCallback;
|
||||
|
||||
// Update blitter info
|
||||
// Set update flags to zero since we are forcing all updates
|
||||
pTopmostDesc->uiFlags = 0;
|
||||
UpdateVideoOverlay( pTopmostDesc, iBlitterIndex , TRUE );
|
||||
|
||||
// Set disabled flag to true
|
||||
// Set disabled flag to true
|
||||
if ( uiFlags & VOVERLAY_STARTDISABLED )
|
||||
{
|
||||
gVideoOverlays[ iBlitterIndex ].fDisabled = TRUE;
|
||||
@@ -932,7 +927,7 @@ INT32 RegisterVideoOverlay( UINT32 uiFlags, VIDEO_OVERLAY_DESC *pTopmostDesc )
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SetVideoOverlayPendingDelete( INT32 iVideoOverlay )
|
||||
{
|
||||
if ( iVideoOverlay != -1 )
|
||||
@@ -960,7 +955,7 @@ void RemoveVideoOverlay( INT32 iVideoOverlay )
|
||||
|
||||
// Remove background
|
||||
FreeBackgroundRect( gVideoOverlays[ iVideoOverlay ].uiBackground );
|
||||
|
||||
|
||||
//DebugMsg( TOPIC_JA2, DBG_LEVEL_0, String( "Delete Overlay %d %S", iVideoOverlay, gVideoOverlays[ iVideoOverlay ].zText ) );
|
||||
|
||||
|
||||
@@ -973,7 +968,7 @@ void RemoveVideoOverlay( INT32 iVideoOverlay )
|
||||
|
||||
|
||||
// Set as not allocated
|
||||
gVideoOverlays[ iVideoOverlay ].fAllocated = FALSE;
|
||||
gVideoOverlays[ iVideoOverlay ].fAllocated = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -996,11 +991,11 @@ BOOLEAN UpdateVideoOverlay( VIDEO_OVERLAY_DESC *pTopmostDesc, UINT32 iBlitterInd
|
||||
|
||||
if ( fForceAll )
|
||||
{
|
||||
gVideoOverlays[ iBlitterIndex ].uiFontID = pTopmostDesc->uiFontID;
|
||||
gVideoOverlays[ iBlitterIndex ].sX = pTopmostDesc->sX;
|
||||
gVideoOverlays[ iBlitterIndex ].sY = pTopmostDesc->sY;
|
||||
gVideoOverlays[ iBlitterIndex ].ubFontBack = pTopmostDesc->ubFontBack;
|
||||
gVideoOverlays[ iBlitterIndex ].ubFontFore = pTopmostDesc->ubFontFore;
|
||||
gVideoOverlays[ iBlitterIndex ].uiFontID = pTopmostDesc->uiFontID;
|
||||
gVideoOverlays[ iBlitterIndex ].sX = pTopmostDesc->sX;
|
||||
gVideoOverlays[ iBlitterIndex ].sY = pTopmostDesc->sY;
|
||||
gVideoOverlays[ iBlitterIndex ].ubFontBack = pTopmostDesc->ubFontBack;
|
||||
gVideoOverlays[ iBlitterIndex ].ubFontFore = pTopmostDesc->ubFontFore;
|
||||
|
||||
if ( pTopmostDesc->pzText != NULL )
|
||||
{
|
||||
@@ -1044,8 +1039,8 @@ BOOLEAN UpdateVideoOverlay( VIDEO_OVERLAY_DESC *pTopmostDesc, UINT32 iBlitterInd
|
||||
FreeBackgroundRectPending( gVideoOverlays[ iBlitterIndex ].uiBackground );
|
||||
|
||||
gVideoOverlays[ iBlitterIndex ].uiBackground = RegisterBackgroundRect( BGND_FLAG_PERMANENT, NULL, pTopmostDesc->sLeft, pTopmostDesc->sTop, (INT16)(pTopmostDesc->sLeft + uiStringLength), (INT16)(pTopmostDesc->sTop + uiStringHeight) );
|
||||
gVideoOverlays[ iBlitterIndex ].sX = pTopmostDesc->sX;
|
||||
gVideoOverlays[ iBlitterIndex ].sY = pTopmostDesc->sY;
|
||||
gVideoOverlays[ iBlitterIndex ].sX = pTopmostDesc->sX;
|
||||
gVideoOverlays[ iBlitterIndex ].sY = pTopmostDesc->sY;
|
||||
|
||||
}
|
||||
|
||||
@@ -1083,7 +1078,7 @@ void ExecuteVideoOverlays( )
|
||||
}
|
||||
else if ( gVideoOverlays[uiCount].fAllocated == 2 )
|
||||
{
|
||||
gVideoOverlays[uiCount].fAllocated = 1;
|
||||
gVideoOverlays[uiCount].fAllocated = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1100,7 +1095,7 @@ void ExecuteVideoOverlays( )
|
||||
|
||||
void ExecuteVideoOverlaysToAlternateBuffer( UINT32 uiNewDestBuffer )
|
||||
{
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCount;
|
||||
UINT32 uiOldDestBuffer;
|
||||
|
||||
for(uiCount=0; uiCount < guiNumVideoOverlays; uiCount++)
|
||||
@@ -1109,12 +1104,12 @@ void ExecuteVideoOverlaysToAlternateBuffer( UINT32 uiNewDestBuffer )
|
||||
{
|
||||
if ( gVideoOverlays[uiCount].fActivelySaving )
|
||||
{
|
||||
uiOldDestBuffer = gVideoOverlays[uiCount].uiDestBuff;
|
||||
uiOldDestBuffer = gVideoOverlays[uiCount].uiDestBuff;
|
||||
|
||||
gVideoOverlays[uiCount].uiDestBuff = uiNewDestBuffer;
|
||||
|
||||
// Call Blit Function
|
||||
(*(gVideoOverlays[uiCount].BltCallback ) ) ( &(gVideoOverlays[uiCount]) );
|
||||
(*(gVideoOverlays[uiCount].BltCallback ) ) ( &(gVideoOverlays[uiCount]) );
|
||||
|
||||
gVideoOverlays[uiCount].uiDestBuff = uiOldDestBuffer;
|
||||
}
|
||||
@@ -1145,7 +1140,7 @@ void AllocateVideoOverlaysArea( )
|
||||
// Allocate
|
||||
if( ( gVideoOverlays[ uiCount ].pSaveArea = (INT16 *) MemAlloc( uiBufSize ) ) == NULL )
|
||||
{
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1183,7 +1178,7 @@ void SaveVideoOverlaysArea( UINT32 uiSrcBuffer )
|
||||
UINT32 uiCount;
|
||||
UINT32 iBackIndex;
|
||||
UINT32 uiSrcPitchBYTES;
|
||||
UINT8 *pSrcBuf;
|
||||
UINT8 *pSrcBuf;
|
||||
|
||||
pSrcBuf = LockVideoSurface( uiSrcBuffer, &uiSrcPitchBYTES );
|
||||
|
||||
@@ -1204,8 +1199,8 @@ void SaveVideoOverlaysArea( UINT32 uiSrcBuffer )
|
||||
// Save data from frame buffer!
|
||||
Blt16BPPTo16BPP((UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
0, 0,
|
||||
gBackSaves[ iBackIndex ].sLeft , gBackSaves[ iBackIndex ].sTop,
|
||||
0, 0,
|
||||
gBackSaves[ iBackIndex ].sLeft , gBackSaves[ iBackIndex ].sTop,
|
||||
gBackSaves[ iBackIndex ].sWidth, gBackSaves[ iBackIndex ].sHeight );
|
||||
}
|
||||
}
|
||||
@@ -1220,7 +1215,7 @@ void SaveVideoOverlayArea( UINT32 uiSrcBuffer, UINT32 uiCount )
|
||||
{
|
||||
UINT32 iBackIndex;
|
||||
UINT32 uiSrcPitchBYTES;
|
||||
UINT8 *pSrcBuf;
|
||||
UINT8 *pSrcBuf;
|
||||
|
||||
pSrcBuf = LockVideoSurface( uiSrcBuffer, &uiSrcPitchBYTES );
|
||||
|
||||
@@ -1240,8 +1235,8 @@ void SaveVideoOverlayArea( UINT32 uiSrcBuffer, UINT32 uiCount )
|
||||
// Save data from frame buffer!
|
||||
Blt16BPPTo16BPP((UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
0, 0,
|
||||
gBackSaves[ iBackIndex ].sLeft , gBackSaves[ iBackIndex ].sTop,
|
||||
0, 0,
|
||||
gBackSaves[ iBackIndex ].sLeft , gBackSaves[ iBackIndex ].sTop,
|
||||
gBackSaves[ iBackIndex ].sWidth, gBackSaves[ iBackIndex ].sHeight );
|
||||
}
|
||||
}
|
||||
@@ -1282,16 +1277,16 @@ void DeleteVideoOverlaysArea( )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
{
|
||||
UINT32 uiCount, uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT8 *pDestBuf;
|
||||
UINT32 iBackIndex;
|
||||
|
||||
INT32 ClipX1, ClipY1, ClipX2, ClipY2;
|
||||
INT32 ClipX1, ClipY1, ClipX2, ClipY2;
|
||||
INT32 uiLeftSkip, uiRightSkip, uiTopSkip, uiBottomSkip;
|
||||
UINT32 usHeight, usWidth;
|
||||
INT32 iTempX, iTempY;
|
||||
INT32 iTempX, iTempY;
|
||||
INT16 sLeft, sTop, sRight, sBottom;
|
||||
|
||||
ClipX1= 0;
|
||||
@@ -1302,7 +1297,7 @@ BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
|
||||
pDestBuf = LockVideoSurface( BACKBUFFER, &uiDestPitchBYTES);
|
||||
|
||||
for(uiCount=0; uiCount < guiNumVideoOverlays; uiCount++)
|
||||
for(uiCount=0; uiCount < guiNumVideoOverlays; uiCount++)
|
||||
{
|
||||
if( gVideoOverlays[uiCount].fAllocated && !gVideoOverlays[uiCount].fDisabled )
|
||||
{
|
||||
@@ -1313,11 +1308,11 @@ BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
{
|
||||
// Get restore background values
|
||||
sLeft = gBackSaves[ iBackIndex ].sLeft;
|
||||
sTop = gBackSaves[ iBackIndex ].sTop;
|
||||
sTop = gBackSaves[ iBackIndex ].sTop;
|
||||
sRight = gBackSaves[ iBackIndex ].sRight;
|
||||
sBottom = gBackSaves[ iBackIndex ].sBottom;
|
||||
usHeight = gBackSaves[ iBackIndex ].sHeight;
|
||||
usWidth = gBackSaves[ iBackIndex ].sWidth;
|
||||
usHeight = gBackSaves[ iBackIndex ].sHeight;
|
||||
usWidth = gBackSaves[ iBackIndex ].sWidth;
|
||||
|
||||
|
||||
// Clip!!
|
||||
@@ -1331,29 +1326,29 @@ BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
uiBottomSkip=__min(__max(ClipY2, (iTempY+(INT32)usHeight)) - ClipY2, (INT32)usHeight);
|
||||
|
||||
// check if whole thing is clipped
|
||||
if((uiLeftSkip >=(INT32)usWidth) || (uiRightSkip >=(INT32)usWidth))
|
||||
if((uiLeftSkip >=(INT32)usWidth) || (uiRightSkip >=(INT32)usWidth))
|
||||
continue;
|
||||
|
||||
// check if whole thing is clipped
|
||||
if((uiTopSkip >=(INT32)usHeight) || (uiBottomSkip >=(INT32)usHeight))
|
||||
if((uiTopSkip >=(INT32)usHeight) || (uiBottomSkip >=(INT32)usHeight))
|
||||
continue;
|
||||
|
||||
// Set re-set values given based on clipping
|
||||
sLeft = iTempX + (INT16)uiLeftSkip;
|
||||
sTop = iTempY + (INT16)uiTopSkip;
|
||||
sRight = sRight + sShiftX - (INT16)uiRightSkip;
|
||||
sBottom = sBottom + sShiftY - (INT16)uiBottomSkip;
|
||||
sLeft = iTempX + (INT16)uiLeftSkip;
|
||||
sTop = iTempY + (INT16)uiTopSkip;
|
||||
sRight = sRight + sShiftX - (INT16)uiRightSkip;
|
||||
sBottom = sBottom + sShiftY - (INT16)uiBottomSkip;
|
||||
|
||||
usHeight = sBottom - sTop;
|
||||
usWidth = sRight - sLeft;
|
||||
usWidth = sRight - sLeft;
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
|
||||
Blt16BPPTo16BPP((UINT16 *)(UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)gVideoOverlays[uiCount].pSaveArea, gBackSaves[ iBackIndex ].sWidth*2,
|
||||
sLeft, sTop,
|
||||
uiLeftSkip, uiTopSkip,
|
||||
sLeft, sTop,
|
||||
uiLeftSkip, uiTopSkip,
|
||||
usWidth, usHeight );
|
||||
|
||||
}
|
||||
@@ -1374,7 +1369,7 @@ BOOLEAN RestoreShiftedVideoOverlays( INT16 sShiftX, INT16 sShiftY )
|
||||
}
|
||||
|
||||
UnLockVideoSurface( BACKBUFFER );
|
||||
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@@ -1399,7 +1394,7 @@ BOOLEAN SetOverlayUserData( INT32 iVideoOverlay, UINT8 ubNum, UINT32 uiData )
|
||||
// Common callbacks for topmost blitters
|
||||
void BlitMFont( VIDEO_OVERLAY *pBlitter )
|
||||
{
|
||||
UINT8 *pDestBuf;
|
||||
UINT8 *pDestBuf;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
|
||||
pDestBuf = LockVideoSurface( pBlitter->uiDestBuff, &uiDestPitchBYTES);
|
||||
@@ -1418,15 +1413,15 @@ void BlitMFont( VIDEO_OVERLAY *pBlitter )
|
||||
BOOLEAN BlitBufferToBuffer(UINT32 uiSrcBuffer, UINT32 uiDestBuffer, UINT16 usSrcX, UINT16 usSrcY, UINT16 usWidth, UINT16 usHeight)
|
||||
{
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
BOOLEAN fRetVal;
|
||||
|
||||
pDestBuf = LockVideoSurface(uiDestBuffer, &uiDestPitchBYTES);
|
||||
pSrcBuf = LockVideoSurface(uiSrcBuffer, &uiSrcPitchBYTES);
|
||||
|
||||
fRetVal = Blt16BPPTo16BPP( (UINT16*)pDestBuf, uiDestPitchBYTES, (UINT16*)pSrcBuf, uiSrcPitchBYTES,
|
||||
usSrcX, usSrcY,
|
||||
usSrcX, usSrcY,
|
||||
usSrcX, usSrcY,
|
||||
usSrcX, usSrcY,
|
||||
usWidth, usHeight);
|
||||
|
||||
UnLockVideoSurface(uiDestBuffer);
|
||||
@@ -1445,10 +1440,10 @@ void EnableVideoOverlay( BOOLEAN fEnable, INT32 iOverlayIndex )
|
||||
|
||||
// enable or disable
|
||||
VideoOverlayDesc.fDisabled = !fEnable;
|
||||
|
||||
|
||||
// go play with enable/disable state
|
||||
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
|
||||
|
||||
VideoOverlayDesc.uiFlags = VOVERLAY_DESC_DISABLED;
|
||||
|
||||
UpdateVideoOverlay( &VideoOverlayDesc, iOverlayIndex, FALSE );
|
||||
|
||||
}
|
||||
|
||||
+29
-30
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "Render Fun.h"
|
||||
#include "worlddef.h"
|
||||
#include "input.h"
|
||||
#include "input.h"
|
||||
#include "sysutil.h"
|
||||
#include "debug.h"
|
||||
#include "wcheck.h"
|
||||
@@ -54,13 +54,13 @@ void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 ubRoomNum )
|
||||
{
|
||||
for ( cnt2 = pSelectRegion->iLeft; cnt2 <= pSelectRegion->iRight; cnt2++ )
|
||||
{
|
||||
gubWorldRoomInfo[ (INT16)MAPROWCOLTOPOS( cnt1, cnt2 ) ] = ubRoomNum;
|
||||
gubWorldRoomInfo[ (INT16)MAPROWCOLTOPOS( cnt1, cnt2 ) ] = ubRoomNum;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN InARoom( UINT16 sGridNo, UINT8 *pubRoomNo )
|
||||
BOOLEAN InARoom( INT16 sGridNo, UINT8 *pubRoomNo )
|
||||
{
|
||||
if ( gubWorldRoomInfo[ sGridNo ] != NO_ROOM )
|
||||
{
|
||||
@@ -75,7 +75,7 @@ BOOLEAN InARoom( UINT16 sGridNo, UINT8 *pubRoomNo )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN InAHiddenRoom( UINT16 sGridNo, UINT8 *pubRoomNo )
|
||||
BOOLEAN InAHiddenRoom( INT16 sGridNo, UINT8 *pubRoomNo )
|
||||
{
|
||||
if ( gubWorldRoomInfo[ sGridNo ] != NO_ROOM )
|
||||
{
|
||||
@@ -109,31 +109,31 @@ void SetRecalculateWireFrameFlagRadius(INT16 sX, INT16 sY, INT16 sRadius)
|
||||
}
|
||||
|
||||
|
||||
void SetGridNoRevealedFlag( UINT16 sGridNo )
|
||||
void SetGridNoRevealedFlag( INT16 sGridNo )
|
||||
{
|
||||
// UINT32 cnt;
|
||||
// ITEM_POOL *pItemPool;
|
||||
// ITEM_POOL *pItemPool;
|
||||
// INT16 sX, sY;
|
||||
LEVELNODE *pNode = NULL;
|
||||
STRUCTURE *pStructure, *pBase;
|
||||
|
||||
// Set hidden flag, for any roofs
|
||||
SetRoofIndexFlagsFromTypeRange( sGridNo, FIRSTROOF, FOURTHROOF, LEVELNODE_HIDDEN );
|
||||
SetRoofIndexFlagsFromTypeRange( sGridNo, FIRSTROOF, FOURTHROOF, LEVELNODE_HIDDEN );
|
||||
|
||||
// ATE: Do this only if we are in a room...
|
||||
if ( gubWorldRoomInfo[ sGridNo ] != NO_ROOM )
|
||||
{
|
||||
SetStructAframeFlags( sGridNo, LEVELNODE_HIDDEN );
|
||||
SetStructAframeFlags( sGridNo, LEVELNODE_HIDDEN );
|
||||
// Find gridno one east as well...
|
||||
|
||||
if ( ( sGridNo + WORLD_COLS ) < NOWHERE )
|
||||
{
|
||||
SetStructAframeFlags( sGridNo + WORLD_COLS, LEVELNODE_HIDDEN );
|
||||
SetStructAframeFlags( sGridNo + WORLD_COLS, LEVELNODE_HIDDEN );
|
||||
}
|
||||
|
||||
if ( ( sGridNo + 1 ) < NOWHERE )
|
||||
{
|
||||
SetStructAframeFlags( sGridNo + 1, LEVELNODE_HIDDEN );
|
||||
SetStructAframeFlags( sGridNo + 1, LEVELNODE_HIDDEN );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ void SetGridNoRevealedFlag( UINT16 sGridNo )
|
||||
|
||||
// ATE: If there are any structs here, we can render them with the obscured flag!
|
||||
// Look for anything but walls pn this gridno!
|
||||
pStructure = gpWorldLevelData[ (INT16)sGridNo ].pStructureHead;
|
||||
pStructure = gpWorldLevelData[ (INT16)sGridNo ].pStructureHead;
|
||||
|
||||
while ( pStructure != NULL )
|
||||
{
|
||||
@@ -162,7 +162,7 @@ void SetGridNoRevealedFlag( UINT16 sGridNo )
|
||||
Assert( 0 );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Get LEVELNODE for struct and remove!
|
||||
pNode = FindLevelNodeBasedOnStructure( pBase->sGridNo, pBase );
|
||||
|
||||
@@ -188,7 +188,7 @@ void SetGridNoRevealedFlag( UINT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo )
|
||||
void ExamineGridNoForSlantRoofExtraGraphic( INT16 sCheckGridNo )
|
||||
{
|
||||
LEVELNODE *pNode = NULL;
|
||||
STRUCTURE *pStructure, *pBase;
|
||||
@@ -205,7 +205,7 @@ void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo )
|
||||
{
|
||||
// We have a slanted roof here ... find base and remove...
|
||||
pBase = FindBaseStructure( pStructure );
|
||||
|
||||
|
||||
// Get LEVELNODE for struct and remove!
|
||||
pNode = FindLevelNodeBasedOnStructure( pBase->sGridNo, pBase );
|
||||
|
||||
@@ -220,7 +220,7 @@ void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo )
|
||||
continue;
|
||||
}
|
||||
|
||||
// Given gridno,
|
||||
// Given gridno,
|
||||
// IF NOT REVEALED AND HIDDEN....
|
||||
if ( !( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REVEALED ) && pNode->uiFlags & LEVELNODE_HIDDEN )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo )
|
||||
fChanged = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Revealed?
|
||||
if ( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REVEALED )
|
||||
{
|
||||
@@ -243,7 +243,7 @@ void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo )
|
||||
fChanged = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,12 +257,11 @@ void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo )
|
||||
}
|
||||
|
||||
|
||||
void RemoveRoomRoof( UINT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
|
||||
void RemoveRoomRoof( INT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT32 cnt;
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPool;
|
||||
INT16 sX, sY;
|
||||
LEVELNODE *pNode = NULL;
|
||||
BOOLEAN fSaidItemSeenQuote = FALSE;
|
||||
|
||||
// STRUCTURE *pStructure;//, *pBase;
|
||||
@@ -273,12 +272,12 @@ void RemoveRoomRoof( UINT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
|
||||
if ( gubWorldRoomInfo[ cnt ] == bRoomNum )
|
||||
{
|
||||
|
||||
SetGridNoRevealedFlag( (UINT16)cnt );
|
||||
SetGridNoRevealedFlag( (INT16)cnt );
|
||||
|
||||
RemoveRoofIndexFlagsFromTypeRange( cnt, FIRSTROOF, SECONDSLANTROOF, LEVELNODE_REVEAL );
|
||||
RemoveRoofIndexFlagsFromTypeRange( cnt, FIRSTROOF, SECONDSLANTROOF, LEVELNODE_REVEAL );
|
||||
|
||||
// Reveal any items if here!
|
||||
if ( GetItemPool( (INT16)cnt, &pItemPool, 0 ) )
|
||||
if ( GetItemPoolFromGround( (INT16)cnt, &pItemPool ) )
|
||||
{
|
||||
// Set visible! ( only if invisible... )
|
||||
if ( SetItemPoolVisibilityOn( pItemPool, INVISIBLE, TRUE ) )
|
||||
@@ -307,7 +306,7 @@ void RemoveRoomRoof( UINT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
|
||||
//{
|
||||
// if ( gubWorldRoomInfo[ cnt ] == bRoomNum )
|
||||
// {
|
||||
// ExamineGridNoForSlantRoofExtraGraphic( (UINT16)cnt );
|
||||
// ExamineGridNoForSlantRoofExtraGraphic( (INT16)cnt );
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -322,7 +321,7 @@ void RemoveRoomRoof( UINT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
|
||||
|
||||
|
||||
|
||||
BOOLEAN AddSpecialTileRange( SGPRect *pSelectRegion )
|
||||
BOOLEAN AddSpecialTileRange( SGPRect *pSelectRegion )
|
||||
{
|
||||
INT32 cnt1, cnt2;
|
||||
|
||||
@@ -330,15 +329,15 @@ BOOLEAN AddSpecialTileRange( SGPRect *pSelectRegion )
|
||||
{
|
||||
for ( cnt2 = pSelectRegion->iLeft; cnt2 <= pSelectRegion->iRight; cnt2++ )
|
||||
{
|
||||
AddObjectToHead( (INT16)MAPROWCOLTOPOS( cnt1, cnt2 ), SPECIALTILE_MAPEXIT );
|
||||
AddObjectToHead( (INT16)MAPROWCOLTOPOS( cnt1, cnt2 ), SPECIALTILE_MAPEXIT );
|
||||
}
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN RemoveSpecialTileRange( SGPRect *pSelectRegion )
|
||||
|
||||
BOOLEAN RemoveSpecialTileRange( SGPRect *pSelectRegion )
|
||||
{
|
||||
INT32 cnt1, cnt2;
|
||||
|
||||
@@ -346,10 +345,10 @@ BOOLEAN RemoveSpecialTileRange( SGPRect *pSelectRegion )
|
||||
{
|
||||
for ( cnt2 = pSelectRegion->iLeft; cnt2 <= pSelectRegion->iRight; cnt2++ )
|
||||
{
|
||||
RemoveObject( (INT16)MAPROWCOLTOPOS( cnt1, cnt2 ), SPECIALTILE_MAPEXIT );
|
||||
RemoveObject( (INT16)MAPROWCOLTOPOS( cnt1, cnt2 ), SPECIALTILE_MAPEXIT );
|
||||
}
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "worlddef.h"
|
||||
|
||||
#define NO_ROOM 0
|
||||
#define MAX_ROOMS 250
|
||||
#define MAX_ROOMS 250
|
||||
|
||||
|
||||
extern UINT8 gubWorldRoomHidden[ MAX_ROOMS ];
|
||||
@@ -18,13 +18,13 @@ void ShutdownRoomDatabase( );
|
||||
void SetTileRoomNum( INT16 sGridNo, UINT8 ubRoomNum );
|
||||
void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 ubRoomNum );
|
||||
|
||||
void RemoveRoomRoof( UINT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN InARoom( UINT16 sGridNo, UINT8 *pubRoomNo );
|
||||
BOOLEAN InAHiddenRoom( UINT16 sGridNo, UINT8 *pubRoomNo );
|
||||
void RemoveRoomRoof( INT16 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN InARoom( INT16 sGridNo, UINT8 *pubRoomNo );
|
||||
BOOLEAN InAHiddenRoom( INT16 sGridNo, UINT8 *pubRoomNo );
|
||||
|
||||
void SetGridNoRevealedFlag( UINT16 sGridNo );
|
||||
void SetGridNoRevealedFlag( INT16 sGridNo );
|
||||
|
||||
void ExamineGridNoForSlantRoofExtraGraphic( UINT16 sCheckGridNo );
|
||||
void ExamineGridNoForSlantRoofExtraGraphic( INT16 sCheckGridNo );
|
||||
|
||||
void SetRecalculateWireFrameFlagRadius(INT16 sX, INT16 sY, INT16 sRadius);
|
||||
|
||||
|
||||
+72
-214
@@ -1,3 +1,4 @@
|
||||
#include "Render Z.h"
|
||||
#include "worlddef.h"
|
||||
#include "renderworld.h"
|
||||
#include "Isometric Utils.h"
|
||||
@@ -5,239 +6,96 @@
|
||||
INT16 gsRScreenCenterX, gsRScreenCenterY;
|
||||
INT16 gsRDistToCenterY, gsRDistToCenterX;
|
||||
|
||||
#define GetMapXYWorldY( sWorldCellX, sWorldCellY, sWorldY )\
|
||||
{\
|
||||
\
|
||||
gsRDistToCenterX = ( sWorldCellX * CELL_X_SIZE ) - gCenterWorldX;\
|
||||
gsRDistToCenterY = ( sWorldCellY * CELL_Y_SIZE ) - gCenterWorldY;\
|
||||
\
|
||||
gsRScreenCenterY = gsRDistToCenterX + gsRDistToCenterY;\
|
||||
\
|
||||
sWorldY = gsRScreenCenterY + gsCY - gsTLY;\
|
||||
INT16 GetMapXYWorldY( INT16 sWorldCellX, INT16 sWorldCellY )
|
||||
{
|
||||
gsRDistToCenterX = ( sWorldCellX * CELL_X_SIZE ) - gCenterWorldX;
|
||||
gsRDistToCenterY = ( sWorldCellY * CELL_Y_SIZE ) - gCenterWorldY;
|
||||
|
||||
gsRScreenCenterY = gsRDistToCenterX + gsRDistToCenterY;
|
||||
|
||||
return (gsRScreenCenterY + gsCY - gsTLY);
|
||||
}
|
||||
|
||||
#define GetMapXYWorldYFromCellCoords( sWorldCellX, sWorldCellY, sWorldY )\
|
||||
{\
|
||||
\
|
||||
gsRDistToCenterX = sWorldCellX - gCenterWorldX;\
|
||||
gsRDistToCenterY = sWorldCellY - gCenterWorldY;\
|
||||
\
|
||||
gsRScreenCenterY = gsRDistToCenterX + gsRDistToCenterY;\
|
||||
\
|
||||
sWorldY = gsRScreenCenterY + gsCY - gsTLY;\
|
||||
INT16 GetMapXYWorldYFromCellCoords( INT16 sWorldCellX, INT16 sWorldCellY )
|
||||
{
|
||||
gsRDistToCenterX = sWorldCellX - gCenterWorldX;
|
||||
gsRDistToCenterY = sWorldCellY - gCenterWorldY;
|
||||
|
||||
gsRScreenCenterY = gsRDistToCenterX + gsRDistToCenterY;
|
||||
|
||||
return gsRScreenCenterY + gsCY - gsTLY;
|
||||
}
|
||||
|
||||
|
||||
#define LandZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
sZLevel = LAND_Z_LEVEL;\
|
||||
INT16 LandZLevel( INT16 sMapX, INT16 sMapY )
|
||||
{
|
||||
return LAND_Z_LEVEL;
|
||||
}
|
||||
|
||||
|
||||
#define ObjectZLevel( TileElem, pNode, sMapX, sMapY )\
|
||||
{\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
\
|
||||
if ( uiTileElemFlags & CLIFFHANG_TILE )\
|
||||
{\
|
||||
sZLevel=LAND_Z_LEVEL;\
|
||||
}\
|
||||
else if ( uiTileElemFlags & OBJECTLAYER_USEZHEIGHT )\
|
||||
{\
|
||||
sZLevel=( ( sWorldY ) *Z_SUBLAYERS)+LAND_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=OBJECT_Z_LEVEL;\
|
||||
}\
|
||||
INT16 ObjectZLevel( TILE_ELEMENT* TileElem, LEVELNODE* pNode, UINT32 uiTileElemFlags, INT32 sMapX, INT32 sMapY, INT16& sWorldY )
|
||||
{
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );
|
||||
|
||||
if ( uiTileElemFlags & CLIFFHANG_TILE )
|
||||
{
|
||||
return LAND_Z_LEVEL;
|
||||
}
|
||||
else if ( uiTileElemFlags & OBJECTLAYER_USEZHEIGHT )
|
||||
{
|
||||
return ( ( sWorldY ) * Z_SUBLAYERS)+LAND_Z_LEVEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return OBJECT_Z_LEVEL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define StructZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
\
|
||||
if ( ( uiLevelNodeFlags & LEVELNODE_ROTTINGCORPSE ) )\
|
||||
{\
|
||||
if ( pCorpse->def.usFlags & ROTTING_CORPSE_VEHICLE )\
|
||||
{\
|
||||
\
|
||||
if ( pNode->pStructureData != NULL )\
|
||||
{\
|
||||
sZOffsetX = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetX;\
|
||||
sZOffsetY = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetY;\
|
||||
}\
|
||||
\
|
||||
GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY), sWorldY );\
|
||||
\
|
||||
GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY), sWorldY );\
|
||||
\
|
||||
sZLevel=( ( sWorldY ) * Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZOffsetX = -1;\
|
||||
sZOffsetY = -1;\
|
||||
GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY), sWorldY );\
|
||||
\
|
||||
sWorldY += 20;\
|
||||
\
|
||||
sZLevel=( ( sWorldY ) * Z_SUBLAYERS)+LAND_Z_LEVEL;\
|
||||
}\
|
||||
}\
|
||||
else if ( uiLevelNodeFlags & LEVELNODE_PHYSICSOBJECT )\
|
||||
{\
|
||||
sWorldY += pNode->sRelativeZ;\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
\
|
||||
}\
|
||||
else if ( uiLevelNodeFlags & LEVELNODE_ITEM )\
|
||||
{\
|
||||
if ( pNode->pItemPool->bRenderZHeightAboveLevel > 0 )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
sZLevel+=( pNode->pItemPool->bRenderZHeightAboveLevel );\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+OBJECT_Z_LEVEL;\
|
||||
}\
|
||||
}\
|
||||
else if ( uiAniTileFlags & ANITILE_SMOKE_EFFECT )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+OBJECT_Z_LEVEL;\
|
||||
}\
|
||||
else if ( ( uiLevelNodeFlags & LEVELNODE_USEZ ) )\
|
||||
{\
|
||||
\
|
||||
if ( ( uiLevelNodeFlags & LEVELNODE_NOZBLITTER ) )\
|
||||
{\
|
||||
sWorldY += 40;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sWorldY += pNode->sRelativeZ;\
|
||||
}\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
}\
|
||||
\
|
||||
INT16 RoofZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY )
|
||||
{
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );
|
||||
sWorldY += WALL_HEIGHT;
|
||||
|
||||
return (sWorldY*Z_SUBLAYERS)+ROOF_Z_LEVEL;
|
||||
|
||||
}
|
||||
|
||||
#define RoofZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
\
|
||||
sWorldY += WALL_HEIGHT;\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ROOF_Z_LEVEL;\
|
||||
\
|
||||
INT16 OnRoofZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY, UINT32 uiLevelNodeFlags )
|
||||
{
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );
|
||||
|
||||
if ( uiLevelNodeFlags & LEVELNODE_ROTTINGCORPSE )
|
||||
{
|
||||
sWorldY += ( WALL_HEIGHT + 40 );
|
||||
}
|
||||
if ( uiLevelNodeFlags & LEVELNODE_ROTTINGCORPSE )
|
||||
{
|
||||
sWorldY += ( WALL_HEIGHT + 40 );
|
||||
}
|
||||
else
|
||||
{
|
||||
sWorldY += WALL_HEIGHT;
|
||||
}
|
||||
|
||||
return(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;
|
||||
|
||||
}
|
||||
|
||||
#define OnRoofZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
\
|
||||
if ( uiLevelNodeFlags & LEVELNODE_ROTTINGCORPSE )\
|
||||
{\
|
||||
sWorldY += ( WALL_HEIGHT + 40 );\
|
||||
}\
|
||||
if ( uiLevelNodeFlags & LEVELNODE_ROTTINGCORPSE )\
|
||||
{\
|
||||
sWorldY += ( WALL_HEIGHT + 40 );\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sWorldY += WALL_HEIGHT;\
|
||||
}\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
\
|
||||
INT16 TopmostZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY )
|
||||
{
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );
|
||||
|
||||
return TOPMOST_Z_LEVEL;
|
||||
}
|
||||
|
||||
#define TopmostZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
\
|
||||
sZLevel=TOPMOST_Z_LEVEL;\
|
||||
\
|
||||
INT16 ShadowZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY )
|
||||
{
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );
|
||||
|
||||
return __max( ( (sWorldY - 80 ) *Z_SUBLAYERS )+SHADOW_Z_LEVEL, 0 );
|
||||
}
|
||||
|
||||
#define ShadowZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
\
|
||||
sZLevel=__max( ( (sWorldY - 80 ) *Z_SUBLAYERS )+SHADOW_Z_LEVEL, 0 );\
|
||||
\
|
||||
}
|
||||
|
||||
#define SoldierZLevel( pSoldier, sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
if ( ( pSoldier->uiStatusFlags & SOLDIER_MULTITILE ) )\
|
||||
{\
|
||||
\
|
||||
if ( pNode->pStructureData != NULL )\
|
||||
{\
|
||||
sZOffsetX = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetX;\
|
||||
sZOffsetY = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetY;\
|
||||
}\
|
||||
\
|
||||
GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY), sWorldY );\
|
||||
\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
GetMapXYWorldY( sMapX, sMapY, sWorldY );\
|
||||
}\
|
||||
\
|
||||
if ( pSoldier->uiStatusFlags & SOLDIER_VEHICLE )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
if ( pSoldier->dHeightAdjustment > 0 )\
|
||||
{\
|
||||
sWorldY += ( WALL_HEIGHT + 20 );\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
if ( ( pSoldier->uiStatusFlags & SOLDIER_DEAD ) )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+MERC_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+MERC_Z_LEVEL;\
|
||||
}\
|
||||
}\
|
||||
\
|
||||
if ( pSoldier->sZLevelOverride != -1 )\
|
||||
{\
|
||||
sZLevel = pSoldier->sZLevelOverride;\
|
||||
}\
|
||||
\
|
||||
if ( gsForceSoldierZLevel != 0 )\
|
||||
{\
|
||||
sZLevel = gsForceSoldierZLevel;\
|
||||
}\
|
||||
}\
|
||||
\
|
||||
}
|
||||
|
||||
|
||||
//#if 0
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
#include "worlddef.h"
|
||||
#include "renderworld.h"
|
||||
#include "Isometric Utils.h"
|
||||
|
||||
|
||||
INT16 ObjectZLevel( TILE_ELEMENT* TileElem, LEVELNODE* pNode, UINT32 uiTileElemFlags, INT32 sMapX, INT32 sMapY, INT16& sWorldY );
|
||||
INT16 GetMapXYWorldY( INT16 sWorldCellX, INT16 sWorldCellY );
|
||||
INT16 GetMapXYWorldYFromCellCoords( INT16 sWorldCellX, INT16 sWorldCellY );
|
||||
INT16 LandZLevel( INT16 sMapX, INT16 sMapY );
|
||||
INT16 RoofZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY );
|
||||
INT16 OnRoofZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY, UINT32 uiLevelNodeFlags );
|
||||
INT16 TopmostZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY );
|
||||
INT16 ShadowZLevel( INT16 sMapX, INT16 sMapY, INT16& sWorldY );
|
||||
|
||||
|
||||
|
||||
#define StructZLevel( sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );\
|
||||
\
|
||||
if ( ( uiLevelNodeFlags & LEVELNODE_ROTTINGCORPSE ) )\
|
||||
{\
|
||||
if ( pCorpse->def.usFlags & ROTTING_CORPSE_VEHICLE )\
|
||||
{\
|
||||
\
|
||||
if ( pNode->pStructureData != NULL )\
|
||||
{\
|
||||
sZOffsetX = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetX;\
|
||||
sZOffsetY = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetY;\
|
||||
}\
|
||||
\
|
||||
sWorldY = GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY) );\
|
||||
\
|
||||
sWorldY = GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY) );\
|
||||
\
|
||||
sZLevel=( ( sWorldY ) * Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZOffsetX = -1;\
|
||||
sZOffsetY = -1;\
|
||||
sWorldY = GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY) );\
|
||||
\
|
||||
sWorldY += 20;\
|
||||
\
|
||||
sZLevel=( ( sWorldY ) * Z_SUBLAYERS)+LAND_Z_LEVEL;\
|
||||
}\
|
||||
}\
|
||||
else if ( uiLevelNodeFlags & LEVELNODE_PHYSICSOBJECT )\
|
||||
{\
|
||||
sWorldY += pNode->sRelativeZ;\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
\
|
||||
}\
|
||||
else if ( uiLevelNodeFlags & LEVELNODE_ITEM )\
|
||||
{\
|
||||
if ( pNode->pItemPool->bRenderZHeightAboveLevel > 0 )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
sZLevel+=( pNode->pItemPool->bRenderZHeightAboveLevel );\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+OBJECT_Z_LEVEL;\
|
||||
}\
|
||||
}\
|
||||
else if ( uiAniTileFlags & ANITILE_SMOKE_EFFECT )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+OBJECT_Z_LEVEL;\
|
||||
}\
|
||||
else if ( ( uiLevelNodeFlags & LEVELNODE_USEZ ) )\
|
||||
{\
|
||||
\
|
||||
if ( ( uiLevelNodeFlags & LEVELNODE_NOZBLITTER ) )\
|
||||
{\
|
||||
sWorldY += 40;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sWorldY += pNode->sRelativeZ;\
|
||||
}\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
}\
|
||||
\
|
||||
}
|
||||
|
||||
|
||||
#define SoldierZLevel( pSoldier, sMapX, sMapY )\
|
||||
{\
|
||||
\
|
||||
if ( ( pSoldier->flags.uiStatusFlags & SOLDIER_MULTITILE ) )\
|
||||
{\
|
||||
\
|
||||
if ( pNode->pStructureData != NULL )\
|
||||
{\
|
||||
sZOffsetX = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetX;\
|
||||
sZOffsetY = pNode->pStructureData->pDBStructureRef->pDBStructure->bZTileOffsetY;\
|
||||
}\
|
||||
\
|
||||
sWorldY = GetMapXYWorldY( (sMapX + sZOffsetX), (sMapY + sZOffsetY) );\
|
||||
\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sWorldY = GetMapXYWorldY( sMapX, sMapY );\
|
||||
}\
|
||||
\
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+STRUCT_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
if ( pSoldier->aiData.dHeightAdjustment > 0 )\
|
||||
{\
|
||||
sWorldY += ( WALL_HEIGHT + 20 );\
|
||||
\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+ONROOF_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
if ( ( pSoldier->flags.uiStatusFlags & SOLDIER_DEAD ) )\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+MERC_Z_LEVEL;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
sZLevel=(sWorldY*Z_SUBLAYERS)+MERC_Z_LEVEL;\
|
||||
}\
|
||||
}\
|
||||
\
|
||||
if ( pSoldier->sZLevelOverride != -1 )\
|
||||
{\
|
||||
sZLevel = pSoldier->sZLevelOverride;\
|
||||
}\
|
||||
\
|
||||
if ( gsForceSoldierZLevel != 0 )\
|
||||
{\
|
||||
sZLevel = gsForceSoldierZLevel;\
|
||||
}\
|
||||
}\
|
||||
\
|
||||
}
|
||||
+74
-75
@@ -26,7 +26,7 @@ extern BOOLEAN gfLoadingExitGrids;
|
||||
|
||||
BOOLEAN gfApplyChangesToTempFile = FALSE;
|
||||
|
||||
// There are 3200 bytes, and each bit represents the revelaed status.
|
||||
// There are 3200 bytes, and each bit represents the revelaed status.
|
||||
// 3200 bytes * 8 bits = 25600 map elements
|
||||
UINT8 *gpRevealedMap;
|
||||
|
||||
@@ -36,7 +36,7 @@ UINT8 *gpRevealedMap;
|
||||
void RemoveSavedStructFromMap( UINT32 uiMapIndex, UINT16 usIndex );
|
||||
void AddObjectFromMapTempFileToMap( UINT32 uiMapIndex, UINT16 usIndex );
|
||||
void AddBloodOrSmellFromMapTempFileToMap( MODIFY_MAP *pMap );
|
||||
void SetSectorsRevealedBit( UINT16 usMapIndex );
|
||||
void SetSectorsRevealedBit( INT16 sMapIndex );
|
||||
void SetMapRevealedStatus();
|
||||
void DamageStructsFromMapTempFile( MODIFY_MAP * pMap );
|
||||
BOOLEAN ModifyWindowStatus( UINT32 uiMapIndex );
|
||||
@@ -174,7 +174,7 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
case SLM_OBJECT:
|
||||
GetTileIndexFromTypeSubIndex( pMap->usImageType, pMap->usSubImageIndex, &usIndex );
|
||||
|
||||
AddObjectFromMapTempFileToMap( pMap->usGridNo, usIndex );
|
||||
AddObjectFromMapTempFileToMap( pMap->sGridNo, usIndex );
|
||||
|
||||
// Save this struct back to the temp file
|
||||
SaveModifiedMapStructToMapTempFile( pMap, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
@@ -186,7 +186,7 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
case SLM_STRUCT:
|
||||
GetTileIndexFromTypeSubIndex( pMap->usImageType, pMap->usSubImageIndex, &usIndex );
|
||||
|
||||
AddStructFromMapTempFileToMap( pMap->usGridNo, usIndex );
|
||||
AddStructFromMapTempFileToMap( pMap->sGridNo, usIndex );
|
||||
|
||||
// Save this struct back to the temp file
|
||||
SaveModifiedMapStructToMapTempFile( pMap, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
@@ -219,12 +219,12 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
if ( pMap->usImageType >= FIRSTDOOR && pMap->usImageType <= FOURTHDOOR )
|
||||
{
|
||||
// Remove ANY door...
|
||||
RemoveAllStructsOfTypeRange( pMap->usGridNo, FIRSTDOOR, FOURTHDOOR );
|
||||
RemoveAllStructsOfTypeRange( pMap->sGridNo, FIRSTDOOR, FOURTHDOOR );
|
||||
}
|
||||
else
|
||||
{
|
||||
GetTileIndexFromTypeSubIndex( pMap->usImageType, pMap->usSubImageIndex, &usIndex );
|
||||
RemoveSavedStructFromMap( pMap->usGridNo, usIndex );
|
||||
RemoveSavedStructFromMap( pMap->sGridNo, usIndex );
|
||||
}
|
||||
|
||||
// Save this struct back to the temp file
|
||||
@@ -257,12 +257,12 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
{
|
||||
EXITGRID ExitGrid;
|
||||
gfLoadingExitGrids = TRUE;
|
||||
ExitGrid.usGridNo = pMap->usSubImageIndex;
|
||||
ExitGrid.sGridNo = pMap->usSubImageIndex;
|
||||
ExitGrid.ubGotoSectorX = (UINT8) pMap->usImageType;
|
||||
ExitGrid.ubGotoSectorY = (UINT8) ( pMap->usImageType >> 8 ) ;
|
||||
ExitGrid.ubGotoSectorZ = pMap->ubExtra;
|
||||
|
||||
AddExitGridToWorld( pMap->usGridNo, &ExitGrid );
|
||||
AddExitGridToWorld( pMap->sGridNo, &ExitGrid );
|
||||
gfLoadingExitGrids = FALSE;
|
||||
|
||||
// Save this struct back to the temp file
|
||||
@@ -274,11 +274,11 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
break;
|
||||
|
||||
case SLM_OPENABLE_STRUCT:
|
||||
SetOpenableStructStatusFromMapTempFile( pMap->usGridNo, (BOOLEAN)pMap->usImageType );
|
||||
SetOpenableStructStatusFromMapTempFile( pMap->sGridNo, (BOOLEAN)pMap->usImageType );
|
||||
break;
|
||||
|
||||
case SLM_WINDOW_HIT:
|
||||
if ( ModifyWindowStatus( pMap->usGridNo ) )
|
||||
if ( ModifyWindowStatus( pMap->sGridNo ) )
|
||||
{
|
||||
// Save this struct back to the temp file
|
||||
SaveModifiedMapStructToMapTempFile( pMap, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
@@ -289,7 +289,7 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertMsg( 0, "ERROR! Map Type not in switch when loading map changes from temp file");
|
||||
AssertMsg( 0, "ERROR! Map Type not in switch when loading map changes from temp file");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
|
||||
//Free the memory used for the temp array
|
||||
MemFree( pTempArrayOfMaps );
|
||||
pTempArrayOfMaps = NULL;
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ void AddStructToMapTempFile( UINT32 uiMapIndex, UINT16 usIndex )
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -369,7 +369,7 @@ void AddObjectToMapTempFile( UINT32 uiMapIndex, UINT16 usIndex )
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -402,7 +402,7 @@ void AddRemoveObjectToMapTempFile( UINT32 uiMapIndex, UINT16 usIndex )
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -430,7 +430,7 @@ void RemoveStructFromMapTempFile( UINT32 uiMapIndex, UINT16 usIndex )
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -472,7 +472,7 @@ void SaveBloodSmellAndRevealedStatesFromMapToTempFile()
|
||||
|
||||
|
||||
// Save the BloodInfo in the bottom byte and the smell info in the upper byte
|
||||
Map.usGridNo = cnt;
|
||||
Map.sGridNo = (INT16)cnt;
|
||||
// Map.usIndex = gpWorldLevelData[cnt].ubBloodInfo | ( gpWorldLevelData[cnt].ubSmellInfo << 8 );
|
||||
Map.usImageType = gpWorldLevelData[cnt].ubBloodInfo;
|
||||
Map.usSubImageIndex = gpWorldLevelData[cnt].ubSmellInfo;
|
||||
@@ -496,7 +496,7 @@ void SaveBloodSmellAndRevealedStatesFromMapToTempFile()
|
||||
{
|
||||
STRUCTURE * pCurrent;
|
||||
|
||||
pCurrent = gpWorldLevelData[cnt].pStructureHead;
|
||||
pCurrent = gpWorldLevelData[cnt].pStructureHead;
|
||||
|
||||
pCurrent = FindStructure( cnt, STRUCTURE_BASE_TILE );
|
||||
|
||||
@@ -515,7 +515,7 @@ void SaveBloodSmellAndRevealedStatesFromMapToTempFile()
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
// Save the Damaged value
|
||||
Map.usGridNo = cnt;
|
||||
Map.sGridNo = (INT16)cnt;
|
||||
// Map.usIndex = StructureFlagToType( pCurrent->fFlags ) | ( pCurrent->ubHitPoints << 8 );
|
||||
Map.usImageType = StructureFlagToType( pCurrent->fFlags );
|
||||
Map.usSubImageIndex = pCurrent->ubHitPoints;
|
||||
@@ -554,19 +554,19 @@ void SaveBloodSmellAndRevealedStatesFromMapToTempFile()
|
||||
// The BloodInfo is saved in the bottom byte and the smell info in the upper byte
|
||||
void AddBloodOrSmellFromMapTempFileToMap( MODIFY_MAP *pMap )
|
||||
{
|
||||
gpWorldLevelData[ pMap->usGridNo ].ubBloodInfo = (UINT8)pMap->usImageType;
|
||||
gpWorldLevelData[ pMap->sGridNo ].ubBloodInfo = (UINT8)pMap->usImageType;
|
||||
|
||||
//if the blood and gore option IS set, add blood
|
||||
if( gGameSettings.fOptions[ TOPTION_BLOOD_N_GORE ] )
|
||||
{
|
||||
// Update graphics for both levels...
|
||||
gpWorldLevelData[ pMap->usGridNo ].uiFlags |= MAPELEMENT_REEVALUATEBLOOD;
|
||||
UpdateBloodGraphics( pMap->usGridNo, 0 );
|
||||
gpWorldLevelData[ pMap->usGridNo ].uiFlags |= MAPELEMENT_REEVALUATEBLOOD;
|
||||
UpdateBloodGraphics( pMap->usGridNo, 1 );
|
||||
gpWorldLevelData[ pMap->sGridNo ].uiFlags |= MAPELEMENT_REEVALUATEBLOOD;
|
||||
UpdateBloodGraphics( pMap->sGridNo, 0 );
|
||||
gpWorldLevelData[ pMap->sGridNo ].uiFlags |= MAPELEMENT_REEVALUATEBLOOD;
|
||||
UpdateBloodGraphics( pMap->sGridNo, 1 );
|
||||
}
|
||||
|
||||
gpWorldLevelData[ pMap->usGridNo ].ubSmellInfo = (UINT8)pMap->usSubImageIndex;
|
||||
gpWorldLevelData[ pMap->sGridNo ].ubSmellInfo = (UINT8)pMap->usSubImageIndex;
|
||||
}
|
||||
|
||||
|
||||
@@ -671,7 +671,7 @@ BOOLEAN LoadRevealedStatusArrayFromRevealedTempFile()
|
||||
|
||||
//Loop through and set the bits in the map that are revealed
|
||||
SetMapRevealedStatus();
|
||||
|
||||
|
||||
MemFree( gpRevealedMap );
|
||||
gpRevealedMap = NULL;
|
||||
|
||||
@@ -680,13 +680,13 @@ BOOLEAN LoadRevealedStatusArrayFromRevealedTempFile()
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void SetSectorsRevealedBit( UINT16 usMapIndex )
|
||||
void SetSectorsRevealedBit( INT16 sMapIndex )
|
||||
{
|
||||
UINT16 usByteNumber;
|
||||
UINT8 ubBitNumber;
|
||||
|
||||
usByteNumber = usMapIndex / 8;
|
||||
ubBitNumber = usMapIndex % 8;
|
||||
usByteNumber = sMapIndex / 8;
|
||||
ubBitNumber = sMapIndex % 8;
|
||||
|
||||
gpRevealedMap[ usByteNumber ] |= 1 << ubBitNumber;
|
||||
}
|
||||
@@ -697,10 +697,10 @@ void SetMapRevealedStatus()
|
||||
{
|
||||
UINT16 usByteCnt;
|
||||
UINT8 ubBitCnt;
|
||||
UINT16 usMapIndex;
|
||||
INT16 sMapIndex;
|
||||
|
||||
if( gpRevealedMap == NULL )
|
||||
AssertMsg( 0, "gpRevealedMap is NULL. DF 1" );
|
||||
AssertMsg( 0, "gpRevealedMap is NULL. DF 1" );
|
||||
|
||||
|
||||
ClearSlantRoofs( );
|
||||
@@ -711,16 +711,16 @@ void SetMapRevealedStatus()
|
||||
//loop through all the bits in the byte
|
||||
for( ubBitCnt=0; ubBitCnt<8; ubBitCnt++)
|
||||
{
|
||||
usMapIndex = ( usByteCnt * 8 ) + ubBitCnt;
|
||||
sMapIndex = ( usByteCnt * 8 ) + ubBitCnt;
|
||||
|
||||
if( gpRevealedMap[ usByteCnt ] & ( 1 << ubBitCnt ) )
|
||||
{
|
||||
gpWorldLevelData[ usMapIndex ].uiFlags |= MAPELEMENT_REVEALED;
|
||||
SetGridNoRevealedFlag( usMapIndex );
|
||||
gpWorldLevelData[ sMapIndex ].uiFlags |= MAPELEMENT_REVEALED;
|
||||
SetGridNoRevealedFlag( sMapIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
gpWorldLevelData[ usMapIndex ].uiFlags &= (~MAPELEMENT_REVEALED );
|
||||
gpWorldLevelData[ sMapIndex ].uiFlags &= (~MAPELEMENT_REVEALED );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -738,12 +738,11 @@ void DamageStructsFromMapTempFile( MODIFY_MAP * pMap )
|
||||
INT8 bLevel;
|
||||
UINT8 ubWallOrientation;
|
||||
UINT8 ubBitToSet = 0x80;
|
||||
UINT8 ubHitPoints=0;
|
||||
UINT8 ubType=0;
|
||||
|
||||
|
||||
//Find the base structure
|
||||
pCurrent = FindStructure( (INT16)pMap->usGridNo, STRUCTURE_BASE_TILE );
|
||||
pCurrent = FindStructure( (INT16)pMap->sGridNo, STRUCTURE_BASE_TILE );
|
||||
|
||||
if( pCurrent == NULL )
|
||||
return;
|
||||
@@ -754,7 +753,7 @@ void DamageStructsFromMapTempFile( MODIFY_MAP * pMap )
|
||||
|
||||
|
||||
//Check to see if the desired strucure node is in this tile
|
||||
pCurrent = FindStructureBySavedInfo( pMap->usGridNo, ubType, ubWallOrientation, bLevel );
|
||||
pCurrent = FindStructureBySavedInfo( pMap->sGridNo, ubType, ubWallOrientation, bLevel );
|
||||
|
||||
if( pCurrent != NULL )
|
||||
{
|
||||
@@ -769,7 +768,7 @@ void DamageStructsFromMapTempFile( MODIFY_MAP * pMap )
|
||||
//////////////
|
||||
|
||||
|
||||
void AddStructToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
void AddStructToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
UINT32 uiType;
|
||||
@@ -783,7 +782,7 @@ void AddStructToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sS
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -794,7 +793,7 @@ void AddStructToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sS
|
||||
SaveModifiedMapStructToMapTempFile( &Map, sSectorX, sSectorY, ubSectorZ );
|
||||
}
|
||||
|
||||
void AddObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
void AddObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
UINT32 uiType;
|
||||
@@ -808,7 +807,7 @@ void AddObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sS
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -819,7 +818,7 @@ void AddObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sS
|
||||
}
|
||||
|
||||
|
||||
void RemoveStructFromUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
void RemoveStructFromUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
UINT32 uiType;
|
||||
@@ -833,7 +832,7 @@ void RemoveStructFromUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -844,7 +843,7 @@ void RemoveStructFromUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT
|
||||
}
|
||||
|
||||
|
||||
void AddRemoveObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
void AddRemoveObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
UINT32 uiType;
|
||||
@@ -858,7 +857,7 @@ void AddRemoveObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, IN
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
// Map.usIndex = usIndex;
|
||||
Map.usImageType = (UINT16)uiType;
|
||||
Map.usSubImageIndex = usSubIndex;
|
||||
@@ -869,7 +868,7 @@ void AddRemoveObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, IN
|
||||
}
|
||||
|
||||
|
||||
void AddExitGridToMapTempFile( UINT16 usGridNo, EXITGRID *pExitGrid, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
void AddExitGridToMapTempFile( INT16 sGridNo, EXITGRID *pExitGrid, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ )
|
||||
{
|
||||
MODIFY_MAP Map;
|
||||
|
||||
@@ -884,11 +883,11 @@ void AddExitGridToMapTempFile( UINT16 usGridNo, EXITGRID *pExitGrid, INT16 sSect
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = usGridNo;
|
||||
Map.sGridNo = sGridNo;
|
||||
// Map.usIndex = pExitGrid->ubGotoSectorX;
|
||||
|
||||
Map.usImageType = pExitGrid->ubGotoSectorX | ( pExitGrid->ubGotoSectorY << 8 );
|
||||
Map.usSubImageIndex = pExitGrid->usGridNo;
|
||||
Map.usSubImageIndex = pExitGrid->sGridNo;
|
||||
|
||||
Map.ubExtra = pExitGrid->ubGotoSectorZ;
|
||||
Map.ubType = SLM_EXIT_GRIDS;
|
||||
@@ -922,7 +921,7 @@ BOOLEAN RemoveGraphicFromTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSec
|
||||
//Check to see if the file exists
|
||||
if( !FileExists( zMapName ) )
|
||||
{
|
||||
//If the file doesnt exists,
|
||||
//If the file doesnt exists,
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -972,7 +971,7 @@ BOOLEAN RemoveGraphicFromTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSec
|
||||
pMap = &pTempArrayOfMaps[ cnt ];
|
||||
|
||||
//if this is the peice we are looking for
|
||||
if( pMap->usGridNo == uiMapIndex && pMap->usImageType == uiType && pMap->usSubImageIndex == usSubIndex )
|
||||
if( pMap->sGridNo == uiMapIndex && pMap->usImageType == uiType && pMap->usSubImageIndex == usSubIndex )
|
||||
{
|
||||
//Do nothin
|
||||
fRetVal = TRUE;
|
||||
@@ -995,7 +994,7 @@ void AddOpenableStructStatusToMapTempFile( UINT32 uiMapIndex, BOOLEAN fOpened )
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
Map.usImageType = fOpened;
|
||||
|
||||
Map.ubType = SLM_OPENABLE_STRUCT;
|
||||
@@ -1009,7 +1008,7 @@ void AddWindowHitToMapTempFile( UINT32 uiMapIndex )
|
||||
|
||||
memset( &Map, 0, sizeof( MODIFY_MAP ) );
|
||||
|
||||
Map.usGridNo = (UINT16)uiMapIndex;
|
||||
Map.sGridNo = (INT16)uiMapIndex;
|
||||
Map.ubType = SLM_WINDOW_HIT;
|
||||
|
||||
SaveModifiedMapStructToMapTempFile( &Map, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
@@ -1022,7 +1021,7 @@ BOOLEAN ModifyWindowStatus( UINT32 uiMapIndex )
|
||||
pStructure = FindStructure( (INT16) uiMapIndex, STRUCTURE_WALLNWINDOW );
|
||||
if (pStructure)
|
||||
{
|
||||
SwapStructureForPartner( (INT16) uiMapIndex, pStructure );
|
||||
SwapStructureForPartner( (INT16) uiMapIndex, pStructure );
|
||||
return( TRUE );
|
||||
}
|
||||
// else forget it, window could be destroyed
|
||||
@@ -1035,13 +1034,13 @@ void SetOpenableStructStatusFromMapTempFile( UINT32 uiMapIndex, BOOLEAN fOpened
|
||||
STRUCTURE * pBase;
|
||||
BOOLEAN fStatusOnTheMap;
|
||||
ITEM_POOL *pItemPool;
|
||||
INT16 sBaseGridNo = (INT16)uiMapIndex;
|
||||
INT16 sBaseGridNo = (INT16)uiMapIndex;
|
||||
|
||||
pStructure = FindStructure( (UINT16)uiMapIndex, STRUCTURE_OPENABLE );
|
||||
pStructure = FindStructure( (INT16)uiMapIndex, STRUCTURE_OPENABLE );
|
||||
|
||||
if( pStructure == NULL )
|
||||
{
|
||||
// ScreenMsg( FONT_MCOLOR_WHITE, MSG_BETAVERSION, L"SetOpenableStructStatusFromMapTempFile( %d, %d ) failed to find the openable struct. DF 1.", uiMapIndex, fOpened );
|
||||
// ScreenMsg( FONT_MCOLOR_WHITE, MSG_BETAVERSION, L"SetOpenableStructStatusFromMapTempFile( %d, %d ) failed to find the openable struct. DF 1.", uiMapIndex, fOpened );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1051,33 +1050,33 @@ void SetOpenableStructStatusFromMapTempFile( UINT32 uiMapIndex, BOOLEAN fOpened
|
||||
{
|
||||
// Adjust the item's gridno to the base of struct.....
|
||||
pBase = FindBaseStructure( pStructure );
|
||||
|
||||
// Get LEVELNODE for struct and remove!
|
||||
if ( pBase )
|
||||
{
|
||||
sBaseGridNo = pBase->sGridNo;
|
||||
}
|
||||
|
||||
if(SwapStructureForPartnerWithoutTriggeringSwitches( (UINT16)uiMapIndex, pStructure ) == NULL )
|
||||
// Get LEVELNODE for struct and remove!
|
||||
if ( pBase )
|
||||
{
|
||||
sBaseGridNo = pBase->sGridNo;
|
||||
}
|
||||
|
||||
if(SwapStructureForPartnerWithoutTriggeringSwitches( (INT16)uiMapIndex, pStructure ) == NULL )
|
||||
{
|
||||
//an error occured
|
||||
}
|
||||
|
||||
|
||||
// Adjust visiblity of any item pools here....
|
||||
// ATE: Nasty bug here - use base gridno for structure for items!
|
||||
// since items always drop to base gridno in AddItemToPool
|
||||
if ( GetItemPool( sBaseGridNo, &pItemPool, 0 ) )
|
||||
// ATE: Nasty bug here - use base gridno for structure for items!
|
||||
// since items always drop to base gridno in AddItemToPool
|
||||
if ( GetItemPoolFromGround( sBaseGridNo, &pItemPool ) )
|
||||
{
|
||||
if ( fOpened )
|
||||
{
|
||||
// We are open, make un-hidden if so....
|
||||
SetItemPoolVisibilityOn( pItemPool, ANY_VISIBILITY_VALUE, FALSE );
|
||||
// We are open, make un-hidden if so....
|
||||
SetItemPoolVisibilityOn( pItemPool, ANY_VISIBILITY_VALUE, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Make sure items are hidden...
|
||||
SetItemPoolVisibilityHidden( pItemPool );
|
||||
// Make sure items are hidden...
|
||||
SetItemPoolVisibilityHidden( pItemPool );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1088,7 +1087,7 @@ void SetOpenableStructStatusFromMapTempFile( UINT32 uiMapIndex, BOOLEAN fOpened
|
||||
|
||||
|
||||
|
||||
BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 usSectorY, INT8 bSectorZ, UINT16 usGridNo, BOOLEAN fChangeToOpen )
|
||||
BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 usSectorY, INT8 bSectorZ, INT16 sGridNo, BOOLEAN fChangeToOpen )
|
||||
{
|
||||
// STRUCTURE * pStructure;
|
||||
// MODIFY_MAP Map;
|
||||
@@ -1098,7 +1097,6 @@ BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 u
|
||||
UINT32 uiNumBytesWritten;
|
||||
UINT32 uiFileSize;
|
||||
UINT32 uiNumberOfElements;
|
||||
UINT32 uiNumberOfElementsSavedBackToFile = 0; // added becuase if no files get saved back to disk, the flag needs to be erased
|
||||
UINT32 cnt;
|
||||
MODIFY_MAP *pMap;
|
||||
MODIFY_MAP *pTempArrayOfMaps=NULL;
|
||||
@@ -1157,7 +1155,7 @@ BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 u
|
||||
|
||||
uiNumberOfElements = uiFileSize / sizeof( MODIFY_MAP );
|
||||
|
||||
//loop through all the array elements to
|
||||
//loop through all the array elements to
|
||||
for( cnt=0; cnt< uiNumberOfElements; cnt++ )
|
||||
{
|
||||
pMap = &pTempArrayOfMaps[ cnt ];
|
||||
@@ -1166,7 +1164,7 @@ BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 u
|
||||
if( pMap->ubType == SLM_OPENABLE_STRUCT )
|
||||
{
|
||||
//if its on the same gridno
|
||||
if( pMap->usGridNo == usGridNo )
|
||||
if( pMap->sGridNo == sGridNo )
|
||||
{
|
||||
//Change to the desired settings
|
||||
pMap->usImageType = fChangeToOpen;
|
||||
@@ -1201,3 +1199,4 @@ BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 u
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "WorldDef.h"
|
||||
#include "Exit Grids.h"
|
||||
|
||||
//Used for the ubType in the MODIFY_MAP struct
|
||||
//Used for the ubType in the MODIFY_MAP struct
|
||||
enum
|
||||
{
|
||||
SLM_NONE,
|
||||
@@ -47,7 +47,7 @@ enum
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT16 usGridNo; //The gridno the graphic will be applied to
|
||||
UINT16 sGridNo; //The gridno the graphic will be applied to
|
||||
UINT16 usImageType; //graphic index
|
||||
UINT16 usSubImageIndex; //
|
||||
// UINT16 usIndex;
|
||||
@@ -57,7 +57,7 @@ typedef struct
|
||||
} MODIFY_MAP;
|
||||
|
||||
|
||||
// Call this function, to set whether the map changes will be added to the map temp file
|
||||
// Call this function, to set whether the map changes will be added to the map temp file
|
||||
void ApplyMapChangesToMapTempFile( BOOLEAN fAddToMap );
|
||||
|
||||
BOOLEAN SaveModifiedMapStructToMapTempFile( MODIFY_MAP *pMap, INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
|
||||
@@ -91,13 +91,13 @@ BOOLEAN SaveRevealedStatusArrayToRevealedTempFile( INT16 sSectorX, INT16 sSector
|
||||
BOOLEAN LoadRevealedStatusArrayFromRevealedTempFile();
|
||||
|
||||
|
||||
void AddRemoveObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void RemoveStructFromUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void AddObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void AddStructToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void AddRemoveObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void RemoveStructFromUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void AddObjectToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void AddStructToUnLoadedMapTempFile( UINT32 uiMapIndex, UINT16 usIndex, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
|
||||
//Adds the exit grid to
|
||||
void AddExitGridToMapTempFile( UINT16 usGridNo, EXITGRID *pExitGrid, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
void AddExitGridToMapTempFile( INT16 sGridNo, EXITGRID *pExitGrid, INT16 sSectorX, INT16 sSectorY, UINT8 ubSectorZ );
|
||||
|
||||
|
||||
//This function removes a struct with the same MapIndex and graphic index from the given sectors temp file
|
||||
@@ -109,7 +109,7 @@ void AddOpenableStructStatusToMapTempFile( UINT32 uiMapIndex, BOOLEAN fOpened );
|
||||
|
||||
void AddWindowHitToMapTempFile( UINT32 uiMapIndex );
|
||||
|
||||
BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 usSectorY, INT8 bSectorZ, UINT16 usGridNo, BOOLEAN fChangeToOpen );
|
||||
BOOLEAN ChangeStatusOfOpenableStructInUnloadedSector( UINT16 usSectorX, UINT16 usSectorY, INT8 bSectorZ, INT16 sGridNo, BOOLEAN fChangeToOpen );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,14 +42,14 @@ void DetermineRGBDistributionSettings()
|
||||
// Snap: save current directory
|
||||
GetFileManCurrentDirectory( DataDir );
|
||||
|
||||
//First, determine if we have a file saved. If not, then this is the first time, and
|
||||
//all shade tables will have to be built and saved to disk. This can be time consuming, adding up to
|
||||
//First, determine if we have a file saved. If not, then this is the first time, and
|
||||
//all shade tables will have to be built and saved to disk. This can be time consuming, adding up to
|
||||
//3-4 seconds to the time of a map load.
|
||||
GetExecutableDirectory( ExecDir );
|
||||
sprintf( ShadeTableDir, "%s\\%s", DataDir, SHADE_TABLE_DIR );
|
||||
|
||||
|
||||
//Check to make sure we have a ShadeTable directory. If we don't create one!
|
||||
|
||||
//Check to make sure we have a ShadeTable directory. If we don't create one!
|
||||
if( !SetFileManCurrentDirectory( ShadeTableDir ) )
|
||||
{
|
||||
if( !MakeFileManDirectory( ShadeTableDir ) )
|
||||
@@ -62,12 +62,12 @@ void DetermineRGBDistributionSettings()
|
||||
}
|
||||
fSaveRGBDist = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if( !fSaveRGBDist )
|
||||
{ //Load the previous RGBDist and determine if it is the same one
|
||||
if( !FileExists( "RGBDist.dat" ) || FileExists( "ResetShadeTables.txt" ) )
|
||||
{ //Can't find the RGBDist.dat file. The directory exists, but the file doesn't, which
|
||||
//means the user deleted the file manually. Now, set it up to create a new one.
|
||||
{ //Can't find the RGBDist.dat file. The directory exists, but the file doesn't, which
|
||||
//means the user deleted the file manually. Now, set it up to create a new one.
|
||||
fSaveRGBDist = TRUE;
|
||||
fCleanShadeTable = TRUE;
|
||||
}
|
||||
@@ -93,24 +93,24 @@ void DetermineRGBDistributionSettings()
|
||||
if( fLoadedPrevRGBDist )
|
||||
{
|
||||
if( uiRBitMask != uiPrevRBitMask || uiGBitMask != uiPrevGBitMask || uiBBitMask != uiPrevBBitMask )
|
||||
{ //The user has changed modes since the last time he has played JA2. This essentially can only happen if:
|
||||
//1) The video card has been changed since the last run of JA2.
|
||||
//2) Certain video cards have different RGB distributions in different operating systems such as
|
||||
{ //The user has changed modes since the last time he has played JA2. This essentially can only happen if:
|
||||
//1) The video card has been changed since the last run of JA2.
|
||||
//2) Certain video cards have different RGB distributions in different operating systems such as
|
||||
// the Millenium card using Windows NT or Windows 95
|
||||
//3) The user has physically modified the RGBDist.dat file.
|
||||
//3) The user has physically modified the RGBDist.dat file.
|
||||
fSaveRGBDist = TRUE;
|
||||
fCleanShadeTable = TRUE;
|
||||
}
|
||||
}
|
||||
if( fCleanShadeTable )
|
||||
{ //This means that we are going to remove all of the current shade tables, if any exist, and
|
||||
//start fresh.
|
||||
//start fresh.
|
||||
EraseDirectory( ShadeTableDir );
|
||||
}
|
||||
if( fSaveRGBDist )
|
||||
{ //The RGB distribution is going to be saved in a tiny file for future reference. As long as the
|
||||
{ //The RGB distribution is going to be saved in a tiny file for future reference. As long as the
|
||||
//RGB distribution never changes, the shade table will grow until eventually, all tilesets are loaded,
|
||||
//shadetables generated and saved in this directory.
|
||||
//shadetables generated and saved in this directory.
|
||||
hfile = FileOpen( "RGBDist.dat", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
|
||||
if( !hfile )
|
||||
{
|
||||
@@ -138,8 +138,8 @@ BOOLEAN LoadShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
||||
CHAR8 *ptr;
|
||||
//ASSUMPTIONS:
|
||||
//We are assuming that the uiTileTypeIndex is referring to the correct file
|
||||
//stored in the TileSurfaceFilenames[]. If it isn't, then that is a huge problem
|
||||
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
|
||||
//stored in the TileSurfaceFilenames[]. If it isn't, then that is a huge problem
|
||||
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
|
||||
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
|
||||
ptr = strstr( ShadeFileName, "." );
|
||||
if( !ptr )
|
||||
@@ -156,7 +156,7 @@ BOOLEAN LoadShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//MISSING: Compare time stamps.
|
||||
//MISSING: Compare time stamps.
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
{
|
||||
@@ -165,7 +165,7 @@ BOOLEAN LoadShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
||||
FileRead( hfile, pObj->pShades[ i ], 512, &uiNumBytesRead );
|
||||
}
|
||||
|
||||
//The file exists, now make sure the
|
||||
//The file exists, now make sure the
|
||||
FileClose( hfile );
|
||||
#ifdef JA2TESTVERSION
|
||||
uiNumTablesLoaded++;
|
||||
@@ -185,8 +185,8 @@ BOOLEAN SaveShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
||||
#endif
|
||||
//ASSUMPTIONS:
|
||||
//We are assuming that the uiTileTypeIndex is referring to the correct file
|
||||
//stored in the TileSurfaceFilenames[]. If it isn't, then that is a huge problem
|
||||
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
|
||||
//stored in the TileSurfaceFilenames[]. If it isn't, then that is a huge problem
|
||||
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
|
||||
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
|
||||
ptr = strstr( ShadeFileName, "." );
|
||||
if( !ptr )
|
||||
@@ -198,7 +198,7 @@ BOOLEAN SaveShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
||||
|
||||
hfile = FileOpen( ShadeFileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
|
||||
if( !hfile )
|
||||
{
|
||||
{
|
||||
FileClose( hfile );
|
||||
AssertMsg( 0, String( "Can't create %s", ShadeFileName ) );
|
||||
return FALSE;
|
||||
@@ -215,6 +215,6 @@ BOOLEAN SaveShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
||||
|
||||
|
||||
BOOLEAN DeleteShadeTableDir( )
|
||||
{
|
||||
{
|
||||
return( RemoveFileManDirectory( SHADE_TABLE_DIR, TRUE ) );
|
||||
}
|
||||
}
|
||||
|
||||
+50
-53
@@ -17,13 +17,13 @@
|
||||
|
||||
/*
|
||||
* Smell & Blood system
|
||||
*
|
||||
* Smell and blood trails decay as time passes.
|
||||
*
|
||||
* Decay Rate Maximum Strength Decay Time: Min Max (for biggest volume)
|
||||
*
|
||||
* Smell 1 per turn 31 31 31
|
||||
* Blood 1 every 1-3 turns 7 7 21
|
||||
* Smell and blood trails decay as time passes.
|
||||
*
|
||||
* Decay Rate Maximum Strength Decay Time: Min Max (for biggest volume)
|
||||
*
|
||||
* Smell 1 per turn 31 31 31
|
||||
* Blood 1 every 1-3 turns 7 7 21
|
||||
*
|
||||
* Smell has a much finer resolution so that creatures which track by smell
|
||||
* can do so effectively.
|
||||
@@ -33,23 +33,23 @@
|
||||
* Time for some crazy-ass macros!
|
||||
* The smell byte is spit as follows:
|
||||
* O \
|
||||
* O \
|
||||
* O \ Smell
|
||||
* O / Strength (only on ground)
|
||||
* O /
|
||||
* O \
|
||||
* O \ Smell
|
||||
* O / Strength (only on ground)
|
||||
* O /
|
||||
* O /
|
||||
* O > Type of blood on roof
|
||||
* O > Type of smell/blood on ground
|
||||
* O > Type of blood on roof
|
||||
* O > Type of smell/blood on ground
|
||||
*
|
||||
* The blood byte is split as follows:
|
||||
* O \
|
||||
* O > Blood quantity on roof
|
||||
* O > Blood quantity on roof
|
||||
* O /
|
||||
* O \
|
||||
* O > Blood quantity on ground
|
||||
* O \
|
||||
* O > Blood quantity on ground
|
||||
* O /
|
||||
* O \ Blood decay
|
||||
* O / time (roof and ground decay together)
|
||||
* O \ Blood decay
|
||||
* O / time (roof and ground decay together)
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -58,20 +58,20 @@
|
||||
*/
|
||||
|
||||
// LUT for which graphic to use based on strength
|
||||
// 0 1, 2, 3, 4, 5, 6, 7
|
||||
UINT8 ubBloodGraphicLUT [ ] = { 3, 3, 2, 2, 1, 1, 0, 0 };
|
||||
// 0 1, 2, 3, 4, 5, 6, 7
|
||||
UINT8 ubBloodGraphicLUT [ ] = { 3, 3, 2, 2, 1, 1, 0, 0 };
|
||||
|
||||
|
||||
#define SMELL_STRENGTH_MAX 63
|
||||
#define BLOOD_STRENGTH_MAX 7
|
||||
#define BLOOD_DELAY_MAX 3
|
||||
#define BLOOD_DELAY_MAX 3
|
||||
|
||||
#define SMELL_TYPE_BITS( s ) (s & 0x03)
|
||||
|
||||
#define BLOOD_ROOF_TYPE( s ) (s & 0x02)
|
||||
#define BLOOD_ROOF_TYPE( s ) (s & 0x02)
|
||||
#define BLOOD_FLOOR_TYPE( s ) (s & 0x01)
|
||||
|
||||
#define BLOOD_ROOF_STRENGTH( b ) (b & 0xE0)
|
||||
#define BLOOD_ROOF_STRENGTH( b ) (b & 0xE0)
|
||||
#define BLOOD_FLOOR_STRENGTH( b ) ( (b & 0x1C) >> 2 )
|
||||
#define BLOOD_DELAY_TIME( b ) (b & 0x03)
|
||||
#define NO_BLOOD_STRENGTH( b ) ((b & 0xFC) == 0)
|
||||
@@ -151,7 +151,7 @@ void RemoveBlood( INT16 sGridNo, INT8 bLevel )
|
||||
|
||||
|
||||
void DecaySmells( void )
|
||||
{
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
MAP_ELEMENT * pMapElement;
|
||||
|
||||
@@ -215,7 +215,7 @@ void DecayBlood()
|
||||
if (NO_BLOOD_STRENGTH( pMapElement->ubBloodInfo ))
|
||||
{
|
||||
// wipe the whole byte to zero
|
||||
pMapElement->ubBloodInfo = 0;
|
||||
pMapElement->ubBloodInfo = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void DecayBloodAndSmells( UINT32 uiTime )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// period between checks, in game seconds
|
||||
switch( giTimeCompressMode )
|
||||
{
|
||||
@@ -279,11 +279,11 @@ void DropSmell( SOLDIERTYPE * pSoldier )
|
||||
UINT8 ubStrength;
|
||||
|
||||
/*
|
||||
* Here we are creating a new smell on the ground. If there is blood in
|
||||
* the tile, it overrides dropping smells of any type
|
||||
*/
|
||||
* Here we are creating a new smell on the ground. If there is blood in
|
||||
* the tile, it overrides dropping smells of any type
|
||||
*/
|
||||
|
||||
if (pSoldier->bLevel == 0)
|
||||
if (pSoldier->pathing.bLevel == 0)
|
||||
{
|
||||
pMapElement = &(gpWorldLevelData[pSoldier->sGridNo]);
|
||||
if (pMapElement->ubBloodInfo)
|
||||
@@ -292,14 +292,14 @@ void DropSmell( SOLDIERTYPE * pSoldier )
|
||||
return;
|
||||
}
|
||||
|
||||
if (pSoldier->bNormalSmell > pSoldier->bMonsterSmell)
|
||||
if (pSoldier->aiData.bNormalSmell > pSoldier->aiData.bMonsterSmell)
|
||||
{
|
||||
ubStrength = pSoldier->bNormalSmell - pSoldier->bMonsterSmell;
|
||||
ubStrength = pSoldier->aiData.bNormalSmell - pSoldier->aiData.bMonsterSmell;
|
||||
ubSmell = HUMAN;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubStrength = pSoldier->bMonsterSmell - pSoldier->bNormalSmell;
|
||||
ubStrength = pSoldier->aiData.bMonsterSmell - pSoldier->aiData.bNormalSmell;
|
||||
if (ubStrength == 0)
|
||||
{
|
||||
// don't drop any smell
|
||||
@@ -360,11 +360,11 @@ void InternalDropBlood( INT16 sGridNo, INT8 bLevel, UINT8 ubType, UINT8 ubStreng
|
||||
UINT8 ubOldStrength=0;
|
||||
UINT8 ubNewStrength=0;
|
||||
UINT8 bOverTerrainType;
|
||||
|
||||
|
||||
/*
|
||||
* Dropping some blood;
|
||||
* We can check the type of blood by consulting the type in the smell byte
|
||||
*/
|
||||
* Dropping some blood;
|
||||
* We can check the type of blood by consulting the type in the smell byte
|
||||
*/
|
||||
|
||||
bOverTerrainType = GetTerrainType( sGridNo);
|
||||
// If we are in water...
|
||||
@@ -396,7 +396,7 @@ void InternalDropBlood( INT16 sGridNo, INT8 bLevel, UINT8 ubType, UINT8 ubStreng
|
||||
if (BLOOD_FLOOR_TYPE( pMapElement->ubBloodInfo ) == ubType)
|
||||
{
|
||||
// combine blood strengths!
|
||||
ubNewStrength = __min( ( ubOldStrength + ubStrength ), BLOOD_STRENGTH_MAX );
|
||||
ubNewStrength = __min( ( ubOldStrength + ubStrength ), BLOOD_STRENGTH_MAX );
|
||||
|
||||
SET_BLOOD_FLOOR_STRENGTH( pMapElement->ubBloodInfo, ubNewStrength );
|
||||
}
|
||||
@@ -414,7 +414,7 @@ void InternalDropBlood( INT16 sGridNo, INT8 bLevel, UINT8 ubType, UINT8 ubStreng
|
||||
else
|
||||
{
|
||||
// no blood on the ground yet, so drop this amount!
|
||||
// set decay time
|
||||
// set decay time
|
||||
SET_BLOOD_DELAY_TIME( pMapElement->ubBloodInfo );
|
||||
SET_BLOOD_FLOOR_STRENGTH( pMapElement->ubBloodInfo, ubStrength );
|
||||
// NB blood floor type stored in smell byte!
|
||||
@@ -431,8 +431,8 @@ void InternalDropBlood( INT16 sGridNo, INT8 bLevel, UINT8 ubType, UINT8 ubStreng
|
||||
if (BLOOD_ROOF_TYPE( pMapElement->ubSmellInfo ) == ubType)
|
||||
{
|
||||
// combine blood strengths!
|
||||
ubNewStrength = __max( ubOldStrength, ubStrength ) + 1;
|
||||
// make sure the strength is legal
|
||||
ubNewStrength = __max( ubOldStrength, ubStrength ) + 1;
|
||||
// make sure the strength is legal
|
||||
ubNewStrength = __max( ubNewStrength, BLOOD_STRENGTH_MAX );
|
||||
SET_BLOOD_ROOF_STRENGTH( pMapElement->ubBloodInfo, ubNewStrength );
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void InternalDropBlood( INT16 sGridNo, INT8 bLevel, UINT8 ubType, UINT8 ubStreng
|
||||
else
|
||||
{
|
||||
// no blood on the roof yet, so drop this amount!
|
||||
// set decay time
|
||||
// set decay time
|
||||
SET_BLOOD_DELAY_TIME( pMapElement->ubBloodInfo );
|
||||
SET_BLOOD_ROOF_STRENGTH( pMapElement->ubBloodInfo, ubNewStrength );
|
||||
SET_BLOOD_ROOF_TYPE( pMapElement->ubSmellInfo, ubType );
|
||||
@@ -471,18 +471,15 @@ void InternalDropBlood( INT16 sGridNo, INT8 bLevel, UINT8 ubType, UINT8 ubStreng
|
||||
void DropBlood( SOLDIERTYPE * pSoldier, UINT8 ubStrength, INT8 bVisible )
|
||||
{
|
||||
UINT8 ubType;
|
||||
UINT8 ubOldStrength=0;
|
||||
UINT8 ubNewStrength=0;
|
||||
|
||||
/*
|
||||
* Dropping some blood;
|
||||
* We can check the type of blood by consulting the type in the smell byte
|
||||
*/
|
||||
* Dropping some blood;
|
||||
* We can check the type of blood by consulting the type in the smell byte
|
||||
*/
|
||||
|
||||
// figure out the type of blood that we're dropping
|
||||
if ( pSoldier->uiStatusFlags & SOLDIER_MONSTER )
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_MONSTER )
|
||||
{
|
||||
if ( pSoldier->bLevel == 0 )
|
||||
if ( pSoldier->pathing.bLevel == 0 )
|
||||
{
|
||||
ubType = CREATURE_ON_FLOOR;
|
||||
}
|
||||
@@ -497,7 +494,7 @@ void DropBlood( SOLDIERTYPE * pSoldier, UINT8 ubStrength, INT8 bVisible )
|
||||
}
|
||||
|
||||
|
||||
InternalDropBlood( pSoldier->sGridNo, pSoldier->bLevel, ubType, ubStrength, bVisible );
|
||||
InternalDropBlood( pSoldier->sGridNo, pSoldier->pathing.bLevel, ubType, ubStrength, bVisible );
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +504,7 @@ void UpdateBloodGraphics( INT16 sGridNo, INT8 bLevel )
|
||||
MAP_ELEMENT * pMapElement;
|
||||
INT8 bValue;
|
||||
UINT16 usIndex, usNewIndex;
|
||||
|
||||
|
||||
// OK, based on level, type, display graphics for blood
|
||||
pMapElement = &(gpWorldLevelData[ sGridNo ]);
|
||||
|
||||
@@ -527,7 +524,7 @@ void UpdateBloodGraphics( INT16 sGridNo, INT8 bLevel )
|
||||
if ( bLevel == 0 )
|
||||
{
|
||||
bValue = BLOOD_FLOOR_STRENGTH( pMapElement->ubBloodInfo );
|
||||
|
||||
|
||||
// OK, remove tile graphic if one exists....
|
||||
if ( TypeRangeExistsInObjectLayer( sGridNo, HUMANBLOOD, CREATUREBLOOD, &usIndex ) )
|
||||
{
|
||||
@@ -579,4 +576,4 @@ void UpdateBloodGraphics( INT16 sGridNo, INT8 bLevel )
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
#include "soldier control.h"
|
||||
|
||||
#define HUMAN 0
|
||||
#define CREATURE_ON_FLOOR 0x01
|
||||
#define CREATURE_ON_ROOF 0x02
|
||||
#define HUMAN 0
|
||||
#define CREATURE_ON_FLOOR 0x01
|
||||
#define CREATURE_ON_ROOF 0x02
|
||||
|
||||
#define NORMAL_HUMAN_SMELL_STRENGTH 10
|
||||
#define COW_SMELL_STRENGTH 15
|
||||
|
||||
+267
-263
@@ -8,10 +8,10 @@
|
||||
#include "wcheck.h"
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "soldier control.h"
|
||||
//#include "soldier control.h"
|
||||
#include "weapons.h"
|
||||
#include "handle items.h"
|
||||
#include "worlddef.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "animation control.h"
|
||||
#include "tile animation.h"
|
||||
@@ -30,6 +30,11 @@
|
||||
|
||||
#include "SaveLoadGame.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
|
||||
|
||||
INT8 FromWorldFlagsToSmokeType( UINT16 ubWorldFlags );
|
||||
UINT16 FromSmokeTypeToWorldFlags( INT8 bType );
|
||||
@@ -153,10 +158,10 @@ UINT16 FromSmokeTypeToWorldFlags( INT8 bType )
|
||||
return( MAPELEMENT_EXT_BURNABLEGAS );
|
||||
break;
|
||||
|
||||
case CREATURE_SMOKE_EFFECT:
|
||||
|
||||
return( MAPELEMENT_EXT_CREATUREGAS );
|
||||
break;
|
||||
case CREATURE_SMOKE_EFFECT:
|
||||
|
||||
return( MAPELEMENT_EXT_CREATUREGAS );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -192,8 +197,8 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
}
|
||||
|
||||
|
||||
switch( Explosive[Item[usItem].ubClassIndex].ubType )
|
||||
{
|
||||
switch( Explosive[Item[usItem].ubClassIndex].ubType )
|
||||
{
|
||||
case EXPLOSV_MUSTGAS:
|
||||
|
||||
bSmokeEffectType = MUSTARDGAS_SMOKE_EFFECT;
|
||||
@@ -205,54 +210,54 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
break;
|
||||
|
||||
case EXPLOSV_TEARGAS:
|
||||
bSmokeEffectType = TEARGAS_SMOKE_EFFECT;
|
||||
bSmokeEffectType = TEARGAS_SMOKE_EFFECT;
|
||||
break;
|
||||
|
||||
case EXPLOSV_SMOKE:
|
||||
|
||||
bSmokeEffectType = NORMAL_SMOKE_EFFECT;
|
||||
bSmokeEffectType = NORMAL_SMOKE_EFFECT;
|
||||
break;
|
||||
|
||||
// case SMALL_CREATURE_GAS:
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
// case SMALL_CREATURE_GAS:
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
//ubDuration = 3;
|
||||
//ubStartRadius = 1;
|
||||
//break;
|
||||
|
||||
case EXPLOSV_CREATUREGAS:
|
||||
bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
case EXPLOSV_CREATUREGAS:
|
||||
bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
break;
|
||||
|
||||
// case VERY_SMALL_CREATURE_GAS:
|
||||
// case VERY_SMALL_CREATURE_GAS:
|
||||
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
//bSmokeEffectType = CREATURE_SMOKE_EFFECT;
|
||||
//ubDuration = 2;
|
||||
//ubStartRadius = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
pSmoke->ubDuration = (UINT8)Explosive[ Item[ usItem ].ubClassIndex ].ubDuration;
|
||||
pSmoke->ubRadius = (UINT8)Explosive[ Item[ usItem ].ubClassIndex ].ubStartRadius;
|
||||
pSmoke->ubRadius = (UINT8)Explosive[ Item[ usItem ].ubClassIndex ].ubStartRadius;
|
||||
pSmoke->bAge = 0;
|
||||
pSmoke->fAllocated = TRUE;
|
||||
pSmoke->fAllocated = TRUE;
|
||||
pSmoke->bType = bSmokeEffectType;
|
||||
pSmoke->ubOwner = ubOwner;
|
||||
pSmoke->ubOwner = ubOwner;
|
||||
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_INDOORS )
|
||||
{
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_INDOORS )
|
||||
{
|
||||
// Duration is increased by 2 turns...indoors
|
||||
pSmoke->ubDuration += 3;
|
||||
}
|
||||
}
|
||||
|
||||
if ( bLevel )
|
||||
{
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_ON_ROOF;
|
||||
}
|
||||
if ( bLevel )
|
||||
{
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_ON_ROOF;
|
||||
}
|
||||
|
||||
// ATE: FALSE into subsequent-- it's the first one!
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex );
|
||||
// ATE: FALSE into subsequent-- it's the first one!
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex );
|
||||
|
||||
return( iSmokeIndex );
|
||||
}
|
||||
@@ -264,17 +269,17 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
{
|
||||
ANITILE_PARAMS AniParams;
|
||||
ANITILE *pAniTile;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
BOOLEAN fDissipating = FALSE;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
BOOLEAN fDissipating = FALSE;
|
||||
|
||||
pSmoke = &gSmokeEffectData[ iSmokeEffectID ];
|
||||
|
||||
if ( ( pSmoke->ubDuration - pSmoke->bAge ) < 2 )
|
||||
{
|
||||
fDissipating = TRUE;
|
||||
// Remove old one...
|
||||
RemoveSmokeEffectFromTile( sGridNo, bLevel );
|
||||
}
|
||||
if ( ( pSmoke->ubDuration - pSmoke->bAge ) < 2 )
|
||||
{
|
||||
fDissipating = TRUE;
|
||||
// Remove old one...
|
||||
RemoveSmokeEffectFromTile( sGridNo, bLevel );
|
||||
}
|
||||
|
||||
|
||||
// If smoke effect exists already.... stop
|
||||
@@ -282,31 +287,31 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// OK, Create anitile....
|
||||
|
||||
// OK, Create anitile....
|
||||
memset( &AniParams, 0, sizeof( ANITILE_PARAMS ) );
|
||||
AniParams.sGridNo = sGridNo;
|
||||
|
||||
if ( bLevel == 0 )
|
||||
{
|
||||
AniParams.ubLevelID = ANI_STRUCT_LEVEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.ubLevelID = ANI_ONROOF_LEVEL;
|
||||
}
|
||||
if ( bLevel == 0 )
|
||||
{
|
||||
AniParams.ubLevelID = ANI_STRUCT_LEVEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.ubLevelID = ANI_ONROOF_LEVEL;
|
||||
}
|
||||
|
||||
|
||||
AniParams.sDelay = (INT16)( 300 + Random( 300 ) );
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)Random( 5 );
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.sStartFrame = (INT16)Random( 5 );
|
||||
}
|
||||
|
||||
|
||||
// Bare bones flags are...
|
||||
@@ -314,14 +319,14 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
//AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING;
|
||||
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_PAUSED | ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING | ANITILE_ALWAYS_TRANSLUCENT;
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_PAUSED | ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING;
|
||||
}
|
||||
else
|
||||
{
|
||||
AniParams.uiFlags = ANITILE_CACHEDTILE | ANITILE_FORWARD | ANITILE_SMOKE_EFFECT | ANITILE_LOOPING | ANITILE_ALWAYS_TRANSLUCENT;
|
||||
}
|
||||
|
||||
AniParams.sX = CenterX( sGridNo );
|
||||
AniParams.sY = CenterY( sGridNo );
|
||||
@@ -332,97 +337,97 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
{
|
||||
case NORMAL_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smkechze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalsmke.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\SMOKE.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smkechze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalsmke.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\SMOKE.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TEARGAS_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\tearchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smaltear.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\TEARGAS.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\tearchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smaltear.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\TEARGAS.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MUSTARDGAS_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\mustchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalmust.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\MUSTARD2.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\mustchze.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalmust.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\MUSTARD2.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BURNABLEGAS_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMCHZE.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalflam.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMETH2.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMCHZE.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\smalflam.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\FLAMETH2.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CREATURE_SMOKE_EFFECT:
|
||||
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
}
|
||||
if ( !( gGameSettings.fOptions[ TOPTION_ANIMATE_SMOKE ] ) )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( fDissipating )
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\spit_gas.STI" );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -455,7 +460,7 @@ void RemoveSmokeEffectFromTile( INT16 sGridNo, INT8 bLevel )
|
||||
}
|
||||
|
||||
pAniTile = GetCachedAniTileOfType( sGridNo, ubLevelID, ANITILE_SMOKE_EFFECT );
|
||||
|
||||
|
||||
if ( pAniTile != NULL )
|
||||
{
|
||||
DeleteAniTile( pAniTile );
|
||||
@@ -476,71 +481,71 @@ void DecaySmokeEffects( UINT32 uiTime )
|
||||
{
|
||||
SMOKEEFFECT *pSmoke;
|
||||
UINT32 cnt, cnt2;
|
||||
BOOLEAN fUpdate = FALSE;
|
||||
BOOLEAN fSpreadEffect;
|
||||
INT8 bLevel;
|
||||
UINT16 usNumUpdates = 1;
|
||||
BOOLEAN fUpdate = FALSE;
|
||||
BOOLEAN fSpreadEffect;
|
||||
INT8 bLevel;
|
||||
UINT16 usNumUpdates = 1;
|
||||
|
||||
for ( cnt = 0; cnt < guiNumMercSlots; cnt++ )
|
||||
{
|
||||
if ( MercSlots[ cnt ] )
|
||||
{
|
||||
// reset 'hit by gas' flags
|
||||
MercSlots[ cnt ]->fHitByGasFlags = 0;
|
||||
MercSlots[ cnt ]->flags.fHitByGasFlags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// ATE: 1 ) make first pass and delete/mark any smoke effect for update
|
||||
// all the deleting has to be done first///
|
||||
// ATE: 1 ) make first pass and delete/mark any smoke effect for update
|
||||
// all the deleting has to be done first///
|
||||
|
||||
// age all active tear gas clouds, deactivate those that are just dispersing
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
// age all active tear gas clouds, deactivate those that are just dispersing
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
fSpreadEffect = TRUE;
|
||||
|
||||
pSmoke = &gSmokeEffectData[ cnt ];
|
||||
|
||||
|
||||
if ( pSmoke->fAllocated )
|
||||
{
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
|
||||
// Do things differently for combat /vs realtime
|
||||
// always try to update during combat
|
||||
if (gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ATE: Do this every so ofte, to acheive the effect we want...
|
||||
if ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) > 10 )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
// Do things differently for combat /vs realtime
|
||||
// always try to update during combat
|
||||
if (gTacticalStatus.uiFlags & INCOMBAT )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ATE: Do this every so ofte, to acheive the effect we want...
|
||||
if ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) > 10 )
|
||||
{
|
||||
fUpdate = TRUE;
|
||||
|
||||
usNumUpdates = ( UINT16 ) ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) / 10 );
|
||||
}
|
||||
}
|
||||
usNumUpdates = ( UINT16 ) ( ( uiTime - pSmoke->uiTimeOfLastUpdate ) / 10 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( fUpdate )
|
||||
{
|
||||
if ( fUpdate )
|
||||
{
|
||||
pSmoke->uiTimeOfLastUpdate = uiTime;
|
||||
|
||||
for ( cnt2 = 0; cnt2 < usNumUpdates; cnt2++ )
|
||||
{
|
||||
pSmoke->bAge++;
|
||||
for ( cnt2 = 0; cnt2 < usNumUpdates; cnt2++ )
|
||||
{
|
||||
pSmoke->bAge++;
|
||||
|
||||
if ( pSmoke->bAge == 1 )
|
||||
{
|
||||
// ATE: At least mark for update!
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
// ATE: At least mark for update!
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
fSpreadEffect = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -548,66 +553,66 @@ void DecaySmokeEffects( UINT32 uiTime )
|
||||
fSpreadEffect = TRUE;
|
||||
}
|
||||
|
||||
if ( fSpreadEffect )
|
||||
{
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bAge <= pSmoke->ubDuration)
|
||||
{
|
||||
// ATE: Only mark now and increse radius - actual drawing is done
|
||||
// in another pass cause it could
|
||||
// just get erased...
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
if ( fSpreadEffect )
|
||||
{
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bAge <= pSmoke->ubDuration)
|
||||
{
|
||||
// ATE: Only mark now and increse radius - actual drawing is done
|
||||
// in another pass cause it could
|
||||
// just get erased...
|
||||
pSmoke->bFlags |= SMOKE_EFFECT_MARK_FOR_UPDATE;
|
||||
|
||||
// calculate the new cloud radius
|
||||
// cloud expands by 1 every turn outdoors, and every other turn indoors
|
||||
// calculate the new cloud radius
|
||||
// cloud expands by 1 every turn outdoors, and every other turn indoors
|
||||
|
||||
// ATE: If radius is < maximun, increase radius, otherwise keep at max
|
||||
if ( pSmoke->ubRadius < Explosive[ Item[ pSmoke->usItem ].ubClassIndex ].ubRadius )
|
||||
{
|
||||
pSmoke->ubRadius++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// deactivate tear gas cloud (use last known radius)
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, ERASE_SPREAD_EFFECT, bLevel, cnt );
|
||||
pSmoke->fAllocated = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ATE: If radius is < maximun, increase radius, otherwise keep at max
|
||||
if ( pSmoke->ubRadius < Explosive[ Item[ pSmoke->usItem ].ubClassIndex ].ubRadius )
|
||||
{
|
||||
pSmoke->ubRadius++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// deactivate tear gas cloud (use last known radius)
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, ERASE_SPREAD_EFFECT, bLevel, cnt );
|
||||
pSmoke->fAllocated = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// damage anyone standing in cloud
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, REDO_SPREAD_EFFECT, bLevel, cnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
for ( cnt = 0; cnt < guiNumSmokeEffects; cnt++ )
|
||||
{
|
||||
pSmoke = &gSmokeEffectData[ cnt ];
|
||||
|
||||
|
||||
if ( pSmoke->fAllocated )
|
||||
{
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_MARK_FOR_UPDATE )
|
||||
// if this cloud remains effective (duration not reached)
|
||||
if ( pSmoke->bFlags & SMOKE_EFFECT_MARK_FOR_UPDATE )
|
||||
{
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, cnt );
|
||||
pSmoke->bFlags &= (~SMOKE_EFFECT_MARK_FOR_UPDATE);
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, cnt );
|
||||
pSmoke->bFlags &= (~SMOKE_EFFECT_MARK_FOR_UPDATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AllTeamsLookForAll( TRUE );
|
||||
}
|
||||
@@ -665,10 +670,10 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
UINT32 uiNumBytesRead;
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCnt=0;
|
||||
INT8 bLevel;
|
||||
INT8 bLevel;
|
||||
|
||||
//no longer need to load smoke effects. They are now in temp files
|
||||
if( guiSaveGameVersion < 75 )
|
||||
//no longer need to load smoke effects. They are now in temp files
|
||||
if( guiCurrentSaveGameVersion < 75 )
|
||||
{
|
||||
//Clear out the old list
|
||||
memset( gSmokeEffectData, 0, sizeof( SMOKEEFFECT ) * NUM_SMOKE_EFFECT_SLOTS );
|
||||
@@ -681,7 +686,7 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
}
|
||||
|
||||
//This is a TEMP hack to allow us to use the saves
|
||||
if( guiSaveGameVersion < 37 && guiNumSmokeEffects == 0 )
|
||||
if( guiCurrentSaveGameVersion < 37 && guiNumSmokeEffects == 0 )
|
||||
{
|
||||
//Load the Smoke effect Data
|
||||
FileRead( hFile, gSmokeEffectData, sizeof( SMOKEEFFECT ), &uiNumBytesRead );
|
||||
@@ -702,7 +707,7 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
return( FALSE );
|
||||
}
|
||||
//This is a TEMP hack to allow us to use the saves
|
||||
if( guiSaveGameVersion < 37 )
|
||||
if( guiCurrentSaveGameVersion < 37 )
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -713,14 +718,14 @@ BOOLEAN LoadSmokeEffectsFromLoadGameFile( HWFILE hFile )
|
||||
//if this slot is allocated
|
||||
if( gSmokeEffectData[uiCount].fAllocated )
|
||||
{
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
SpreadEffect( gSmokeEffectData[uiCount].sGridNo, gSmokeEffectData[uiCount].ubRadius, gSmokeEffectData[uiCount].usItem, gSmokeEffectData[uiCount].ubOwner, TRUE, bLevel, uiCount );
|
||||
}
|
||||
@@ -815,9 +820,8 @@ BOOLEAN LoadSmokeEffectsFromMapTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
UINT32 uiCount;
|
||||
UINT32 uiCnt=0;
|
||||
HWFILE hFile;
|
||||
UINT32 uiNumBytesWritten=0;
|
||||
CHAR8 zMapName[ 128 ];
|
||||
INT8 bLevel;
|
||||
INT8 bLevel;
|
||||
|
||||
GetMapTempFileName( SF_SMOKE_EFFECTS_TEMP_FILE_EXISTS, zMapName, sMapX, sMapY, bMapZ );
|
||||
|
||||
@@ -860,14 +864,14 @@ BOOLEAN LoadSmokeEffectsFromMapTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
//if this slot is allocated
|
||||
if( gSmokeEffectData[uiCount].fAllocated )
|
||||
{
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( gSmokeEffectData[uiCount].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
SpreadEffect( gSmokeEffectData[uiCount].sGridNo, gSmokeEffectData[uiCount].ubRadius, gSmokeEffectData[uiCount].usItem, gSmokeEffectData[uiCount].ubOwner, TRUE, bLevel, uiCount );
|
||||
}
|
||||
@@ -889,9 +893,9 @@ void ResetSmokeEffects()
|
||||
|
||||
void UpdateSmokeEffectGraphics( )
|
||||
{
|
||||
UINT32 uiCnt;
|
||||
UINT32 uiCnt;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
INT8 bLevel;
|
||||
INT8 bLevel;
|
||||
|
||||
//loop through and save the number of smoke effects
|
||||
for( uiCnt=0; uiCnt < guiNumSmokeEffects; uiCnt++)
|
||||
@@ -901,18 +905,18 @@ void UpdateSmokeEffectGraphics( )
|
||||
//if the smoke is active
|
||||
if( gSmokeEffectData[ uiCnt ].fAllocated )
|
||||
{
|
||||
if ( gSmokeEffectData[uiCnt].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
if ( gSmokeEffectData[uiCnt].bFlags & SMOKE_EFFECT_ON_ROOF )
|
||||
{
|
||||
bLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bLevel = 0;
|
||||
}
|
||||
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, ERASE_SPREAD_EFFECT, bLevel, uiCnt );
|
||||
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, uiCnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, TRUE, bLevel, uiCnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -13,24 +13,24 @@ enum
|
||||
BURNABLEGAS_SMOKE_EFFECT,
|
||||
};
|
||||
|
||||
#define SMOKE_EFFECT_INDOORS 0x01
|
||||
#define SMOKE_EFFECT_ON_ROOF 0x02
|
||||
#define SMOKE_EFFECT_MARK_FOR_UPDATE 0x04
|
||||
#define SMOKE_EFFECT_INDOORS 0x01
|
||||
#define SMOKE_EFFECT_ON_ROOF 0x02
|
||||
#define SMOKE_EFFECT_MARK_FOR_UPDATE 0x04
|
||||
|
||||
|
||||
typedef struct TAG_SMOKE_EFFECT
|
||||
{
|
||||
INT16 sGridNo; // gridno at which the tear gas cloud is centered
|
||||
INT16 sGridNo; // gridno at which the tear gas cloud is centered
|
||||
|
||||
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 bAge; // the number of turns gas has been around
|
||||
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 bAge; // the number of turns gas has been around
|
||||
BOOLEAN fAllocated;
|
||||
INT8 bType;
|
||||
UINT16 usItem;
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubPadding;
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubPadding;
|
||||
UINT32 uiTimeOfLastUpdate;
|
||||
|
||||
} SMOKEEFFECT;
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
// hit points, but instead stores a pointer to the
|
||||
// base object (section).
|
||||
//
|
||||
// Each section has a line of sight profile. These
|
||||
// Each section has a line of sight profile. These
|
||||
// profiles are split into 5 in each horizontal direction
|
||||
// and 4 vertically, forming 100 "cubes". In real
|
||||
// and 4 vertically, forming 100 "cubes". In real
|
||||
// world terms, each section represents a volume
|
||||
// with a height of 8 feet (and width and length
|
||||
// of what?)
|
||||
@@ -58,8 +58,8 @@ extern UINT8 AtHeight[PROFILE_Z_SIZE];
|
||||
// then the structure is the "base" of the object
|
||||
// and its hitpoint value is the one for the object
|
||||
//
|
||||
// vv generic flags for all structures
|
||||
// vvv type flags
|
||||
// vv generic flags for all structures
|
||||
// vvv type flags
|
||||
//
|
||||
|
||||
// how to handle explodable structures
|
||||
@@ -116,16 +116,16 @@ extern UINT8 AtHeight[PROFILE_Z_SIZE];
|
||||
#define STRUCTURE_ANYDOOR 0x00CC0000
|
||||
#define STRUCTURE_OBSTACLE 0x00008F00
|
||||
#define STRUCTURE_WALLSTUFF 0x00CF0000
|
||||
#define STRUCTURE_BLOCKSMOVES 0x00208F00
|
||||
#define STRUCTURE_BLOCKSMOVES 0x00208F00
|
||||
#define STRUCTURE_TYPE_DEFINED 0x8FEF8F00
|
||||
#define STRUCTURE_ROOF 0x07000000
|
||||
#define STRUCTURE_ROOF 0x07000000
|
||||
|
||||
#define TILE_ON_ROOF 0x01
|
||||
#define TILE_PASSABLE 0x02
|
||||
|
||||
typedef struct TAG_STRUCTURE_TILE
|
||||
{
|
||||
INT16 sPosRelToBase; // "single-axis"
|
||||
INT16 sPosRelToBase; // "single-axis"
|
||||
INT8 bXPosRelToBase;
|
||||
INT8 bYPosRelToBase;
|
||||
PROFILE Shape; // 25 bytes
|
||||
|
||||
@@ -91,7 +91,7 @@ UINT8 gubHilightedGroupID = 0;
|
||||
UINT8 gubCursorGroupID = 0;
|
||||
INT8 gbSelectedMercID = -1;
|
||||
INT8 gbHilightedMercID = -1;
|
||||
INT8 gbCursorMercID = -1;
|
||||
INT8 gbCursorMercID = -1;
|
||||
SOLDIERTYPE *gpTacticalPlacementSelectedSoldier = NULL;
|
||||
SOLDIERTYPE *gpTacticalPlacementHilightedSoldier = NULL;
|
||||
|
||||
@@ -114,7 +114,7 @@ void PickUpMercPiece( INT32 iPlacement );
|
||||
void SetCursorMerc( INT8 bPlacementID );
|
||||
void SelectNextUnplacedUnit();
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
#ifdef JA2BETAVERSION
|
||||
|
||||
BOOLEAN gfNorthValid, gfEastValid, gfSouthValid, gfWestValid;
|
||||
BOOLEAN gfChangedEntrySide = FALSE;
|
||||
@@ -126,38 +126,38 @@ void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
|
||||
gMapInformation.sSouthGridNo == -1 &&
|
||||
gMapInformation.sWestGridNo == -1 )
|
||||
{
|
||||
AssertMsg( 0, "Map has no entry points at all. Can't generate edge points. LC:1" );
|
||||
AssertMsg( 0, "Map has no entry points at all. Can't generate edge points. LC:1" );
|
||||
}
|
||||
if( gMapInformation.sNorthGridNo != -1 && !gps1stNorthEdgepointArray ||
|
||||
gMapInformation.sEastGridNo != -1 && !gps1stEastEdgepointArray ||
|
||||
gMapInformation.sSouthGridNo != -1 && !gps1stSouthEdgepointArray ||
|
||||
gMapInformation.sWestGridNo != -1 && !gps1stWestEdgepointArray )
|
||||
if( gMapInformation.sNorthGridNo != -1 && !gps1stNorthEdgepointArray ||
|
||||
gMapInformation.sEastGridNo != -1 && !gps1stEastEdgepointArray ||
|
||||
gMapInformation.sSouthGridNo != -1 && !gps1stSouthEdgepointArray ||
|
||||
gMapInformation.sWestGridNo != -1 && !gps1stWestEdgepointArray )
|
||||
{
|
||||
InvalidateScreen();
|
||||
DrawTextToScreen( L"Map doesn't has entrypoints without corresponding edgepoints. LC:1",
|
||||
iOffsetHorizontal + 30, iOffsetVertical + 150, 600, FONT10ARIALBOLD, FONT_RED, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
|
||||
DrawTextToScreen( L"GENERATING MAP EDGEPOINTS! Please wait...",
|
||||
DrawTextToScreen( L"GENERATING MAP EDGEPOINTS! Please wait...",
|
||||
iOffsetHorizontal + 30, iOffsetVertical + 160, 600, FONT10ARIALBOLD, FONT_YELLOW, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
|
||||
|
||||
|
||||
RefreshScreen( NULL );
|
||||
GenerateMapEdgepoints();
|
||||
switch( *pubStrategicInsertionCode )
|
||||
{
|
||||
case INSERTION_CODE_NORTH:
|
||||
case INSERTION_CODE_NORTH:
|
||||
if( !gps1stNorthEdgepointArray )
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
break;
|
||||
case INSERTION_CODE_EAST:
|
||||
if( !gps1stEastEdgepointArray )
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
case INSERTION_CODE_SOUTH:
|
||||
if( !gps1stSouthEdgepointArray )
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
case INSERTION_CODE_WEST:
|
||||
if( !gps1stWestEdgepointArray )
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
AssertMsg( 0, "Map Edgepoint generation failed. KM : 0 -- send map" );
|
||||
break;
|
||||
}
|
||||
return;
|
||||
@@ -192,7 +192,7 @@ void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
|
||||
{
|
||||
switch( *pubStrategicInsertionCode )
|
||||
{
|
||||
case INSERTION_CODE_NORTH:
|
||||
case INSERTION_CODE_NORTH:
|
||||
if( !gps1stNorthEdgepointArray )
|
||||
FindValidInsertionCode( pubStrategicInsertionCode );
|
||||
break;
|
||||
@@ -200,11 +200,11 @@ void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
|
||||
if( !gps1stEastEdgepointArray )
|
||||
FindValidInsertionCode( pubStrategicInsertionCode );
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
case INSERTION_CODE_SOUTH:
|
||||
if( !gps1stSouthEdgepointArray )
|
||||
FindValidInsertionCode( pubStrategicInsertionCode );
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
case INSERTION_CODE_WEST:
|
||||
if( !gps1stWestEdgepointArray )
|
||||
FindValidInsertionCode( pubStrategicInsertionCode );
|
||||
break;
|
||||
@@ -265,7 +265,7 @@ void InitTacticalPlacementGUI()
|
||||
{
|
||||
AssertMsg( 0, "Failed to load Interface\\panels.sti" );
|
||||
}
|
||||
|
||||
|
||||
giOverheadButtonImages[ DONE_BUTTON ] = LoadButtonImage( "Interface\\OverheadUIButtons.sti", -1, 0, -1, 1, -1 );
|
||||
if( giOverheadButtonImages[ DONE_BUTTON ] == -1 )
|
||||
{
|
||||
@@ -276,25 +276,25 @@ void InitTacticalPlacementGUI()
|
||||
giOverheadButtonImages[ CLEAR_BUTTON ] = UseLoadedButtonImage( giOverheadButtonImages[ DONE_BUTTON ], -1, 0, -1, 1, -1 );
|
||||
|
||||
//Create the buttons which provide automatic placements.
|
||||
iTPButtons[ CLEAR_BUTTON ] =
|
||||
iTPButtons[ CLEAR_BUTTON ] =
|
||||
QuickCreateButton( giOverheadButtonImages[ CLEAR_BUTTON ], 11, SCREEN_HEIGHT - 148, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, ClearPlacementsCallback );
|
||||
SpecifyGeneralButtonTextAttributes( iTPButtons[ CLEAR_BUTTON ], gpStrategicString[ STR_TP_CLEAR ], BLOCKFONT, FONT_BEIGE, 141 );
|
||||
SetButtonFastHelpText( iTPButtons[ CLEAR_BUTTON ], gpStrategicString[ STR_TP_CLEARHELP ] );
|
||||
SetBtnHelpEndCallback( iTPButtons[ CLEAR_BUTTON ], FastHelpRemoved2Callback );
|
||||
iTPButtons[ SPREAD_BUTTON ] =
|
||||
iTPButtons[ SPREAD_BUTTON ] =
|
||||
QuickCreateButton( giOverheadButtonImages[ SPREAD_BUTTON ], 11, SCREEN_HEIGHT - 113, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, SpreadPlacementsCallback );
|
||||
SpecifyGeneralButtonTextAttributes( iTPButtons[ SPREAD_BUTTON ], gpStrategicString[ STR_TP_SPREAD ], BLOCKFONT, FONT_BEIGE, 141 );
|
||||
SetButtonFastHelpText( iTPButtons[ SPREAD_BUTTON ], gpStrategicString[ STR_TP_SPREADHELP ] );
|
||||
SetBtnHelpEndCallback( iTPButtons[ SPREAD_BUTTON ], FastHelpRemovedCallback );
|
||||
iTPButtons[ GROUP_BUTTON ] =
|
||||
iTPButtons[ GROUP_BUTTON ] =
|
||||
QuickCreateButton( giOverheadButtonImages[ GROUP_BUTTON ], 11, SCREEN_HEIGHT - 78, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, GroupPlacementsCallback );
|
||||
SpecifyGeneralButtonTextAttributes( iTPButtons[ GROUP_BUTTON ], gpStrategicString[ STR_TP_GROUP ], BLOCKFONT, FONT_BEIGE, 141 );
|
||||
SetButtonFastHelpText( iTPButtons[ GROUP_BUTTON ], gpStrategicString[ STR_TP_GROUPHELP ] );
|
||||
SetBtnHelpEndCallback( iTPButtons[ GROUP_BUTTON ], FastHelpRemovedCallback );
|
||||
iTPButtons[ DONE_BUTTON ] =
|
||||
iTPButtons[ DONE_BUTTON ] =
|
||||
QuickCreateButton( giOverheadButtonImages[ DONE_BUTTON ], 11, SCREEN_HEIGHT - 43, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
DEFAULT_MOVE_CALLBACK, DoneOverheadPlacementClickCallback );
|
||||
SpecifyGeneralButtonTextAttributes( iTPButtons[ DONE_BUTTON ], gpStrategicString[ STR_TP_DONE ], BLOCKFONT, FONT_BEIGE, 141 );
|
||||
@@ -307,16 +307,16 @@ void InitTacticalPlacementGUI()
|
||||
SpecifyButtonHilitedTextColors( iTPButtons[ GROUP_BUTTON ], FONT_WHITE, FONT_NEARBLACK );
|
||||
SpecifyButtonHilitedTextColors( iTPButtons[ DONE_BUTTON ], FONT_WHITE, FONT_NEARBLACK );
|
||||
|
||||
//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.
|
||||
//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++ )
|
||||
{
|
||||
|
||||
if( MercPtrs[ i ]->bActive && !MercPtrs[ i ]->fBetweenSectors &&
|
||||
if( MercPtrs[ i ]->bActive && !MercPtrs[ i ]->flags.fBetweenSectors &&
|
||||
MercPtrs[ i ]->sSectorX == gpBattleGroup->ubSectorX &&
|
||||
MercPtrs[ i ]->sSectorY == gpBattleGroup->ubSectorY &&
|
||||
!( MercPtrs[ i ]->uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||
MercPtrs[ i ]->sSectorY == gpBattleGroup->ubSectorY &&
|
||||
!( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW &&
|
||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT &&
|
||||
!MercPtrs[ i ]->bSectorZ )
|
||||
@@ -327,21 +327,21 @@ void InitTacticalPlacementGUI()
|
||||
//Allocate the array based on how many mercs there are.
|
||||
gMercPlacement = (MERCPLACEMENT*)MemAlloc( sizeof( MERCPLACEMENT ) * giPlacements );
|
||||
Assert( gMercPlacement );
|
||||
//Second pass: Assign the mercs to their respective slots.
|
||||
//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++ )
|
||||
{
|
||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->bLife && !MercPtrs[ i ]->fBetweenSectors &&
|
||||
if( MercPtrs[ i ]->bActive && MercPtrs[ i ]->stats.bLife && !MercPtrs[ i ]->flags.fBetweenSectors &&
|
||||
MercPtrs[ i ]->sSectorX == gpBattleGroup->ubSectorX &&
|
||||
MercPtrs[ i ]->sSectorY == gpBattleGroup->ubSectorY &&
|
||||
MercPtrs[ i ]->sSectorY == gpBattleGroup->ubSectorY &&
|
||||
MercPtrs[ i ]->bAssignment != ASSIGNMENT_POW &&
|
||||
MercPtrs[ i ]->bAssignment != IN_TRANSIT &&
|
||||
!( MercPtrs[ i ]->uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||
!( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_VEHICLE ) ) && // ATE Ignore vehicles
|
||||
!MercPtrs[ i ]->bSectorZ )
|
||||
{
|
||||
|
||||
// ATE: If we are in a vehicle - remove ourselves from it!
|
||||
//if ( MercPtrs[ i ]->uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
|
||||
//if ( MercPtrs[ i ]->flags.uiStatusFlags & ( SOLDIER_DRIVER | SOLDIER_PASSENGER ) )
|
||||
//{
|
||||
// RemoveSoldierFromVehicle( MercPtrs[ i ], MercPtrs[ i ]->bVehicleID );
|
||||
//}
|
||||
@@ -359,17 +359,17 @@ void InitTacticalPlacementGUI()
|
||||
#endif
|
||||
switch( MercPtrs[ i ]->ubStrategicInsertionCode )
|
||||
{
|
||||
case INSERTION_CODE_NORTH:
|
||||
case INSERTION_CODE_NORTH:
|
||||
gfNorth = TRUE;
|
||||
break;
|
||||
case INSERTION_CODE_EAST:
|
||||
gfEast = TRUE;
|
||||
case INSERTION_CODE_EAST:
|
||||
gfEast = TRUE;
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
gfSouth = TRUE;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
gfSouth = TRUE;
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
gfWest = TRUE;
|
||||
case INSERTION_CODE_WEST:
|
||||
gfWest = TRUE;
|
||||
break;
|
||||
}
|
||||
giPlacements++;
|
||||
@@ -413,7 +413,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 );
|
||||
}
|
||||
|
||||
|
||||
PlaceMercs();
|
||||
|
||||
if( gubDefaultButton == GROUP_BUTTON )
|
||||
@@ -422,7 +422,7 @@ void InitTacticalPlacementGUI()
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{ //go from the currently selected soldier to the end
|
||||
if( !gMercPlacement[ i ].fPlaced )
|
||||
{ //Found an unplaced merc. Select him.
|
||||
{ //Found an unplaced merc. Select him.
|
||||
gbSelectedMercID = (INT8)i;
|
||||
if( gubDefaultButton == GROUP_BUTTON )
|
||||
gubSelectedGroupID = gMercPlacement[ i ].pSoldier->ubGroupID;
|
||||
@@ -467,7 +467,7 @@ void RenderTacticalPlacementGUI()
|
||||
}
|
||||
|
||||
//yp = (gbHilightedMercID % 2) ? 412 : 361;
|
||||
|
||||
|
||||
if( gusMouseXPos < xp || gusMouseXPos > xp + 54 || gusMouseYPos < yp || gusMouseYPos > yp + 62 )
|
||||
{
|
||||
gbHilightedMercID = -1;
|
||||
@@ -501,17 +501,17 @@ void RenderTacticalPlacementGUI()
|
||||
{
|
||||
yp = SCREEN_HEIGHT - 109;
|
||||
}
|
||||
|
||||
|
||||
//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 );
|
||||
//HEALTH BAR
|
||||
if( !pSoldier->bLife )
|
||||
if( !pSoldier->stats.bLife )
|
||||
continue;
|
||||
//yellow one for bleeding
|
||||
iStartY = yp + 29 - 27*pSoldier->bLifeMax/100;
|
||||
iStartY = yp + 29 - 27*pSoldier->stats.bLifeMax/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 107, 107, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 222, 181, 115 ) ) );
|
||||
//pink one for bandaged.
|
||||
@@ -519,7 +519,7 @@ void RenderTacticalPlacementGUI()
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 156, 57, 57 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 222, 132, 132 ) ) );
|
||||
//red one for actual health
|
||||
iStartY = yp + 29 - 27*pSoldier->bLife/100;
|
||||
iStartY = yp + 29 - 27*pSoldier->stats.bLife/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+36, iStartY, xp+37, yp+29, Get16BPPColor( FROMRGB( 107, 8, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+37, iStartY, xp+38, yp+29, Get16BPPColor( FROMRGB( 206, 0, 0 ) ) );
|
||||
//BREATH BAR
|
||||
@@ -527,14 +527,14 @@ void RenderTacticalPlacementGUI()
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+39, iStartY, xp+40, yp+29, Get16BPPColor( FROMRGB( 8, 8, 132 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+40, iStartY, xp+41, yp+29, Get16BPPColor( FROMRGB( 8, 8, 107 ) ) );
|
||||
//MORALE BAR
|
||||
iStartY = yp + 29 - 27*pSoldier->bMorale/100;
|
||||
iStartY = yp + 29 - 27*pSoldier->aiData.bMorale/100;
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+42, iStartY, xp+43, yp+29, Get16BPPColor( FROMRGB( 8, 156, 8 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, xp+43, iStartY, xp+44, yp+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||
}
|
||||
SetFont( BLOCKFONT );
|
||||
SetFontForeground( FONT_BEIGE );
|
||||
SetFontShadow( 141 );
|
||||
|
||||
|
||||
GetSectorIDString( gubPBSectorX, gubPBSectorY, gubPBSectorZ, str, TRUE );
|
||||
|
||||
mprintf(120, SCREEN_HEIGHT - 145, L"%s %s -- %s...", gpStrategicString[ STR_TP_SECTOR ], str, gpStrategicString[ STR_TP_CHOOSEENTRYPOSITIONS ] );
|
||||
@@ -544,13 +544,13 @@ void RenderTacticalPlacementGUI()
|
||||
}
|
||||
if( gfValidLocationsChanged )
|
||||
{
|
||||
if( DayTime() )
|
||||
if( DayTime() )
|
||||
{ //6AM to 9PM is black
|
||||
usHatchColor = 0; //Black
|
||||
}
|
||||
else
|
||||
{ //9PM to 6AM is gray (black is too dark to distinguish)
|
||||
usHatchColor = Get16BPPColor( FROMRGB( 63, 31, 31 ) );
|
||||
usHatchColor = Get16BPPColor( FROMRGB( 63, 31, 31 ) );
|
||||
}
|
||||
gfValidLocationsChanged--;
|
||||
BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, iOffsetHorizontal, iOffsetVertical, 640, 320 );
|
||||
@@ -567,7 +567,7 @@ void RenderTacticalPlacementGUI()
|
||||
gTPClipRect.iLeft = iOffsetHorizontal;
|
||||
gTPClipRect.iTop = iOffsetVertical + 3;
|
||||
//gTPClipRect.iRight = iOffsetHorizontal + 640;
|
||||
gTPClipRect.iRight = iOffsetHorizontal + 634; // 635
|
||||
gTPClipRect.iRight = iOffsetHorizontal + 634; // 635
|
||||
gTPClipRect.iBottom = iOffsetVertical + 320;
|
||||
switch( gMercPlacement[ gbCursorMercID ].ubStrategicInsertionCode )
|
||||
{
|
||||
@@ -586,7 +586,7 @@ void RenderTacticalPlacementGUI()
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{ //Render the merc's names
|
||||
pSoldier = gMercPlacement[ i ].pSoldier;
|
||||
|
||||
|
||||
xp = 95 + (i / 2) * 54;
|
||||
|
||||
if (i % 2)
|
||||
@@ -601,12 +601,12 @@ void RenderTacticalPlacementGUI()
|
||||
//yp = (i % 2) ? 422 : 371;
|
||||
//NAME
|
||||
if( gubDefaultButton == GROUP_BUTTON && gMercPlacement[ i ].pSoldier->ubGroupID == gubSelectedGroupID ||
|
||||
gubDefaultButton != GROUP_BUTTON && i == gbSelectedMercID )
|
||||
gubDefaultButton != GROUP_BUTTON && i == gbSelectedMercID )
|
||||
{
|
||||
ubColor = FONT_YELLOW;
|
||||
}
|
||||
else if( gubDefaultButton == GROUP_BUTTON && gMercPlacement[ i ].pSoldier->ubGroupID == gubHilightedGroupID ||
|
||||
gubDefaultButton != GROUP_BUTTON && i == gbHilightedMercID )
|
||||
gubDefaultButton != GROUP_BUTTON && i == gbHilightedMercID )
|
||||
{
|
||||
ubColor = FONT_WHITE;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ void RenderTacticalPlacementGUI()
|
||||
//Render the question mark over the face if the merc hasn't yet been placed.
|
||||
if( gMercPlacement[ i ].fPlaced )
|
||||
{
|
||||
RegisterBackgroundRect( BGND_FLAG_SINGLE, NULL, (INT16)(xp + 16), (INT16)(yp + 14), (INT16)(xp + 24), (INT16)(yp + 22) );
|
||||
RegisterBackgroundRect( BGND_FLAG_SINGLE, NULL, (INT16)(xp + 16), (INT16)(yp + 14), (INT16)(xp + 24), (INT16)(yp + 22) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -645,7 +645,7 @@ void EnsureDoneButtonStatus()
|
||||
//BOOLEAN fChanged = FALSE;
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{
|
||||
if( !gMercPlacement[ i ].fPlaced )
|
||||
if( !gMercPlacement[ i ].fPlaced )
|
||||
{
|
||||
if( ButtonList[ iTPButtons[ DONE_BUTTON ] ]->uiFlags & BUTTON_ENABLED )
|
||||
{
|
||||
@@ -664,7 +664,7 @@ void EnsureDoneButtonStatus()
|
||||
|
||||
void TacticalPlacementHandle()
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
InputAtom InputEvent;
|
||||
|
||||
EnsureDoneButtonStatus();
|
||||
|
||||
@@ -677,8 +677,8 @@ void TacticalPlacementHandle()
|
||||
gpTacticalPlacementSelectedSoldier = NULL;
|
||||
}
|
||||
|
||||
while( DequeueEvent( &InputEvent ) )
|
||||
{
|
||||
while( DequeueEvent( &InputEvent ) )
|
||||
{
|
||||
if( InputEvent.usEvent == KEY_DOWN )
|
||||
{
|
||||
switch( InputEvent.usParam )
|
||||
@@ -719,19 +719,19 @@ void TacticalPlacementHandle()
|
||||
{
|
||||
switch( gMercPlacement[ gbCursorMercID ].ubStrategicInsertionCode )
|
||||
{
|
||||
case INSERTION_CODE_NORTH:
|
||||
case INSERTION_CODE_NORTH:
|
||||
if( gusMouseYPos <= (iOffsetVertical + 30) ) // 40
|
||||
gfValidCursor = TRUE;
|
||||
break;
|
||||
case INSERTION_CODE_EAST:
|
||||
if( gusMouseXPos >= (iOffsetHorizontal + 610) ) // 600
|
||||
case INSERTION_CODE_EAST:
|
||||
if( gusMouseXPos >= (iOffsetHorizontal + 610) ) // 600
|
||||
gfValidCursor = TRUE;
|
||||
break;
|
||||
case INSERTION_CODE_SOUTH:
|
||||
if( gusMouseYPos >= (iOffsetVertical + 290) ) // 280
|
||||
case INSERTION_CODE_SOUTH:
|
||||
if( gusMouseYPos >= (iOffsetVertical + 290) ) // 280
|
||||
gfValidCursor = TRUE;
|
||||
break;
|
||||
case INSERTION_CODE_WEST:
|
||||
case INSERTION_CODE_WEST:
|
||||
if( gusMouseXPos <= (iOffsetHorizontal + 30) ) // 40
|
||||
gfValidCursor = TRUE;
|
||||
break;
|
||||
@@ -784,7 +784,7 @@ void KillTacticalPlacementGUI()
|
||||
gbCursorMercID = -1;
|
||||
gpTacticalPlacementHilightedSoldier = NULL;
|
||||
gpTacticalPlacementSelectedSoldier = NULL;
|
||||
|
||||
|
||||
//Destroy the tactical placement gui.
|
||||
gfEnterTacticalPlacementGUI = FALSE;
|
||||
gfTacticalPlacementGUIActive = FALSE;
|
||||
@@ -809,7 +809,7 @@ void KillTacticalPlacementGUI()
|
||||
gsCurInterfacePanel = TEAM_PANEL;
|
||||
|
||||
SetCurrentInterfacePanel( (UINT8)gsCurInterfacePanel );
|
||||
|
||||
|
||||
//Leave the overhead map.
|
||||
KillOverheadMap();
|
||||
//Recreate the tactical panel.
|
||||
@@ -819,7 +819,7 @@ void KillTacticalPlacementGUI()
|
||||
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{
|
||||
PickUpMercPiece( i );
|
||||
PickUpMercPiece( i );
|
||||
}
|
||||
|
||||
PrepareLoadedSector();
|
||||
@@ -828,7 +828,7 @@ void KillTacticalPlacementGUI()
|
||||
#ifdef JA2BETAVERSION
|
||||
if( gfChangedEntrySide )
|
||||
{
|
||||
ScreenMsg( FONT_RED, MSG_ERROR, L"Substituted different entry side due to invalid entry points or map edgepoints. KM, LC : 1" );
|
||||
ScreenMsg( FONT_RED, MSG_ERROR, L"Substituted different entry side due to invalid entry points or map edgepoints. KM, LC : 1" );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -840,7 +840,7 @@ void ChooseRandomEdgepoints()
|
||||
INT32 i;
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{
|
||||
if ( !( gMercPlacement[ i ].pSoldier->uiStatusFlags & SOLDIER_VEHICLE ) )
|
||||
if ( !( gMercPlacement[ i ].pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
|
||||
{
|
||||
gMercPlacement[ i ].pSoldier->usStrategicInsertionData = ChooseMapEdgepoint( gMercPlacement[ i ].ubStrategicInsertionCode );
|
||||
if( gMercPlacement[ i ].pSoldier->usStrategicInsertionData != NOWHERE )
|
||||
@@ -873,7 +873,7 @@ void PlaceMercs()
|
||||
case CLEAR_BUTTON:
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{
|
||||
PickUpMercPiece( i );
|
||||
PickUpMercPiece( i );
|
||||
}
|
||||
gubSelectedGroupID = 0;
|
||||
gbSelectedMercID = 0;
|
||||
@@ -996,7 +996,7 @@ void SelectNextUnplacedUnit()
|
||||
for( i = gbSelectedMercID; i < giPlacements; i++ )
|
||||
{ //go from the currently selected soldier to the end
|
||||
if( !gMercPlacement[ i ].fPlaced )
|
||||
{ //Found an unplaced merc. Select him.
|
||||
{ //Found an unplaced merc. Select him.
|
||||
gbSelectedMercID = (INT8)i;
|
||||
if( gubDefaultButton == GROUP_BUTTON )
|
||||
gubSelectedGroupID = gMercPlacement[ i ].pSoldier->ubGroupID;
|
||||
@@ -1009,7 +1009,7 @@ void SelectNextUnplacedUnit()
|
||||
for( i = 0; i < gbSelectedMercID; i++ )
|
||||
{ //go from the beginning to the currently selected soldier
|
||||
if( !gMercPlacement[ i ].fPlaced )
|
||||
{ //Found an unplaced merc. Select him.
|
||||
{ //Found an unplaced merc. Select him.
|
||||
gbSelectedMercID = (INT8)i;
|
||||
if( gubDefaultButton == GROUP_BUTTON )
|
||||
gubSelectedGroupID = gMercPlacement[ i ].pSoldier->ubGroupID;
|
||||
@@ -1019,7 +1019,7 @@ void SelectNextUnplacedUnit()
|
||||
return;
|
||||
}
|
||||
}
|
||||
//checked the whole array, and everybody has been placed. Select nobody.
|
||||
//checked the whole array, and everybody has been placed. Select nobody.
|
||||
if( !gfEveryonePlaced )
|
||||
{
|
||||
gfEveryonePlaced = TRUE;
|
||||
@@ -1050,9 +1050,9 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
|
||||
if( gubDefaultButton == GROUP_BUTTON )
|
||||
{ //We are placing a whole group.
|
||||
for( i = 0; i < giPlacements; i++ )
|
||||
{ //Find locations of each member of the group, but don't place them yet. If
|
||||
{ //Find locations of each member of the group, but don't place them yet. If
|
||||
//one of the mercs can't be placed, then we won't place any, and tell the user
|
||||
//the problem. If everything's okay, we will place them all.
|
||||
//the problem. If everything's okay, we will place them all.
|
||||
if( gMercPlacement[ i ].pSoldier->ubGroupID == gubSelectedGroupID )
|
||||
{
|
||||
gMercPlacement[ i ].pSoldier->usStrategicInsertionData = SearchForClosestPrimaryMapEdgepoint( sGridNo, gMercPlacement[ i ].ubStrategicInsertionCode );
|
||||
@@ -1077,7 +1077,7 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //This is a single merc placement. If valid, then place him, else report error.
|
||||
{ //This is a single merc placement. If valid, then place him, else report error.
|
||||
gMercPlacement[ gbSelectedMercID ].pSoldier->usStrategicInsertionData = SearchForClosestPrimaryMapEdgepoint( sGridNo, gMercPlacement[ gbSelectedMercID ].ubStrategicInsertionCode );
|
||||
if( gMercPlacement[ gbSelectedMercID ].pSoldier->usStrategicInsertionData != NOWHERE )
|
||||
{
|
||||
@@ -1099,14 +1099,14 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
|
||||
EndMapEdgepointSearch();
|
||||
|
||||
if( fInvalidArea )
|
||||
{
|
||||
{
|
||||
// Only display the error message, when the cursor is on the overview map
|
||||
if (gusMouseYPos < (iOffsetVertical + 320) && gusMouseYPos > iOffsetVertical
|
||||
&& gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 640))
|
||||
{
|
||||
//Report error due to invalid placement.
|
||||
SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INACCESSIBLE_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INACCESSIBLE_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1123,9 +1123,9 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
|
||||
// Only display the error message, when the cursor is on the overview map
|
||||
if (gusMouseYPos < (iOffsetVertical + 320) && gusMouseYPos > iOffsetVertical
|
||||
&& gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 640))
|
||||
{
|
||||
{
|
||||
SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INVALID_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INVALID_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1136,8 +1136,8 @@ void SetCursorMerc( INT8 bPlacementID )
|
||||
{
|
||||
if( gbCursorMercID != bPlacementID )
|
||||
{
|
||||
if( gbCursorMercID == -1 || bPlacementID == -1 ||
|
||||
gMercPlacement[ gbCursorMercID ].ubStrategicInsertionCode != gMercPlacement[ bPlacementID ].ubStrategicInsertionCode )
|
||||
if( gbCursorMercID == -1 || bPlacementID == -1 ||
|
||||
gMercPlacement[ gbCursorMercID ].ubStrategicInsertionCode != gMercPlacement[ bPlacementID ].ubStrategicInsertionCode )
|
||||
gfValidLocationsChanged = TRUE;
|
||||
gbCursorMercID = bPlacementID;
|
||||
}
|
||||
@@ -1178,8 +1178,8 @@ void PutDownMercPiece( INT32 iPlacement )
|
||||
if( sGridNo != NOWHERE )
|
||||
{
|
||||
ConvertGridNoToCellXY( sGridNo, &sCellX, &sCellY );
|
||||
EVENT_SetSoldierPosition( pSoldier, (FLOAT)sCellX, (FLOAT)sCellY );
|
||||
EVENT_SetSoldierDirection( pSoldier, ubDirection );
|
||||
pSoldier->EVENT_SetSoldierPosition( (FLOAT)sCellX, (FLOAT)sCellY );
|
||||
pSoldier->EVENT_SetSoldierDirection( ubDirection );
|
||||
pSoldier->ubInsertionDirection = pSoldier->ubDirection;
|
||||
gMercPlacement[ iPlacement ].fPlaced = TRUE;
|
||||
gMercPlacement[ iPlacement ].pSoldier->bInSector = TRUE;
|
||||
@@ -1188,7 +1188,7 @@ void PutDownMercPiece( INT32 iPlacement )
|
||||
|
||||
void PickUpMercPiece( INT32 iPlacement )
|
||||
{
|
||||
RemoveSoldierFromGridNo( gMercPlacement[ iPlacement ].pSoldier );
|
||||
gMercPlacement[ iPlacement ].pSoldier->RemoveSoldierFromGridNo( );
|
||||
gMercPlacement[ iPlacement ].fPlaced = FALSE;
|
||||
gMercPlacement[ iPlacement ].pSoldier->bInSector = FALSE;
|
||||
}
|
||||
@@ -1207,5 +1207,5 @@ void FastHelpRemoved2Callback()
|
||||
void DialogRemoved( UINT8 ubResult )
|
||||
{
|
||||
gfTacticalPlacementGUIDirty = TRUE;
|
||||
gfValidLocationsChanged = TRUE;
|
||||
gfValidLocationsChanged = TRUE;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ extern BOOLEAN gfEnterTacticalPlacementGUI;
|
||||
extern SOLDIERTYPE *gpTacticalPlacementSelectedSoldier;
|
||||
extern SOLDIERTYPE *gpTacticalPlacementHilightedSoldier;
|
||||
|
||||
//Saved value. Contains the last choice for future battles.
|
||||
//Saved value. Contains the last choice for future battles.
|
||||
extern UINT8 gubDefaultButton;
|
||||
|
||||
#endif
|
||||
@@ -73,7 +73,7 @@ ANITILE *CreateAnimationTile( ANITILE_PARAMS *pAniParams )
|
||||
|
||||
memset( pNewAniNode, 0, sizeof( ANITILE ) );
|
||||
|
||||
if ( (uiFlags & ANITILE_EXISTINGTILE ) )
|
||||
if ( (uiFlags & ANITILE_EXISTINGTILE ) )
|
||||
{
|
||||
pNewAniNode->pLevelNode = pGivenNode;
|
||||
pNewAniNode->pLevelNode->pAniTile = pNewAniNode;
|
||||
@@ -159,7 +159,7 @@ ANITILE *CreateAnimationTile( ANITILE_PARAMS *pAniParams )
|
||||
|
||||
if ( ( uiFlags & ANITILE_CACHEDTILE ) )
|
||||
{
|
||||
pNewAniNode->pLevelNode->uiFlags |= ( LEVELNODE_CACHEDANITILE );
|
||||
pNewAniNode->pLevelNode->uiFlags |= ( LEVELNODE_CACHEDANITILE );
|
||||
pNewAniNode->sCachedTileID = (INT16)iCachedTile;
|
||||
pNewAniNode->usCachedTileSubIndex = usTileType;
|
||||
pNewAniNode->pLevelNode->pAniTile = pNewAniNode;
|
||||
@@ -169,7 +169,7 @@ ANITILE *CreateAnimationTile( ANITILE_PARAMS *pAniParams )
|
||||
|
||||
}
|
||||
// Can't set relative X,Y,Z IF FLAGS ANITILE_CACHEDTILE set!
|
||||
else if ( (uiFlags & ANITILE_USEABSOLUTEPOS ) )
|
||||
else if ( (uiFlags & ANITILE_USEABSOLUTEPOS ) )
|
||||
{
|
||||
pNewAniNode->pLevelNode->sRelativeX = sX;
|
||||
pNewAniNode->pLevelNode->sRelativeY = sY;
|
||||
@@ -285,7 +285,7 @@ ANITILE *CreateAnimationTile( ANITILE_PARAMS *pAniParams )
|
||||
pNewAniNode->uiTimeLastUpdate = GetJA2Clock( );
|
||||
pNewAniNode->sGridNo = sGridNo;
|
||||
|
||||
pNewAniNode->sStartFrame = sStartFrame;
|
||||
pNewAniNode->sStartFrame = sStartFrame;
|
||||
|
||||
pNewAniNode->ubKeyFrame1 = pAniParams->ubKeyFrame1;
|
||||
pNewAniNode->uiKeyFrame1Code = pAniParams->uiKeyFrame1Code;
|
||||
@@ -299,7 +299,7 @@ ANITILE *CreateAnimationTile( ANITILE_PARAMS *pAniParams )
|
||||
//Set head
|
||||
pAniTileHead = pNewAniNode;
|
||||
|
||||
// Set some special stuff
|
||||
// Set some special stuff
|
||||
return( pNewAniNode );
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ void DeleteAniTile( ANITILE *pAniTile )
|
||||
pOldAniNode->pNext = pAniNode->pNext;
|
||||
}
|
||||
|
||||
if ( !(pAniNode->uiFlags & ANITILE_EXISTINGTILE ) )
|
||||
if ( !(pAniNode->uiFlags & ANITILE_EXISTINGTILE ) )
|
||||
{
|
||||
|
||||
// Delete memory assosiated with item
|
||||
@@ -421,10 +421,10 @@ void DeleteAniTile( ANITILE *pAniTile )
|
||||
{
|
||||
// First delete the bullet!
|
||||
RemoveBullet( pAniNode->uiUserData3 );
|
||||
|
||||
// 0verhaul: Removed because it's handled by RemoveBullet.
|
||||
|
||||
// 0verhaul: Removed because it's handled by RemoveBullet.
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - miss finished animation") );
|
||||
// FreeUpAttacker( (UINT8) pAniNode->ubAttackerMissed );
|
||||
// FreeUpAttacker( (UINT8) pAniNode->ubAttackerMissed );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -556,16 +556,16 @@ void UpdateAniTiles( )
|
||||
|
||||
case ANI_KEYFRAME_DO_SOUND:
|
||||
|
||||
PlayJA2Sample( pNode->uiUserData, RATE_11025, SoundVolume( MIDVOLUME, (INT16)pNode->uiUserData3 ), 1, SoundDir( (INT16)pNode->uiUserData3 ) );
|
||||
PlayJA2Sample( pNode->uiUserData, RATE_11025, SoundVolume( MIDVOLUME, (INT16)pNode->uiUserData3 ), 1, SoundDir( (INT16)pNode->uiUserData3 ) );
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK IF WE SHOULD BE DISPLAYING TRANSLUCENTLY!
|
||||
if ( pNode->sCurrentFrame == pNode->ubKeyFrame2 )
|
||||
{
|
||||
UINT16 ubExpType;
|
||||
UINT16 ubExpType;
|
||||
|
||||
switch( pNode->uiKeyFrame2Code )
|
||||
{
|
||||
@@ -573,13 +573,13 @@ void UpdateAniTiles( )
|
||||
|
||||
ubExpType = Explosive[ Item[ (UINT16)pNode->uiUserData ].ubClassIndex ].ubType;
|
||||
|
||||
// if ( ubExpType == EXPLOSV_TEARGAS || ubExpType == EXPLOSV_MUSTGAS ||
|
||||
// ubExpType == EXPLOSV_SMOKE )
|
||||
if ( ubExpType == EXPLOSV_TEARGAS || ubExpType == EXPLOSV_MUSTGAS ||
|
||||
// if ( ubExpType == EXPLOSV_TEARGAS || ubExpType == EXPLOSV_MUSTGAS ||
|
||||
// ubExpType == EXPLOSV_SMOKE )
|
||||
if ( ubExpType == EXPLOSV_TEARGAS || ubExpType == EXPLOSV_MUSTGAS ||
|
||||
ubExpType == EXPLOSV_SMOKE || ubExpType == EXPLOSV_BURNABLEGAS )
|
||||
{
|
||||
// Do sound....
|
||||
// PlayJA2Sample( AIR_ESCAPING_1, RATE_11025, SoundVolume( HIGHVOLUME, pNode->sGridNo ), 1, SoundDir( pNode->sGridNo ) );
|
||||
// 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 );
|
||||
}
|
||||
else
|
||||
@@ -624,7 +624,7 @@ void UpdateAniTiles( )
|
||||
pNode->uiFlags |= ANITILE_BACKWARD;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
|
||||
// Delete from world!
|
||||
DeleteAniTile( pNode );
|
||||
@@ -641,7 +641,7 @@ void UpdateAniTiles( )
|
||||
if ( pNode->uiFlags & ANITILE_BACKWARD )
|
||||
{
|
||||
if ( pNode->uiFlags & ANITILE_ERASEITEMFROMSAVEBUFFFER )
|
||||
{
|
||||
{
|
||||
// ATE: Check if bounding box is on the screen...
|
||||
if ( pNode->bFrameCountAfterStart == 0 )
|
||||
{
|
||||
@@ -729,7 +729,7 @@ void UpdateAniTiles( )
|
||||
}
|
||||
|
||||
if ( pNode->uiFlags & ANITILE_ERASEITEMFROMSAVEBUFFFER )
|
||||
{
|
||||
{
|
||||
// ATE: Check if bounding box is on the screen...
|
||||
pNode->bFrameCountAfterStart = 0;
|
||||
//pNode->pLevelNode->uiFlags |= LEVELNODE_UPDATESAVEBUFFERONCE;
|
||||
@@ -750,7 +750,7 @@ void UpdateAniTiles( )
|
||||
{
|
||||
// ONLY TURN OFF IF PAUSED...
|
||||
if ( ( pNode->uiFlags & ANITILE_ERASEITEMFROMSAVEBUFFFER ) )
|
||||
{
|
||||
{
|
||||
if ( pNode->uiFlags & ANITILE_PAUSED )
|
||||
{
|
||||
if ( pNode->pLevelNode->uiFlags & LEVELNODE_DYNAMIC )
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
|
||||
typedef struct TAG_anitile
|
||||
{
|
||||
struct TAG_anitile *pNext;
|
||||
struct TAG_anitile *pNext;
|
||||
UINT32 uiFlags; // flags struct
|
||||
UINT32 uiTimeLastUpdate; // Stuff for animated tiles
|
||||
|
||||
LEVELNODE *pLevelNode;
|
||||
UINT8 ubLevelID;
|
||||
INT16 sCurrentFrame;
|
||||
INT16 sCurrentFrame;
|
||||
INT16 sStartFrame;
|
||||
INT16 sDelay;
|
||||
UINT16 usTileType;
|
||||
@@ -80,7 +80,7 @@ typedef struct TAG_anitile_params
|
||||
{
|
||||
UINT32 uiFlags; // flags struct
|
||||
UINT8 ubLevelID; // Level ID for rendering layer
|
||||
INT16 sStartFrame; // Start frame
|
||||
INT16 sStartFrame; // Start frame
|
||||
INT16 sDelay; // Delay time
|
||||
UINT16 usTileType; // Tile databse type ( optional )
|
||||
UINT16 usTileIndex; // Tile database index ( optional )
|
||||
@@ -112,7 +112,7 @@ enum KeyFrameEnums
|
||||
ANI_KEYFRAME_BEGIN_TRANSLUCENCY,
|
||||
ANI_KEYFRAME_BEGIN_DAMAGE,
|
||||
ANI_KEYFRAME_CHAIN_WATER_EXPLOSION,
|
||||
ANI_KEYFRAME_DO_SOUND,
|
||||
ANI_KEYFRAME_DO_SOUND,
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
+37
-36
@@ -23,15 +23,15 @@
|
||||
UINT32 guiNumTileCacheStructs = 0;
|
||||
UINT32 guiMaxTileCacheSize = 50;
|
||||
UINT32 guiCurTileCacheSize = 0;
|
||||
INT32 giDefaultStructIndex = -1;
|
||||
INT32 giDefaultStructIndex = -1;
|
||||
|
||||
TILE_CACHE_ELEMENT *gpTileCache = NULL;
|
||||
TILE_CACHE_STRUCT *gpTileCacheStructInfo = NULL;
|
||||
|
||||
|
||||
|
||||
BOOLEAN InitTileCache( )
|
||||
{
|
||||
BOOLEAN InitTileCache( )
|
||||
{
|
||||
UINT32 cnt;
|
||||
GETFILESTRUCT FileInfo;
|
||||
INT16 sFiles = 0;
|
||||
@@ -84,13 +84,13 @@ BOOLEAN InitTileCache( )
|
||||
#ifdef JA2TESTVERSION
|
||||
if ( gpTileCacheStructInfo[ cnt ].pStructureFileRef == NULL )
|
||||
{
|
||||
SET_ERROR( "Cannot load tilecache JSD: %s", gpTileCacheStructInfo[ cnt ].Filename );
|
||||
SET_ERROR( "Cannot load tilecache JSD: %s", gpTileCacheStructInfo[ cnt ].Filename );
|
||||
}
|
||||
#endif
|
||||
if ( _stricmp( gpTileCacheStructInfo[ cnt ].zRootName, "l_dead1" ) == 0 )
|
||||
{
|
||||
giDefaultStructIndex = cnt;
|
||||
}
|
||||
if ( _stricmp( gpTileCacheStructInfo[ cnt ].zRootName, "l_dead1" ) == 0 )
|
||||
{
|
||||
giDefaultStructIndex = cnt;
|
||||
}
|
||||
|
||||
cnt++;
|
||||
}
|
||||
@@ -130,12 +130,12 @@ void DeleteTileCache( )
|
||||
INT16 FindCacheStructDataIndex( STR8 cFilename )
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
|
||||
for ( cnt = 0; cnt < guiNumTileCacheStructs; cnt++ )
|
||||
{
|
||||
if ( _stricmp( gpTileCacheStructInfo[ cnt ].zRootName, cFilename ) == 0 )
|
||||
{
|
||||
return( (INT16)cnt );
|
||||
return( (INT16)cnt );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ INT32 GetCachedTile( const STR8 cFilename )
|
||||
{
|
||||
UINT32 cnt;
|
||||
UINT32 ubLowestIndex = 0;
|
||||
INT16 sMostHits = (INT16)15000;
|
||||
INT16 sMostHits = (INT16)15000;
|
||||
|
||||
// Check to see if surface exists already
|
||||
for ( cnt = 0; cnt < guiCurTileCacheSize; cnt++ )
|
||||
@@ -155,9 +155,9 @@ INT32 GetCachedTile( const STR8 cFilename )
|
||||
{
|
||||
if ( _stricmp( gpTileCache[ cnt ].zName, cFilename ) == 0 )
|
||||
{
|
||||
// Found surface, return
|
||||
gpTileCache[ cnt ].sHits++;
|
||||
return( (INT32)cnt );
|
||||
// Found surface, return
|
||||
gpTileCache[ cnt ].sHits++;
|
||||
return( (INT32)cnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,11 +168,11 @@ INT32 GetCachedTile( const STR8 cFilename )
|
||||
// cache out least used file
|
||||
for ( cnt = 0; cnt < guiCurTileCacheSize; cnt++ )
|
||||
{
|
||||
if ( gpTileCache[ cnt ].sHits < sMostHits )
|
||||
{
|
||||
if ( gpTileCache[ cnt ].sHits < sMostHits )
|
||||
{
|
||||
sMostHits = gpTileCache[ cnt ].sHits;
|
||||
ubLowestIndex = cnt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Bump off lowest index
|
||||
@@ -209,7 +209,7 @@ INT32 GetCachedTile( const STR8 cFilename )
|
||||
// ATE: Add z-strip info
|
||||
if ( gpTileCache[ cnt ].sStructRefID != -1 )
|
||||
{
|
||||
AddZStripInfoToVObject( gpTileCache[ cnt ].pImagery->vo, gpTileCacheStructInfo[ gpTileCache[ cnt ].sStructRefID ].pStructureFileRef, TRUE, 0 );
|
||||
AddZStripInfoToVObject( gpTileCache[ cnt ].pImagery->vo, gpTileCacheStructInfo[ gpTileCache[ cnt ].sStructRefID ].pStructureFileRef, TRUE, 0 );
|
||||
}
|
||||
|
||||
if ( gpTileCache[ cnt ].pImagery->pAuxData != NULL )
|
||||
@@ -247,17 +247,17 @@ BOOLEAN RemoveCachedTile( INT32 iCachedTile )
|
||||
{
|
||||
if ( cnt == (UINT32)iCachedTile )
|
||||
{
|
||||
// Found surface, decrement hits
|
||||
gpTileCache[ cnt ].sHits--;
|
||||
// Found surface, decrement hits
|
||||
gpTileCache[ cnt ].sHits--;
|
||||
|
||||
// Are we at zero?
|
||||
if ( gpTileCache[ cnt ].sHits == 0 )
|
||||
{
|
||||
// Are we at zero?
|
||||
if ( gpTileCache[ cnt ].sHits == 0 )
|
||||
{
|
||||
DeleteTileSurface( gpTileCache[ cnt ].pImagery );
|
||||
gpTileCache[ cnt ].pImagery = NULL;
|
||||
gpTileCache[ cnt ].sStructRefID = -1;
|
||||
return( TRUE );;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ STRUCTURE_FILE_REF *GetCachedTileStructureRefFromFilename( const STR8 cFilename
|
||||
|
||||
|
||||
void CheckForAndAddTileCacheStructInfo( LEVELNODE *pNode, INT16 sGridNo, UINT16 usIndex, UINT16 usSubIndex )
|
||||
{
|
||||
{
|
||||
STRUCTURE_FILE_REF *pStructureFileRef;
|
||||
|
||||
pStructureFileRef = GetCachedTileStructureRef( usIndex );
|
||||
@@ -323,22 +323,22 @@ void CheckForAndAddTileCacheStructInfo( LEVELNODE *pNode, INT16 sGridNo, UINT16
|
||||
if ( pStructureFileRef != NULL)
|
||||
{
|
||||
if ( !AddStructureToWorld( sGridNo, 0, &( pStructureFileRef->pDBStructureRef[ usSubIndex ] ), pNode ) )
|
||||
{
|
||||
if ( giDefaultStructIndex != -1 )
|
||||
{
|
||||
pStructureFileRef = gpTileCacheStructInfo[ giDefaultStructIndex ].pStructureFileRef;
|
||||
{
|
||||
if ( giDefaultStructIndex != -1 )
|
||||
{
|
||||
pStructureFileRef = gpTileCacheStructInfo[ giDefaultStructIndex ].pStructureFileRef;
|
||||
|
||||
if ( pStructureFileRef != NULL)
|
||||
{
|
||||
AddStructureToWorld( sGridNo, 0, &( pStructureFileRef->pDBStructureRef[ usSubIndex ] ), pNode );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( pStructureFileRef != NULL)
|
||||
{
|
||||
AddStructureToWorld( sGridNo, 0, &( pStructureFileRef->pDBStructureRef[ usSubIndex ] ), pNode );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckForAndDeleteTileCacheStructInfo( LEVELNODE *pNode, UINT16 usIndex )
|
||||
{
|
||||
{
|
||||
STRUCTURE_FILE_REF *pStructureFileRef;
|
||||
|
||||
if ( usIndex >= TILE_CACHE_START_INDEX )
|
||||
@@ -380,3 +380,4 @@ void GetRootName( STR8 pDestStr, const STR8 pSrcStr )
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+13
-13
@@ -25,13 +25,13 @@ TILE_IMAGERY *gTileSurfaceArray[ NUMBEROFTILETYPES ];
|
||||
UINT8 gbDefaultSurfaceUsed[ NUMBEROFTILETYPES ];
|
||||
UINT8 gbSameAsDefaultSurfaceUsed[ NUMBEROFTILETYPES ];
|
||||
|
||||
TILE_IMAGERY *LoadTileSurface( STR8 cFilename )
|
||||
TILE_IMAGERY *LoadTileSurface( STR8 cFilename )
|
||||
{
|
||||
// Add tile surface
|
||||
PTILE_IMAGERY pTileSurf = NULL;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
HVOBJECT hVObject;
|
||||
HIMAGE hImage;
|
||||
PTILE_IMAGERY pTileSurf = NULL;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
HVOBJECT hVObject;
|
||||
HIMAGE hImage;
|
||||
SGPFILENAME cStructureFilename;
|
||||
STR cEndOfName;
|
||||
STRUCTURE_FILE_REF * pStructureFileRef;
|
||||
@@ -81,21 +81,21 @@ TILE_IMAGERY *LoadTileSurface( STR8 cFilename )
|
||||
{
|
||||
DestroyImage( hImage );
|
||||
DeleteVideoObject( hVObject );
|
||||
SET_ERROR( "Structure file error: %s", cStructureFilename );
|
||||
SET_ERROR( "Structure file error: %s", cStructureFilename );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, cStructureFilename );
|
||||
|
||||
|
||||
fOk = AddZStripInfoToVObject( hVObject, pStructureFileRef, FALSE, 0 );
|
||||
if (fOk == FALSE)
|
||||
{
|
||||
DestroyImage( hImage );
|
||||
DeleteVideoObject( hVObject );
|
||||
SET_ERROR( "ZStrip creation error: %s", cStructureFilename );
|
||||
SET_ERROR( "ZStrip creation error: %s", cStructureFilename );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -134,7 +134,7 @@ TILE_IMAGERY *LoadTileSurface( STR8 cFilename )
|
||||
// the hImage is no longer needed
|
||||
DestroyImage( hImage );
|
||||
|
||||
return( pTileSurf );
|
||||
return( pTileSurf );
|
||||
}
|
||||
|
||||
|
||||
@@ -191,11 +191,11 @@ void SetRaisedObjectFlag( STR8 cFilename, TILE_IMAGERY *pTileSurf )
|
||||
while( ubRaisedObjectFiles[ cnt ][ 0 ] != '1' )
|
||||
{
|
||||
if ( _stricmp( ubRaisedObjectFiles[ cnt ], cRootFile ) == 0 )
|
||||
{
|
||||
{
|
||||
pTileSurf->bRaisedObjectType = TRUE;
|
||||
}
|
||||
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+196
-195
@@ -109,7 +109,7 @@ INT16 gReverseShadowBuddys[] =
|
||||
SECONDFULLSHADOW, SECONDFULLSHADOW1, SECONDFULLSTRUCT1,
|
||||
THIRDFULLSHADOW, THIRDFULLSHADOW1, THIRDFULLSTRUCT1,
|
||||
FOURTHFULLSHADOW, FOURTHFULLSHADOW1, FOURTHFULLSTRUCT1,
|
||||
|
||||
|
||||
FIRSTDOORSHADOW, FIRSTDOORSH1, FIRSTDOOR1,
|
||||
SECONDDOORSHADOW, SECONDDOORSH1, SECONDDOOR1,
|
||||
THIRDDOORSHADOW, THIRDDOORSH1, THIRDDOOR1,
|
||||
@@ -150,11 +150,11 @@ INT16 gForwardShadowBuddys[] =
|
||||
SEVENTHOSTRUCT, SEVENTHOSTRUCT1, SEVENTHSHADOW1,
|
||||
EIGHTOSTRUCT, EIGHTOSTRUCT1, EIGHTSHADOW1,
|
||||
|
||||
FIRSTFULLSTRUCT, FIRSTFULLSTRUCT1, FIRSTFULLSHADOW1,
|
||||
SECONDFULLSTRUCT, SECONDFULLSTRUCT1, SECONDFULLSHADOW1,
|
||||
THIRDFULLSTRUCT, THIRDFULLSTRUCT1, THIRDFULLSHADOW1,
|
||||
FOURTHFULLSTRUCT, FOURTHFULLSTRUCT1, FOURTHFULLSHADOW1,
|
||||
|
||||
FIRSTFULLSTRUCT, FIRSTFULLSTRUCT1, FIRSTFULLSHADOW1,
|
||||
SECONDFULLSTRUCT, SECONDFULLSTRUCT1, SECONDFULLSHADOW1,
|
||||
THIRDFULLSTRUCT, THIRDFULLSTRUCT1, THIRDFULLSHADOW1,
|
||||
FOURTHFULLSTRUCT, FOURTHFULLSTRUCT1, FOURTHFULLSHADOW1,
|
||||
|
||||
FIRSTDOOR, FIRSTDOOR1, FIRSTDOORSH1,
|
||||
SECONDDOOR, SECONDDOOR1, SECONDDOORSH1,
|
||||
THIRDDOOR, THIRDDOOR1, THIRDDOORSH1,
|
||||
@@ -181,45 +181,45 @@ INT16 gForwardShadowBuddys[] =
|
||||
};
|
||||
|
||||
// Global variable used to initialize tile database with full tile spec
|
||||
UINT8 gFullBaseTileValues[] =
|
||||
UINT8 gFullBaseTileValues[] =
|
||||
|
||||
{
|
||||
{
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // First Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Second Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Third Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Forth Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Fifth Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Sixth Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Seventh Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // Water1 Texture
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // Water2 Texture
|
||||
|
||||
@@ -404,116 +404,116 @@ STR gTileSurfaceName[NUMBEROFTILETYPES] =
|
||||
|
||||
UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ] =
|
||||
{
|
||||
FIRSTTEXTURE35 - FIRSTTEXTURE1 + 1,
|
||||
SECONDTEXTURE35 - SECONDTEXTURE1 + 1,
|
||||
THIRDTEXTURE35 - THIRDTEXTURE1 + 1,
|
||||
FOURTHTEXTURE35 - FOURTHTEXTURE1 + 1,
|
||||
FIFTHTEXTURE35 - FIFTHTEXTURE1 + 1,
|
||||
SIXTHTEXTURE37 - SIXTHTEXTURE1 + 1,
|
||||
SEVENTHTEXTURE49 - SEVENTHTEXTURE1 + 1,
|
||||
REGWATERTEXTURE50 - REGWATERTEXTURE1 + 1,
|
||||
FIRSTTEXTURE35 - FIRSTTEXTURE1 + 1,
|
||||
SECONDTEXTURE35 - SECONDTEXTURE1 + 1,
|
||||
THIRDTEXTURE35 - THIRDTEXTURE1 + 1,
|
||||
FOURTHTEXTURE35 - FOURTHTEXTURE1 + 1,
|
||||
FIFTHTEXTURE35 - FIFTHTEXTURE1 + 1,
|
||||
SIXTHTEXTURE37 - SIXTHTEXTURE1 + 1,
|
||||
SEVENTHTEXTURE49 - SEVENTHTEXTURE1 + 1,
|
||||
REGWATERTEXTURE50 - REGWATERTEXTURE1 + 1,
|
||||
DEEPWATERTEXTURE37 - DEEPWATERTEXTURE1 + 1,
|
||||
FIRSTCLIFFHANG17 - FIRSTCLIFFHANG1 + 1,
|
||||
FIRSTCLIFF17 - FIRSTCLIFF1 + 1,
|
||||
FIRSTCLIFFHANG17 - FIRSTCLIFFHANG1 + 1,
|
||||
FIRSTCLIFF17 - FIRSTCLIFF1 + 1,
|
||||
FIRSTCLIFFSHADOW17 - FIRSTCLIFFSHADOW1 + 1, // Med hill
|
||||
|
||||
FIRSTOSTRUCT12 - FIRSTOSTRUCT1 + 1,
|
||||
SECONDOSTRUCT12 - SECONDOSTRUCT1 + 1,
|
||||
THIRDOSTRUCT12 - THIRDOSTRUCT1 + 1,
|
||||
FOURTHOSTRUCT12 - FOURTHOSTRUCT1 + 1, // Fourth OSTRUCT
|
||||
FIFTHOSTRUCT12 - FIFTHOSTRUCT1 + 1, // Fifth OSTRUCT
|
||||
SIXTHOSTRUCT12 - SIXTHOSTRUCT1 + 1, // Sixth OSTRUCT
|
||||
SEVENTHOSTRUCT12 - SEVENTHOSTRUCT1 + 1, // Seventh OSTRUCT
|
||||
EIGHTOSTRUCT12 - EIGHTOSTRUCT1 + 1, // Eigth OSTRUCT
|
||||
FIRSTFULLSTRUCT12 - FIRSTFULLSTRUCT1 + 1,
|
||||
FIRSTOSTRUCT12 - FIRSTOSTRUCT1 + 1,
|
||||
SECONDOSTRUCT12 - SECONDOSTRUCT1 + 1,
|
||||
THIRDOSTRUCT12 - THIRDOSTRUCT1 + 1,
|
||||
FOURTHOSTRUCT12 - FOURTHOSTRUCT1 + 1, // Fourth OSTRUCT
|
||||
FIFTHOSTRUCT12 - FIFTHOSTRUCT1 + 1, // Fifth OSTRUCT
|
||||
SIXTHOSTRUCT12 - SIXTHOSTRUCT1 + 1, // Sixth OSTRUCT
|
||||
SEVENTHOSTRUCT12 - SEVENTHOSTRUCT1 + 1, // Seventh OSTRUCT
|
||||
EIGHTOSTRUCT12 - EIGHTOSTRUCT1 + 1, // Eigth OSTRUCT
|
||||
FIRSTFULLSTRUCT12 - FIRSTFULLSTRUCT1 + 1,
|
||||
SECONDFULLSTRUCT12 - SECONDFULLSTRUCT1 + 1,
|
||||
THIRDFULLSTRUCT2 - THIRDFULLSTRUCT1 + 1,
|
||||
THIRDFULLSTRUCT2 - THIRDFULLSTRUCT1 + 1,
|
||||
FOURTHFULLSTRUCT2 - FOURTHFULLSTRUCT1 + 1,
|
||||
|
||||
FIRSTSHADOW12 - FIRSTSHADOW1 + 1,
|
||||
SECONDSHADOW12 - SECONDSHADOW1 + 1,
|
||||
THIRDSHADOW12 - THIRDSHADOW1 + 1,
|
||||
FOURTHSHADOW12 - FOURTHSHADOW1 + 1,
|
||||
FIFTHSHADOW12 - FIFTHSHADOW1 + 1,
|
||||
SIXTHSHADOW12 - SIXTHSHADOW1 + 1,
|
||||
SEVENTHSHADOW12 - SEVENTHSHADOW1 + 1,
|
||||
EIGHTSHADOW12 - EIGHTSHADOW1 + 1,
|
||||
FIRSTFULLSHADOW12 - FIRSTFULLSHADOW1 + 1,
|
||||
FIRSTSHADOW12 - FIRSTSHADOW1 + 1,
|
||||
SECONDSHADOW12 - SECONDSHADOW1 + 1,
|
||||
THIRDSHADOW12 - THIRDSHADOW1 + 1,
|
||||
FOURTHSHADOW12 - FOURTHSHADOW1 + 1,
|
||||
FIFTHSHADOW12 - FIFTHSHADOW1 + 1,
|
||||
SIXTHSHADOW12 - SIXTHSHADOW1 + 1,
|
||||
SEVENTHSHADOW12 - SEVENTHSHADOW1 + 1,
|
||||
EIGHTSHADOW12 - EIGHTSHADOW1 + 1,
|
||||
FIRSTFULLSHADOW12 - FIRSTFULLSHADOW1 + 1,
|
||||
SECONDFULLSHADOW12 - SECONDFULLSHADOW1 + 1,
|
||||
THIRDFULLSHADOW2 - THIRDFULLSHADOW1 + 1,
|
||||
THIRDFULLSHADOW2 - THIRDFULLSHADOW1 + 1,
|
||||
FOURTHFULLSHADOW2 - FOURTHFULLSHADOW1 + 1,
|
||||
|
||||
|
||||
FIRSTWALL65 - FIRSTWALL1 + 1,
|
||||
SECONDWALL65 - SECONDWALL1 + 1,
|
||||
THIRDWALL65 - THIRDWALL1 + 1,
|
||||
FOURTHWALL65 - FOURTHWALL1 + 1,
|
||||
FIRSTWALL65 - FIRSTWALL1 + 1,
|
||||
SECONDWALL65 - SECONDWALL1 + 1,
|
||||
THIRDWALL65 - THIRDWALL1 + 1,
|
||||
FOURTHWALL65 - FOURTHWALL1 + 1,
|
||||
|
||||
FIRSTDOOR20 - FIRSTDOOR1 + 1,
|
||||
SECONDDOOR20 - SECONDDOOR1 + 1,
|
||||
THIRDDOOR20 - THIRDDOOR1 + 1,
|
||||
FOURTHDOOR20 - FOURTHDOOR1 + 1,
|
||||
FIRSTDOOR20 - FIRSTDOOR1 + 1,
|
||||
SECONDDOOR20 - SECONDDOOR1 + 1,
|
||||
THIRDDOOR20 - THIRDDOOR1 + 1,
|
||||
FOURTHDOOR20 - FOURTHDOOR1 + 1,
|
||||
|
||||
FIRSTDOORSH20 - FIRSTDOORSH1 + 1,
|
||||
SECONDDOORSH20 - SECONDDOORSH1 + 1,
|
||||
THIRDDOORSH20 - THIRDDOORSH1 + 1,
|
||||
FOURTHDOORSH20 - FOURTHDOORSH1 + 1,
|
||||
FIRSTDOORSH20 - FIRSTDOORSH1 + 1,
|
||||
SECONDDOORSH20 - SECONDDOORSH1 + 1,
|
||||
THIRDDOORSH20 - THIRDDOORSH1 + 1,
|
||||
FOURTHDOORSH20 - FOURTHDOORSH1 + 1,
|
||||
|
||||
SLANTROOFCEILING2 - SLANTROOFCEILING1 + 1,
|
||||
ANOTHERDEBRIS10 - ANOTHERDEBRIS1 + 1,
|
||||
ROADPIECES400 - ROADPIECES001 + 1,
|
||||
FOURTHWINDOW2 - FOURTHWINDOW1 + 1,
|
||||
SLANTROOFCEILING2 - SLANTROOFCEILING1 + 1,
|
||||
ANOTHERDEBRIS10 - ANOTHERDEBRIS1 + 1,
|
||||
ROADPIECES400 - ROADPIECES001 + 1,
|
||||
FOURTHWINDOW2 - FOURTHWINDOW1 + 1,
|
||||
|
||||
FIRSTDECORATIONS10 - FIRSTDECORATIONS1 + 1,
|
||||
FIRSTDECORATIONS10 - FIRSTDECORATIONS1 + 1,
|
||||
SECONDDECORATIONS10 - SECONDDECORATIONS1 + 1,
|
||||
THIRDDECORATIONS10 - THIRDDECORATIONS1 + 1,
|
||||
THIRDDECORATIONS10 - THIRDDECORATIONS1 + 1,
|
||||
FOURTHDECORATIONS10 - FOURTHDECORATIONS1 + 1,
|
||||
|
||||
FIRSTWALLDECAL10 - FIRSTWALLDECAL1 + 1,
|
||||
SECONDWALLDECAL10 - SECONDWALLDECAL1 + 1,
|
||||
THIRDWALLDECAL10 - THIRDWALLDECAL1 + 1,
|
||||
FOURTHWALLDECAL10 - FOURTHWALLDECAL1 + 1,
|
||||
FIRSTWALLDECAL10 - FIRSTWALLDECAL1 + 1,
|
||||
SECONDWALLDECAL10 - SECONDWALLDECAL1 + 1,
|
||||
THIRDWALLDECAL10 - THIRDWALLDECAL1 + 1,
|
||||
FOURTHWALLDECAL10 - FOURTHWALLDECAL1 + 1,
|
||||
|
||||
FIRSTFLOOR8 - FIRSTFLOOR1 + 1,
|
||||
SECONDFLOOR8 - SECONDFLOOR1 + 1,
|
||||
THIRDFLOOR8 - THIRDFLOOR1 + 1,
|
||||
FOURTHFLOOR8 - FOURTHFLOOR1 + 1,
|
||||
FIRSTFLOOR8 - FIRSTFLOOR1 + 1,
|
||||
SECONDFLOOR8 - SECONDFLOOR1 + 1,
|
||||
THIRDFLOOR8 - THIRDFLOOR1 + 1,
|
||||
FOURTHFLOOR8 - FOURTHFLOOR1 + 1,
|
||||
|
||||
FIRSTROOF14 - FIRSTROOF1 + 1,
|
||||
SECONDROOF14 - SECONDROOF1 + 1,
|
||||
THIRDROOF14 - THIRDROOF1 + 1,
|
||||
FOURTHROOF14 - FOURTHROOF1 + 1,
|
||||
FIRSTSLANTROOF20 - FIRSTSLANTROOF1 + 1,
|
||||
SECONDSLANTROOF20 - SECONDSLANTROOF1 + 1,
|
||||
FIRSTROOF14 - FIRSTROOF1 + 1,
|
||||
SECONDROOF14 - SECONDROOF1 + 1,
|
||||
THIRDROOF14 - THIRDROOF1 + 1,
|
||||
FOURTHROOF14 - FOURTHROOF1 + 1,
|
||||
FIRSTSLANTROOF20 - FIRSTSLANTROOF1 + 1,
|
||||
SECONDSLANTROOF20 - SECONDSLANTROOF1 + 1,
|
||||
|
||||
FIRSTONROOF12 - FIRSTONROOF1 + 1,
|
||||
SECONDONROOF12 - SECONDONROOF1 + 1,
|
||||
FIRSTONROOF12 - FIRSTONROOF1 + 1,
|
||||
SECONDONROOF12 - SECONDONROOF1 + 1,
|
||||
|
||||
1,
|
||||
|
||||
FIRSTISTRUCT24 - FIRSTISTRUCT1 + 1,
|
||||
SECONDISTRUCT24 - SECONDISTRUCT1 + 1,
|
||||
THIRDISTRUCT24 - THIRDISTRUCT1 + 1,
|
||||
FOURTHISTRUCT24 - FOURTHISTRUCT1 + 1,
|
||||
FIRSTCISTRUCT24 - FIRSTCISTRUCT1 + 1,
|
||||
FIRSTISTRUCT24 - FIRSTISTRUCT1 + 1,
|
||||
SECONDISTRUCT24 - SECONDISTRUCT1 + 1,
|
||||
THIRDISTRUCT24 - THIRDISTRUCT1 + 1,
|
||||
FOURTHISTRUCT24 - FOURTHISTRUCT1 + 1,
|
||||
FIRSTCISTRUCT24 - FIRSTCISTRUCT1 + 1,
|
||||
|
||||
FIRSTROAD35 - FIRSTROAD1 + 1,
|
||||
FIRSTROAD35 - FIRSTROAD1 + 1,
|
||||
|
||||
DEBRISROCKS10 - DEBRISROCKS1 + 1,
|
||||
DEBRISWOOD10 - DEBRISWOOD1 + 1,
|
||||
DEBRISWEEDS10 - DEBRISWEEDS1 + 1,
|
||||
DEBRISGRASS10 - DEBRISGRASS1 + 1,
|
||||
DEBRISSAND10 - DEBRISSAND1 + 1,
|
||||
DEBRISMISC10 - DEBRISMISC1 + 1,
|
||||
DEBRISROCKS10 - DEBRISROCKS1 + 1,
|
||||
DEBRISWOOD10 - DEBRISWOOD1 + 1,
|
||||
DEBRISWEEDS10 - DEBRISWEEDS1 + 1,
|
||||
DEBRISGRASS10 - DEBRISGRASS1 + 1,
|
||||
DEBRISSAND10 - DEBRISSAND1 + 1,
|
||||
DEBRISMISC10 - DEBRISMISC1 + 1,
|
||||
|
||||
ANIOSTRUCT20 - ANIOSTRUCT1 + 1,
|
||||
FENCESTRUCT23 - FENCESTRUCT1 + 1,
|
||||
FENCESHADOW23 - FENCESHADOW1 + 1,
|
||||
ANIOSTRUCT20 - ANIOSTRUCT1 + 1,
|
||||
FENCESTRUCT23 - FENCESTRUCT1 + 1,
|
||||
FENCESHADOW23 - FENCESHADOW1 + 1,
|
||||
FIRSTVEHICLE12 - FIRSTVEHICLE1 + 1,
|
||||
SECONDVEHICLE12 - SECONDVEHICLE1 + 1,
|
||||
FIRSTVEHICLESHADOW12 - FIRSTVEHICLESHADOW1 + 1,
|
||||
SECONDVEHICLESHADOW12 - SECONDVEHICLESHADOW1 + 1,
|
||||
DEBRIS2MISC10 - DEBRIS2MISC1 + 1,
|
||||
DEBRIS2MISC10 - DEBRIS2MISC1 + 1,
|
||||
|
||||
FIRSTDEBRISSTRUCT10 - FIRSTDEBRISSTRUCT1 + 1,
|
||||
SECONDDEBRISSTRUCT10 - SECONDDEBRISSTRUCT1 + 1,
|
||||
@@ -540,10 +540,10 @@ UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ] =
|
||||
FIRSTHIGHROOF15 - FIRSTHIGHROOF1 + 1,
|
||||
SECONDHIGHROOF15 - SECONDHIGHROOF1 + 1,
|
||||
|
||||
FIFTHWALLDECAL10 - FIFTHWALLDECAL1 + 1,
|
||||
SIXTHWALLDECAL10 - SIXTHWALLDECAL1 + 1,
|
||||
FIFTHWALLDECAL10 - FIFTHWALLDECAL1 + 1,
|
||||
SIXTHWALLDECAL10 - SIXTHWALLDECAL1 + 1,
|
||||
SEVENTHWALLDECAL10 - SEVENTHWALLDECAL1 + 1,
|
||||
EIGTHWALLDECAL10 - EIGTHWALLDECAL1 + 1,
|
||||
EIGTHWALLDECAL10 - EIGTHWALLDECAL1 + 1,
|
||||
|
||||
HUMANBLOOD16 - HUMANBLOOD1 + 1,
|
||||
CREATUREBLOOD16 - CREATUREBLOOD1 + 1,
|
||||
@@ -554,39 +554,39 @@ UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ] =
|
||||
FIRSTREVEALEDHIGHROOFS11 - FIRSTREVEALEDHIGHROOFS1 + 1,
|
||||
SECONDREVEALEDHIGHROOFS11 - SECONDREVEALEDHIGHROOFS1 + 1,
|
||||
|
||||
GUN5000 - GUN1 + 1,
|
||||
P1ITEM5000 - P1ITEM1 + 1,
|
||||
P2ITEM5000 - P2ITEM1 + 1,
|
||||
GUN5000 - GUN1 + 1,
|
||||
P1ITEM5000 - P1ITEM1 + 1,
|
||||
P2ITEM5000 - P2ITEM1 + 1,
|
||||
|
||||
WINDOWSHATTER20 - WINDOWSHATTER1 + 1,
|
||||
P3ITEM5000 - P3ITEM1 + 1,
|
||||
BODYEXPLOSION15 - BODYEXPLOSION1 + 1,
|
||||
WINDOWSHATTER20 - WINDOWSHATTER1 + 1,
|
||||
P3ITEM5000 - P3ITEM1 + 1,
|
||||
BODYEXPLOSION15 - BODYEXPLOSION1 + 1,
|
||||
|
||||
EXITTEXTURE35 - EXITTEXTURE1 + 1,
|
||||
FOOTPRINTS80 - FOOTPRINTS1 + 1,
|
||||
EXITTEXTURE35 - EXITTEXTURE1 + 1,
|
||||
FOOTPRINTS80 - FOOTPRINTS1 + 1,
|
||||
|
||||
FIRSTPOINTERS24 - FIRSTPOINTERS1 + 1,
|
||||
SECONDPOINTERS8 - SECONDPOINTERS1 + 1,
|
||||
THIRDPOINTERS3 - THIRDPOINTERS1 + 1,
|
||||
FIRSTPOINTERS24 - FIRSTPOINTERS1 + 1,
|
||||
SECONDPOINTERS8 - SECONDPOINTERS1 + 1,
|
||||
THIRDPOINTERS3 - THIRDPOINTERS1 + 1,
|
||||
|
||||
GOODRUN11 - GOODRUN1 + 1,
|
||||
GOODWALK11 - GOODWALK1 + 1,
|
||||
GOODSWAT11 - GOODSWAT1 + 1,
|
||||
GOODPRONE11 - GOODPRONE1 + 1,
|
||||
CONFIRMMOVE11 - CONFIRMMOVE1 + 1,
|
||||
VEHICLEMOVE10 - VEHICLEMOVE1 + 1,
|
||||
ACTIONTWO11 - ACTIONTWO1 + 1,
|
||||
BADMARKER11 - BADMARKER1 + 1,
|
||||
GOODRING10 - GOODRING1 + 1,
|
||||
ROTATINGKEY8 - ROTATINGKEY1 + 1,
|
||||
SELRING10 - SELRING1 + 1,
|
||||
SPECIALTILE_COVER_5 - SPECIALTILE_MAPEXIT + 1,
|
||||
BULLETTILE2 - BULLETTILE1 + 1,
|
||||
GOODRUN11 - GOODRUN1 + 1,
|
||||
GOODWALK11 - GOODWALK1 + 1,
|
||||
GOODSWAT11 - GOODSWAT1 + 1,
|
||||
GOODPRONE11 - GOODPRONE1 + 1,
|
||||
CONFIRMMOVE11 - CONFIRMMOVE1 + 1,
|
||||
VEHICLEMOVE10 - VEHICLEMOVE1 + 1,
|
||||
ACTIONTWO11 - ACTIONTWO1 + 1,
|
||||
BADMARKER11 - BADMARKER1 + 1,
|
||||
GOODRING10 - GOODRING1 + 1,
|
||||
ROTATINGKEY8 - ROTATINGKEY1 + 1,
|
||||
SELRING10 - SELRING1 + 1,
|
||||
SPECIALTILE_COVER_5 - SPECIALTILE_MAPEXIT + 1,
|
||||
BULLETTILE2 - BULLETTILE1 + 1,
|
||||
|
||||
FIRSTMISS5 - FIRSTMISS1 + 1,
|
||||
SECONDMISS5 - SECONDMISS1 + 1,
|
||||
THIRDMISS14 - THIRDMISS1 + 1,
|
||||
WIREFRAMES15 - WIREFRAMES1 + 1
|
||||
FIRSTMISS5 - FIRSTMISS1 + 1,
|
||||
SECONDMISS5 - SECONDMISS1 + 1,
|
||||
THIRDMISS14 - THIRDMISS1 + 1,
|
||||
WIREFRAMES15 - WIREFRAMES1 + 1
|
||||
};
|
||||
|
||||
UINT8 gTileTypeLogicalHeight[ NUMBEROFTILETYPES ] =
|
||||
@@ -639,10 +639,10 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
cnt+=3;
|
||||
};
|
||||
|
||||
|
||||
|
||||
if ( uiDatabaseElem >= FIRSTDOOR1 &&
|
||||
uiDatabaseElem <= FOURTHDOORSH20 )
|
||||
|
||||
if ( uiDatabaseElem >= FIRSTDOOR1 &&
|
||||
uiDatabaseElem <= FOURTHDOORSH20 )
|
||||
{
|
||||
// Door anims
|
||||
// Open
|
||||
@@ -720,7 +720,7 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
};
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem == FIRSTMISS1 )
|
||||
if ( uiDatabaseElem == FIRSTMISS1 )
|
||||
{
|
||||
// Allocate Animated tile data
|
||||
AllocateAnimTileData( TileElement, 5 );
|
||||
@@ -732,14 +732,14 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
}
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem >= FIRSTMISS1 &&
|
||||
uiDatabaseElem <= FIRSTMISS5 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTMISS1 &&
|
||||
uiDatabaseElem <= FIRSTMISS5 )
|
||||
{
|
||||
TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
}
|
||||
|
||||
|
||||
if ( uiDatabaseElem == WINDOWSHATTER1 || uiDatabaseElem == WINDOWSHATTER6 || uiDatabaseElem == WINDOWSHATTER11 || uiDatabaseElem == WINDOWSHATTER16 )
|
||||
if ( uiDatabaseElem == WINDOWSHATTER1 || uiDatabaseElem == WINDOWSHATTER6 || uiDatabaseElem == WINDOWSHATTER11 || uiDatabaseElem == WINDOWSHATTER16 )
|
||||
{
|
||||
// Allocate Animated tile data
|
||||
AllocateAnimTileData( TileElement, 5 );
|
||||
@@ -751,19 +751,19 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
}
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem >= WINDOWSHATTER1 &&
|
||||
uiDatabaseElem <= WINDOWSHATTER20 )
|
||||
{
|
||||
if ( uiDatabaseElem >= WINDOWSHATTER1 &&
|
||||
uiDatabaseElem <= WINDOWSHATTER20 )
|
||||
{
|
||||
TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
}
|
||||
|
||||
// if ( usType == FIRSTEXPLOSION )
|
||||
// {
|
||||
// {
|
||||
// TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
// }
|
||||
|
||||
if ( usType == BODYEXPLOSION )
|
||||
{
|
||||
{
|
||||
TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
}
|
||||
|
||||
@@ -774,22 +774,22 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
|
||||
// SET FLAGS FOR OBJECTS PEICES WHICH USE PROPER Z
|
||||
if ( fUseRaisedObjectType )
|
||||
{
|
||||
{
|
||||
TileElement->uiFlags |= OBJECTLAYER_USEZHEIGHT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// OFFSET SLANTED ROOFS TO HEIGHT OF WALLS
|
||||
if ( uiDatabaseElem >= FIRSTROOF1 &&
|
||||
uiDatabaseElem <= SECONDSLANTROOF20 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTROOF1 &&
|
||||
uiDatabaseElem <= SECONDSLANTROOF20 )
|
||||
{
|
||||
//TileElement->sOffsetHeight = WALL_HEIGHT;
|
||||
}
|
||||
|
||||
// Set flag for full 3d tiles, as well as the dynamic flag for the folliage
|
||||
if ( uiDatabaseElem >= FIRSTFULLSTRUCT1 &&
|
||||
uiDatabaseElem <= SECONDFULLSTRUCT12 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTFULLSTRUCT1 &&
|
||||
uiDatabaseElem <= SECONDFULLSTRUCT12 )
|
||||
{
|
||||
//TileElement->uiFlags |= FULL3D_TILE;
|
||||
sIndexDiff = uiDatabaseElem - gTileTypeStartIndex[ usType ];
|
||||
|
||||
@@ -808,9 +808,9 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
}
|
||||
|
||||
//Ignore height for cliffs ie: if we rasie the land, do not offset the cliff
|
||||
if ( uiDatabaseElem >= FIRSTCLIFFHANG1 &&
|
||||
uiDatabaseElem <= FIRSTCLIFFSHADOW17 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTCLIFFHANG1 &&
|
||||
uiDatabaseElem <= FIRSTCLIFFSHADOW17 )
|
||||
{
|
||||
if ( usType == FIRSTCLIFFHANG )
|
||||
{
|
||||
TileElement->uiFlags |= CLIFFHANG_TILE;
|
||||
@@ -819,20 +819,20 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem >= FIRSTWALL1 &&
|
||||
uiDatabaseElem <= FOURTHWALL65 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTWALL1 &&
|
||||
uiDatabaseElem <= FOURTHWALL65 )
|
||||
{
|
||||
TileElement->uiFlags |= WALL_TILE;
|
||||
}
|
||||
|
||||
// Set a-frames heigher!
|
||||
if ( uiDatabaseElem >= FIRSTWALL1 &&
|
||||
uiDatabaseElem <= FOURTHWALL47 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTWALL1 &&
|
||||
uiDatabaseElem <= FOURTHWALL47 )
|
||||
{
|
||||
|
||||
// Set these ones higher ( for roof pieces )
|
||||
if ( uiDatabaseElem >= ( gTileTypeStartIndex[ usType ] + WALL_AFRAME_START ) &&
|
||||
uiDatabaseElem <= ( gTileTypeStartIndex[ usType ] + WALL_AFRAME_END ) )
|
||||
if ( uiDatabaseElem >= ( gTileTypeStartIndex[ usType ] + WALL_AFRAME_START ) &&
|
||||
uiDatabaseElem <= ( gTileTypeStartIndex[ usType ] + WALL_AFRAME_END ) )
|
||||
{
|
||||
//TileElement->sOffsetHeight = WALL_HEIGHT;
|
||||
TileElement->uiFlags |= AFRAME_TILE;
|
||||
@@ -842,32 +842,32 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
}
|
||||
|
||||
// Set UI Elements to be dynamic
|
||||
if ( uiDatabaseElem >= FOOTPRINTS1 &&
|
||||
uiDatabaseElem <= THIRDPOINTERS2 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FOOTPRINTS1 &&
|
||||
uiDatabaseElem <= THIRDPOINTERS2 )
|
||||
{
|
||||
TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
TileElement->uiFlags |= OBJECTLAYER_USEZHEIGHT;
|
||||
}
|
||||
|
||||
// Set UI Elements to use object z level
|
||||
if ( usType >= FOOTPRINTS &&
|
||||
usType <= LASTUIELEM )
|
||||
{
|
||||
if ( usType >= FOOTPRINTS &&
|
||||
usType <= LASTUIELEM )
|
||||
{
|
||||
TileElement->uiFlags |= OBJECTLAYER_USEZHEIGHT;
|
||||
}
|
||||
|
||||
// Set UI Elements to use object z level
|
||||
if ( usType >= HUMANBLOOD &&
|
||||
usType <= CREATUREBLOOD )
|
||||
{
|
||||
if ( usType >= HUMANBLOOD &&
|
||||
usType <= CREATUREBLOOD )
|
||||
{
|
||||
TileElement->uiFlags |= OBJECTLAYER_USEZHEIGHT;
|
||||
}
|
||||
|
||||
|
||||
// Set UI Elements to use object z level
|
||||
if ( usType >= GUNS &&
|
||||
usType <= P2ITEMS )
|
||||
{
|
||||
if ( usType >= GUNS &&
|
||||
usType <= P2ITEMS )
|
||||
{
|
||||
TileElement->uiFlags |= OBJECTLAYER_USEZHEIGHT;
|
||||
}
|
||||
if ( usType == P3ITEMS )
|
||||
@@ -880,39 +880,39 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
TileElement->uiFlags |= OBJECTLAYER_USEZHEIGHT;
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem >= FIRSTDOOR1 &&
|
||||
uiDatabaseElem <= FOURTHDOORSH20 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTDOOR1 &&
|
||||
uiDatabaseElem <= FOURTHDOORSH20 )
|
||||
{
|
||||
//TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
}
|
||||
|
||||
// Set UI Elements to be dynamic
|
||||
if ( uiDatabaseElem == MOCKFLOOR1 )
|
||||
{
|
||||
if ( uiDatabaseElem == MOCKFLOOR1 )
|
||||
{
|
||||
TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( usType == BULLETTILE )
|
||||
{
|
||||
if ( usType == BULLETTILE )
|
||||
{
|
||||
TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
}
|
||||
|
||||
if ( usType == WIREFRAMES )
|
||||
{
|
||||
if ( usType == WIREFRAMES )
|
||||
{
|
||||
//TileElement->uiFlags |= DYNAMIC_TILE;
|
||||
}
|
||||
|
||||
// Set full tile flag for floors
|
||||
if ( uiDatabaseElem >= FIRSTFLOOR1 &&
|
||||
uiDatabaseElem <= FOURTHFLOOR8 )
|
||||
{
|
||||
if ( uiDatabaseElem >= FIRSTFLOOR1 &&
|
||||
uiDatabaseElem <= FOURTHFLOOR8 )
|
||||
{
|
||||
TileElement->ubFullTile = 1;
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem >= FIRSTTEXTURE1 &&
|
||||
uiDatabaseElem <= DEEPWATERTEXTURE10 )
|
||||
uiDatabaseElem <= DEEPWATERTEXTURE10 )
|
||||
{
|
||||
// Set tile 'fullness' attribute
|
||||
TileElement->ubFullTile = gFullBaseTileValues[ uiDatabaseElem ];
|
||||
@@ -925,7 +925,7 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
}
|
||||
|
||||
if ( uiDatabaseElem >= REGWATERTEXTURE18 && uiDatabaseElem <= REGWATERTEXTURE50 || uiDatabaseElem == REGWATERTEXTURE ||
|
||||
uiDatabaseElem == REGWATERTEXTURE12 || uiDatabaseElem == REGWATERTEXTURE14 || uiDatabaseElem == REGWATERTEXTURE16 )
|
||||
uiDatabaseElem == REGWATERTEXTURE12 || uiDatabaseElem == REGWATERTEXTURE14 || uiDatabaseElem == REGWATERTEXTURE16 )
|
||||
{
|
||||
TileElement->ubTerrainID = FLAT_GROUND;
|
||||
}
|
||||
@@ -936,3 +936,4 @@ void SetSpecificDatabaseValues( UINT16 usType, UINT16 uiDatabaseElem, TILE_ELEME
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3225,7 +3225,7 @@ enum TileTypeDefines
|
||||
// Quick defines for finding last type entry in tile types
|
||||
#define LASTTEXTURE (DEEPWATERTEXTURE - 1)
|
||||
#define LASTBANKS (FIRSTCLIFFSHADOW - 1)
|
||||
#define LASTCLIFFHANG (FIRSTCLIFF-1)
|
||||
#define LASTCLIFFHANG (FIRSTCLIFF-1)
|
||||
#define LASTCLIFFSHADOW (FIRSTOSTRUCT - 1)
|
||||
#define LASTOSTRUCT (THIRDFULLSTRUCT - 1)
|
||||
#define LASTSHADOW (FIRSTWALL - 1)
|
||||
@@ -3245,7 +3245,7 @@ enum TileTypeDefines
|
||||
//#define LASTDEBRIS (FOOTPRINTS - 1)
|
||||
#define LASTFOOTPRINTS (FIRSTPOINTERS - 1)
|
||||
#define LASTPOINTERS (SELRING - 1)
|
||||
#define LASTUIELEM (WIREFRAMES - 1) // Change this entry if adding new types to the end
|
||||
#define LASTUIELEM (WIREFRAMES - 1) // Change this entry if adding new types to the end
|
||||
#define LASTTIELSETELEM (GUNS - 1)
|
||||
|
||||
//===========================================================================
|
||||
@@ -3253,10 +3253,10 @@ enum TileTypeDefines
|
||||
// DEFINES FOR SPECIFIC SPECIAL TILE SLOTS
|
||||
#define WALL_AFRAME_START 31
|
||||
#define WALL_AFRAME_END 34
|
||||
#define WALL_AFRAME1 31
|
||||
#define WALL_AFRAME2 32
|
||||
#define WALL_AFRAME3 33
|
||||
#define WALL_AFRAME4 34
|
||||
#define WALL_AFRAME1 31
|
||||
#define WALL_AFRAME2 32
|
||||
#define WALL_AFRAME3 33
|
||||
#define WALL_AFRAME4 34
|
||||
|
||||
|
||||
extern INT16 gOpenDoorList[20];
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
#include "math.h"
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include "input.h"
|
||||
#include "input.h"
|
||||
#include "video.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "edit_sys.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="TileEngine_2005Express"
|
||||
ProjectGUID="{FC1938E8-9253-49A8-AA99-4639BBB46C1B}"
|
||||
RootNamespace="TileEngine_2005Express"
|
||||
@@ -39,7 +39,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE"
"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
@@ -103,7 +103,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
@@ -139,6 +138,69 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MapEditor|Win32"
|
||||
OutputDirectory="MapEditor"
|
||||
IntermediateDirectory="MapEditor"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_2005Express.vsprops;..\ja2_2005ExpressEditor.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4100"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
@@ -224,6 +286,10 @@
|
||||
RelativePath=".\Render Fun.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Render Z.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\renderworld.h"
|
||||
>
|
||||
@@ -382,6 +448,10 @@
|
||||
RelativePath=".\Render Fun.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Render Z.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\renderworld.cpp"
|
||||
>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
enum
|
||||
{
|
||||
TLS_GENERIC_1, // 0, JA2 default
|
||||
TLS_GENERIC_1, // 0, JA2 default
|
||||
TLS_CAVES_1,
|
||||
TLS_DESERT_1,
|
||||
TLS_LUSH_1,
|
||||
@@ -17,7 +17,7 @@ enum
|
||||
TLS_FARM_1,
|
||||
TLS_OMERTA,
|
||||
|
||||
TLS_GENERIC_2, // 10
|
||||
TLS_GENERIC_2, // 10
|
||||
TLS_FARM_2,
|
||||
TLS_PRISON,
|
||||
TLS_HOSPITAL,
|
||||
@@ -28,7 +28,7 @@ enum
|
||||
TLS_LAWLESS_2,
|
||||
TLS_DEAD_AIRSTRIP,
|
||||
|
||||
TLS_BASEMENT, // 20
|
||||
TLS_BASEMENT, // 20
|
||||
TLS_LAWLESS_3,
|
||||
TLS_PRISON_DUNGEON,
|
||||
TLS_ACTIVE_DRASSEN,
|
||||
@@ -39,7 +39,7 @@ enum
|
||||
TLS_MILITARY_WAREHOUSE,
|
||||
TLS_MILITARY_TOWN,
|
||||
|
||||
TLS_OLD_SCHOOL, // 30
|
||||
TLS_OLD_SCHOOL, // 30
|
||||
TLS_CAMBRIA_STRIP,
|
||||
TLS_CAMBRIA_HOMES,
|
||||
TLS_PALACE,
|
||||
@@ -50,7 +50,7 @@ enum
|
||||
TLS_BALIME_MUSEUM,
|
||||
TLS_DESERT_SAM,
|
||||
|
||||
TLS_ORTA, // 40
|
||||
TLS_ORTA, // 40
|
||||
TLS_ORTA_WEAPONS,
|
||||
TLS_SWAMP_BARETREES,
|
||||
TLS_ESTONI,
|
||||
@@ -61,7 +61,7 @@ enum
|
||||
TLS_QUEENS_AIRPORT,
|
||||
TLS_DEMO_TILESET,
|
||||
|
||||
TLS_HEAVY_SNOW, // 50, JA2.5 default
|
||||
TLS_HEAVY_SNOW, // 50, JA2.5 default
|
||||
TLS_MIXED_SNOW,
|
||||
TLS_GRASS_SNOW,
|
||||
TLS_FALL_TOWN,
|
||||
@@ -72,7 +72,7 @@ enum
|
||||
TLS_UPPER_COMPLEX,
|
||||
TLS_LOWEST_LEVEL_COMPLEX,
|
||||
|
||||
TILESET_60, // 60
|
||||
TILESET_60, // 60
|
||||
TILESET_61,
|
||||
TILESET_62,
|
||||
TILESET_63,
|
||||
@@ -83,7 +83,7 @@ enum
|
||||
TILESET_68,
|
||||
TILESET_69,
|
||||
|
||||
NUM_TILESETS // 70
|
||||
NUM_TILESETS // 70
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -24,7 +24,7 @@ void SetTilesetFourTerrainValues();
|
||||
// where it is read from JA2SET.DAT header.
|
||||
UINT8 gubNumSets = MAX_TILESETS;
|
||||
|
||||
TILESET gTilesets[ MAX_TILESETS ];
|
||||
TILESET gTilesets[ MAX_TILESETS ];
|
||||
|
||||
|
||||
void InitEngineTilesets( )
|
||||
@@ -38,13 +38,13 @@ void InitEngineTilesets( )
|
||||
//OPEN FILE
|
||||
// hfile = fopen( "BINARYDATA\\JA2SET.DAT", "rb" );
|
||||
hfile = FileOpen( "BINARYDATA\\JA2SET.DAT", FILE_ACCESS_READ, FALSE );
|
||||
if ( !hfile )
|
||||
if ( !hfile )
|
||||
{
|
||||
SET_ERROR( "Cannot open tileset data file" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// READ # TILESETS and compare
|
||||
// fread( &gubNumSets, sizeof( gubNumSets ), 1, hfile );
|
||||
FileRead( hfile, &gubNumSets, sizeof( gubNumSets ), &uiNumBytesRead );
|
||||
@@ -80,7 +80,7 @@ void InitEngineTilesets( )
|
||||
// fread( &(gTilesets[ cnt ].ubAmbientID), sizeof( UINT8), 1, hfile );
|
||||
FileRead( hfile, &(gTilesets[ cnt ].ubAmbientID), sizeof( UINT8 ), &uiNumBytesRead );
|
||||
|
||||
// Set into tileset
|
||||
// Set into tileset
|
||||
swprintf( gTilesets[ cnt ].zName, L"%S", zName );
|
||||
|
||||
// Loop for files
|
||||
|
||||
@@ -20,9 +20,9 @@ typedef struct
|
||||
// Snap: The maximum number of tilesets allowed is max of UINT8
|
||||
#define MAX_TILESETS 255
|
||||
|
||||
extern UINT8 gubNumSets; // from WorldDat.cpp
|
||||
extern UINT8 gubNumSets; // from WorldDat.cpp
|
||||
|
||||
extern TILESET gTilesets[ MAX_TILESETS ];
|
||||
extern TILESET gTilesets[ MAX_TILESETS ];
|
||||
|
||||
|
||||
void InitEngineTilesets( );
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "explosion control.h"
|
||||
#include "explosion control.h"
|
||||
#include "TopicIDs.h"
|
||||
#include "TopicOps.h"
|
||||
#include "Debug.h"
|
||||
@@ -23,7 +23,7 @@ struct
|
||||
|
||||
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||
|
||||
EXPLOSION_DATA expData;
|
||||
EXPLOSION_DATA expData;
|
||||
INT32 maxArraySize;
|
||||
INT32 curIndex;
|
||||
INT32 currentDepth;
|
||||
@@ -31,7 +31,7 @@ struct
|
||||
}
|
||||
typedef explosionDataParseData;
|
||||
|
||||
static void XMLCALL
|
||||
static void XMLCALL
|
||||
explosionDataStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
||||
{
|
||||
explosionDataParseData * pData = (explosionDataParseData *)userData;
|
||||
@@ -50,7 +50,7 @@ explosionDataStartElementHandle(void *userData, const XML_Char *name, const XML_
|
||||
|
||||
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3,"MergeStartElementHandle: setting memory for curMerge");
|
||||
|
||||
memset(&(pData->expData),0,sizeof(EXPLOSION_DATA));
|
||||
memset(&(pData->expData),0,sizeof(EXPLOSION_DATA));
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
pData->curIndex++;
|
||||
@@ -59,8 +59,8 @@ explosionDataStartElementHandle(void *userData, const XML_Char *name, const XML_
|
||||
(strcmp(name, "TransKeyFrame") == 0 ||
|
||||
strcmp(name, "DamageKeyFrame") == 0 ||
|
||||
strcmp(name, "ExplosionSoundID") == 0 ||
|
||||
strcmp(name, "AltExplosionSoundID") == 0 ||
|
||||
strcmp(name, "BlastFilename") == 0 ||
|
||||
strcmp(name, "AltExplosionSoundID") == 0 ||
|
||||
strcmp(name, "BlastFilename") == 0 ||
|
||||
strcmp(name, "BlastSpeed") == 0 ))
|
||||
{
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
@@ -80,9 +80,9 @@ explosionDataCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
||||
{
|
||||
explosionDataParseData * pData = (explosionDataParseData *)userData;
|
||||
|
||||
if( (pData->currentDepth <= pData->maxReadDepth) &&
|
||||
if( (pData->currentDepth <= pData->maxReadDepth) &&
|
||||
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
|
||||
){
|
||||
){
|
||||
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
|
||||
}
|
||||
}
|
||||
@@ -105,41 +105,41 @@ explosionDataEndElementHandle(void *userData, const XML_Char *name)
|
||||
|
||||
if(pData->curIndex < pData->maxArraySize)
|
||||
{
|
||||
memcpy( &(gExpAniData[pData->curIndex]), &(pData->expData), sizeof(EXPLOSION_DATA) );
|
||||
memcpy( &(gExpAniData[pData->curIndex]), &(pData->expData), sizeof(EXPLOSION_DATA) );
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "TransKeyFrame") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->expData.ubTransKeyFrame = (UINT8) atol(pData->szCharData);
|
||||
pData->expData.ubTransKeyFrame = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "DamageKeyFrame") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->expData.ubDamageKeyFrame = (UINT8) atol(pData->szCharData);
|
||||
pData->expData.ubDamageKeyFrame = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "ExplosionSoundID") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->expData.uiExplosionSoundID = (UINT32) atol(pData->szCharData);
|
||||
pData->expData.uiExplosionSoundID = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "AltExplosionSoundID") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->expData.uiAltExplosionSoundID = (UINT32) atol(pData->szCharData);
|
||||
pData->expData.uiAltExplosionSoundID = (UINT32) atol(pData->szCharData);
|
||||
}
|
||||
else if(strcmp(name, "BlastFilename") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
// Lesh: maybe it is needed to check lenght of the pData->szCharData string
|
||||
// and warn user, otherwise game behavior is unexpected when trying to
|
||||
// play animation from clipped filename (runtime error, crash ???)
|
||||
strncpy(pData->expData.zBlastFilename, pData->szCharData, MAX_BLAST_FILENAME_LEN);
|
||||
// Lesh: maybe it is needed to check lenght of the pData->szCharData string
|
||||
// and warn user, otherwise game behavior is unexpected when trying to
|
||||
// play animation from clipped filename (runtime error, crash ???)
|
||||
strncpy(pData->expData.zBlastFilename, pData->szCharData, MAX_BLAST_FILENAME_LEN);
|
||||
}
|
||||
else if(strcmp(name, "BlastSpeed") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->expData.sBlastSpeed = (UINT8) atol(pData->szCharData);
|
||||
pData->expData.sBlastSpeed = (UINT8) atol(pData->szCharData);
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
@@ -158,7 +158,7 @@ BOOLEAN ReadInExplosionDataStats(STR fileName)
|
||||
UINT32 uiFSize;
|
||||
CHAR8 * lpcBuffer;
|
||||
XML_Parser parser = XML_ParserCreate(NULL);
|
||||
|
||||
|
||||
explosionDataParseData pData;
|
||||
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading ExplosionData.xml" );
|
||||
@@ -167,7 +167,7 @@ BOOLEAN ReadInExplosionDataStats(STR fileName)
|
||||
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
|
||||
|
||||
uiFSize = FileGetSize(hFile);
|
||||
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
|
||||
|
||||
@@ -182,19 +182,19 @@ BOOLEAN ReadInExplosionDataStats(STR fileName)
|
||||
|
||||
FileClose( hFile );
|
||||
|
||||
|
||||
|
||||
XML_SetElementHandler(parser, explosionDataStartElementHandle, explosionDataEndElementHandle);
|
||||
XML_SetCharacterDataHandler(parser, explosionDataCharacterDataHandle);
|
||||
|
||||
|
||||
|
||||
memset(&pData,0,sizeof(pData));
|
||||
pData.maxArraySize = NUM_EXP_TYPES;
|
||||
pData.maxArraySize = NUM_EXP_TYPES;
|
||||
pData.curIndex = -1;
|
||||
|
||||
|
||||
XML_SetUserData(parser, &pData);
|
||||
|
||||
|
||||
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||
{
|
||||
CHAR8 errorBuf[511];
|
||||
|
||||
@@ -221,21 +221,21 @@ BOOLEAN WriteExplosionDataStats()
|
||||
hFile = FileOpen( "TABLEDATA\\ExplosionData out.xml", FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
|
||||
if ( !hFile )
|
||||
return( FALSE );
|
||||
|
||||
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
FilePrintf(hFile,"<EXPDATALIST>\r\n");
|
||||
for(cnt = 0;cnt < NUM_EXP_TYPES;cnt++)
|
||||
for(cnt = 0;cnt < NUM_EXP_TYPES;cnt++)
|
||||
{
|
||||
FilePrintf(hFile,"\t<EXPDATA>\r\n");
|
||||
|
||||
FilePrintf(hFile,"\t\t<TransKeyFrame>%d</TransKeyFrame>\r\n", gExpAniData[cnt].ubTransKeyFrame);
|
||||
FilePrintf(hFile,"\t\t<DamageKeyFrame>%d</DamageKeyFrame>\r\n", gExpAniData[cnt].ubDamageKeyFrame);
|
||||
FilePrintf(hFile,"\t\t<ExplosionSoundID>%d</ExplosionSoundID>\r\n", gExpAniData[cnt].uiExplosionSoundID);
|
||||
FilePrintf(hFile,"\t\t<AltExplosionSoundID>%d</AltExplosionSoundID>\r\n", gExpAniData[cnt].uiAltExplosionSoundID);
|
||||
FilePrintf(hFile,"\t\t<BlastFilename>%s</BlastFilename>\r\n", gExpAniData[cnt].zBlastFilename);
|
||||
FilePrintf(hFile,"\t\t<BlastSpeed>%d</BlastSpeed>\r\n", gExpAniData[cnt].sBlastSpeed);
|
||||
FilePrintf(hFile,"\t\t<TransKeyFrame>%d</TransKeyFrame>\r\n", gExpAniData[cnt].ubTransKeyFrame);
|
||||
FilePrintf(hFile,"\t\t<DamageKeyFrame>%d</DamageKeyFrame>\r\n", gExpAniData[cnt].ubDamageKeyFrame);
|
||||
FilePrintf(hFile,"\t\t<ExplosionSoundID>%d</ExplosionSoundID>\r\n", gExpAniData[cnt].uiExplosionSoundID);
|
||||
FilePrintf(hFile,"\t\t<AltExplosionSoundID>%d</AltExplosionSoundID>\r\n", gExpAniData[cnt].uiAltExplosionSoundID);
|
||||
FilePrintf(hFile,"\t\t<BlastFilename>%s</BlastFilename>\r\n", gExpAniData[cnt].zBlastFilename);
|
||||
FilePrintf(hFile,"\t\t<BlastSpeed>%d</BlastSpeed>\r\n", gExpAniData[cnt].sBlastSpeed);
|
||||
|
||||
FilePrintf(hFile,"\t</EXPDATA>\r\n");
|
||||
}
|
||||
@@ -244,4 +244,4 @@ BOOLEAN WriteExplosionDataStats()
|
||||
FileClose( hFile );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
+172
-172
@@ -5,7 +5,7 @@
|
||||
#include "lighting.h"
|
||||
#include "environment.h"
|
||||
#include "renderworld.h"
|
||||
#include "sound control.h"
|
||||
#include "Sound Control.h"
|
||||
#include "overhead.h"
|
||||
#include "Game Clock.h"
|
||||
#include "quests.h"
|
||||
@@ -28,37 +28,37 @@
|
||||
|
||||
#include "Text.h"
|
||||
|
||||
//effects whether or not time of day effects the lighting. Underground
|
||||
//effects whether or not time of day effects the lighting. Underground
|
||||
//maps have an ambient light level that is saved in the map, and doesn't change.
|
||||
BOOLEAN gfBasement = FALSE;
|
||||
BOOLEAN gfCaves = FALSE;
|
||||
|
||||
|
||||
#define ENV_TOD_FLAGS_DAY 0x00000001
|
||||
#define ENV_TOD_FLAGS_DAWN 0x00000002
|
||||
#define ENV_TOD_FLAGS_DUSK 0x00000004
|
||||
#define ENV_TOD_FLAGS_NIGHT 0x00000008
|
||||
#define ENV_TOD_FLAGS_DAY 0x00000001
|
||||
#define ENV_TOD_FLAGS_DAWN 0x00000002
|
||||
#define ENV_TOD_FLAGS_DUSK 0x00000004
|
||||
#define ENV_TOD_FLAGS_NIGHT 0x00000008
|
||||
|
||||
/*
|
||||
#define DAWNLIGHT_START ( 5 * 60 )
|
||||
#define DAWN_START ( 6 * 60 )
|
||||
#define DAY_START ( 8 * 60 )
|
||||
#define DAY_START ( 8 * 60 )
|
||||
#define TWILLIGHT_START ( 19 * 60 )
|
||||
#define DUSK_START ( 20 * 60 )
|
||||
#define NIGHT_START ( 22 * 60 )
|
||||
#define NIGHT_START ( 22 * 60 )
|
||||
*/
|
||||
#define DAWN_START ( 6 * 60 + 47 ) //6:47AM
|
||||
#define DAY_START ( 7 * 60 + 5 ) //7:05AM
|
||||
#define DAY_START ( 7 * 60 + 5 ) //7:05AM
|
||||
#define DUSK_START ( 20 * 60 + 57 ) //8:57PM
|
||||
#define NIGHT_START ( 21 * 60 + 15 ) //9:15PM
|
||||
#define NIGHT_START ( 21 * 60 + 15 ) //9:15PM
|
||||
|
||||
#define DAWN_TO_DAY (DAY_START-DAWN_START)
|
||||
#define DAY_TO_DUSK (DUSK_START-DAY_START)
|
||||
#define DUSK_TO_NIGHT (NIGHT_START-DUSK_START)
|
||||
#define NIGHT_TO_DAWN (24*60-NIGHT_START+DAWN_START)
|
||||
|
||||
UINT32 guiEnvWeather = 0;
|
||||
UINT32 guiRainLoop = NO_SAMPLE;
|
||||
UINT32 guiEnvWeather = 0;
|
||||
UINT32 guiRainLoop = NO_SAMPLE;
|
||||
|
||||
|
||||
// frame cues for lightning
|
||||
@@ -84,7 +84,7 @@ UINT8 ubLightningTable[3][10][2]=
|
||||
{7, 6},
|
||||
{8, 0},
|
||||
{9, 0} },
|
||||
|
||||
|
||||
{ {0, 15},
|
||||
{1, 0},
|
||||
{2, 15},
|
||||
@@ -96,8 +96,8 @@ UINT8 ubLightningTable[3][10][2]=
|
||||
{8, 0},
|
||||
{9, 0} } };
|
||||
|
||||
// CJC: I don't think these are used anywhere!
|
||||
UINT8 guiTODFlags[ENV_NUM_TIMES] = {
|
||||
// CJC: I don't think these are used anywhere!
|
||||
UINT8 guiTODFlags[ENV_NUM_TIMES] = {
|
||||
ENV_TOD_FLAGS_NIGHT, // 00
|
||||
ENV_TOD_FLAGS_NIGHT, // 01
|
||||
ENV_TOD_FLAGS_NIGHT, // 02
|
||||
@@ -106,12 +106,12 @@ UINT8 guiTODFlags[ENV_NUM_TIMES] = {
|
||||
ENV_TOD_FLAGS_DAWN, // 05
|
||||
ENV_TOD_FLAGS_DAWN, // 06
|
||||
ENV_TOD_FLAGS_DAWN, // 07
|
||||
ENV_TOD_FLAGS_DAY, // 08
|
||||
ENV_TOD_FLAGS_DAY, // 09
|
||||
ENV_TOD_FLAGS_DAY, // 10
|
||||
ENV_TOD_FLAGS_DAY, // 11
|
||||
ENV_TOD_FLAGS_DAY, // 08
|
||||
ENV_TOD_FLAGS_DAY, // 09
|
||||
ENV_TOD_FLAGS_DAY, // 10
|
||||
ENV_TOD_FLAGS_DAY, // 11
|
||||
ENV_TOD_FLAGS_DAY, // 12
|
||||
ENV_TOD_FLAGS_DAY, // 13
|
||||
ENV_TOD_FLAGS_DAY, // 13
|
||||
ENV_TOD_FLAGS_DAY, // 14
|
||||
ENV_TOD_FLAGS_DAY, // 15
|
||||
ENV_TOD_FLAGS_DAY, // 16
|
||||
@@ -121,7 +121,7 @@ UINT8 guiTODFlags[ENV_NUM_TIMES] = {
|
||||
ENV_TOD_FLAGS_DUSK, // 20
|
||||
ENV_TOD_FLAGS_DUSK, // 21
|
||||
ENV_TOD_FLAGS_NIGHT, // 22
|
||||
ENV_TOD_FLAGS_NIGHT}; // 23
|
||||
ENV_TOD_FLAGS_NIGHT}; // 23
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -133,7 +133,7 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
TEMPERATURE_DESERT_COOL,
|
||||
TEMPERATURE_DESERT_WARM,
|
||||
TEMPERATURE_DESERT_WARM,
|
||||
TEMPERATURE_DESERT_HOT,
|
||||
TEMPERATURE_GLOBAL_COOL,
|
||||
TEMPERATURE_GLOBAL_WARM,
|
||||
@@ -156,7 +156,7 @@ BOOLEAN fTimeOfDayControls=TRUE;
|
||||
UINT32 guiEnvTime=0;
|
||||
UINT32 guiEnvDay=0;
|
||||
UINT8 gubEnvLightValue = 0;
|
||||
BOOLEAN gfDoLighting = FALSE;
|
||||
BOOLEAN gfDoLighting = FALSE;
|
||||
|
||||
UINT8 gubDesertTemperature = 0;
|
||||
UINT8 gubGlobalTemperature = 0;
|
||||
@@ -172,15 +172,15 @@ void EnvDoLightning(void);
|
||||
// polled by the game to handle time/atmosphere changes from gamescreen
|
||||
void EnvironmentController( BOOLEAN fCheckForLights )
|
||||
{
|
||||
UINT32 uiOldWorldHour;
|
||||
UINT8 ubLightAdjustFromWeather = 0;
|
||||
UINT32 uiOldWorldHour;
|
||||
UINT8 ubLightAdjustFromWeather = 0;
|
||||
|
||||
|
||||
// do none of this stuff in the basement or caves
|
||||
if( gfBasement || gfCaves )
|
||||
{
|
||||
guiEnvWeather &= (~WEATHER_FORECAST_THUNDERSHOWERS );
|
||||
guiEnvWeather &= (~WEATHER_FORECAST_SHOWERS );
|
||||
guiEnvWeather &= (~WEATHER_FORECAST_THUNDERSHOWERS );
|
||||
guiEnvWeather &= (~WEATHER_FORECAST_SHOWERS );
|
||||
|
||||
if (gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] == TRUE)
|
||||
{
|
||||
@@ -201,7 +201,7 @@ void EnvironmentController( BOOLEAN fCheckForLights )
|
||||
if ( uiOldWorldHour != guiEnvTime )
|
||||
{
|
||||
// Hour change....
|
||||
|
||||
|
||||
guiEnvTime=uiOldWorldHour;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ void EnvironmentController( BOOLEAN fCheckForLights )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BuildDayLightLevels()
|
||||
@@ -318,11 +318,11 @@ void BuildDayLightLevels()
|
||||
AddEveryDayStrategicEvent( EVENT_TEMPERATURE_UPDATE, GLOBAL_HOT_START, TEMPERATURE_GLOBAL_HOT );
|
||||
AddEveryDayStrategicEvent( EVENT_TEMPERATURE_UPDATE, GLOBAL_HOT_END, TEMPERATURE_GLOBAL_WARM );
|
||||
AddEveryDayStrategicEvent( EVENT_TEMPERATURE_UPDATE, GLOBAL_WARM_END, TEMPERATURE_GLOBAL_COOL );
|
||||
|
||||
|
||||
/*
|
||||
// Twilight; light 5
|
||||
AddEveryDayStrategicEvent( EVENT_CHANGELIGHTVAL, TWILLIGHT_START, NORMAL_LIGHTLEVEL_DAY + 1 );
|
||||
|
||||
|
||||
// Dusk; loop from light 5 up to 12
|
||||
for (uiLoop = 1; uiLoop < 8; uiLoop++)
|
||||
{
|
||||
@@ -393,7 +393,7 @@ void ForecastDayEvents( )
|
||||
{
|
||||
UINT32 uiOldDay;
|
||||
UINT32 uiStartTime, uiEndTime;
|
||||
UINT8 ubStormIntensity;
|
||||
UINT8 ubStormIntensity;
|
||||
// UINT32 cnt;
|
||||
|
||||
// Get current day and see if different
|
||||
@@ -409,22 +409,22 @@ void ForecastDayEvents( )
|
||||
BuildDayAmbientSounds( );
|
||||
|
||||
// Build weather....
|
||||
|
||||
|
||||
// ATE: Don't forecast if start of game...
|
||||
if ( guiEnvDay > 1 )
|
||||
{
|
||||
//rain
|
||||
//rain
|
||||
if ( Random( 100 ) < gGameExternalOptions.gusRainChancePerDay )
|
||||
{
|
||||
// Add rain!
|
||||
// Between 6:00 and 10:00
|
||||
uiStartTime = (UINT32)( Random( 1440 - 1 - gGameExternalOptions.gusRainMaxLength ) );
|
||||
uiStartTime = (UINT32)( Random( 1440 - 1 - gGameExternalOptions.gusRainMaxLength ) );
|
||||
// Between 5 - 15 miniutes
|
||||
uiEndTime = uiStartTime + ( gGameExternalOptions.gusRainMinLength + Random( gGameExternalOptions.gusRainMaxLength - gGameExternalOptions.gusRainMinLength ) );
|
||||
|
||||
ubStormIntensity = 0;
|
||||
|
||||
|
||||
|
||||
//Kaiden: making thunderstorms optional
|
||||
if (gGameExternalOptions.gfAllowLightning)
|
||||
{
|
||||
@@ -435,14 +435,14 @@ void ForecastDayEvents( )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( gGameExternalOptions.gfAllowRain ) AddSameDayRangedStrategicEvent( EVENT_RAINSTORM, uiStartTime, uiEndTime - uiStartTime, ubStormIntensity );
|
||||
|
||||
//AddSameDayStrategicEvent( EVENT_BEGINRAINSTORM, uiStartTime, ubStormIntensity );
|
||||
//AddSameDayStrategicEvent( EVENT_ENDRAINSTORM, uiEndTime, 0 );
|
||||
}
|
||||
//end rain
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// Should it rain...?
|
||||
@@ -461,15 +461,15 @@ void ForecastDayEvents( )
|
||||
{
|
||||
ubStormIntensity = 1;
|
||||
}
|
||||
|
||||
// ATE: Disable RAIN!
|
||||
|
||||
// ATE: Disable RAIN!
|
||||
// AddSameDayRangedStrategicEvent( EVENT_RAINSTORM, uiStartTime, uiEndTime - uiStartTime, ubStormIntensity );
|
||||
|
||||
//AddSameDayStrategicEvent( EVENT_BEGINRAINSTORM, uiStartTime, ubStormIntensity );
|
||||
//AddSameDayStrategicEvent( EVENT_ENDRAINSTORM, uiEndTime, 0 );
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -503,12 +503,12 @@ UINT32 guiChanceToDoLightningBetweenTurns = 20;
|
||||
|
||||
#define MAX_DELAYED_SOUNDS 10
|
||||
#define NO_DL_SOUND 0xFFFFFFFF
|
||||
|
||||
|
||||
// 1000 = 1 second
|
||||
#define MIN_DL_INTERVAL ( 1000 * guiMinDLInterval )
|
||||
#define MAX_DL_INTERVAL ( 1000 * guiMaxDLInterval )
|
||||
|
||||
#define EXTRA_ADD_VIS_DIST_IF_SEEN_SOMEONE ( 1000 * guiProlongLightningIfSeenSomeone )
|
||||
#define EXTRA_ADD_VIS_DIST_IF_SEEN_SOMEONE ( 1000 * guiProlongLightningIfSeenSomeone )
|
||||
#define CHANCE_TO_DO_LIGHTNING_BETWEEN_TURNS guiChanceToDoLightningBetweenTurns
|
||||
|
||||
BOOLEAN gfLightningInProgress = FALSE;
|
||||
@@ -522,7 +522,7 @@ BOOLEAN gfWasTurnBasedWhenLightningBegin = FALSE;
|
||||
|
||||
UINT8 gubLastTeamLightning;
|
||||
|
||||
#define IS_TURNBASED ( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT )
|
||||
#define IS_TURNBASED ( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT )
|
||||
|
||||
void BeginTeamTurn( UINT8 ubTeam );
|
||||
|
||||
@@ -531,25 +531,25 @@ void BeginTeamTurn( UINT8 ubTeam );
|
||||
|
||||
void EnvDoLightning(void)
|
||||
{
|
||||
static UINT32 uiCount=10, uiIndex=0, uiStrike=0, uiFrameNext=0;
|
||||
static UINT8 ubLevel=0, ubLastLevel=0;
|
||||
static UINT32 uiLastUpdate = 0xFFFFFFFF;
|
||||
static UINT32 uiTurnOffExtraVisDist = 0xFFFFFFFF;
|
||||
static UINT32 pDelayedSounds[ MAX_DELAYED_SOUNDS ];
|
||||
UINT32 uiDSIndex;
|
||||
static UINT32 uiCount=10, uiIndex=0, uiStrike=0, uiFrameNext=0;
|
||||
static UINT8 ubLevel=0, ubLastLevel=0;
|
||||
static UINT32 uiLastUpdate = 0xFFFFFFFF;
|
||||
static UINT32 uiTurnOffExtraVisDist = 0xFFFFFFFF;
|
||||
static UINT32 pDelayedSounds[ MAX_DELAYED_SOUNDS ];
|
||||
UINT32 uiDSIndex;
|
||||
|
||||
if( GetJA2Clock() < uiLastUpdate )
|
||||
{
|
||||
if( GetJA2Clock() < uiLastUpdate )
|
||||
{
|
||||
uiLastUpdate = 0;
|
||||
memset( pDelayedSounds, NO_DL_SOUND, sizeof( UINT32 ) * MAX_DELAYED_SOUNDS );
|
||||
}
|
||||
}
|
||||
|
||||
if( GetJA2Clock() < uiLastUpdate + 1000 / 60 )return;
|
||||
if( GetJA2Clock() < uiLastUpdate + 1000 / 60 )return;
|
||||
else
|
||||
uiLastUpdate = GetJA2Clock();
|
||||
|
||||
if( GetJA2Clock() > uiTurnOffExtraVisDist )
|
||||
{
|
||||
if( GetJA2Clock() > uiTurnOffExtraVisDist )
|
||||
{
|
||||
AllTeamsLookForAll( FALSE );
|
||||
uiTurnOffExtraVisDist = 0xFFFFFFFF;
|
||||
|
||||
@@ -559,26 +559,26 @@ void EnvDoLightning(void)
|
||||
gfTurnBasedLightningEnd = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for( uiDSIndex = 0; uiDSIndex < MAX_DELAYED_SOUNDS; ++uiDSIndex )
|
||||
if( GetJA2Clock() > pDelayedSounds[ uiDSIndex ] )
|
||||
{
|
||||
PlayJA2Ambient(LIGHTNING_1+Random(2), HIGHVOLUME, 1);
|
||||
pDelayedSounds[ uiDSIndex ] = NO_DL_SOUND;
|
||||
}
|
||||
for( uiDSIndex = 0; uiDSIndex < MAX_DELAYED_SOUNDS; ++uiDSIndex )
|
||||
if( GetJA2Clock() > pDelayedSounds[ uiDSIndex ] )
|
||||
{
|
||||
PlayJA2Ambient(LIGHTNING_1+Random(2), HIGHVOLUME, 1);
|
||||
pDelayedSounds[ uiDSIndex ] = NO_DL_SOUND;
|
||||
}
|
||||
|
||||
if ( gfPauseDueToPlayerGamePause )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( gfPauseDueToPlayerGamePause )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( IS_TURNBASED && !gfLightningInProgress )
|
||||
{
|
||||
if( IS_TURNBASED && !gfLightningInProgress )
|
||||
{
|
||||
if( !gfTurnBasedDoLightning )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gfTurnBasedDoLightning = FALSE;
|
||||
@@ -586,19 +586,19 @@ void EnvDoLightning(void)
|
||||
uiCount = 0;
|
||||
gfTurnBasedLightningEnd = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uiCount++;
|
||||
if(uiCount >= (uiFrameNext+10))
|
||||
{
|
||||
if( gfHaveSeenSomeone && gfWasTurnBasedWhenLightningBegin )
|
||||
if( gfHaveSeenSomeone && gfWasTurnBasedWhenLightningBegin )
|
||||
uiTurnOffExtraVisDist = GetJA2Clock() + EXTRA_ADD_VIS_DIST_IF_SEEN_SOMEONE;
|
||||
else
|
||||
uiTurnOffExtraVisDist = GetJA2Clock();
|
||||
|
||||
gfLightningInProgress = FALSE;
|
||||
gfHaveSeenSomeone = FALSE;
|
||||
|
||||
|
||||
uiCount=0;
|
||||
uiIndex=0;
|
||||
ubLevel=0;
|
||||
@@ -634,30 +634,30 @@ void EnvDoLightning(void)
|
||||
ubLastLevel=ubLevel;
|
||||
ubLevel=min( ubRealAmbientLightLevel - 1, ubLightningTable[uiStrike][uiIndex][1] );
|
||||
|
||||
/* // ATE: Don't modify if scrolling!
|
||||
if ( gfScrollPending || gfScrollInertia )
|
||||
{
|
||||
}
|
||||
else*/
|
||||
{
|
||||
if(ubLastLevel!=ubLevel)
|
||||
{
|
||||
if(ubLevel > ubLastLevel)
|
||||
{
|
||||
LightAddBaseLevel(0, (UINT8)(ubLevel-ubLastLevel));
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// LightSubtractBaseLevel(0, (UINT8)(ubLastLevel-ubLevel));
|
||||
LightSetBaseLevel( ubRealAmbientLightLevel - ubLevel );
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
}
|
||||
/* // ATE: Don't modify if scrolling!
|
||||
if ( gfScrollPending || gfScrollInertia )
|
||||
{
|
||||
}
|
||||
else*/
|
||||
{
|
||||
if(ubLastLevel!=ubLevel)
|
||||
{
|
||||
if(ubLevel > ubLastLevel)
|
||||
{
|
||||
LightAddBaseLevel(0, (UINT8)(ubLevel-ubLastLevel));
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// LightSubtractBaseLevel(0, (UINT8)(ubLastLevel-ubLevel));
|
||||
LightSetBaseLevel( ubRealAmbientLightLevel - ubLevel );
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -673,7 +673,7 @@ BOOLEAN LightningEndOfTurn( UINT8 ubTeam )
|
||||
gubLastTeamLightning = ubTeam;
|
||||
EnvDoLightning();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
@@ -699,25 +699,25 @@ void EnvBeginRainStorm( UINT8 ubIntensity )
|
||||
{
|
||||
gfDoLighting = TRUE;
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Starting Rain...." );
|
||||
#endif
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Starting Rain...." );
|
||||
#endif
|
||||
|
||||
// First turn off whatever rain it is, then turn on the requested rain
|
||||
guiEnvWeather &= ~(WEATHER_FORECAST_THUNDERSHOWERS | WEATHER_FORECAST_SHOWERS);
|
||||
// First turn off whatever rain it is, then turn on the requested rain
|
||||
guiEnvWeather &= ~(WEATHER_FORECAST_THUNDERSHOWERS | WEATHER_FORECAST_SHOWERS);
|
||||
|
||||
if ( ubIntensity == 1 )
|
||||
{
|
||||
// Turn on rain storms
|
||||
guiEnvWeather |= WEATHER_FORECAST_THUNDERSHOWERS;
|
||||
if ( ubIntensity == 1 )
|
||||
{
|
||||
// Turn on rain storms
|
||||
guiEnvWeather |= WEATHER_FORECAST_THUNDERSHOWERS;
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_STORM_STARTED] );
|
||||
}
|
||||
else
|
||||
{
|
||||
guiEnvWeather |= WEATHER_FORECAST_SHOWERS;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiEnvWeather |= WEATHER_FORECAST_SHOWERS;
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_RAIN_STARTED] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -726,17 +726,17 @@ void EnvEndRainStorm( )
|
||||
gfDoLighting = TRUE;
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Ending Rain...." );
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Ending Rain...." );
|
||||
#endif
|
||||
|
||||
if ( guiEnvWeather & WEATHER_FORECAST_THUNDERSHOWERS )
|
||||
{
|
||||
if ( guiEnvWeather & WEATHER_FORECAST_THUNDERSHOWERS )
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_STORM_ENDED] );
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_RAIN_ENDED] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
guiEnvWeather &= (~WEATHER_FORECAST_THUNDERSHOWERS );
|
||||
@@ -759,10 +759,10 @@ void EnvDoLightning(void)
|
||||
static UINT32 uiCount=0, uiIndex=0, uiStrike=0, uiFrameNext=1000;
|
||||
static UINT8 ubLevel=0, ubLastLevel=0;
|
||||
|
||||
if ( gfPauseDueToPlayerGamePause )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( gfPauseDueToPlayerGamePause )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uiCount++;
|
||||
if(uiCount >= (uiFrameNext+10))
|
||||
@@ -789,29 +789,29 @@ static UINT8 ubLevel=0, ubLastLevel=0;
|
||||
ubLastLevel=ubLevel;
|
||||
ubLevel=ubLightningTable[uiStrike][uiIndex][1];
|
||||
|
||||
// ATE: Don't modify if scrolling!
|
||||
if ( gfScrollPending || gfScrollInertia )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ubLastLevel!=ubLevel)
|
||||
{
|
||||
if(ubLevel > ubLastLevel)
|
||||
{
|
||||
LightAddBaseLevel(0, (UINT8)(ubLevel-ubLastLevel));
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
LightSubtractBaseLevel(0, (UINT8)(ubLastLevel-ubLevel));
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
}
|
||||
// ATE: Don't modify if scrolling!
|
||||
if ( gfScrollPending || gfScrollInertia )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ubLastLevel!=ubLevel)
|
||||
{
|
||||
if(ubLevel > ubLastLevel)
|
||||
{
|
||||
LightAddBaseLevel(0, (UINT8)(ubLevel-ubLastLevel));
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
LightSubtractBaseLevel(0, (UINT8)(ubLastLevel-ubLevel));
|
||||
if(ubLevel > 0)
|
||||
RenderSetShadows(TRUE);
|
||||
}
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -835,20 +835,20 @@ void EnvBeginRainStorm( UINT8 ubIntensity )
|
||||
{
|
||||
gfDoLighting = TRUE;
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Starting Rain...." );
|
||||
#endif
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Starting Rain...." );
|
||||
#endif
|
||||
|
||||
if ( ubIntensity == 1 )
|
||||
{
|
||||
// Turn on rain storms
|
||||
guiEnvWeather |= WEATHER_FORECAST_THUNDERSHOWERS;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiEnvWeather |= WEATHER_FORECAST_SHOWERS;
|
||||
}
|
||||
}
|
||||
if ( ubIntensity == 1 )
|
||||
{
|
||||
// Turn on rain storms
|
||||
guiEnvWeather |= WEATHER_FORECAST_THUNDERSHOWERS;
|
||||
}
|
||||
else
|
||||
{
|
||||
guiEnvWeather |= WEATHER_FORECAST_SHOWERS;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -857,7 +857,7 @@ void EnvEndRainStorm( )
|
||||
gfDoLighting = TRUE;
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Ending Rain...." );
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Ending Rain...." );
|
||||
#endif
|
||||
|
||||
guiEnvWeather &= (~WEATHER_FORECAST_THUNDERSHOWERS );
|
||||
@@ -872,7 +872,7 @@ void TurnOnNightLights()
|
||||
for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
|
||||
{
|
||||
if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_NIGHTTIME &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_NIGHTTIME &&
|
||||
!(LightSprites[ i ].uiFlags & (LIGHT_SPR_ON|MERC_LIGHT) ) )
|
||||
{
|
||||
LightSpritePower( i, TRUE );
|
||||
@@ -886,9 +886,9 @@ void TurnOffNightLights()
|
||||
for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
|
||||
{
|
||||
if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_NIGHTTIME &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_SPR_ON &&
|
||||
!(LightSprites[ i ].uiFlags & MERC_LIGHT) )
|
||||
LightSprites[ i ].uiFlags & LIGHT_NIGHTTIME &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_SPR_ON &&
|
||||
!(LightSprites[ i ].uiFlags & MERC_LIGHT) )
|
||||
{
|
||||
LightSpritePower( i, FALSE );
|
||||
}
|
||||
@@ -901,7 +901,7 @@ void TurnOnPrimeLights()
|
||||
for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
|
||||
{
|
||||
if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_PRIMETIME &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_PRIMETIME &&
|
||||
!(LightSprites[ i ].uiFlags & (LIGHT_SPR_ON|MERC_LIGHT) ) )
|
||||
{
|
||||
LightSpritePower( i, TRUE );
|
||||
@@ -915,9 +915,9 @@ void TurnOffPrimeLights()
|
||||
for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
|
||||
{
|
||||
if( LightSprites[ i ].uiFlags & LIGHT_SPR_ACTIVE &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_PRIMETIME &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_SPR_ON &&
|
||||
!(LightSprites[ i ].uiFlags & MERC_LIGHT) )
|
||||
LightSprites[ i ].uiFlags & LIGHT_PRIMETIME &&
|
||||
LightSprites[ i ].uiFlags & LIGHT_SPR_ON &&
|
||||
!(LightSprites[ i ].uiFlags & MERC_LIGHT) )
|
||||
{
|
||||
LightSpritePower( i, FALSE );
|
||||
}
|
||||
@@ -931,7 +931,7 @@ void UpdateTemperature( UINT8 ubTemperatureCode )
|
||||
case TEMPERATURE_DESERT_COOL:
|
||||
gubDesertTemperature = 0;
|
||||
break;
|
||||
case TEMPERATURE_DESERT_WARM:
|
||||
case TEMPERATURE_DESERT_WARM:
|
||||
gubDesertTemperature = 1;
|
||||
break;
|
||||
case TEMPERATURE_DESERT_HOT:
|
||||
@@ -947,7 +947,7 @@ void UpdateTemperature( UINT8 ubTemperatureCode )
|
||||
gubGlobalTemperature = 2;
|
||||
break;
|
||||
}
|
||||
gfDoLighting = TRUE;
|
||||
gfDoLighting = TRUE;
|
||||
}
|
||||
|
||||
INT8 SectorTemperature( UINT32 uiTime, INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ )
|
||||
@@ -959,7 +959,7 @@ INT8 SectorTemperature( UINT32 uiTime, INT16 sSectorX, INT16 sSectorY, INT8 bSec
|
||||
}
|
||||
else if ( IsSectorDesert( sSectorX, sSectorY ) ) // is desert
|
||||
{
|
||||
return( gubDesertTemperature );
|
||||
return( gubDesertTemperature );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+452
-455
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@
|
||||
|
||||
// lightlist node flags
|
||||
#define LIGHT_NODE_DRAWN 0x00000001 // light node duplicate marker
|
||||
#define LIGHT_ROOF_ONLY 0x00001000 // light only rooftops
|
||||
#define LIGHT_ROOF_ONLY 0x00001000 // light only rooftops
|
||||
#define LIGHT_IGNORE_WALLS 0x00002000 // doesn't take walls into account
|
||||
#define LIGHT_BACKLIGHT 0x00004000 // light does not light objs, trees
|
||||
#define LIGHT_NEW_RAY 0x00008000 // start of new ray in linked list
|
||||
@@ -57,7 +57,7 @@
|
||||
#define LIGHT_SPR_ERASE 0x0008
|
||||
#define LIGHT_SPR_REDRAW 0x0010
|
||||
#define LIGHT_SPR_ONROOF 0x0020
|
||||
#define MERC_LIGHT 0x0040
|
||||
#define MERC_LIGHT 0x0040
|
||||
#define LIGHT_PRIMETIME 0x0080 // light turns goes on in evening, turns off at bedtime.
|
||||
#define LIGHT_NIGHTTIME 0x0100 // light stays on when dark outside
|
||||
|
||||
|
||||
+162
-163
@@ -39,9 +39,9 @@
|
||||
#include "gameloop.h"
|
||||
#include "sysutil.h"
|
||||
#include "tile surface.h"
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef JA2EDITOR
|
||||
#include "Soldier Init List.h"
|
||||
extern SOLDIERINITNODE *gpSelected;
|
||||
@@ -70,7 +70,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
HVOBJECT vo;
|
||||
UINT16 usSubIndex;
|
||||
UINT16 usSubIndex;
|
||||
UINT32 fType;
|
||||
|
||||
} SMALL_TILE_DB;
|
||||
@@ -78,7 +78,7 @@ typedef struct
|
||||
|
||||
SMALL_TILE_SURF gSmTileSurf[ NUMBEROFTILETYPES ];
|
||||
SMALL_TILE_DB gSmTileDB[ NUMBEROFTILES ];
|
||||
UINT8 gubSmTileNum = 0;
|
||||
UINT8 gubSmTileNum = 0;
|
||||
BOOLEAN gfSmTileLoaded = FALSE;
|
||||
BOOLEAN gfInOverheadMap = FALSE;
|
||||
MOUSE_REGION OverheadRegion;
|
||||
@@ -116,8 +116,8 @@ void RenderOverheadOverlays();
|
||||
void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
HVOBJECT hVObject;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
HVOBJECT hVObject;
|
||||
CHAR8 cFileBPP[128];
|
||||
CHAR8 cAdjustedFile[ 128 ];
|
||||
UINT32 cnt1, cnt2;
|
||||
@@ -125,7 +125,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
UINT32 NumRegions;
|
||||
UINT32 dbSize = 0;
|
||||
|
||||
|
||||
|
||||
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
|
||||
{
|
||||
|
||||
@@ -135,7 +135,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
FilenameForBPP( gTilesets[ ubTilesetID ].TileSurfaceFilenames[ uiLoop ], cFileBPP);
|
||||
|
||||
// Adjust for tileset position
|
||||
sprintf( cAdjustedFile, "TILESETS\\%d\\T\\%s", ubTilesetID, cFileBPP );
|
||||
sprintf( cAdjustedFile, "TILESETS\\%d\\T\\%s", ubTilesetID, cFileBPP );
|
||||
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
strcpy( VObjectDesc.ImageFile, cAdjustedFile);
|
||||
@@ -146,7 +146,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
// TRY loading from default directory
|
||||
FilenameForBPP( gTilesets[ TLS_GENERIC_1 ].TileSurfaceFilenames[ uiLoop ], cFileBPP);
|
||||
// Adjust for tileset position
|
||||
sprintf( cAdjustedFile, "TILESETS\\0\\T\\%s", cFileBPP );
|
||||
sprintf( cAdjustedFile, "TILESETS\\0\\T\\%s", cFileBPP );
|
||||
|
||||
// LOAD ONE WE KNOW ABOUT!
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
@@ -173,7 +173,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
s = gSmTileSurf[ cnt1 ];
|
||||
|
||||
NumRegions = s.vo->usNumberOfObjects;
|
||||
|
||||
|
||||
// Check for overflow
|
||||
if ( NumRegions > gNumTilesPerType[ cnt1 ] )
|
||||
{
|
||||
@@ -215,7 +215,7 @@ void InitNewOverheadDB( UINT8 ubTilesetID )
|
||||
INT16 sX1, sY1, sX2, sY2;
|
||||
|
||||
CalculateRestrictedMapCoords( NORTH, &sX1, &sY1, &sX2, &gsStartRestrictedY, iOffsetHorizontal + 640, iOffsetVertical + 320 );
|
||||
CalculateRestrictedMapCoords( EAST, &sX1, &sY1, &gsStartRestrictedX, &sY2, iOffsetHorizontal + 640, iOffsetVertical + 320 );
|
||||
CalculateRestrictedMapCoords( EAST, &sX1, &sY1, &gsStartRestrictedX, &sY2, iOffsetHorizontal + 640, iOffsetVertical + 320 );
|
||||
}
|
||||
|
||||
// Copy over shade tables from main tileset
|
||||
@@ -237,24 +237,24 @@ void DeleteOverheadDB( )
|
||||
|
||||
BOOLEAN GetClosestItemPool( INT16 sSweetGridNo, ITEM_POOL **ppReturnedItemPool, UINT8 ubRadius, INT8 bLevel )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sGridNo;
|
||||
INT32 uiRange, uiLowestRange = 999999;
|
||||
INT32 leftmost;
|
||||
BOOLEAN fFound = FALSE;
|
||||
ITEM_POOL *pItemPool;
|
||||
|
||||
|
||||
//create dummy soldier, and use the pathing to determine which nearby slots are
|
||||
//reachable.
|
||||
|
||||
sTop = ubRadius;
|
||||
sBottom = -ubRadius;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
uiLowestRange = 999999;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
uiLowestRange = 999999;
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
{
|
||||
@@ -286,23 +286,23 @@ BOOLEAN GetClosestItemPool( INT16 sSweetGridNo, ITEM_POOL **ppReturnedItemPool,
|
||||
|
||||
BOOLEAN GetClosestMercInOverheadMap( INT16 sSweetGridNo, SOLDIERTYPE **ppReturnedSoldier, UINT8 ubRadius )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT16 sGridNo;
|
||||
INT32 uiRange, uiLowestRange = 999999;
|
||||
INT32 leftmost;
|
||||
BOOLEAN fFound = FALSE;
|
||||
|
||||
|
||||
//create dummy soldier, and use the pathing to determine which nearby slots are
|
||||
//reachable.
|
||||
|
||||
sTop = ubRadius;
|
||||
sBottom = -ubRadius;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
uiLowestRange = 999999;
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
uiLowestRange = 999999;
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
{
|
||||
@@ -315,7 +315,7 @@ BOOLEAN GetClosestMercInOverheadMap( INT16 sSweetGridNo, SOLDIERTYPE **ppReturne
|
||||
if( sGridNo >=0 && sGridNo < WORLD_MAX && sGridNo >= leftmost && sGridNo < ( leftmost + WORLD_COLS ) )
|
||||
{
|
||||
// Go on sweet stop
|
||||
if ( gpWorldLevelData[ sGridNo ].pMercHead != NULL && gpWorldLevelData[ sGridNo ].pMercHead->pSoldier->bVisible != -1 )
|
||||
if ( gpWorldLevelData[ sGridNo ].pMercHead != NULL && gpWorldLevelData[ sGridNo ].pMercHead->pSoldier->bVisible != -1 )
|
||||
{
|
||||
uiRange = GetRangeInCellCoordsFromGridNoDiff( sSweetGridNo, sGridNo );
|
||||
|
||||
@@ -398,7 +398,7 @@ void HandleOverheadMap( )
|
||||
|
||||
// Force load
|
||||
gfSmTileLoaded = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gubSmTileNum = (UINT8)giCurrentTilesetID;
|
||||
@@ -410,12 +410,12 @@ void HandleOverheadMap( )
|
||||
InitNewOverheadDB( gubSmTileNum );
|
||||
gfSmTileLoaded = TRUE;
|
||||
}
|
||||
|
||||
|
||||
// restore background rects
|
||||
RestoreBackgroundRects( );
|
||||
|
||||
// Render the overhead map
|
||||
RenderOverheadMap( 0, (WORLD_COLS / 2), iOffsetHorizontal,
|
||||
RenderOverheadMap( 0, (WORLD_COLS / 2), iOffsetHorizontal,
|
||||
iOffsetVertical, 640 + iOffsetHorizontal, 320 + iOffsetVertical, FALSE );
|
||||
|
||||
HandleTalkingAutoFaces( );
|
||||
@@ -436,7 +436,7 @@ void HandleOverheadMap( )
|
||||
HandleOverheadUI();
|
||||
|
||||
if ( !gfInOverheadMap )
|
||||
{
|
||||
{
|
||||
return;
|
||||
}
|
||||
RenderTacticalInterface( );
|
||||
@@ -448,74 +448,73 @@ void HandleOverheadMap( )
|
||||
// RenderClock( CLOCK_X, CLOCK_Y );
|
||||
// RenderTownIDString( );
|
||||
|
||||
HandleAutoFaces( );
|
||||
HandleAutoFaces( );
|
||||
}
|
||||
}
|
||||
|
||||
if( !gfEditMode && !gfTacticalPlacementGUIActive )
|
||||
{
|
||||
INT16 usMapPos;
|
||||
INT16 sMapPos;
|
||||
ITEM_POOL *pItemPool;
|
||||
|
||||
gfUIHandleSelectionAboveGuy = FALSE;
|
||||
|
||||
HandleAnyMercInSquadHasCompatibleStuff( (INT8) CurrentSquad( ), NULL, TRUE );
|
||||
|
||||
if ( GetOverheadMouseGridNo( &usMapPos ) )
|
||||
if ( GetOverheadMouseGridNo( &sMapPos ) )
|
||||
{
|
||||
// ATE: Find the closest item pool within 5 tiles....
|
||||
if ( GetClosestItemPool( usMapPos, &pItemPool, 1, 0 ) )
|
||||
if ( GetClosestItemPool( sMapPos, &pItemPool, 1, 0 ) )
|
||||
{
|
||||
STRUCTURE *pStructure = NULL;
|
||||
INT16 sIntTileGridNo;
|
||||
INT8 bZLevel = 0;
|
||||
INT16 sActionGridNo = usMapPos;
|
||||
INT16 sActionGridNo = sMapPos;
|
||||
|
||||
// Get interactive tile...
|
||||
if ( ConditionalGetCurInteractiveTileGridNoAndStructure( &sIntTileGridNo , &pStructure, FALSE ) )
|
||||
{
|
||||
sActionGridNo = sIntTileGridNo;
|
||||
}
|
||||
|
||||
|
||||
bZLevel = GetZLevelOfItemPoolGivenStructure( sActionGridNo, 0, pStructure );
|
||||
|
||||
if ( AnyItemsVisibleOnLevel( pItemPool, bZLevel ) )
|
||||
{
|
||||
DrawItemPoolList( pItemPool, usMapPos , ITEMLIST_DISPLAY, bZLevel, gusMouseXPos, gusMouseYPos );
|
||||
DrawItemPoolList( pItemPool, sMapPos , ITEMLIST_DISPLAY, bZLevel, gusMouseXPos, gusMouseYPos );
|
||||
|
||||
gfOverItemPool = TRUE;
|
||||
gsOveritemPoolGridNo = pItemPool->sGridNo;
|
||||
}
|
||||
}
|
||||
|
||||
if ( GetClosestItemPool( usMapPos, &pItemPool, 1, 1 ) )
|
||||
if ( GetClosestItemPool( sMapPos, &pItemPool, 1, 1 ) )
|
||||
{
|
||||
INT8 bZLevel = 0;
|
||||
INT16 sActionGridNo = usMapPos;
|
||||
|
||||
if ( AnyItemsVisibleOnLevel( pItemPool, bZLevel ) )
|
||||
{
|
||||
DrawItemPoolList( pItemPool, usMapPos , ITEMLIST_DISPLAY, bZLevel, gusMouseXPos, (UINT16)( gusMouseYPos - 5 ) );
|
||||
DrawItemPoolList( pItemPool, sMapPos , ITEMLIST_DISPLAY, bZLevel, gusMouseXPos, (UINT16)( gusMouseYPos - 5 ) );
|
||||
|
||||
gfOverItemPool = TRUE;
|
||||
gsOveritemPoolGridNo = pItemPool->sGridNo;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( GetOverheadMouseGridNoForFullSoldiersGridNo( &usMapPos ) )
|
||||
{
|
||||
if ( GetClosestMercInOverheadMap( usMapPos, &pSoldier, 1 ) )
|
||||
if ( GetOverheadMouseGridNoForFullSoldiersGridNo( &sMapPos ) )
|
||||
{
|
||||
if ( GetClosestMercInOverheadMap( sMapPos, &pSoldier, 1 ) )
|
||||
{
|
||||
if ( pSoldier->bTeam == gbPlayerNum )
|
||||
{
|
||||
gfUIHandleSelectionAboveGuy = TRUE;
|
||||
gsSelectedGuy = pSoldier->ubID;
|
||||
}
|
||||
if ( pSoldier->bTeam == gbPlayerNum )
|
||||
{
|
||||
gfUIHandleSelectionAboveGuy = TRUE;
|
||||
gsSelectedGuy = pSoldier->ubID;
|
||||
}
|
||||
|
||||
DisplayMercNameInOverhead( pSoldier );
|
||||
}
|
||||
DisplayMercNameInOverhead( pSoldier );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,7 +527,7 @@ void HandleOverheadMap( )
|
||||
{
|
||||
pSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
|
||||
DisplayMercNameInOverhead( pSoldier );
|
||||
DisplayMercNameInOverhead( pSoldier );
|
||||
}
|
||||
|
||||
RenderButtons( );
|
||||
@@ -553,7 +552,7 @@ BOOLEAN InOverheadMap( )
|
||||
|
||||
void GoIntoOverheadMap( )
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
HVOBJECT hVObject;
|
||||
|
||||
gfInOverheadMap = TRUE;
|
||||
@@ -565,13 +564,13 @@ void GoIntoOverheadMap( )
|
||||
iOffsetVertical = (SCREEN_HEIGHT - 160) / 2 - 160; // Vertical start position of the overview map
|
||||
|
||||
MSYS_DefineRegion( &OverheadBackgroundRegion, 0, 0 , SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH,
|
||||
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
|
||||
//Add region
|
||||
MSYS_AddRegion( &OverheadBackgroundRegion );
|
||||
|
||||
MSYS_DefineRegion( &OverheadRegion, 0, 0 , SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH,
|
||||
CURSOR_NORMAL, MoveOverheadRegionCallback, ClickOverheadRegionCallback );
|
||||
CURSOR_NORMAL, MoveOverheadRegionCallback, ClickOverheadRegionCallback );
|
||||
|
||||
// Add region
|
||||
MSYS_AddRegion( &OverheadRegion );
|
||||
@@ -608,9 +607,9 @@ void GoIntoOverheadMap( )
|
||||
|
||||
// Add shades to persons....
|
||||
GetVideoObject( &hVObject, uiPERSONS );
|
||||
hVObject->pShades[ 0 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 256, 256, 256, FALSE );
|
||||
hVObject->pShades[ 1 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 310, 310, 310, FALSE );
|
||||
hVObject->pShades[ 2 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 0, 0, 0, FALSE );
|
||||
hVObject->pShades[ 0 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 256, 256, 256, FALSE );
|
||||
hVObject->pShades[ 1 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 310, 310, 310, FALSE );
|
||||
hVObject->pShades[ 2 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 0, 0, 0, FALSE );
|
||||
|
||||
gfOverheadMapDirty = TRUE;
|
||||
|
||||
@@ -637,7 +636,7 @@ void GoIntoOverheadMap( )
|
||||
|
||||
void HandleOverheadUI( )
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
InputAtom InputEvent;
|
||||
INT16 sMousePos=0;
|
||||
UINT8 ubID;
|
||||
|
||||
@@ -645,7 +644,7 @@ void HandleOverheadUI( )
|
||||
if ( GetOverheadMouseGridNo( &sMousePos ) )
|
||||
{
|
||||
// Look quickly for a soldier....
|
||||
ubID = QuickFindSoldier( sMousePos );
|
||||
ubID = QuickFindSoldier( sMousePos );
|
||||
|
||||
if ( ubID != NOBODY )
|
||||
{
|
||||
@@ -658,10 +657,10 @@ void HandleOverheadUI( )
|
||||
}
|
||||
}
|
||||
|
||||
while (DequeueEvent(&InputEvent) == TRUE)
|
||||
{
|
||||
if( ( InputEvent.usEvent == KEY_DOWN ) )
|
||||
{
|
||||
while (DequeueEvent(&InputEvent) == TRUE)
|
||||
{
|
||||
if( ( InputEvent.usEvent == KEY_DOWN ) )
|
||||
{
|
||||
switch( InputEvent.usParam )
|
||||
{
|
||||
case( ESC ):
|
||||
@@ -677,7 +676,7 @@ void HandleOverheadUI( )
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -702,7 +701,7 @@ void KillOverheadMap()
|
||||
INT16 GetOffsetLandHeight( INT32 sGridNo )
|
||||
{
|
||||
INT16 sTileHeight;
|
||||
|
||||
|
||||
sTileHeight = gpWorldLevelData[ sGridNo ].sHeight;
|
||||
|
||||
return( sTileHeight );
|
||||
@@ -739,7 +738,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
INT16 sX, sY;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
LEVELNODE *pNode;
|
||||
LEVELNODE *pNode;
|
||||
SMALL_TILE_DB *pTile;
|
||||
INT16 sHeight;
|
||||
HVOBJECT hVObject;
|
||||
@@ -794,7 +793,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
|
||||
do
|
||||
{
|
||||
// / 5 -> / 3
|
||||
// / 5->/ 3
|
||||
|
||||
usTileIndex=FASTMAPROWCOLTOPOS( sTempPosY_M, sTempPosX_M );
|
||||
|
||||
@@ -814,8 +813,8 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
|
||||
|
||||
// RENDER!
|
||||
//BltVideoObjectFromIndex( FRAME_BUFFER, SGR1, gSmallTileDatabase[ gpWorldLevelData[ usTileIndex ].pLandHead->usIndex ], sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
//BltVideoObjectFromIndex( FRAME_BUFFER, SGR1, 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
//BltVideoObjectFromIndex( FRAME_BUFFER, SGR1, gSmallTileDatabase[ gpWorldLevelData[ usTileIndex ].pLandHead->usIndex ], sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
//BltVideoObjectFromIndex( FRAME_BUFFER, SGR1, 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
|
||||
|
||||
pNode = pNode->pPrevNode;
|
||||
@@ -829,7 +828,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
|
||||
if ( sTempPosX_S >= sEndXS )
|
||||
{
|
||||
fEndRenderRow = TRUE;
|
||||
fEndRenderRow = TRUE;
|
||||
}
|
||||
|
||||
} while( !fEndRenderRow );
|
||||
@@ -842,7 +841,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
{
|
||||
sAnchorPosX_M ++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bXOddFlag = !bXOddFlag;
|
||||
sAnchorPosY_S += 2;
|
||||
@@ -956,7 +955,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
|
||||
sX = sTempPosX_S;
|
||||
sY = sTempPosY_S - (gTileDatabase[ pNode->usIndex ].sOffsetHeight/5);
|
||||
|
||||
|
||||
if( gTileDatabase[ pNode->usIndex ].uiFlags & IGNORE_WORLD_HEIGHT )
|
||||
{
|
||||
sY -= sModifiedHeight;
|
||||
@@ -978,14 +977,14 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
pNode = pNode->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sTempPosX_S += 8;
|
||||
sTempPosX_M ++;
|
||||
sTempPosY_M --;
|
||||
|
||||
if ( sTempPosX_S >= sEndXS )
|
||||
{
|
||||
fEndRenderRow = TRUE;
|
||||
fEndRenderRow = TRUE;
|
||||
}
|
||||
|
||||
} while( !fEndRenderRow );
|
||||
@@ -998,7 +997,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
{
|
||||
sAnchorPosX_M ++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bXOddFlag = !bXOddFlag;
|
||||
sAnchorPosY_S += 2;
|
||||
@@ -1012,7 +1011,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
while( !fEndRenderCol );
|
||||
|
||||
//if ( !fFromMapUtility && !gfEditMode )
|
||||
{
|
||||
{
|
||||
|
||||
// ROOF RENDR LOOP
|
||||
// Begin Render Loop
|
||||
@@ -1044,30 +1043,30 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
{
|
||||
sHeight=( GetOffsetLandHeight(usTileIndex) /5);
|
||||
|
||||
pNode = gpWorldLevelData[ usTileIndex ].pRoofHead;
|
||||
while( pNode != NULL )
|
||||
{
|
||||
if ( pNode->usIndex < NUMBEROFTILES )
|
||||
{
|
||||
if ( !( pNode->uiFlags & LEVELNODE_HIDDEN ) )
|
||||
{
|
||||
pTile = &( gSmTileDB[ pNode->usIndex ] );
|
||||
pNode = gpWorldLevelData[ usTileIndex ].pRoofHead;
|
||||
while( pNode != NULL )
|
||||
{
|
||||
if ( pNode->usIndex < NUMBEROFTILES )
|
||||
{
|
||||
if ( !( pNode->uiFlags & LEVELNODE_HIDDEN ) )
|
||||
{
|
||||
pTile = &( gSmTileDB[ pNode->usIndex ] );
|
||||
|
||||
sX = sTempPosX_S;
|
||||
sY = sTempPosY_S - (gTileDatabase[ pNode->usIndex ].sOffsetHeight/5) -sHeight;
|
||||
sX = sTempPosX_S;
|
||||
sY = sTempPosY_S - (gTileDatabase[ pNode->usIndex ].sOffsetHeight/5) -sHeight;
|
||||
|
||||
sY -= ( WALL_HEIGHT/5 );
|
||||
sY -= ( WALL_HEIGHT/5 );
|
||||
|
||||
sY += ( gsRenderHeight / 5 );
|
||||
sY += ( gsRenderHeight / 5 );
|
||||
|
||||
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
|
||||
pTile->vo->pShadeCurrent= gSmTileSurf[ pTile->fType ].vo->pShades[pNode->ubShadeLevel];
|
||||
|
||||
// RENDER!
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
|
||||
}
|
||||
}
|
||||
pNode = pNode->pNext;
|
||||
}
|
||||
// RENDER!
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, pTile->vo, sX, sY, pTile->usSubIndex );
|
||||
}
|
||||
}
|
||||
pNode = pNode->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
sTempPosX_S += 8;
|
||||
@@ -1076,7 +1075,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
|
||||
if ( sTempPosX_S >= sEndXS )
|
||||
{
|
||||
fEndRenderRow = TRUE;
|
||||
fEndRenderRow = TRUE;
|
||||
}
|
||||
|
||||
} while( !fEndRenderRow );
|
||||
@@ -1089,7 +1088,7 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
{
|
||||
sAnchorPosX_M ++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bXOddFlag = !bXOddFlag;
|
||||
sAnchorPosY_S += 2;
|
||||
@@ -1109,16 +1108,16 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
if ( gMapInformation.ubRestrictedScrollID != 0 )
|
||||
{
|
||||
CalculateRestrictedMapCoords( NORTH, &sX1, &sY1, &sX2, &sY2, sEndXS, sEndYS );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
|
||||
CalculateRestrictedMapCoords( EAST, &sX1, &sY1, &sX2, &sY2, sEndXS, sEndYS );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
|
||||
CalculateRestrictedMapCoords( SOUTH, &sX1, &sY1, &sX2, &sY2, sEndXS, sEndYS );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
|
||||
CalculateRestrictedMapCoords( WEST, &sX1, &sY1, &sX2, &sY2, sEndXS, sEndYS );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
}
|
||||
|
||||
if ( !fFromMapUtility )
|
||||
@@ -1127,31 +1126,31 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, uiOVERMAP, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
// Update the save buffer
|
||||
{
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT16 usWidth, usHeight;
|
||||
UINT8 ubBitDepth;
|
||||
|
||||
// Update saved buffer - do for the viewport size ony!
|
||||
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
|
||||
// Update the save buffer
|
||||
{
|
||||
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
|
||||
UINT8 *pDestBuf, *pSrcBuf;
|
||||
UINT16 usWidth, usHeight;
|
||||
UINT8 ubBitDepth;
|
||||
|
||||
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
|
||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||
// Update saved buffer - do for the viewport size ony!
|
||||
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
|
||||
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
// BLIT HERE
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
0, 0, 0, 0, usWidth, usHeight );
|
||||
}
|
||||
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
|
||||
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
|
||||
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
// BLIT HERE
|
||||
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES,
|
||||
(UINT16 *)pSrcBuf, uiSrcPitchBYTES,
|
||||
0, 0, 0, 0, usWidth, usHeight );
|
||||
}
|
||||
|
||||
}
|
||||
UnLockVideoSurface(guiRENDERBUFFER);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1172,7 +1171,7 @@ void RenderOverheadOverlays()
|
||||
GetVideoObject( &hVObject, uiPERSONS );
|
||||
|
||||
|
||||
//SOLDIER OVERLAY
|
||||
//SOLDIER OVERLAY
|
||||
if( gfTacticalPlacementGUIActive )
|
||||
{ //loop through only the player soldiers
|
||||
end = gTacticalStatus.Team[ OUR_TEAM ].bLastID;
|
||||
@@ -1188,8 +1187,8 @@ void RenderOverheadOverlays()
|
||||
pSoldier = MercPtrs[ i ];
|
||||
if( !pSoldier->bActive || !pSoldier->bInSector )
|
||||
continue;
|
||||
//Soldier is here. Calculate his screen position based on his current gridno.
|
||||
|
||||
//Soldier is here. Calculate his screen position based on his current gridno.
|
||||
|
||||
|
||||
GetOverheadScreenXYFromGridNo( pSoldier->sGridNo, &sX, &sY );
|
||||
//Now, draw his "doll"
|
||||
@@ -1257,46 +1256,46 @@ void RenderOverheadOverlays()
|
||||
|
||||
#ifdef JA2EDITOR
|
||||
if( gfEditMode && gpSelected && gpSelected->pSoldier == pSoldier )
|
||||
{ //editor: show the selected edited merc as the yellow one.
|
||||
{ //editor: show the selected edited merc as the yellow one.
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 0 );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if( !gfTacticalPlacementGUIActive )
|
||||
{ //normal
|
||||
{ //normal
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 3), (INT16)(sY + 9));
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 3), (INT16)(sY + 9));
|
||||
}
|
||||
else if( pSoldier->uiStatusFlags & SOLDIER_VEHICLE )
|
||||
else if( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{ //vehicle
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 9 );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-6), (INT16)(sY), (INT16)(sX + 9), (INT16)(sY + 10));
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-6), (INT16)(sY), (INT16)(sX + 9), (INT16)(sY + 10));
|
||||
}
|
||||
//else if( pSoldier->uiStatusFlags & (SOLDIER_PASSENGER | SOLDIER_DRIVER) )
|
||||
//else if( pSoldier->flags.uiStatusFlags & (SOLDIER_PASSENGER | SOLDIER_DRIVER) )
|
||||
//{// //don't draw person, because they are inside the vehicle.
|
||||
// ubPassengers++;
|
||||
//}
|
||||
else if( gpTacticalPlacementSelectedSoldier == pSoldier )
|
||||
{ //tactical placement selected merc
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 7 );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-2), (INT16)(sY-2), (INT16)(sX + 5), (INT16)(sY + 11));
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-2), (INT16)(sY-2), (INT16)(sX + 5), (INT16)(sY + 11));
|
||||
}
|
||||
else if( gpTacticalPlacementHilightedSoldier == pSoldier && pSoldier->uiStatusFlags )
|
||||
else if( gpTacticalPlacementHilightedSoldier == pSoldier && pSoldier->flags.uiStatusFlags )
|
||||
{ //tactical placement hilighted merc
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 8 );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-2), (INT16)(sY-2), (INT16)(sX + 5), (INT16)(sY + 11));
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-2), (INT16)(sY-2), (INT16)(sX + 5), (INT16)(sY + 11));
|
||||
}
|
||||
else
|
||||
{ //normal
|
||||
{ //normal
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 3), (INT16)(sY + 9));
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 3), (INT16)(sY + 9));
|
||||
}
|
||||
if( ubPassengers )
|
||||
{
|
||||
SetFont( SMALLCOMPFONT );
|
||||
SetFontForeground( FONT_WHITE );
|
||||
gprintfdirty( (INT16)(sX - 3), sY, L"%d", ubPassengers );
|
||||
mprintf_buffer( pDestBuf, uiDestPitchBYTES, SMALLCOMPFONT, sX - 3, sY , L"%d", ubPassengers );
|
||||
mprintf_buffer( pDestBuf, uiDestPitchBYTES, SMALLCOMPFONT, sX - 3, sY , L"%d", ubPassengers );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1304,7 +1303,7 @@ void RenderOverheadOverlays()
|
||||
//ITEMS OVERLAY
|
||||
if( !gfTacticalPlacementGUIActive )
|
||||
{
|
||||
for( i = 0 ; i < guiNumWorldItems; i++ )
|
||||
for( i = 0 ; i < guiNumWorldItems; i++ )
|
||||
{
|
||||
pWorldItem = &gWorldItems[ i ];
|
||||
if( !pWorldItem || !pWorldItem->fExists || pWorldItem->bVisible != VISIBLE && !(gTacticalStatus.uiFlags & SHOW_ALL_ITEMS) )
|
||||
@@ -1331,7 +1330,7 @@ void RenderOverheadOverlays()
|
||||
{
|
||||
sX += iOffsetHorizontal;
|
||||
}
|
||||
|
||||
|
||||
// Smaller maps
|
||||
if (gsStartRestrictedY > 0)
|
||||
{
|
||||
@@ -1352,16 +1351,16 @@ void RenderOverheadOverlays()
|
||||
}
|
||||
else switch( pWorldItem->bVisible )
|
||||
{
|
||||
case HIDDEN_ITEM: usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) ); break;
|
||||
case BURIED: usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) ); break;
|
||||
case HIDDEN_IN_OBJECT: usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) ); break;
|
||||
case INVISIBLE: usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) ); break;
|
||||
case HIDDEN_ITEM: usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) ); break;
|
||||
case BURIED: usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) ); break;
|
||||
case HIDDEN_IN_OBJECT: usLineColor = Get16BPPColor( FROMRGB( 0, 0, 255 ) ); break;
|
||||
case INVISIBLE: usLineColor = Get16BPPColor( FROMRGB( 0, 255, 0 ) ); break;
|
||||
case VISIBLE: usLineColor = Get16BPPColor( FROMRGB( 255, 255, 255 ) ); break;
|
||||
}
|
||||
|
||||
if ( gfOverItemPool && gsOveritemPoolGridNo == pWorldItem->sGridNo )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
|
||||
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
|
||||
}
|
||||
|
||||
PixelDraw( FALSE, sX, sY, usLineColor, pDestBuf );
|
||||
@@ -1387,7 +1386,7 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
INT16 sX, sY;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
LEVELNODE *pNode;
|
||||
LEVELNODE *pNode;
|
||||
UINT16 usLineColor;
|
||||
INT16 sHeight;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
@@ -1434,7 +1433,7 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
sX = sTempPosX_S;
|
||||
sY = sTempPosY_S - sHeight;
|
||||
// RENDER!
|
||||
if ( pNode->pItemPool->bVisible == -1 && !(gTacticalStatus.uiFlags & SHOW_ALL_ITEMS) )
|
||||
if ( pNode->pItemPool->bVisible == -1 && !(gTacticalStatus.uiFlags & SHOW_ALL_ITEMS) )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1469,7 +1468,7 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
sY = sTempPosY_S - sHeight - 8; // 8 height of doll guy
|
||||
|
||||
// RENDER!
|
||||
if ( pSoldier->bLastRenderVisibleValue == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) )
|
||||
if ( pSoldier->bLastRenderVisibleValue == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1496,7 +1495,7 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
}
|
||||
#ifdef JA2EDITOR
|
||||
if( gfEditMode && gpSelected && gpSelected->pSoldier == pSoldier )
|
||||
{ //editor: show the selected edited merc as the yellow one.
|
||||
{ //editor: show the selected edited merc as the yellow one.
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 0 );
|
||||
}
|
||||
else
|
||||
@@ -1510,10 +1509,10 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 8 );
|
||||
}
|
||||
else
|
||||
{ //normal
|
||||
{ //normal
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
}
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-2), (INT16)(sY-2), (INT16)(sX + 5), (INT16)(sY + 11));
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, (INT16)(sX-2), (INT16)(sY-2), (INT16)(sX + 5), (INT16)(sY + 11));
|
||||
}
|
||||
|
||||
pNode = pNode->pNext;
|
||||
@@ -1526,7 +1525,7 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
|
||||
if ( sTempPosX_S >= sEndXS )
|
||||
{
|
||||
fEndRenderRow = TRUE;
|
||||
fEndRenderRow = TRUE;
|
||||
}
|
||||
|
||||
} while( !fEndRenderRow );
|
||||
@@ -1539,7 +1538,7 @@ void RenderOverheadOverlays( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 s
|
||||
{
|
||||
sAnchorPosX_M ++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bXOddFlag = !bXOddFlag;
|
||||
sAnchorPosY_S += 2;
|
||||
@@ -1563,7 +1562,7 @@ void MoveInOverheadRegionCallback(MOUSE_REGION *reg, INT32 reason)
|
||||
void ClickOverheadRegionCallback(MOUSE_REGION *reg,INT32 reason)
|
||||
{
|
||||
UINT32 uiCellX, uiCellY;
|
||||
INT16 sWorldScreenX, sWorldScreenY;
|
||||
INT16 sWorldScreenX, sWorldScreenY;
|
||||
|
||||
if( gfTacticalPlacementGUIActive )
|
||||
{
|
||||
@@ -1627,7 +1626,7 @@ void MoveOverheadRegionCallback(MOUSE_REGION *reg,INT32 reason)
|
||||
|
||||
void GetOverheadScreenXYFromGridNo( INT16 sGridNo, INT16 *psScreenX, INT16 *psScreenY )
|
||||
{
|
||||
GetWorldXYAbsoluteScreenXY( (INT16)(CenterX( sGridNo ) / CELL_X_SIZE ), (INT16)( CenterY( sGridNo ) / CELL_Y_SIZE ), psScreenX, psScreenY );
|
||||
GetWorldXYAbsoluteScreenXY( (INT16)(CenterX( sGridNo ) / CELL_X_SIZE ), (INT16)( CenterY( sGridNo ) / CELL_Y_SIZE ), psScreenX, psScreenY );
|
||||
*psScreenX /= 5;
|
||||
*psScreenY /= 5;
|
||||
|
||||
@@ -1635,14 +1634,14 @@ void GetOverheadScreenXYFromGridNo( INT16 sGridNo, INT16 *psScreenX, INT16 *psSc
|
||||
*psScreenY += 5;
|
||||
|
||||
//Subtract the height....
|
||||
//*psScreenY -= gpWorldLevelData[ sGridNo ].sHeight / 5;
|
||||
//*psScreenY -= gpWorldLevelData[ sGridNo ].sHeight / 5;
|
||||
}
|
||||
|
||||
// WANNE: Fixed bug from sir tech, which occured on smaller maps ;-)
|
||||
BOOLEAN GetOverheadMouseGridNo( INT16 *psGridNo )
|
||||
{
|
||||
UINT32 uiCellX, uiCellY;
|
||||
INT16 sWorldScreenX, sWorldScreenY;
|
||||
INT16 sWorldScreenX, sWorldScreenY;
|
||||
|
||||
if ( ( OverheadRegion.uiFlags & MSYS_MOUSE_IN_AREA ) )
|
||||
{
|
||||
@@ -1697,7 +1696,7 @@ BOOLEAN GetOverheadMouseGridNo( INT16 *psGridNo )
|
||||
BOOLEAN GetOverheadMouseGridNoForFullSoldiersGridNo( INT16 *psGridNo )
|
||||
{
|
||||
UINT32 uiCellX, uiCellY;
|
||||
INT16 sWorldScreenX, sWorldScreenY;
|
||||
INT16 sWorldScreenX, sWorldScreenY;
|
||||
|
||||
if ( ( OverheadRegion.uiFlags & MSYS_MOUSE_IN_AREA ) )
|
||||
{
|
||||
@@ -1787,7 +1786,7 @@ void CalculateRestrictedMapCoords( INT8 bDirection, INT16 *psX1, INT16 *psY1, IN
|
||||
void CopyOverheadDBShadetablesFromTileset( )
|
||||
{
|
||||
UINT32 uiLoop, uiLoop2;
|
||||
PTILE_IMAGERY pTileSurf;
|
||||
PTILE_IMAGERY pTileSurf;
|
||||
|
||||
|
||||
// Loop through tileset
|
||||
@@ -1802,7 +1801,7 @@ void CopyOverheadDBShadetablesFromTileset( )
|
||||
gSmTileSurf[ uiLoop ].vo->pShades[ uiLoop2 ] = pTileSurf->vo->pShades[ uiLoop2 ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void TrashOverheadMap( )
|
||||
@@ -1815,5 +1814,5 @@ void TrashOverheadMap( )
|
||||
|
||||
// Force load
|
||||
gfSmTileLoaded = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-10
@@ -24,7 +24,7 @@ vector_3 VSubtract( vector_3 *a, vector_3 *b )
|
||||
c.x = a->x - b->x;
|
||||
c.y = a->y - b->y;
|
||||
c.z = a->z - b->z;
|
||||
|
||||
|
||||
return( c );
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ vector_3 VAdd( vector_3 *a, vector_3 *b )
|
||||
c.x = a->x + b->x;
|
||||
c.y = a->y + b->y;
|
||||
c.z = a->z + b->z;
|
||||
|
||||
|
||||
return( c );
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ vector_3 VMultScalar( vector_3 *a, real b )
|
||||
c.x = a->x * b;
|
||||
c.y = a->y * b;
|
||||
c.z = a->z * b;
|
||||
|
||||
|
||||
return( c );
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ vector_3 VDivScalar( vector_3 *a, real b )
|
||||
c.x = a->x / b;
|
||||
c.y = a->y / b;
|
||||
c.z = a->z / b;
|
||||
|
||||
|
||||
return( c );
|
||||
}
|
||||
|
||||
@@ -76,9 +76,9 @@ vector_3 VCrossProduct( vector_3 *a, vector_3 *b )
|
||||
{
|
||||
vector_3 c;
|
||||
|
||||
c.x = ( a->y * b->z ) - ( a->z * b->y );
|
||||
c.y = ( a->x * b->z ) - ( a->z * b->x );
|
||||
c.z = ( a->x * b->y ) - ( a->y * b->x );
|
||||
c.x = ( a->y * b->z ) - ( a->z * b->y );
|
||||
c.y = ( a->x * b->z ) - ( a->z * b->x );
|
||||
c.z = ( a->x * b->y ) - ( a->y * b->x );
|
||||
|
||||
return( c );
|
||||
}
|
||||
@@ -89,8 +89,8 @@ vector_3 VGetPerpendicular( vector_3 *a )
|
||||
vector_3 c;
|
||||
|
||||
c.x = -a->y;
|
||||
c.y = a->x;
|
||||
c.z = a->z;
|
||||
c.y = a->x;
|
||||
c.z = a->z;
|
||||
|
||||
return( c );
|
||||
}
|
||||
@@ -108,7 +108,7 @@ vector_3 VGetNormal( vector_3 *a )
|
||||
|
||||
Length = VGetLength( a );
|
||||
|
||||
if ( Length == 0 )
|
||||
if ( Length == 0 )
|
||||
{
|
||||
c.x = 0;
|
||||
c.y = 0;
|
||||
@@ -143,3 +143,4 @@ vector_3 VGetNormal( vector_3 *a )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
typedef float real;
|
||||
|
||||
#define REAL_MAX FLT_MAX
|
||||
#define REAL_MIN FLT_MIN
|
||||
#define REAL_MAX FLT_MAX
|
||||
#define REAL_MIN FLT_MIN
|
||||
|
||||
#define PI2 3.14159265358979323846
|
||||
#define Epsilon2 0.00001
|
||||
@@ -61,3 +61,4 @@ vector_3 VCrossProduct( vector_3 *a, vector_3 *b );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+243
-181
File diff suppressed because it is too large
Load Diff
+81
-10
@@ -10,8 +10,9 @@
|
||||
|
||||
extern UINT32 guiNumObjectSlots;
|
||||
|
||||
typedef struct
|
||||
class OLD_REAL_OBJECT_101
|
||||
{
|
||||
public:
|
||||
BOOLEAN fAllocated;
|
||||
BOOLEAN fAlive;
|
||||
BOOLEAN fApplyFriction;
|
||||
@@ -41,7 +42,7 @@ typedef struct
|
||||
INT16 sGridNo;
|
||||
INT32 iID;
|
||||
LEVELNODE *pNode;
|
||||
LEVELNODE *pShadow;
|
||||
LEVELNODE *pShadow;
|
||||
|
||||
INT16 sConsecutiveCollisions;
|
||||
INT16 sConsecutiveZeroVelocityCollisions;
|
||||
@@ -49,7 +50,7 @@ typedef struct
|
||||
|
||||
FLOAT dLifeLength;
|
||||
FLOAT dLifeSpan;
|
||||
OBJECTTYPE Obj;
|
||||
OLD_OBJECTTYPE_101 oldObj;
|
||||
BOOLEAN fFirstTimeMoved;
|
||||
INT16 sFirstGridNo;
|
||||
UINT8 ubOwner;
|
||||
@@ -64,18 +65,88 @@ typedef struct
|
||||
BOOLEAN fEndedWithCollisionPositionSet;
|
||||
vector_3 EndedWithCollisionPosition;
|
||||
BOOLEAN fHaveHitGround;
|
||||
BOOLEAN fPotentialForDebug;
|
||||
INT16 sLevelNodeGridNo;
|
||||
INT32 iSoundID;
|
||||
UINT8 ubLastTargetTakenDamage;
|
||||
BOOLEAN fPotentialForDebug;
|
||||
INT16 sLevelNodeGridNo;
|
||||
INT32 iSoundID;
|
||||
UINT8 ubLastTargetTakenDamage;
|
||||
UINT8 ubPadding[1];
|
||||
|
||||
} REAL_OBJECT;
|
||||
};
|
||||
|
||||
class REAL_OBJECT
|
||||
{
|
||||
public:
|
||||
REAL_OBJECT () {initialize();};
|
||||
REAL_OBJECT& operator=(OLD_REAL_OBJECT_101& src);
|
||||
BOOLEAN Load(HWFILE hFile);
|
||||
BOOLEAN Save(HWFILE hFile);
|
||||
void initialize();
|
||||
|
||||
BOOLEAN fAllocated;
|
||||
BOOLEAN fAlive;
|
||||
BOOLEAN fApplyFriction;
|
||||
BOOLEAN fColliding;
|
||||
BOOLEAN fZOnRest;
|
||||
BOOLEAN fVisible;
|
||||
BOOLEAN fInWater;
|
||||
BOOLEAN fTestObject;
|
||||
BOOLEAN fTestEndedWithCollision;
|
||||
BOOLEAN fTestPositionNotSet;
|
||||
|
||||
real TestZTarget;
|
||||
real OneOverMass;
|
||||
real AppliedMu;
|
||||
|
||||
vector_3 Position;
|
||||
vector_3 TestTargetPosition;
|
||||
vector_3 OldPosition;
|
||||
vector_3 Velocity;
|
||||
vector_3 OldVelocity;
|
||||
vector_3 InitialForce;
|
||||
vector_3 Force;
|
||||
vector_3 CollisionNormal;
|
||||
vector_3 CollisionVelocity;
|
||||
real CollisionElasticity;
|
||||
|
||||
INT16 sGridNo;
|
||||
INT32 iID;
|
||||
LEVELNODE *pNode;
|
||||
LEVELNODE *pShadow;
|
||||
|
||||
INT16 sConsecutiveCollisions;
|
||||
INT16 sConsecutiveZeroVelocityCollisions;
|
||||
INT32 iOldCollisionCode;
|
||||
|
||||
FLOAT dLifeLength;
|
||||
FLOAT dLifeSpan;
|
||||
BOOLEAN fFirstTimeMoved;
|
||||
INT16 sFirstGridNo;
|
||||
UINT8 ubOwner;
|
||||
UINT8 ubActionCode;
|
||||
UINT32 uiActionData;
|
||||
BOOLEAN fDropItem;
|
||||
UINT32 uiNumTilesMoved;
|
||||
BOOLEAN fCatchGood;
|
||||
BOOLEAN fAttemptedCatch;
|
||||
BOOLEAN fCatchAnimOn;
|
||||
BOOLEAN fCatchCheckDone;
|
||||
BOOLEAN fEndedWithCollisionPositionSet;
|
||||
vector_3 EndedWithCollisionPosition;
|
||||
BOOLEAN fHaveHitGround;
|
||||
BOOLEAN fPotentialForDebug;
|
||||
INT16 sLevelNodeGridNo;
|
||||
INT32 iSoundID;
|
||||
UINT8 ubLastTargetTakenDamage;
|
||||
|
||||
char endOfPod;
|
||||
OBJECTTYPE Obj;
|
||||
};
|
||||
#define SIZEOF_REAL_OBJECT_POD offsetof(REAL_OBJECT, endOfPod)
|
||||
|
||||
|
||||
#define NUM_OBJECT_SLOTS 50
|
||||
|
||||
extern REAL_OBJECT ObjectSlots[ NUM_OBJECT_SLOTS ];
|
||||
extern REAL_OBJECT ObjectSlots[ NUM_OBJECT_SLOTS ];
|
||||
|
||||
|
||||
// OBJECT LIST STUFF
|
||||
@@ -95,7 +166,7 @@ void CalculateLaunchItemParamsForThrow( SOLDIERTYPE *pSoldier, INT16 sGridNo, UI
|
||||
|
||||
|
||||
// SIMULATE WORLD
|
||||
void SimulateWorld( );
|
||||
void SimulateWorld( );
|
||||
|
||||
|
||||
BOOLEAN SavePhysicsTableToSaveGameFile( HWFILE hFile );
|
||||
|
||||
+42
-42
@@ -30,28 +30,28 @@ void Add3X3Pit( INT32 iMapIndex )
|
||||
if( !gfEditMode )
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
AddObjectToTail( iMapIndex + 159, REGWATERTEXTURE1 );
|
||||
AddObjectToTail( iMapIndex - 1, REGWATERTEXTURE2 );
|
||||
AddObjectToTail( iMapIndex - 1, REGWATERTEXTURE2 );
|
||||
AddObjectToTail( iMapIndex - 161, REGWATERTEXTURE3 );
|
||||
AddObjectToTail( iMapIndex + 160, REGWATERTEXTURE4 );
|
||||
AddObjectToTail( iMapIndex, REGWATERTEXTURE5 );
|
||||
AddObjectToTail( iMapIndex - 160, REGWATERTEXTURE6 );
|
||||
AddObjectToTail( iMapIndex + 161, REGWATERTEXTURE7 );
|
||||
AddObjectToTail( iMapIndex + 1, REGWATERTEXTURE8 );
|
||||
AddObjectToTail( iMapIndex + 1, REGWATERTEXTURE8 );
|
||||
AddObjectToTail( iMapIndex - 159, REGWATERTEXTURE9 );
|
||||
if( !gfEditMode )
|
||||
{ //Add the exitgrids associated with the pit.
|
||||
ExitGrid.ubGotoSectorX = (UINT8)gWorldSectorX;
|
||||
ExitGrid.ubGotoSectorY = (UINT8)gWorldSectorY;
|
||||
ExitGrid.ubGotoSectorZ = (UINT8)(gbWorldSectorZ+1);
|
||||
ExitGrid.usGridNo = (UINT16)iMapIndex;
|
||||
ExitGrid.sGridNo = (INT16)iMapIndex;
|
||||
AddExitGridToWorld( iMapIndex + 159, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 161, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 160, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 160, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 161, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 159, &ExitGrid );
|
||||
RecompileLocalMovementCostsFromRadius( (INT16)iMapIndex, 2 );
|
||||
}
|
||||
@@ -68,12 +68,12 @@ void Add5X5Pit( INT32 iMapIndex )
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
AddObjectToTail( iMapIndex + 318, REGWATERTEXTURE10 );
|
||||
AddObjectToTail( iMapIndex + 158, REGWATERTEXTURE11 );
|
||||
AddObjectToTail( iMapIndex - 2, REGWATERTEXTURE12 );
|
||||
AddObjectToTail( iMapIndex - 2, REGWATERTEXTURE12 );
|
||||
AddObjectToTail( iMapIndex - 162, REGWATERTEXTURE13 );
|
||||
AddObjectToTail( iMapIndex - 322, REGWATERTEXTURE14 );
|
||||
AddObjectToTail( iMapIndex + 319, REGWATERTEXTURE15 );
|
||||
AddObjectToTail( iMapIndex + 159, REGWATERTEXTURE16 );
|
||||
AddObjectToTail( iMapIndex - 1, REGWATERTEXTURE17 );
|
||||
AddObjectToTail( iMapIndex - 1, REGWATERTEXTURE17 );
|
||||
AddObjectToTail( iMapIndex - 161, REGWATERTEXTURE18 );
|
||||
AddObjectToTail( iMapIndex - 321, REGWATERTEXTURE19 );
|
||||
AddObjectToTail( iMapIndex + 320, REGWATERTEXTURE20 );
|
||||
@@ -83,12 +83,12 @@ void Add5X5Pit( INT32 iMapIndex )
|
||||
AddObjectToTail( iMapIndex - 320, REGWATERTEXTURE24 );
|
||||
AddObjectToTail( iMapIndex + 321, REGWATERTEXTURE25 );
|
||||
AddObjectToTail( iMapIndex + 161, REGWATERTEXTURE26 );
|
||||
AddObjectToTail( iMapIndex + 1, REGWATERTEXTURE27 );
|
||||
AddObjectToTail( iMapIndex + 1, REGWATERTEXTURE27 );
|
||||
AddObjectToTail( iMapIndex - 159, REGWATERTEXTURE28 );
|
||||
AddObjectToTail( iMapIndex - 319, REGWATERTEXTURE29 );
|
||||
AddObjectToTail( iMapIndex + 322, REGWATERTEXTURE30 );
|
||||
AddObjectToTail( iMapIndex + 162, REGWATERTEXTURE31 );
|
||||
AddObjectToTail( iMapIndex + 2, REGWATERTEXTURE32 );
|
||||
AddObjectToTail( iMapIndex + 2, REGWATERTEXTURE32 );
|
||||
AddObjectToTail( iMapIndex - 158, REGWATERTEXTURE33 );
|
||||
AddObjectToTail( iMapIndex - 318, REGWATERTEXTURE34 );
|
||||
if( !gfEditMode )
|
||||
@@ -96,30 +96,30 @@ void Add5X5Pit( INT32 iMapIndex )
|
||||
ExitGrid.ubGotoSectorX = (UINT8)gWorldSectorX;
|
||||
ExitGrid.ubGotoSectorY = (UINT8)gWorldSectorY;
|
||||
ExitGrid.ubGotoSectorZ = (UINT8)(gbWorldSectorZ+1);
|
||||
ExitGrid.usGridNo = (UINT16)iMapIndex;
|
||||
ExitGrid.sGridNo = (INT16)iMapIndex;
|
||||
AddExitGridToWorld( iMapIndex + 318, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 158, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 2, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 2, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 162, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 322, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 319, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 159, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 161, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 321, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 320, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 160, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 160, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 320, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 321, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 161, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 1, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 159, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 319, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 322, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 162, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 2, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex + 2, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 158, &ExitGrid );
|
||||
AddExitGridToWorld( iMapIndex - 318, &ExitGrid );
|
||||
RecompileLocalMovementCostsFromRadius( (INT16)iMapIndex, 3 );
|
||||
@@ -132,13 +132,13 @@ void Add5X5Pit( INT32 iMapIndex )
|
||||
void Remove3X3Pit( INT32 iMapIndex )
|
||||
{
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 159, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 161, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 160, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 160, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 161, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 159, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
MarkWorldDirty();
|
||||
}
|
||||
@@ -147,12 +147,12 @@ void Remove5X5Pit( INT32 iMapIndex )
|
||||
{
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 318, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 158, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 2, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 2, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 162, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 322, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 319, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 159, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 161, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 321, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 320, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
@@ -162,12 +162,12 @@ void Remove5X5Pit( INT32 iMapIndex )
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 320, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 321, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 161, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 1, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 159, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 319, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 322, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 162, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 2, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex + 2, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 158, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex - 318, REGWATERTEXTURE, REGWATERTEXTURE );
|
||||
MarkWorldDirty();
|
||||
@@ -178,13 +178,13 @@ void AddAllPits()
|
||||
UINT32 i;
|
||||
for( i = 0; i < guiNumWorldItems; i++ )
|
||||
{
|
||||
if( gWorldItems[ i ].o.usItem == ACTION_ITEM )
|
||||
if( gWorldItems[ i ].object.usItem == ACTION_ITEM )
|
||||
{
|
||||
if( gWorldItems[ i ].o.ItemData.Trigger.bActionValue == ACTION_ITEM_SMALL_PIT )
|
||||
Add3X3Pit( gWorldItems[ i ].sGridNo );
|
||||
else if( gWorldItems[ i ].o.ItemData.Trigger.bActionValue == ACTION_ITEM_LARGE_PIT )
|
||||
if( gWorldItems[ i ].object[0]->data.misc.bActionValue == ACTION_ITEM_SMALL_PIT )
|
||||
Add3X3Pit( gWorldItems[ i ].sGridNo );
|
||||
else if( gWorldItems[ i ].object[0]->data.misc.bActionValue == ACTION_ITEM_LARGE_PIT )
|
||||
Add5X5Pit( gWorldItems[ i ].sGridNo );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,13 +193,13 @@ void RemoveAllPits()
|
||||
UINT32 i;
|
||||
for( i = 0; i < guiNumWorldItems; i++ )
|
||||
{
|
||||
if( gWorldItems[ i ].o.usItem == ACTION_ITEM )
|
||||
if( gWorldItems[ i ].object.usItem == ACTION_ITEM )
|
||||
{
|
||||
if( gWorldItems[ i ].o.ItemData.Trigger.bActionValue == ACTION_ITEM_SMALL_PIT )
|
||||
Remove3X3Pit( gWorldItems[ i ].sGridNo );
|
||||
else if( gWorldItems[ i ].o.ItemData.Trigger.bActionValue == ACTION_ITEM_LARGE_PIT )
|
||||
if( gWorldItems[ i ].object[0]->data.misc.bActionValue == ACTION_ITEM_SMALL_PIT )
|
||||
Remove3X3Pit( gWorldItems[ i ].sGridNo );
|
||||
else if( gWorldItems[ i ].object[0]->data.misc.bActionValue == ACTION_ITEM_LARGE_PIT )
|
||||
Remove5X5Pit( gWorldItems[ i ].sGridNo );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,8 +214,8 @@ void SearchForOtherMembersWithinPitRadiusAndMakeThemFall( INT16 sGridNo, INT16 s
|
||||
for( y = -sRadius; y <= sRadius; y++ ) for( x = -sRadius; x <= sRadius; x++ )
|
||||
{
|
||||
sNewGridNo = sGridNo + y * WORLD_COLS + x;
|
||||
//Validate gridno location, and check if there are any mercs here. If there are
|
||||
//any mercs, we want them to fall below. The exitgrid already exists at this location
|
||||
//Validate gridno location, and check if there are any mercs here. If there are
|
||||
//any mercs, we want them to fall below. The exitgrid already exists at this location
|
||||
if( GridNoOnVisibleWorldTile( sNewGridNo ) )
|
||||
{
|
||||
|
||||
@@ -228,10 +228,10 @@ void SearchForOtherMembersWithinPitRadiusAndMakeThemFall( INT16 sGridNo, INT16 s
|
||||
// Set data to look for exit grid....
|
||||
pSoldier = MercPtrs[ ubID ];
|
||||
|
||||
pSoldier->uiPendingActionData4 = sNewGridNo;
|
||||
pSoldier->aiData.uiPendingActionData4 = sNewGridNo;
|
||||
|
||||
EVENT_InitNewSoldierAnim( pSoldier, FALL_INTO_PIT, 0 , FALSE );
|
||||
}
|
||||
pSoldier->EVENT_InitNewSoldierAnim( FALL_INTO_PIT, 0 , FALSE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,14 +242,14 @@ void HandleFallIntoPitFromAnimation( UINT8 ubID )
|
||||
EXITGRID ExitGrid;
|
||||
INT16 sPitGridNo;
|
||||
// OK, get exit grid...
|
||||
|
||||
sPitGridNo = (INT16)pSoldier->uiPendingActionData4;
|
||||
|
||||
sPitGridNo = (INT16)pSoldier->aiData.uiPendingActionData4;
|
||||
|
||||
GetExitGrid( sPitGridNo, &ExitGrid );
|
||||
|
||||
// Given exit grid, make buddy move to next sector....
|
||||
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
pSoldier->usStrategicInsertionData = ExitGrid.usGridNo;
|
||||
pSoldier->usStrategicInsertionData = ExitGrid.sGridNo;
|
||||
|
||||
pSoldier->sSectorX = ExitGrid.ubGotoSectorX;
|
||||
pSoldier->sSectorY = ExitGrid.ubGotoSectorY;
|
||||
@@ -260,6 +260,6 @@ void HandleFallIntoPitFromAnimation( UINT8 ubID )
|
||||
|
||||
HandleSoldierLeavingSectorByThemSelf( pSoldier );
|
||||
|
||||
SetSoldierHeight( pSoldier, 0 );
|
||||
pSoldier->SetSoldierHeight( 0 );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+461
-457
File diff suppressed because it is too large
Load Diff
@@ -156,17 +156,17 @@ void ScrollWorld( );
|
||||
void InitRenderParams( UINT8 ubRestrictionID );
|
||||
void RenderWorld( );
|
||||
|
||||
/* This procedure will initialize gsVIEWPORT_xxx variables
|
||||
* they ware declared with static initializer
|
||||
* any question? joker
|
||||
/* This procedure will initialize gsVIEWPORT_xxx variables
|
||||
* they ware declared with static initializer
|
||||
* any question? joker
|
||||
*/
|
||||
void InitializeViewPort();
|
||||
void ResetLayerOptimizing(void);
|
||||
void ResetSpecificLayerOptimizing( UINT32 uiRowFlag );
|
||||
|
||||
// Routines of RenderWorld
|
||||
extern void RenderStaticWorld( );
|
||||
extern void RenderDynamicWorld( );
|
||||
extern void RenderStaticWorld( );
|
||||
extern void RenderDynamicWorld( );
|
||||
void CopyRenderBuffer( );
|
||||
|
||||
void SetRenderFlags(UINT32 uiFlags);
|
||||
|
||||
+191
-173
@@ -33,7 +33,7 @@
|
||||
#endif
|
||||
|
||||
#include "explosion control.h"
|
||||
#include "sound control.h"
|
||||
#include "Sound Control.h"
|
||||
|
||||
#include "Buildings.h"
|
||||
|
||||
@@ -51,13 +51,13 @@
|
||||
|
||||
void DeleteStructureFromTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure );
|
||||
/*
|
||||
* NB: STRUCTURE_SPECIAL
|
||||
* NB: STRUCTURE_SPECIAL
|
||||
*
|
||||
* Means different things depending on the context.
|
||||
*
|
||||
*
|
||||
* WALLNWINDOW SPECIAL - opaque to sight
|
||||
* MULTI SPECIAL - second level (damaged) MULTI structure, should only be deleted if
|
||||
* starting with the deletion of a MULTI SPECIAL structure
|
||||
* MULTI SPECIAL - second level (damaged) MULTI structure, should only be deleted if
|
||||
* starting with the deletion of a MULTI SPECIAL structure
|
||||
*/
|
||||
|
||||
UINT8 AtHeight[PROFILE_Z_SIZE] = { 0x01, 0x02, 0x04, 0x08 };
|
||||
@@ -106,7 +106,7 @@ INT32 guiMaterialHitSound[ NUM_MATERIAL_TYPES ] =
|
||||
|
||||
UINT8 gubMaterialArmour[] =
|
||||
/*
|
||||
index 1-10, organics
|
||||
index 1-10, organics
|
||||
index 11-20, rocks and concretes
|
||||
index 21-30, metals
|
||||
|
||||
@@ -125,11 +125,11 @@ index 25, indestructable metal
|
||||
*/
|
||||
|
||||
{ // note: must increase; r.c. should block *AP* 7.62mm rounds
|
||||
0, // nothing
|
||||
0, // nothing
|
||||
25, // dry timber; wood wall +1/2
|
||||
20, // furniture wood (thin!) or plywood wall +1/2
|
||||
30, // wood (live); 1.5x timber
|
||||
3, // light vegetation
|
||||
3, // light vegetation
|
||||
10, // upholstered furniture
|
||||
47, // porcelain
|
||||
10, // cactus, hay, bamboo
|
||||
@@ -138,9 +138,9 @@ index 25, indestructable metal
|
||||
0,
|
||||
55, // stone masonry; 3x timber
|
||||
63, // non-reinforced concrete; 4x timber???
|
||||
70, // reinforced concrete; 6x timber
|
||||
85, // rock? - number invented
|
||||
9, // rubber - tires
|
||||
70, // reinforced concrete; 6x timber
|
||||
85, // rock? - number invented
|
||||
9, // rubber - tires
|
||||
40, // sand
|
||||
1, // cloth
|
||||
40, // sandbag
|
||||
@@ -148,7 +148,7 @@ index 25, indestructable metal
|
||||
0,
|
||||
37, // light metal (furniture; NB thin!)
|
||||
57, // thicker metal (dumpster)
|
||||
85, // heavy metal (vault doors) - block everything
|
||||
85, // heavy metal (vault doors) - block everything
|
||||
// note that vehicle armour will probably end up in here
|
||||
127, // rock indestructable
|
||||
127, // indestructable
|
||||
@@ -185,8 +185,9 @@ UINT8 FilledTilePositions( DB_STRUCTURE_TILE * pTile )
|
||||
//
|
||||
|
||||
void FreeStructureFileRef( STRUCTURE_FILE_REF * pFileRef )
|
||||
{ // Frees all of the memory associated with a file reference, including
|
||||
// the file reference structure itself
|
||||
{
|
||||
// Frees all of the memory associated with a file reference, including
|
||||
// the file reference structure itself
|
||||
|
||||
UINT16 usLoop;
|
||||
|
||||
@@ -218,7 +219,8 @@ void FreeStructureFileRef( STRUCTURE_FILE_REF * pFileRef )
|
||||
}
|
||||
|
||||
void FreeAllStructureFiles( void )
|
||||
{ // Frees all of the structure database!
|
||||
{
|
||||
// Frees all of the structure database!
|
||||
STRUCTURE_FILE_REF * pFileRef;
|
||||
STRUCTURE_FILE_REF * pNextRef;
|
||||
|
||||
@@ -261,14 +263,15 @@ BOOLEAN FreeStructureFile( STRUCTURE_FILE_REF * pStructureFile )
|
||||
|
||||
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
|
||||
{
|
||||
// Loads a structure file's data as a honking chunk o' memory
|
||||
HWFILE hInput;
|
||||
STRUCTURE_FILE_HEADER Header;
|
||||
STRUCTURE_FILE_HEADER Header;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiDataSize;
|
||||
BOOLEAN fOk;
|
||||
|
||||
CHECKF( szFileName );
|
||||
CHECKF( szFileName );
|
||||
CHECKF( pFileRef );
|
||||
hInput = FileOpen( szFileName, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
if (hInput == 0)
|
||||
@@ -359,8 +362,9 @@ BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32
|
||||
}
|
||||
|
||||
BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataSize )
|
||||
{ // Based on a file chunk, creates all the dynamic arrays for the
|
||||
// structure definitions contained within
|
||||
{
|
||||
// Based on a file chunk, creates all the dynamic arrays for the
|
||||
// structure definitions contained within
|
||||
|
||||
UINT8 * pCurrent;
|
||||
DB_STRUCTURE_REF * pDBStructureRef;
|
||||
@@ -406,7 +410,7 @@ BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataS
|
||||
ppTileArray[usTileLoop] = (DB_STRUCTURE_TILE *) pCurrent;
|
||||
// set the single-value relative position between this tile and the base tile
|
||||
ppTileArray[usTileLoop]->sPosRelToBase = ppTileArray[usTileLoop]->bXPosRelToBase + ppTileArray[usTileLoop]->bYPosRelToBase * WORLD_COLS;
|
||||
uiHitPoints += FilledTilePositions( ppTileArray[usTileLoop] );
|
||||
uiHitPoints += FilledTilePositions( ppTileArray[usTileLoop] );
|
||||
pCurrent += sizeof( DB_STRUCTURE_TILE );
|
||||
}
|
||||
// scale hit points down to something reasonable...
|
||||
@@ -429,7 +433,8 @@ BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataS
|
||||
}
|
||||
|
||||
STRUCTURE_FILE_REF * LoadStructureFile( STR szFileName )
|
||||
{ // NB should be passed in expected number of structures so we can check equality
|
||||
{
|
||||
// NB should be passed in expected number of structures so we can check equality
|
||||
UINT32 uiDataSize = 0;
|
||||
BOOLEAN fOk;
|
||||
STRUCTURE_FILE_REF * pFileRef;
|
||||
@@ -455,7 +460,7 @@ STRUCTURE_FILE_REF * LoadStructureFile( STR szFileName )
|
||||
return( NULL );
|
||||
}
|
||||
}
|
||||
// Add the file reference to the master list, at the head for convenience
|
||||
// Add the file reference to the master list, at the head for convenience
|
||||
if (gpStructureFileRefs != NULL)
|
||||
{
|
||||
gpStructureFileRefs->pPrev = pFileRef;
|
||||
@@ -472,7 +477,8 @@ STRUCTURE_FILE_REF * LoadStructureFile( STR szFileName )
|
||||
|
||||
|
||||
STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileNum )
|
||||
{ // Creates a STRUCTURE struct for one tile of a structure
|
||||
{
|
||||
// Creates a STRUCTURE struct for one tile of a structure
|
||||
STRUCTURE * pStructure;
|
||||
DB_STRUCTURE * pDBStructure;
|
||||
DB_STRUCTURE_TILE * pTile;
|
||||
@@ -484,7 +490,7 @@ STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubT
|
||||
CHECKN( pDBStructureRef->ppTile );
|
||||
pTile = pDBStructureRef->ppTile[ubTileNum];
|
||||
CHECKN( pTile );
|
||||
|
||||
|
||||
// allocate memory...
|
||||
pStructure = (STRUCTURE *) MemAlloc( sizeof( STRUCTURE ) );
|
||||
CHECKN( pStructure );
|
||||
@@ -506,7 +512,7 @@ STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubT
|
||||
{
|
||||
// for multi-tile walls, which are only the special corner pieces,
|
||||
// the non-base tile gets no orientation value because this copy
|
||||
// will be skipped
|
||||
// will be skipped
|
||||
if (pStructure->fFlags & STRUCTURE_BASE_TILE)
|
||||
{
|
||||
pStructure->ubWallOrientation = pDBStructure->ubWallOrientation;
|
||||
@@ -522,7 +528,8 @@ STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubT
|
||||
}
|
||||
|
||||
BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fIgnorePeople )
|
||||
{ // Verifies whether a structure is blocked from being added to the map at a particular point
|
||||
{
|
||||
// Verifies whether a structure is blocked from being added to the map at a particular point
|
||||
DB_STRUCTURE * pDBStructure;
|
||||
DB_STRUCTURE_TILE ** ppTile;
|
||||
STRUCTURE * pExistingStructure;
|
||||
@@ -562,15 +569,15 @@ BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
|
||||
// CJC:
|
||||
// If adding a mobile structure, allow addition if existing structure is passable
|
||||
if ( (pDBStructure->fFlags & STRUCTURE_MOBILE) && (pExistingStructure->fFlags & STRUCTURE_PASSABLE) )
|
||||
{
|
||||
if ( (pDBStructure->fFlags & STRUCTURE_MOBILE) && (pExistingStructure->fFlags & STRUCTURE_PASSABLE) )
|
||||
{
|
||||
// Skip!
|
||||
pExistingStructure = pExistingStructure->pNext;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (pDBStructure->fFlags & STRUCTURE_OBSTACLE)
|
||||
if (pDBStructure->fFlags & STRUCTURE_OBSTACLE)
|
||||
{
|
||||
|
||||
// CJC: NB these next two if states are probably COMPLETELY OBSOLETE but I'm leaving
|
||||
@@ -598,14 +605,14 @@ BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// two obstacle structures aren't allowed in the same tile at the same height
|
||||
// ATE: There is more sophisticated logic for mobiles, so postpone this check if mobile....
|
||||
if ( ( pExistingStructure->fFlags & STRUCTURE_OBSTACLE ) && !( pDBStructure->fFlags & STRUCTURE_MOBILE ) )
|
||||
{
|
||||
if ( pExistingStructure->fFlags & STRUCTURE_PASSABLE && !(pExistingStructure->fFlags & STRUCTURE_MOBILE) )
|
||||
{
|
||||
// no mobiles, existing structure is passable
|
||||
// no mobiles, existing structure is passable
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -687,8 +694,8 @@ BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( pDBStructure->fFlags & STRUCTURE_MOBILE )
|
||||
|
||||
if ( pDBStructure->fFlags & STRUCTURE_MOBILE )
|
||||
{
|
||||
// ATE:
|
||||
// ignore this one if it has the same ID num as exclusion
|
||||
@@ -720,13 +727,13 @@ BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// ATE: Another rule: allow PASSABLE *IF* the PASSABLE is *NOT* MOBILE!
|
||||
// ATE: Another rule: allow PASSABLE *IF* the PASSABLE is *NOT* MOBILE!
|
||||
if ( !( pExistingStructure->fFlags & STRUCTURE_MOBILE ) && (pExistingStructure->fFlags & STRUCTURE_PASSABLE) )
|
||||
{
|
||||
// Skip!
|
||||
pExistingStructure = pExistingStructure->pNext;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// ATE: Added here - UNLESS this part is PASSABLE....
|
||||
// two obstacle structures aren't allowed in the same tile at the same height
|
||||
@@ -735,7 +742,7 @@ BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((pDBStructure->fFlags & STRUCTURE_OPENABLE))
|
||||
{
|
||||
if (pExistingStructure->fFlags & STRUCTURE_OPENABLE)
|
||||
@@ -749,7 +756,7 @@ BOOLEAN OkayToAddStructureToTile( INT16 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
|
||||
|
||||
pExistingStructure = pExistingStructure->pNext;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -803,7 +810,8 @@ BOOLEAN OkayToAddStructureToWorld( INT16 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
// adds a STRUCTURE to a MAP_ELEMENT (adds part of a structure to a location on the map)
|
||||
STRUCTURE * pStructureTail;
|
||||
|
||||
CHECKF( pMapElement );
|
||||
@@ -829,7 +837,8 @@ BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, U
|
||||
|
||||
|
||||
STRUCTURE * InternalAddStructureToWorld( INT16 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
|
||||
{
|
||||
// Adds a complete structure to the world at a location plus all other locations covered by the structure
|
||||
INT16 sGridNo;
|
||||
STRUCTURE ** ppStructure;
|
||||
STRUCTURE * pBaseStructure;
|
||||
@@ -859,9 +868,9 @@ STRUCTURE * InternalAddStructureToWorld( INT16 sBaseGridNo, INT8 bLevel, DB_STRU
|
||||
|
||||
// We go through a definition stage here and a later stage of
|
||||
// adding everything to the world so that we don't have to untangle
|
||||
// things if we run out of memory. First we create an array of
|
||||
// things if we run out of memory. First we create an array of
|
||||
// pointers to point to all of the STRUCTURE elements created in
|
||||
// the first stage. This array gets given to the base tile so
|
||||
// the first stage. This array gets given to the base tile so
|
||||
// there is an easy way to remove an entire object from the world quickly
|
||||
|
||||
// NB we add 1 because the 0th element is in fact the reference count!
|
||||
@@ -886,9 +895,9 @@ STRUCTURE * InternalAddStructureToWorld( INT16 sBaseGridNo, INT8 bLevel, DB_STRU
|
||||
if (ubLoop != BASE_TILE)
|
||||
{
|
||||
#ifdef JA2EDITOR
|
||||
//Kris:
|
||||
//Kris:
|
||||
//Added this undo code if in the editor.
|
||||
//It is important to save tiles effected by multitiles. If the structure placement
|
||||
//It is important to save tiles effected by multitiles. If the structure placement
|
||||
//fails below, it doesn't matter, because it won't hurt the undo code.
|
||||
if( gfEditMode )
|
||||
AddToUndoList( ppStructure[ ubLoop ]->sGridNo );
|
||||
@@ -938,7 +947,7 @@ STRUCTURE * InternalAddStructureToWorld( INT16 sBaseGridNo, INT8 bLevel, DB_STRU
|
||||
}
|
||||
else if (pLevelNode->uiFlags & LEVELNODE_ROTTINGCORPSE)
|
||||
{
|
||||
// ATE: Offset IDs so they don't collide with soldiers
|
||||
// ATE: Offset IDs so they don't collide with soldiers
|
||||
usStructureID = (UINT16)( TOTAL_SOLDIERS + pLevelNode->pAniTile->uiUserData );
|
||||
}
|
||||
else
|
||||
@@ -956,7 +965,7 @@ STRUCTURE * InternalAddStructureToWorld( INT16 sBaseGridNo, INT8 bLevel, DB_STRU
|
||||
{
|
||||
sGridNo = ppStructure[ubLoop]->sGridNo;
|
||||
if (ubLoop == BASE_TILE)
|
||||
{
|
||||
{
|
||||
sBaseTileHeight = gpWorldLevelData[sGridNo].sHeight;
|
||||
}
|
||||
else
|
||||
@@ -1010,7 +1019,8 @@ BOOLEAN AddStructureToWorld( INT16 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF *
|
||||
//
|
||||
|
||||
void DeleteStructureFromTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure )
|
||||
{ // removes a STRUCTURE element at a particular location from the world
|
||||
{
|
||||
// removes a STRUCTURE element at a particular location from the world
|
||||
// put location pointer in tile
|
||||
if (pMapElement->pStructureHead == pStructure)
|
||||
{
|
||||
@@ -1034,7 +1044,7 @@ void DeleteStructureFromTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure
|
||||
}
|
||||
else
|
||||
{
|
||||
// second or later element in the list; it's guaranteed that there is a
|
||||
// second or later element in the list; it's guaranteed that there is a
|
||||
// previous element but not necessary a next
|
||||
pStructure->pPrev->pNext = pStructure->pNext;
|
||||
if (pStructure->pNext != NULL)
|
||||
@@ -1050,7 +1060,8 @@ void DeleteStructureFromTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure
|
||||
}
|
||||
|
||||
BOOLEAN DeleteStructureFromWorld( STRUCTURE * pStructure )
|
||||
{ // removes all of the STRUCTURE elements for a structure from the world
|
||||
{
|
||||
// removes all of the STRUCTURE elements for a structure from the world
|
||||
MAP_ELEMENT * pBaseMapElement;
|
||||
STRUCTURE * pBaseStructure;
|
||||
DB_STRUCTURE_TILE ** ppTile;
|
||||
@@ -1067,7 +1078,7 @@ BOOLEAN DeleteStructureFromWorld( STRUCTURE * pStructure )
|
||||
CHECKF( pStructure );
|
||||
|
||||
pBaseStructure = FindBaseStructure( pStructure );
|
||||
CHECKF( pBaseStructure );
|
||||
CHECKF( pBaseStructure );
|
||||
|
||||
usStructureID = pBaseStructure->usStructureID;
|
||||
fMultiStructure = ( ( pBaseStructure->fFlags & STRUCTURE_MULTI ) != 0 );
|
||||
@@ -1116,12 +1127,13 @@ BOOLEAN DeleteStructureFromWorld( STRUCTURE * pStructure )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
STRUCTURE * InternalSwapStructureForPartner( INT16 sGridNo, STRUCTURE * pStructure, BOOLEAN fFlipSwitches, BOOLEAN fStoreInMap )
|
||||
{ // switch structure
|
||||
{
|
||||
// switch structure
|
||||
LEVELNODE * pLevelNode;
|
||||
LEVELNODE * pShadowNode;
|
||||
STRUCTURE * pBaseStructure;
|
||||
@@ -1207,7 +1219,7 @@ STRUCTURE * InternalSwapStructureForPartner( INT16 sGridNo, STRUCTURE * pStructu
|
||||
}
|
||||
|
||||
STRUCTURE * SwapStructureForPartner( INT16 sGridNo, STRUCTURE * pStructure )
|
||||
{
|
||||
{
|
||||
return( InternalSwapStructureForPartner( sGridNo, pStructure, TRUE, FALSE ) );
|
||||
}
|
||||
|
||||
@@ -1222,13 +1234,14 @@ STRUCTURE * SwapStructureForPartnerAndStoreChangeInMap( INT16 sGridNo, STRUCTURE
|
||||
}
|
||||
|
||||
STRUCTURE * FindStructure( INT16 sGridNo, UINT32 fFlags )
|
||||
{ // finds a structure that matches any of the given flags
|
||||
{
|
||||
// finds a structure that matches any of the given flags
|
||||
STRUCTURE * pCurrent;
|
||||
|
||||
if( sGridNo > WORLD_MAX-1 ) //bug fix for win98 crash when traveling between sectors
|
||||
return( NULL );
|
||||
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
while (pCurrent != NULL)
|
||||
{
|
||||
if ((pCurrent->fFlags & fFlags) != 0)
|
||||
@@ -1258,10 +1271,11 @@ STRUCTURE * FindNextStructure( STRUCTURE * pStructure, UINT32 fFlags )
|
||||
}
|
||||
|
||||
STRUCTURE * FindStructureByID( INT16 sGridNo, UINT16 usStructureID )
|
||||
{ // finds a structure that matches any of the given flags
|
||||
{
|
||||
// finds a structure that matches any of the given flags
|
||||
STRUCTURE * pCurrent;
|
||||
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
while (pCurrent != NULL)
|
||||
{
|
||||
if (pCurrent->usStructureID == usStructureID)
|
||||
@@ -1274,7 +1288,8 @@ STRUCTURE * FindStructureByID( INT16 sGridNo, UINT16 usStructureID )
|
||||
}
|
||||
|
||||
STRUCTURE * FindBaseStructure( STRUCTURE * pStructure )
|
||||
{ // finds the base structure for any structure
|
||||
{
|
||||
// finds the base structure for any structure
|
||||
CHECKF( pStructure );
|
||||
if (pStructure->fFlags & STRUCTURE_BASE_TILE)
|
||||
{
|
||||
@@ -1284,7 +1299,8 @@ STRUCTURE * FindBaseStructure( STRUCTURE * pStructure )
|
||||
}
|
||||
|
||||
STRUCTURE * FindNonBaseStructure( INT16 sGridNo, STRUCTURE * pStructure )
|
||||
{ // finds a non-base structure in a location
|
||||
{
|
||||
// finds a non-base structure in a location
|
||||
CHECKF( pStructure );
|
||||
if (!(pStructure->fFlags & STRUCTURE_BASE_TILE))
|
||||
{ // error!
|
||||
@@ -1311,7 +1327,8 @@ INT16 GetBaseTile( STRUCTURE * pStructure )
|
||||
}
|
||||
|
||||
INT8 StructureHeight( STRUCTURE * pStructure )
|
||||
{ // return the height of an object from 1-4
|
||||
{
|
||||
// return the height of an object from 1-4
|
||||
UINT8 ubLoopX, ubLoopY;
|
||||
PROFILE * pShape;
|
||||
UINT8 ubShapeValue;
|
||||
@@ -1350,7 +1367,7 @@ INT8 StructureHeight( STRUCTURE * pStructure )
|
||||
return( bGreatestHeight + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1443,7 +1460,8 @@ INT8 GetStructureTargetHeight( INT16 sGridNo, BOOLEAN fOnRoof )
|
||||
|
||||
|
||||
INT8 StructureBottomLevel( STRUCTURE * pStructure )
|
||||
{ // return the bottom level of an object, from 1-4
|
||||
{
|
||||
// return the bottom level of an object, from 1-4
|
||||
UINT8 ubLoopX, ubLoopY;
|
||||
PROFILE * pShape;
|
||||
UINT8 ubShapeValue;
|
||||
@@ -1474,7 +1492,7 @@ INT8 StructureBottomLevel( STRUCTURE * pStructure )
|
||||
return( 1 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1533,7 +1551,8 @@ BOOLEAN StructureDensity( STRUCTURE * pStructure, UINT8 * pubLevel0, UINT8 * pub
|
||||
}
|
||||
|
||||
BOOLEAN DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason, INT16 sGridNo, INT16 sX, INT16 sY, UINT8 ubOwner )
|
||||
{ // do damage to a structure; returns TRUE if the structure should be removed
|
||||
{
|
||||
// do damage to a structure; returns TRUE if the structure should be removed
|
||||
|
||||
STRUCTURE *pBase;
|
||||
UINT8 ubArmour;
|
||||
@@ -1588,7 +1607,7 @@ BOOLEAN DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason,
|
||||
{
|
||||
// Remove struct!
|
||||
pBase = FindBaseStructure( pStructure );
|
||||
|
||||
|
||||
// ATE: Set hit points to zero....
|
||||
pBase->ubHitPoints = 0;
|
||||
|
||||
@@ -1610,17 +1629,17 @@ BOOLEAN DamageStructure( STRUCTURE * pStructure, UINT8 ubDamage, UINT8 ubReason,
|
||||
}
|
||||
|
||||
// Make hit sound....
|
||||
if ( pStructure->fFlags & STRUCTURE_CAVEWALL )
|
||||
{
|
||||
PlayJA2Sample( S_VEG_IMPACT1, RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( guiMaterialHitSound[ pStructure->pDBStructureRef->pDBStructure->ubArmour ] != -1 )
|
||||
{
|
||||
PlayJA2Sample( guiMaterialHitSound[ pStructure->pDBStructureRef->pDBStructure->ubArmour ], RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
}
|
||||
if ( pStructure->fFlags & STRUCTURE_CAVEWALL )
|
||||
{
|
||||
PlayJA2Sample( S_VEG_IMPACT1, RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( guiMaterialHitSound[ pStructure->pDBStructureRef->pDBStructure->ubArmour ] != -1 )
|
||||
{
|
||||
PlayJA2Sample( guiMaterialHitSound[ pStructure->pDBStructureRef->pDBStructure->ubArmour ], RATE_11025, SoundVolume( HIGHVOLUME, sGridNo ), 1, SoundDir( sGridNo ) );
|
||||
}
|
||||
}
|
||||
// Don't update damage HPs....
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -1654,7 +1673,7 @@ void DebugStructurePage1( void )
|
||||
STRUCTURE * pStructure;
|
||||
STRUCTURE * pBase;
|
||||
//LEVELNODE * pLand;
|
||||
UINT16 usGridNo;
|
||||
INT16 sGridNo;
|
||||
INT16 sDesiredLevel;
|
||||
INT8 bHeight, bDens0, bDens1, bDens2, bDens3;
|
||||
INT8 bStructures;
|
||||
@@ -1670,7 +1689,7 @@ void DebugStructurePage1( void )
|
||||
|
||||
SetFont( LARGEFONT1 );
|
||||
gprintf( 0, 0, L"DEBUG STRUCTURES PAGE 1 OF 1" );
|
||||
if (GetMouseMapPos( &usGridNo ) == FALSE)
|
||||
if (GetMouseMapPos( &sGridNo ) == FALSE)
|
||||
{
|
||||
return;
|
||||
//gprintf( 0, LINE_HEIGHT * 1, L"No structure selected" );
|
||||
@@ -1685,14 +1704,14 @@ void DebugStructurePage1( void )
|
||||
sDesiredLevel = STRUCTURE_ON_ROOF;
|
||||
}
|
||||
|
||||
gprintf( 320, 0, L"Building %d", gubBuildingInfo[ usGridNo ] );
|
||||
gprintf( 320, 0, L"Building %d", gubBuildingInfo[ sGridNo ] );
|
||||
/*
|
||||
pLand = gpWorldLevelData[usGridNo].pLandHead;
|
||||
pLand = gpWorldLevelData[sGridNo].pLandHead;
|
||||
gprintf( 320, 0, L"Fake light %d", pLand->ubFakeShadeLevel );
|
||||
gprintf( 320, LINE_HEIGHT, L"Real light: ground %d roof %d", LightTrueLevel( usGridNo, 0 ), LightTrueLevel( usGridNo, 1 ) );
|
||||
gprintf( 320, LINE_HEIGHT, L"Real light: ground %d roof %d", LightTrueLevel( sGridNo, 0 ), LightTrueLevel( sGridNo, 1 ) );
|
||||
*/
|
||||
|
||||
pStructure = gpWorldLevelData[usGridNo].pStructureHead;
|
||||
pStructure = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
while (pStructure != NULL)
|
||||
{
|
||||
if (pStructure->sCubeOffset == sDesiredLevel)
|
||||
@@ -1738,7 +1757,7 @@ void DebugStructurePage1( void )
|
||||
}
|
||||
else if (pStructure->fFlags & STRUCTURE_SLIDINGDOOR)
|
||||
{
|
||||
gprintf( 0, LINE_HEIGHT * 1, L"%s sliding door with orientation %s",
|
||||
gprintf( 0, LINE_HEIGHT * 1, L"%s sliding door with orientation %s",
|
||||
(pStructure->fFlags & STRUCTURE_OPEN) ? L"Open" : L"Closed",
|
||||
WallOrientationString[pStructure->ubWallOrientation] );
|
||||
}
|
||||
@@ -1755,7 +1774,7 @@ void DebugStructurePage1( void )
|
||||
gprintf( 0, LINE_HEIGHT * 1, L"UNKNOWN STRUCTURE! (%x)", pStructure->fFlags );
|
||||
}
|
||||
bHeight = StructureHeight( pStructure );
|
||||
pBase = FindBaseStructure( pStructure );
|
||||
pBase = FindBaseStructure( pStructure );
|
||||
gprintf( 0, LINE_HEIGHT * 2, L"Structure height %d, cube offset %d, armour %d, HP %d", bHeight, pStructure->sCubeOffset, gubMaterialArmour[pStructure->pDBStructureRef->pDBStructure->ubArmour], pBase->ubHitPoints );
|
||||
if (StructureDensity( pStructure, (UINT8 *)&bDens0, (UINT8 *)&bDens1, (UINT8 *)&bDens2, (UINT8 *)&bDens3 ) == TRUE)
|
||||
{
|
||||
@@ -1767,7 +1786,7 @@ void DebugStructurePage1( void )
|
||||
gprintf( 0, LINE_HEIGHT * 4, L"Structure ID %d", pStructure->usStructureID );
|
||||
#endif
|
||||
|
||||
pStructure = gpWorldLevelData[usGridNo].pStructureHead;
|
||||
pStructure = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
for ( bStructures = 0; pStructure != NULL; pStructure = pStructure->pNext)
|
||||
{
|
||||
bStructures++;
|
||||
@@ -1802,23 +1821,23 @@ void DebugStructurePage1( void )
|
||||
}
|
||||
#endif
|
||||
gprintf( 0, LINE_HEIGHT * 13, L"N %d NE %d E %d SE %d",
|
||||
gubWorldMovementCosts[ usGridNo ][ NORTH ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ usGridNo ][ NORTHEAST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ usGridNo ][ EAST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ usGridNo ][ SOUTHEAST ][ gsInterfaceLevel ] );
|
||||
gubWorldMovementCosts[ sGridNo ][ NORTH ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ sGridNo ][ NORTHEAST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ sGridNo ][ EAST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ sGridNo ][ SOUTHEAST ][ gsInterfaceLevel ] );
|
||||
gprintf( 0, LINE_HEIGHT * 14, L"S %d SW %d W %d NW %d",
|
||||
gubWorldMovementCosts[ usGridNo ][ SOUTH ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ usGridNo ][ SOUTHWEST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ usGridNo ][ WEST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ usGridNo ][ NORTHWEST ][ gsInterfaceLevel ] );
|
||||
gubWorldMovementCosts[ sGridNo ][ SOUTH ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ sGridNo ][ SOUTHWEST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ sGridNo ][ WEST ][ gsInterfaceLevel ],
|
||||
gubWorldMovementCosts[ sGridNo ][ NORTHWEST ][ gsInterfaceLevel ] );
|
||||
gprintf( 0, LINE_HEIGHT * 15, L"Ground smell %d strength %d",
|
||||
SMELL_TYPE( gpWorldLevelData[ usGridNo ].ubSmellInfo ),
|
||||
SMELL_STRENGTH( gpWorldLevelData[ usGridNo ].ubSmellInfo ) );
|
||||
SMELL_TYPE( gpWorldLevelData[ sGridNo ].ubSmellInfo ),
|
||||
SMELL_STRENGTH( gpWorldLevelData[ sGridNo ].ubSmellInfo ) );
|
||||
|
||||
#ifdef COUNT_PATHS
|
||||
if (guiTotalPathChecks > 0)
|
||||
{
|
||||
gprintf( 0, LINE_HEIGHT * 16,
|
||||
gprintf( 0, LINE_HEIGHT * 16,
|
||||
L"Total %ld, %%succ %3ld | %%failed %3ld | %%unsucc %3ld",
|
||||
guiTotalPathChecks,
|
||||
100 * guiSuccessfulPathChecks / guiTotalPathChecks,
|
||||
@@ -1827,8 +1846,8 @@ void DebugStructurePage1( void )
|
||||
|
||||
}
|
||||
#else
|
||||
gprintf( 0, LINE_HEIGHT * 16,
|
||||
L"Adj soldiers %d", gpWorldLevelData[usGridNo].ubAdjacentSoldierCnt );
|
||||
gprintf( 0, LINE_HEIGHT * 16,
|
||||
L"Adj soldiers %d", gpWorldLevelData[sGridNo].ubAdjacentSoldierCnt );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1874,7 +1893,7 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
{
|
||||
// spans multiple tiles! (could be two levels high in one tile)
|
||||
fFound = TRUE;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1919,8 +1938,8 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
}
|
||||
|
||||
sStructIndex = 0;
|
||||
sNext = sSTIStartIndex + sSTIStep;
|
||||
fFirstTime = TRUE;
|
||||
sNext = sSTIStartIndex + sSTIStep;
|
||||
fFirstTime = TRUE;
|
||||
|
||||
for (uiLoop = (UINT8)sSTIStartIndex; uiLoop < hVObject->usNumberOfObjects; uiLoop++ )
|
||||
{
|
||||
@@ -1967,7 +1986,7 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
hVObject->ppZStripInfo[ uiDestVoIndex ] = (ZStripInfo *) MemAlloc( sizeof( ZStripInfo ) );
|
||||
if (hVObject->ppZStripInfo[ uiDestVoIndex ] == NULL)
|
||||
{
|
||||
// augh!! out of memory! free everything allocated and abort
|
||||
// augh!! out of memory! free everything allocated and abort
|
||||
for (ubLoop2 = 0; ubLoop2 < uiLoop; ubLoop2++)
|
||||
{
|
||||
if (hVObject->ppZStripInfo[ubLoop2] != NULL)
|
||||
@@ -1993,16 +2012,15 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
usWidth = hVObject->pETRLEObject[uiLoop].usWidth;
|
||||
usHeight = hVObject->pETRLEObject[uiLoop].usHeight;
|
||||
if (pDBStructure->fFlags & (STRUCTURE_MOBILE | STRUCTURE_CORPSE) )
|
||||
{
|
||||
UINT32 i = 0;
|
||||
// adjust for the difference between the animation and structure base tile
|
||||
|
||||
{
|
||||
// adjust for the difference between the animation and structure base tile
|
||||
|
||||
//if (pDBStructure->fFlags & (STRUCTURE_MOBILE ) )
|
||||
{
|
||||
sOffsetX = sOffsetX + (WORLD_TILE_X / 2);
|
||||
sOffsetY = sOffsetY + (WORLD_TILE_Y / 2);
|
||||
}
|
||||
// adjust for the tile offset
|
||||
// adjust for the tile offset
|
||||
sOffsetX = sOffsetX - pDBStructure->bZTileOffsetX * (WORLD_TILE_X / 2) + pDBStructure->bZTileOffsetY * (WORLD_TILE_X / 2);
|
||||
sOffsetY = sOffsetY - pDBStructure->bZTileOffsetY * (WORLD_TILE_Y / 2);
|
||||
}
|
||||
@@ -2016,7 +2034,7 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
sRightHalfWidth = usWidth + sOffsetX - (WORLD_TILE_X / 2);
|
||||
|
||||
if (sRightHalfWidth >= 0)
|
||||
{
|
||||
{
|
||||
// Case 1: negative image offset, image straddles bottom corner
|
||||
|
||||
// negative of a negative is positive
|
||||
@@ -2055,7 +2073,7 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
else
|
||||
{
|
||||
// Case 5: positive offset, image all on right side
|
||||
// should never happen either
|
||||
// should never happen either
|
||||
sLeftHalfWidth = 0;
|
||||
sRightHalfWidth = usWidth;
|
||||
}
|
||||
@@ -2064,7 +2082,7 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
{
|
||||
ubNumIncreasing = sLeftHalfWidth / (WORLD_TILE_X / 2);
|
||||
}
|
||||
if (sRightHalfWidth > 0)
|
||||
if (sRightHalfWidth > 0)
|
||||
{
|
||||
ubNumStable = 1;
|
||||
if (sRightHalfWidth > (WORLD_TILE_X / 2))
|
||||
@@ -2118,12 +2136,12 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
|
||||
}
|
||||
for (ubLoop2 = 0; ubLoop2 < ubNumIncreasing; ubLoop2++)
|
||||
{
|
||||
pCurr->pbZChange[ubLoop2] = 1;
|
||||
}
|
||||
pCurr->pbZChange[ubLoop2] = 1;
|
||||
}
|
||||
for (; ubLoop2 < ubNumIncreasing + ubNumStable; ubLoop2++)
|
||||
{
|
||||
pCurr->pbZChange[ubLoop2] = 0;
|
||||
}
|
||||
}
|
||||
for (; ubLoop2 < pCurr->ubNumberOfZChanges; ubLoop2++)
|
||||
{
|
||||
pCurr->pbZChange[ubLoop2] = -1;
|
||||
@@ -2163,7 +2181,7 @@ BOOLEAN FiniStructureDB( void )
|
||||
|
||||
INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLevel, INT8 *pStructHeight, STRUCTURE ** ppTallestStructure, BOOLEAN fWallsBlock )
|
||||
{
|
||||
STRUCTURE * pCurrent, *pStructure = NULL;
|
||||
STRUCTURE * pCurrent, *pStructure = 0;
|
||||
INT16 sDesiredLevel;
|
||||
BOOLEAN fOKStructOnLevel = FALSE;
|
||||
BOOLEAN fMinimumBlockingFound = FALSE;
|
||||
@@ -2177,12 +2195,12 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
sDesiredLevel = STRUCTURE_ON_ROOF;
|
||||
}
|
||||
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
|
||||
// If no struct, return
|
||||
if ( pCurrent == NULL )
|
||||
{
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*ppTallestStructure) = NULL;
|
||||
return( NOTHING_BLOCKING );
|
||||
}
|
||||
@@ -2193,16 +2211,16 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
if (pCurrent->sCubeOffset == sDesiredLevel )
|
||||
{
|
||||
fOKStructOnLevel = TRUE;
|
||||
pStructure = pCurrent;
|
||||
pStructure = pCurrent;
|
||||
|
||||
// Turn off if we are on upper level!
|
||||
if ( pCurrent->fFlags & STRUCTURE_ROOF && bLevel == 1 )
|
||||
if ( pCurrent->fFlags & STRUCTURE_ROOF && bLevel == 1 )
|
||||
{
|
||||
fOKStructOnLevel = FALSE;
|
||||
}
|
||||
|
||||
// Don't stop FOV for people
|
||||
if ( pCurrent->fFlags & ( STRUCTURE_CORPSE | STRUCTURE_PERSON ) )
|
||||
if ( pCurrent->fFlags & ( STRUCTURE_CORPSE | STRUCTURE_PERSON ) )
|
||||
{
|
||||
fOKStructOnLevel = FALSE;
|
||||
}
|
||||
@@ -2220,7 +2238,7 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
// OK! This will be handled by movement costs......!
|
||||
fOKStructOnLevel = FALSE;
|
||||
}
|
||||
|
||||
|
||||
// CHECK FOR WINDOW
|
||||
if ( pCurrent->fFlags & STRUCTURE_WALLNWINDOW )
|
||||
{
|
||||
@@ -2228,34 +2246,34 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
{
|
||||
case OUTSIDE_TOP_LEFT:
|
||||
case INSIDE_TOP_LEFT:
|
||||
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*ppTallestStructure) = pCurrent;
|
||||
|
||||
if ( pCurrent->fFlags & STRUCTURE_OPEN )
|
||||
{
|
||||
return( BLOCKING_TOPLEFT_OPEN_WINDOW );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( BLOCKING_TOPLEFT_WINDOW );
|
||||
}
|
||||
if ( pCurrent->fFlags & STRUCTURE_OPEN )
|
||||
{
|
||||
return( BLOCKING_TOPLEFT_OPEN_WINDOW );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( BLOCKING_TOPLEFT_WINDOW );
|
||||
}
|
||||
break;
|
||||
|
||||
case OUTSIDE_TOP_RIGHT:
|
||||
case INSIDE_TOP_RIGHT:
|
||||
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*ppTallestStructure) = pCurrent;
|
||||
|
||||
if ( pCurrent->fFlags & STRUCTURE_OPEN )
|
||||
{
|
||||
return( BLOCKING_TOPRIGHT_OPEN_WINDOW );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( BLOCKING_TOPRIGHT_WINDOW );
|
||||
}
|
||||
if ( pCurrent->fFlags & STRUCTURE_OPEN )
|
||||
{
|
||||
return( BLOCKING_TOPRIGHT_OPEN_WINDOW );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( BLOCKING_TOPRIGHT_WINDOW );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2266,10 +2284,10 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
// If we are not opem, we are full blocking!
|
||||
if ( !(pCurrent->fFlags & STRUCTURE_OPEN ) )
|
||||
{
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*ppTallestStructure) = pCurrent;
|
||||
return( FULL_BLOCKING );
|
||||
break;
|
||||
return( FULL_BLOCKING );
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2278,17 +2296,17 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
case OUTSIDE_TOP_LEFT:
|
||||
case INSIDE_TOP_LEFT:
|
||||
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*ppTallestStructure) = pCurrent;
|
||||
return( BLOCKING_TOPLEFT_DOOR );
|
||||
return( BLOCKING_TOPLEFT_DOOR );
|
||||
break;
|
||||
|
||||
case OUTSIDE_TOP_RIGHT:
|
||||
case INSIDE_TOP_RIGHT:
|
||||
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*pStructHeight) = StructureHeight( pCurrent );
|
||||
(*ppTallestStructure) = pCurrent;
|
||||
return( BLOCKING_TOPRIGHT_DOOR );
|
||||
return( BLOCKING_TOPRIGHT_DOOR );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2302,20 +2320,20 @@ INT8 GetBlockingStructureInfo( INT16 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe
|
||||
{
|
||||
if ( fMinimumBlockingFound )
|
||||
{
|
||||
(*pStructHeight) = StructureHeight( pStructure );
|
||||
(*pStructHeight) = StructureHeight( pStructure );
|
||||
(*ppTallestStructure) = pStructure;
|
||||
return( BLOCKING_REDUCE_RANGE );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pStructHeight) = StructureHeight( pStructure );
|
||||
(*pStructHeight) = StructureHeight( pStructure );
|
||||
(*ppTallestStructure) = pStructure;
|
||||
return( BLOCKING_NEXT_TILE );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pStructHeight) = 0;
|
||||
(*pStructHeight) = 0;
|
||||
(*ppTallestStructure) = NULL;
|
||||
return( NOTHING_BLOCKING );
|
||||
}
|
||||
@@ -2343,7 +2361,7 @@ UINT8 StructureFlagToType( UINT32 uiFlag )
|
||||
UINT32 StructureTypeToFlag( UINT8 ubType )
|
||||
{
|
||||
UINT32 uiFlag = 0x1;
|
||||
|
||||
|
||||
uiFlag = uiFlag << ubType;
|
||||
return( uiFlag );
|
||||
}
|
||||
@@ -2355,9 +2373,9 @@ STRUCTURE * FindStructureBySavedInfo( INT16 sGridNo, UINT8 ubType, UINT8 ubWallO
|
||||
|
||||
uiTypeFlag = StructureTypeToFlag( ubType );
|
||||
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
pCurrent = gpWorldLevelData[sGridNo].pStructureHead;
|
||||
while (pCurrent != NULL)
|
||||
{
|
||||
{
|
||||
if (pCurrent->fFlags & uiTypeFlag && pCurrent->ubWallOrientation == ubWallOrientation &&
|
||||
( (bLevel == 0 && pCurrent->sCubeOffset == 0) || (bLevel > 0 && pCurrent->sCubeOffset > 0) ) )
|
||||
{
|
||||
@@ -2371,31 +2389,31 @@ STRUCTURE * FindStructureBySavedInfo( INT16 sGridNo, UINT8 ubType, UINT8 ubWallO
|
||||
|
||||
UINT32 GetStructureOpenSound( STRUCTURE * pStructure, BOOLEAN fClose )
|
||||
{
|
||||
UINT32 uiSoundID;
|
||||
UINT32 uiSoundID;
|
||||
|
||||
switch( pStructure->pDBStructureRef->pDBStructure->ubArmour )
|
||||
{
|
||||
case MATERIAL_LIGHT_METAL:
|
||||
case MATERIAL_THICKER_METAL:
|
||||
switch( pStructure->pDBStructureRef->pDBStructure->ubArmour )
|
||||
{
|
||||
case MATERIAL_LIGHT_METAL:
|
||||
case MATERIAL_THICKER_METAL:
|
||||
|
||||
uiSoundID = OPEN_LOCKER;
|
||||
break;
|
||||
uiSoundID = OPEN_LOCKER;
|
||||
break;
|
||||
|
||||
case MATERIAL_WOOD_WALL:
|
||||
case MATERIAL_PLYWOOD_WALL:
|
||||
case MATERIAL_FURNITURE:
|
||||
case MATERIAL_WOOD_WALL:
|
||||
case MATERIAL_PLYWOOD_WALL:
|
||||
case MATERIAL_FURNITURE:
|
||||
|
||||
uiSoundID = OPEN_WOODEN_BOX;
|
||||
break;
|
||||
uiSoundID = OPEN_WOODEN_BOX;
|
||||
break;
|
||||
|
||||
default:
|
||||
uiSoundID = OPEN_DEFAULT_OPENABLE;
|
||||
}
|
||||
default:
|
||||
uiSoundID = OPEN_DEFAULT_OPENABLE;
|
||||
}
|
||||
|
||||
if ( fClose )
|
||||
{
|
||||
uiSoundID++;
|
||||
}
|
||||
if ( fClose )
|
||||
{
|
||||
uiSoundID++;
|
||||
}
|
||||
|
||||
return( uiSoundID );
|
||||
return( uiSoundID );
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLOCKING_TOPLEFT_DOOR 50
|
||||
#define BLOCKING_TOPRIGHT_DOOR 60
|
||||
#define FULL_BLOCKING 70
|
||||
#define BLOCKING_TOPLEFT_OPEN_WINDOW 90
|
||||
#define BLOCKING_TOPLEFT_OPEN_WINDOW 90
|
||||
#define BLOCKING_TOPRIGHT_OPEN_WINDOW 100
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ BOOLEAN InitializeGameVideoObjects( )
|
||||
UINT16 usWidth;
|
||||
UINT16 usHeight;
|
||||
UINT8 ubBitDepth;
|
||||
|
||||
|
||||
// Create render buffer
|
||||
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
|
||||
vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE;
|
||||
@@ -42,7 +42,7 @@ BOOLEAN InitializeGameVideoObjects( )
|
||||
vs_desc.ubBitDepth = ubBitDepth;
|
||||
|
||||
CHECKF( AddVideoSurface( &vs_desc, &guiSAVEBUFFER ) );
|
||||
|
||||
|
||||
CHECKF( AddVideoSurface( &vs_desc, &guiEXTRABUFFER ) );
|
||||
gfExtraBuffer = TRUE;
|
||||
|
||||
|
||||
+623
-609
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -27,7 +27,7 @@
|
||||
#define AFRAME_TILE 0x00002000
|
||||
#define HIDDEN_TILE 0x00004000
|
||||
#define CLIFFHANG_TILE 0x00008000
|
||||
#define UNDERFLOW_FILLER 0x00010000
|
||||
#define UNDERFLOW_FILLER 0x00010000
|
||||
#define Z_AWARE_DYNAMIC_TILE 0x00020000
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#define WALL_HEIGHT 50
|
||||
|
||||
|
||||
//Kris: Added the last two bottom corner orientation values. This won't effect
|
||||
//current code, but there is new code that makes use of this. A function called
|
||||
//Kris: Added the last two bottom corner orientation values. This won't effect
|
||||
//current code, but there is new code that makes use of this. A function called
|
||||
//UINT8 CalculateWallOrientationsAtGridNo( INT32 iMapIndex ) that will look at all
|
||||
//of the walls and return the last two wall orientations for tiles with two proper
|
||||
//wall pieces.
|
||||
@@ -71,7 +71,7 @@ typedef struct
|
||||
{
|
||||
HVOBJECT vo;
|
||||
UINT32 fType;
|
||||
AuxObjectData * pAuxData;
|
||||
AuxObjectData * pAuxData;
|
||||
RelTileLoc * pTileLocData;
|
||||
STRUCTURE_FILE_REF * pStructureFileRef;
|
||||
UINT8 ubTerrainID;
|
||||
@@ -113,12 +113,12 @@ typedef struct
|
||||
// Land and overlay type
|
||||
// struct
|
||||
// {
|
||||
INT16 sOffsetHeight;
|
||||
UINT16 usWallOrientation;
|
||||
UINT8 ubFullTile;
|
||||
INT16 sOffsetHeight;
|
||||
UINT16 usWallOrientation;
|
||||
UINT8 ubFullTile;
|
||||
|
||||
// For animated tiles
|
||||
TILE_ANIMATION_DATA *pAnimData;
|
||||
// For animated tiles
|
||||
TILE_ANIMATION_DATA *pAnimData;
|
||||
// };
|
||||
|
||||
// };
|
||||
@@ -171,7 +171,7 @@ UINT8 GetLandLevelDepth( UINT32 iMapIndex );
|
||||
|
||||
BOOLEAN SetLandIndexWithRadius( INT32 iMapIndex, UINT16 usIndex, UINT32 uiNewType, UINT8 ubRadius, BOOLEAN fReplace );
|
||||
|
||||
BOOLEAN LandTypeHeigher( UINT32 uiDestType, UINT32 uiSrcType );
|
||||
BOOLEAN LandTypeHeigher( UINT32 uiDestType, UINT32 uiSrcType );
|
||||
|
||||
BOOLEAN MoveLandIndexToTop( UINT32 iMapIndex, UINT16 usIndex );
|
||||
|
||||
|
||||
+593
-560
File diff suppressed because it is too large
Load Diff
+22
-9
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "vobject.h"
|
||||
#include "tiledef.h"
|
||||
#include "Soldier Control.h"
|
||||
//#include "Soldier Control.h"
|
||||
#include "structure.h"
|
||||
#include "Handle Items.h"
|
||||
|
||||
@@ -17,14 +17,28 @@
|
||||
#define CELL_X_SIZE 10
|
||||
#define CELL_Y_SIZE 10
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
//Don't mess with this value, unless you want to force update all maps in the game!
|
||||
// Lesh: fix the sad situation with the different major map versions
|
||||
//#ifdef RUSSIAN
|
||||
//#define MAJOR_MAP_VERSION 6.00
|
||||
//#else
|
||||
#define MAJOR_MAP_VERSION 6.00
|
||||
//#endif
|
||||
//Current minor map version updater.
|
||||
#define MINOR_MAP_VERSION 27
|
||||
|
||||
#define WORLD_BASE_HEIGHT 0
|
||||
#define WORLD_CLIFF_HEIGHT 80
|
||||
|
||||
|
||||
//A macro that actually memcpy's over data and increments the pointer automatically
|
||||
//based on the size. Works like a FileRead except with a buffer instead of a file pointer.
|
||||
//based on the size. Works like a FileRead except with a buffer instead of a file pointer.
|
||||
//Used by LoadWorld() and child functions.
|
||||
#include <memory.h>
|
||||
#define LOADDATA( dst, src, size ) memcpy( dst, src, size ); src += size
|
||||
#define LOADDATA( dst, src, size ) memcpy( dst, src, size ); src += size
|
||||
|
||||
|
||||
#define LANDHEAD 0
|
||||
@@ -50,7 +64,7 @@
|
||||
#define LEVELNODE_DISPLAY_AP 0x00000400
|
||||
#define LEVELNODE_ANIMATION 0x00000800
|
||||
#define LEVELNODE_USEABSOLUTEPOS 0x00001000
|
||||
#define LEVELNODE_REVEAL 0x00002000
|
||||
#define LEVELNODE_REVEAL 0x00002000
|
||||
#define LEVELNODE_REVEALTREES 0x00004000
|
||||
#define LEVELNODE_USEBESTTRANSTYPE 0x00008000
|
||||
#define LEVELNODE_USEZ 0x00010000
|
||||
@@ -94,7 +108,7 @@
|
||||
#define MAPELEMENT_EXT_RECALCULATE_MOVEMENT 0x0010 //0x10
|
||||
#define MAPELEMENT_EXT_NOBURN_STRUCT 0x0020 //0x20
|
||||
#define MAPELEMENT_EXT_ROOFCODE_VISITED 0x0040 //0x40
|
||||
#define MAPELEMENT_EXT_CREATUREGAS 0x0080 //0x80
|
||||
#define MAPELEMENT_EXT_CREATUREGAS 0x0080 //0x80
|
||||
#define MAPELEMENT_EXT_BURNABLEGAS 0x0100 //0x100
|
||||
#define MAPELEMENT_EXT_CLIMBPOINT 0x0200 //0x200
|
||||
|
||||
@@ -105,7 +119,6 @@
|
||||
#define ANY_SMOKE_EFFECT ( MAPELEMENT_EXT_CREATUREGAS | MAPELEMENT_EXT_SMOKE | MAPELEMENT_EXT_TEARGAS | MAPELEMENT_EXT_MUSTARDGAS | MAPELEMENT_EXT_BURNABLEGAS )
|
||||
|
||||
|
||||
// WDS - Clean up inventory handling
|
||||
struct LEVELNODE
|
||||
{
|
||||
struct LEVELNODE *pNext;
|
||||
@@ -273,7 +286,7 @@ void TrashMapTile(INT16 MapTile);
|
||||
BOOLEAN NewWorld( void );
|
||||
|
||||
BOOLEAN SaveWorld( const STR8 puiFilename );
|
||||
BOOLEAN LoadWorld( const STR8 puiFilename );
|
||||
BOOLEAN LoadWorld( const STR8 puiFilename, float* pMajorMapVersion = NULL, UINT8* pMinorMapVersion = NULL );
|
||||
|
||||
void CompileWorldMovementCosts( );
|
||||
void RecompileLocalMovementCosts( INT16 sCentreGridNo );
|
||||
@@ -290,7 +303,7 @@ void RemoveWorldWireFrameTiles( );
|
||||
void RemoveWireFrameTiles( INT16 sGridNo );
|
||||
|
||||
|
||||
LEVELNODE *GetAnimProfileFlags( UINT16 sGridNo, UINT16 *usFlags, SOLDIERTYPE **ppTargSoldier, LEVELNODE *pGivenNode );
|
||||
LEVELNODE *GetAnimProfileFlags( INT16 sGridNo, UINT16 *usFlags, SOLDIERTYPE **ppTargSoldier, LEVELNODE *pGivenNode );
|
||||
|
||||
void ReloadTileset( UINT8 ubID );
|
||||
|
||||
|
||||
+248
-249
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -18,17 +18,17 @@ BOOLEAN TypeRangeExistsInObjectLayer( UINT32 iMapIndex, UINT32 fStartType, UINT3
|
||||
|
||||
// Roof manipulation functions
|
||||
BOOLEAN RemoveRoof( UINT32 iMapIndex, UINT16 usIndex );
|
||||
LEVELNODE *AddRoofToTail( UINT32 iMapIndex, UINT16 usIndex );
|
||||
LEVELNODE *AddRoofToTail( UINT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN AddRoofToHead( UINT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN TypeExistsInRoofLayer( UINT32 iMapIndex, UINT32 fType, UINT16 *pusRoofIndex );
|
||||
BOOLEAN RemoveAllRoofsOfTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType );
|
||||
void SetAllRoofShadeLevels( UINT32 iMapIndex, UINT8 ubShadeLevel );
|
||||
void AdjustAllRoofShadeLevels( UINT32 iMapIndex, INT8 bShadeDiff );
|
||||
void RemoveRoofIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void SetRoofIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void RemoveRoofIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void SetRoofIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
BOOLEAN TypeRangeExistsInRoofLayer( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT16 *pusRoofIndex );
|
||||
void SetWallLevelnodeFlags( UINT16 sGridNo, UINT32 uiFlags );
|
||||
void RemoveWallLevelnodeFlags( UINT16 sGridNo, UINT32 uiFlags );
|
||||
void SetWallLevelnodeFlags( INT16 sGridNo, UINT32 uiFlags );
|
||||
void RemoveWallLevelnodeFlags( INT16 sGridNo, UINT32 uiFlags );
|
||||
BOOLEAN IndexExistsInRoofLayer( INT16 sGridNo, UINT16 usIndex );
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ BOOLEAN ReplaceLandIndex( UINT32 iMapIndex, UINT16 usOldIndex, UINT16 usNewIndex
|
||||
BOOLEAN DeleteAllLandLayers( UINT32 iMapIndex );
|
||||
BOOLEAN InsertLandIndexAtLevel( UINT32 iMapIndex, UINT16 usIndex, UINT8 ubLevel );
|
||||
BOOLEAN RemoveHigherLandLevels( UINT32 iMapIndex, UINT32 fSrcType, UINT32 **puiHigherTypes, UINT8 *pubNumHigherTypes );
|
||||
BOOLEAN SetLowerLandLevels( UINT32 iMapIndex, UINT32 fSrcType, UINT16 usIndex );
|
||||
BOOLEAN SetLowerLandLevels( UINT32 iMapIndex, UINT32 fSrcType, UINT16 usIndex );
|
||||
BOOLEAN AdjustForFullTile( UINT32 iMapIndex );
|
||||
void SetAllLandShadeLevels( UINT32 iMapIndex, UINT8 ubShadeLevel );
|
||||
void AdjustAllLandShadeLevels( UINT32 iMapIndex, INT8 bShadeDiff );
|
||||
@@ -80,10 +80,10 @@ BOOLEAN HideStructOfGivenType( UINT32 iMapIndex, UINT32 fType, BOOLEAN fHide );
|
||||
BOOLEAN InsertStructIndex( UINT32 iMapIndex, UINT16 usIndex, UINT8 ubLevel );
|
||||
void SetAllStructShadeLevels( UINT32 iMapIndex, UINT8 ubShadeLevel );
|
||||
void AdjustAllStructShadeLevels( UINT32 iMapIndex, INT8 bShadeDiff );
|
||||
void SetStructIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void RemoveStructIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void SetStructAframeFlags( UINT32 iMapIndex, UINT32 uiFlags );
|
||||
void RemoveStructAframeFlags( UINT32 iMapIndex, UINT32 uiFlags );
|
||||
void SetStructIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void RemoveStructIndexFlagsFromTypeRange( UINT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags );
|
||||
void SetStructAframeFlags( UINT32 iMapIndex, UINT32 uiFlags );
|
||||
void RemoveStructAframeFlags( UINT32 iMapIndex, UINT32 uiFlags );
|
||||
BOOLEAN RemoveStructFromLevelNode( UINT32 iMapIndex, LEVELNODE *pNode );
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ BOOLEAN RemoveShadowFromLevelNode( UINT32 iMapIndex, LEVELNODE *pNode );
|
||||
// #################################################################
|
||||
|
||||
BOOLEAN AddMercToHead( UINT32 iMapIndex, SOLDIERTYPE *pSoldier, BOOLEAN fAddStructInfo );
|
||||
BOOLEAN RemoveMerc( UINT32 iMapIndex, SOLDIERTYPE *pSoldier, BOOLEAN fPlaceHolder );
|
||||
BOOLEAN RemoveMerc( UINT32 iMapIndex, SOLDIERTYPE *pSoldier, BOOLEAN fPlaceHolder );
|
||||
UINT8 WhoIsThere2( INT16 sGridNo, INT8 bLevel );
|
||||
BOOLEAN AddMercStructureInfo( INT16 sGridNo, SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN AddMercStructureInfoFromAnimSurface( INT16 sGridNo, SOLDIERTYPE *pSoldier, UINT16 usAnimSurface, UINT16 usAnimState );
|
||||
@@ -118,7 +118,7 @@ BOOLEAN OKToAddMercToWorld( SOLDIERTYPE *pSoldier, INT8 bDirection );
|
||||
|
||||
|
||||
// TOPMOST manipulation functions
|
||||
LEVELNODE *AddTopmostToTail( UINT32 iMapIndex, UINT16 usIndex );
|
||||
LEVELNODE *AddTopmostToTail( UINT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN AddTopmostToHead( UINT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN RemoveTopmost( UINT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN TypeExistsInTopmostLayer( UINT32 iMapIndex, UINT32 fType, UINT16 *pusTopmostIndex );
|
||||
|
||||
Reference in New Issue
Block a user