*** Merged Code from Multiplayer Branch Revision 2960 ***

- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-)
- Multiplayer Version 1.1 + some additional features and bugfixes
* INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory *




git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2009-06-04 21:01:45 +00:00
parent 17f44f63e8
commit 47db604b50
301 changed files with 76701 additions and 1843 deletions
+6 -6
View File
@@ -2057,7 +2057,7 @@ void VerifyTownTrainingIsPaidFor( void )
SOLDIERTYPE *pSoldier = NULL;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// valid character?
if( gCharactersList[ iCounter ].fValid == FALSE )
@@ -3950,9 +3950,9 @@ INT16 GetBonusTrainingPtsDueToInstructor( SOLDIERTYPE *pInstructor, SOLDIERTYPE
// factor in their mutual relationship
if (OKToCheckOpinion(pInstructor->ubProfile))
bOpinionFactor = gMercProfiles[ pStudent->ubProfile ].bMercOpinion[ pInstructor->ubProfile ];
bOpinionFactor = gMercProfiles[ pStudent->ubProfile ].bMercOpinion[ pInstructor->ubProfile ];
if (OKToCheckOpinion(pStudent->ubProfile))
bOpinionFactor += gMercProfiles[ pInstructor->ubProfile ].bMercOpinion[ pStudent->ubProfile ] / 2;
bOpinionFactor += gMercProfiles[ pInstructor->ubProfile ].bMercOpinion[ pStudent->ubProfile ] / 2;
}
@@ -10663,7 +10663,7 @@ BOOLEAN HandleSelectedMercsBeingPutAsleep( BOOLEAN fWakeUp, BOOLEAN fDisplayWarn
CHAR16 sString[ 128 ];
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
pSoldier = NULL;
@@ -10982,7 +10982,7 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam )
// sets assignment for the list
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( ( gCharactersList[ iCounter ].fValid ) &&
( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE ) &&
@@ -11542,7 +11542,7 @@ SOLDIERTYPE *GetSelectedAssignSoldier( BOOLEAN fNullOK )
if ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) )
{
// mapscreen version
if( ( bSelectedAssignChar >= 0 ) && ( bSelectedAssignChar < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) &&
if( ( bSelectedAssignChar >= 0 ) && ( bSelectedAssignChar < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) &&
( gCharactersList[ bSelectedAssignChar ].fValid ) )
{
pSoldier = &Menptr[ gCharactersList[ bSelectedAssignChar ].usSolID ];
+3 -1
View File
@@ -87,6 +87,8 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
{
BOOLEAN bMercDayOne = FALSE;
// BF : file access is bad, especially if a function is called so often.
#if 0
// Kaiden: Opening the INI File
CIniReader iniReader("..\\Ja2_Options.ini");
@@ -96,7 +98,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
// for some reason, this can't be in gamesettings.cpp
// or it won't work.
bMercDayOne = iniReader.ReadBoolean("Options","MERC_DAY_ONE",FALSE);
#endif
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"ExecuteStrategicEvent");
if( gGameExternalOptions.gfEnableEmergencyButton_SkipStrategicEvents && _KeyDown( NUM_LOCK ) )
+14 -6
View File
@@ -519,10 +519,14 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
{
SetLaptopExitScreen( MAP_SCREEN ); //hayden
SetPendingNewScreen( MAP_SCREEN );
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, L"------------------------------------------------------");
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, MPHelp[0]);
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, L"------------------------------------------------------");
ScreenMsg( MSG_FONT_WHITE, MSG_CHAT, MPHelp[1]);
// WANNE: No more used
/*
ScreenMsg( MSG_FONT_WHITE, MSG_MPSYSTEM, L"------------------------------------------------------");
ScreenMsg( MSG_FONT_WHITE, MSG_MPSYSTEM, MPHelp[0]);
ScreenMsg( MSG_FONT_WHITE, MSG_MPSYSTEM, L"------------------------------------------------------");
ScreenMsg( MSG_FONT_WHITE, MSG_MPSYSTEM, MPHelp[1]);
*/
}
else
@@ -698,7 +702,7 @@ void QuickSetupOfMercProfileItems( UINT32 uiCount, UINT8 ubProfileIndex )
// TEMP!
// make carman's opinion of us high!
if (OKToCheckOpinion(ubProfileIndex))
gMercProfiles[ 78 ].bMercOpinion[ ubProfileIndex ] = 25;
gMercProfiles[ 78 ].bMercOpinion[ ubProfileIndex ] = 25;
}
else if ( uiCount == 1 )
@@ -896,5 +900,9 @@ void ReStartingGame()
// Reset timer callbacks
gpCustomizableTimerCallback = NULL;
gubCheatLevel = STARTING_CHEAT_LEVEL;
// WANNE - MP: Set cheat level to 0 for mp
if (!is_networked)
gubCheatLevel = STARTING_CHEAT_LEVEL;
else
gubCheatLevel = 0;
}
+35 -35
View File
@@ -432,7 +432,7 @@ void InitalizeVehicleAndCharacterList( void )
void SetEntryInSelectedCharacterList( INT8 bEntry )
{
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
Assert( ( bEntry >= 0 ) && ( bEntry < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
// set this entry to selected
fSelectedListOfMercsForMapScreen[ bEntry ] = TRUE ;
@@ -442,7 +442,7 @@ void SetEntryInSelectedCharacterList( INT8 bEntry )
void ResetEntryForSelectedList( INT8 bEntry )
{
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
Assert( ( bEntry >= 0 ) && ( bEntry < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
// set this entry to selected
fSelectedListOfMercsForMapScreen[ bEntry ] = FALSE;
@@ -469,7 +469,7 @@ void ResetSelectedListForMapScreen( void )
BOOLEAN IsEntryInSelectedListSet( INT8 bEntry )
{
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
Assert( ( bEntry >= 0 ) && ( bEntry < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
// is this entry in the selected list set?
@@ -480,7 +480,7 @@ BOOLEAN IsEntryInSelectedListSet( INT8 bEntry )
void ToggleEntryInSelectedList( INT8 bEntry )
{
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
Assert( ( bEntry >= 0 ) && ( bEntry < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
// toggle the value in the selected list
fSelectedListOfMercsForMapScreen[ bEntry ] = !( fSelectedListOfMercsForMapScreen[ bEntry ] );
@@ -522,7 +522,7 @@ BOOLEAN MultipleCharacterListEntriesSelected( void )
INT32 iCounter = 0;
// check if more than one person is selected in the selected list
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( fSelectedListOfMercsForMapScreen[iCounter] == TRUE )
{
@@ -547,7 +547,7 @@ void ResetAssignmentsForMercsTrainingUnpaidSectorsInSelectedList( INT8 bAssignme
INT32 iCounter = 0;
SOLDIERTYPE *pSoldier = NULL;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// valid character?
if( gCharactersList[ iCounter ].fValid == FALSE )
@@ -579,7 +579,7 @@ void ResetAssignmentOfMercsThatWereTrainingMilitiaInThisSector( INT16 sSectorX,
INT32 iCounter = 0;
SOLDIERTYPE *pSoldier = NULL;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// valid character?
if( gCharactersList[ iCounter ].fValid == FALSE )
@@ -632,7 +632,7 @@ void DeselectSelectedListMercsWhoCantMoveWithThisGuy( SOLDIERTYPE *pSoldier )
// deselect any other selected mercs that can't travel together with pSoldier
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -727,7 +727,7 @@ void SelectUnselectedMercsWhoMustMoveWithThisGuy( void )
SOLDIERTYPE *pSoldier = NULL;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -759,7 +759,7 @@ BOOLEAN AnyMercInSameSquadOrVehicleIsSelected( SOLDIERTYPE *pSoldier )
SOLDIERTYPE *pSoldier2 = NULL;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -838,7 +838,7 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
if( iOldAssignmentLine != giAssignHighLine )
{
// restore background
RestoreExternBackgroundRect( 66, Y_START - 1, 118 + 1 - 67, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
RestoreExternBackgroundRect( 66, Y_START - 1, 118 + 1 - 67, ( INT16 )( ( ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -866,7 +866,7 @@ void RestoreBackgroundForDestinationGlowRegionList( void )
if( iOldDestinationLine != giDestHighLine )
{
// restore background
RestoreExternBackgroundRect( 182, Y_START - 1, 217 + 1 - 182, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
RestoreExternBackgroundRect( 182, Y_START - 1, 217 + 1 - 182, ( INT16 )( ( ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -894,7 +894,7 @@ void RestoreBackgroundForContractGlowRegionList( void )
if( iOldContractLine != giContractHighLine )
{
// restore background
RestoreExternBackgroundRect( 222, Y_START - 1, 250 + 1 - 222, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
RestoreExternBackgroundRect( 222, Y_START - 1, 250 + 1 - 222, ( INT16 )( ( ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -926,7 +926,7 @@ void RestoreBackgroundForSleepGlowRegionList( void )
if( iOldSleepHighLine != giSleepHighLine )
{
// restore background
RestoreExternBackgroundRect( 123, Y_START - 1, 142 + 1 - 123, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
RestoreExternBackgroundRect( 123, Y_START - 1, 142 + 1 - 123, ( INT16 )( ( ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -967,7 +967,7 @@ void PlayGlowRegionSound( void )
INT16 CharacterIsGettingPathPlotted( INT16 sCharNumber )
{
// valid character number?
if( ( sCharNumber < 0 ) || ( sCharNumber >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
if( ( sCharNumber < 0 ) || ( sCharNumber >= giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
{
return( FALSE );
}
@@ -1009,7 +1009,7 @@ INT16 CharacterIsGettingPathPlotted( INT16 sCharNumber )
BOOLEAN IsCharacterSelectedForAssignment( INT16 sCharNumber )
{
// valid character number?
if( ( sCharNumber < 0 ) || ( sCharNumber >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
if( ( sCharNumber < 0 ) || ( sCharNumber >= giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
{
return( FALSE );
}
@@ -1046,7 +1046,7 @@ BOOLEAN IsCharacterSelectedForAssignment( INT16 sCharNumber )
BOOLEAN IsCharacterSelectedForSleep( INT16 sCharNumber )
{
// valid character number?
if( ( sCharNumber < 0 ) || ( sCharNumber >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
if( ( sCharNumber < 0 ) || ( sCharNumber >= giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
{
return( FALSE );
}
@@ -1249,7 +1249,7 @@ void CheckAndUpdateBasedOnContractTimes( void )
INT32 iCounter = 0;
INT32 iTimeRemaining = 0;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[iCounter].fValid == TRUE )
{
@@ -1345,7 +1345,7 @@ void HandleDisplayOfSelectedMercArrows( void )
BltVideoObject( guiSAVEBUFFER , hHandle, 0,SELECTED_CHAR_ARROW_X, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
// now run through the selected list of guys, an arrow for each
for( ubCount = 0; ubCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; ubCount++ )
for( ubCount = 0; ubCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; ubCount++ )
{
if( gCharactersList[ ubCount ].fValid == TRUE )
{
@@ -2111,7 +2111,7 @@ void FindAndSetThisContractSoldier( SOLDIERTYPE *pSoldier )
fShowContractMenu = FALSE;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter].fValid == TRUE )
{
@@ -2345,7 +2345,7 @@ INT32 GetNumberOfPeopleInCharacterList( void )
INT32 iCounter = 0, iCount = 0;
// get the number of valid mercs in the mapscreen character list
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter].fValid == TRUE )
{
@@ -2513,7 +2513,7 @@ void GoToNextCharacterInList( void )
}
// is the current guy invalid or the first one?
if( ( bSelectedInfoChar == -1 )|| ( bSelectedInfoChar == CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
if( ( bSelectedInfoChar == -1 )|| ( bSelectedInfoChar == giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
{
iCount = 0;
}
@@ -2522,9 +2522,9 @@ void GoToNextCharacterInList( void )
iCount = bSelectedInfoChar + 1;
}
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCount ) )
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCount ) )
{
ChangeSelectedInfoChar( ( INT8 )iCount, TRUE );
break;
@@ -2533,7 +2533,7 @@ void GoToNextCharacterInList( void )
{
iCount++;
if( iCount >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS )
if( iCount >= giMAXIMUM_NUMBER_OF_PLAYER_SLOTS )
{
iCount = 0;
}
@@ -2560,7 +2560,7 @@ void GoToPrevCharacterInList( void )
// is the current guy invalid or the first one?
if( ( bSelectedInfoChar == -1 ) || ( bSelectedInfoChar == 0 ) )
{
iCount = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS;
iCount = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
}
else
{
@@ -2568,9 +2568,9 @@ void GoToPrevCharacterInList( void )
}
// now run through the list and find first prev guy
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCount ) )
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCount ) )
{
ChangeSelectedInfoChar( ( INT8 )iCount, TRUE );
break;
@@ -2582,7 +2582,7 @@ void GoToPrevCharacterInList( void )
if( iCount < 0 )
{
// was FIRST_VEHICLE
iCount = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS;
iCount = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
}
}
}
@@ -3363,7 +3363,7 @@ void AddSoldierToMovingLists( SOLDIERTYPE *pSoldier )
{
INT32 iCounter = 0;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( pSoldierMovingList[ iCounter ] == pSoldier )
{
@@ -3459,7 +3459,7 @@ void InitializeMovingLists( void )
giNumberOfVehiclesInSectorMoving = 0;
// init the soldiers
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// soldier is NOT moving
pSoldierMovingList[ iCounter ] = NULL;
@@ -3497,7 +3497,7 @@ BOOLEAN IsAnythingSelectedForMoving( void )
// check soldiers
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if ( ( pSoldierMovingList[ iCounter ] != NULL ) && fSoldierIsMoving[ iCounter ] )
{
@@ -3580,7 +3580,7 @@ void SetUpMovingListsForSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
// note that Skyrider can't be moved using the move box, and won't appear because the helicoprer is not in the char list
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid )
{
@@ -4442,7 +4442,7 @@ void HandleSettingTheSelectedListOfMercs( void )
bSelectedDestChar = -1;
// run through the list of grunts
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// is the current guy a valid character?
if( gCharactersList[ iCounter ].fValid == TRUE )
@@ -6107,7 +6107,7 @@ BOOLEAN CanEntireMovementGroupMercIsInMove( SOLDIERTYPE *pSoldier, INT8 *pbError
// even if group is 0 (not that that should happen, should it?) still loop through for other mercs selected to move
// if anyone in the merc's group or also selected cannot move for whatever reason return false
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
+2 -2
View File
@@ -98,7 +98,7 @@ BOOLEAN SaveContractRenewalDataToSaveGameFile( HWFILE hFile )
{
UINT32 uiNumBytesWritten;
for (int idx=0; idx < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; idx++) {
for (int idx=0; idx < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; idx++) {
FileWrite( hFile, &ContractRenewalList[idx], sizeof( CONTRACT_NEWAL_LIST_NODE ), &uiNumBytesWritten );
if( uiNumBytesWritten != sizeof( CONTRACT_NEWAL_LIST_NODE ) )
{
@@ -126,7 +126,7 @@ BOOLEAN LoadContractRenewalDataFromSaveGameFile( HWFILE hFile )
{
UINT32 uiNumBytesRead;
for (int idx=0; idx < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; idx++) {
for (int idx=0; idx < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; idx++) {
FileRead( hFile, &ContractRenewalList[idx], sizeof( CONTRACT_NEWAL_LIST_NODE ), &uiNumBytesRead );
if( uiNumBytesRead != sizeof( CONTRACT_NEWAL_LIST_NODE ) )
{
+47 -18
View File
@@ -550,23 +550,24 @@ BOOLEAN PrepareEnemyForSectorBattle()
gfPendingEnemies = (NumEnemiesInSector( gWorldSectorX, gWorldSectorY ) > mapMaximumNumberOfEnemies );
pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ];
if( pSector->uiFlags & SF_USE_MAP_SETTINGS )
{ //count the number of enemy placements in a map and use those
SOLDIERINITNODE *curr = gSoldierInitHead;
ubTotalAdmins = ubTotalTroops = ubTotalElites = 0;
while( curr )
// OJW - 20090403 - override max ai in co-op
if (is_networked && is_server && OVERRIDE_MAX_AI == 1)
{
float totalEnemies = pSector->ubNumAdmins + pSector->ubNumTroops + pSector->ubNumElites;
ubTotalAdmins = ((float)pSector->ubNumAdmins / totalEnemies) * mapMaximumNumberOfEnemies;
ubTotalTroops = ((float)pSector->ubNumTroops / totalEnemies) * mapMaximumNumberOfEnemies;
ubTotalElites = ((float)pSector->ubNumElites / totalEnemies) * mapMaximumNumberOfEnemies;
totalEnemies = ubTotalAdmins + ubTotalTroops + ubTotalElites;
// take care of any rounding losses
while (totalEnemies < mapMaximumNumberOfEnemies)
{
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
{
switch( curr->pBasicPlacement->ubSoldierClass )
{
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
}
}
curr = curr->next;
// just fill out with standard troops
ubTotalTroops++;
totalEnemies++;
}
pSector->ubNumAdmins = ubTotalAdmins;
pSector->ubNumTroops = ubTotalTroops;
pSector->ubNumElites = ubTotalElites;
@@ -576,9 +577,37 @@ BOOLEAN PrepareEnemyForSectorBattle()
}
else
{
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
if( pSector->uiFlags & SF_USE_MAP_SETTINGS )
{ //count the number of enemy placements in a map and use those
SOLDIERINITNODE *curr = gSoldierInitHead;
ubTotalAdmins = ubTotalTroops = ubTotalElites = 0;
while( curr )
{
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
{
switch( curr->pBasicPlacement->ubSoldierClass )
{
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
}
}
curr = curr->next;
}
pSector->ubNumAdmins = ubTotalAdmins;
pSector->ubNumTroops = ubTotalTroops;
pSector->ubNumElites = ubTotalElites;
pSector->ubAdminsInBattle = 0;
pSector->ubTroopsInBattle = 0;
pSector->ubElitesInBattle = 0;
}
else
{
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
}
}
totalCountOfStationaryEnemies = ubTotalAdmins + ubTotalTroops + ubTotalElites;
+1 -1
View File
@@ -2817,7 +2817,7 @@ BOOLEAN CreateDestroyDisplayTextEntryBox( UINT8 ubAction, STR16 pString, TEXT_EN
gfRedrawQuestDebugSystem = TRUE;
//get the striong from the text field
Get16BitStringFromField( 0, zText );
Get16BitStringFromField( 0, zText, 32 );
//if the text is not null
if( zText[0] != '\0' )
+10 -5
View File
@@ -34,6 +34,7 @@
#endif
#include "BobbyRMailOrder.h"
#include "connect.h"
#define TESTQUESTS
@@ -1248,10 +1249,11 @@ void InternalStartQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN
{
gubQuest[ubQuest] = QUESTINPROGRESS;
if ( fUpdateHistory )
{
SetHistoryFact( HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY );
}
if ( fUpdateHistory )
{
if (!is_networked)
SetHistoryFact( HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY );
}
}
else
{
@@ -1330,9 +1332,12 @@ void CheckForQuests( UINT32 uiDay )
// already started
if (gubQuest[QUEST_DELIVER_LETTER] == QUESTNOTSTARTED)
{
StartQuest( QUEST_DELIVER_LETTER, -1, -1 );
#ifdef TESTQUESTS
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"Started DELIVER LETTER quest");
if (!is_networked)
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"Started DELIVER LETTER quest");
#endif
}
+24 -7
View File
@@ -4562,23 +4562,31 @@ void HourlyCheckStrategicAI()
#ifdef JA2BETAVERSION
#include "vfs.h"
#include "PropertyContainer.h"
static CLog& s_stratD = *CLog::Create(L"Strategic Decisions.txt", true);
void LogStrategicMsg( STR8 str, ... )
{
va_list argptr;
CHAR8 string[512];
#ifndef USE_VFS
FILE *fp;
fp = fopen( "Strategic Decisions.txt", "a" );
if( !fp )
return;
#endif
va_start(argptr, str );
vsprintf( string, str, argptr);
va_end(argptr);
#ifndef USE_VFS
fprintf( fp, "%s\n", string );
#else
s_stratD << string << CLog::endl;
#endif
if( gfDisplayStrategicAILogs )
{
@@ -4589,28 +4597,32 @@ void LogStrategicMsg( STR8 str, ... )
OutputDebugString( (LPCSTR)String( "%s\n", string ) );
}
#ifndef USE_VFS
fclose( fp );
#endif
}
void LogStrategicEvent( STR8 str, ... )
{
va_list argptr;
CHAR8 string[512];
#ifndef USE_VFS
FILE *fp;
fp = fopen( "Strategic Decisions.txt", "a" );
if( !fp )
return;
#endif
va_start(argptr, str );
vsprintf( string, str, argptr);
va_end(argptr);
#ifndef USE_VFS
fprintf( fp, "\n%S:\n", WORLDTIMESTR );
fprintf( fp, "%s\n", string );
#else
s_stratD.Endl() << WORLDTIMESTR << ":" << CLog::endl << string << CLog::endl;
#endif
if( gfDisplayStrategicAILogs )
{
ScreenMsg( FONT_LTKHAKI, MSG_DIALOG, L"%S", string );
@@ -4619,12 +4631,14 @@ void LogStrategicEvent( STR8 str, ... )
{
OutputDebugString( (LPCSTR)String( "%s\n", string ) );
}
#ifndef USE_VFS
fclose( fp );
#endif
}
void ClearStrategicLog()
{
#ifndef USE_VFS
FILE *fp;
fp = fopen( "Strategic Decisions.txt", "w" );
if( !fp )
@@ -4633,6 +4647,9 @@ void ClearStrategicLog()
fprintf( fp, "STRATEGIC LOG\n" );
fclose( fp );
#else
s_stratD.Flush();
#endif
}
#endif
+4 -4
View File
@@ -1017,7 +1017,7 @@ void UpdateBuddyAndHatedCounters( void )
if (OKToCheckOpinion(ubOtherProfileID)) {
pProfile->bMercOpinion[ubOtherProfileID] += (HATED_OPINION - pProfile->bMercOpinion[ubOtherProfileID]) / (pProfile->bLearnToHateCount + 1);
}
}
}
}
else
{
@@ -1050,15 +1050,15 @@ void UpdateBuddyAndHatedCounters( void )
{
// add to liked!
if (OKToCheckOpinion(ubOtherProfileID)) {
pProfile->bBuddy[2] = pProfile->bLearnToLike;
pProfile->bMercOpinion[ubOtherProfileID] = BUDDY_OPINION;
pProfile->bBuddy[2] = pProfile->bLearnToLike;
pProfile->bMercOpinion[ubOtherProfileID] = BUDDY_OPINION;
}
}
else if (pProfile->bLearnToLikeCount < pProfile->bLearnToLikeTime / 2)
{
// increase opinion of them!
if (OKToCheckOpinion(ubOtherProfileID)) {
pProfile->bMercOpinion[ubOtherProfileID] += (BUDDY_OPINION - pProfile->bMercOpinion[ubOtherProfileID]) / (pProfile->bLearnToLikeCount + 1);
pProfile->bMercOpinion[ubOtherProfileID] += (BUDDY_OPINION - pProfile->bMercOpinion[ubOtherProfileID]) / (pProfile->bLearnToLikeCount + 1);
}
break;
}
+2 -2
View File
@@ -41,7 +41,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
Optimization="0"
AdditionalIncludeDirectories="..\Multiplayer"
AdditionalIncludeDirectories="..\Multiplayer;..\VFS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -105,7 +105,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D &quot;_CRT_SECURE_NO_DEPRECATE&quot;"
AdditionalIncludeDirectories="..\Multiplayer"
AdditionalIncludeDirectories="..\Multiplayer;..\VFS"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
RuntimeLibrary="0"
RuntimeTypeInfo="false"
+6 -6
View File
@@ -1163,7 +1163,7 @@ void HandleCompletionOfTownTrainingByGroupWithTrainer( SOLDIERTYPE *pTrainer )
sSectorY = pTrainer->sSectorY;
bSectorZ = pTrainer->bSectorZ;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// valid character?
if( gCharactersList[ iCounter ].fValid == FALSE )
@@ -1298,7 +1298,7 @@ void BuildListOfUnpaidTrainableSectors( void )
if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
{
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// valid character?
if( gCharactersList[ iCounter ].fValid )
@@ -1337,11 +1337,11 @@ void BuildListOfUnpaidTrainableSectors( void )
}
// now clean out repeated sectors
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1; iCounter++ )
{
if( gsUnpaidStrategicSector[ iCounter ] > 0 )
{
for( iCounterB = iCounter + 1 ; iCounterB < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounterB++ )
for( iCounterB = iCounter + 1 ; iCounterB < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounterB++ )
{
if( gsUnpaidStrategicSector[ iCounterB ] == gsUnpaidStrategicSector[ iCounter ] )
{
@@ -1362,7 +1362,7 @@ INT32 GetNumberOfUnpaidTrainableSectors( void )
BuildListOfUnpaidTrainableSectors();
// now count up the results
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gsUnpaidStrategicSector[ iCounter ] > 0 )
{
@@ -1387,7 +1387,7 @@ void StartTrainingInAllUnpaidTrainableSectors()
BuildListOfUnpaidTrainableSectors();
// pay up in each sector
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gsUnpaidStrategicSector[ iCounter ] > 0 )
{
+164 -109
View File
@@ -1851,7 +1851,7 @@ BOOLEAN SetInfoChar( UINT8 ubID )
{
INT8 bCounter;
for ( bCounter = 0; bCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++)
for ( bCounter = 0; bCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++)
{
// skip invalid characters
if ( gCharactersList[ bCounter ].fValid == TRUE )
@@ -3121,7 +3121,7 @@ BOOLEAN CharacterIsInTransitAndHasItemPickedUp( INT8 bCharacterNumber )
void DisplayCharacterInfo( void )
{
Assert( bSelectedInfoChar < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS );
Assert( bSelectedInfoChar < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS );
Assert( gCharactersList[ bSelectedInfoChar ].fValid );
// set font buffer
@@ -3313,7 +3313,7 @@ void HighLightAssignLine()
UINT16 usColor;
static INT32 iColorNum = STARTING_COLOR_NUM;
static BOOLEAN fDelta=FALSE;
static INT32 uiOldHighlight = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
static INT32 uiOldHighlight = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
INT16 usCount = 0;
UINT16 usX;
UINT16 usY;
@@ -3323,7 +3323,7 @@ void HighLightAssignLine()
// is this a valid line?
if( ( giAssignHighLine == -1 ) || fShowInventoryFlag )
{
uiOldHighlight = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
uiOldHighlight = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
return;
}
@@ -3354,7 +3354,7 @@ void HighLightAssignLine()
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
for( usCount = 0; usCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; usCount++ )
for( usCount = 0; usCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; usCount++ )
{
if( IsCharacterSelectedForAssignment( usCount ) == TRUE )
{
@@ -3377,7 +3377,7 @@ void HighLightAssignLine()
LineDraw( TRUE, usX, usY, usX+ASSIGN_WIDTH, usY, usColor,pDestBuf);
}
if( ( ( usCount == CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ) || ( usCount != ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ? !( IsCharacterSelectedForAssignment( ( UINT16 )( usCount + 1 ) ) ) : 0) || ( usCount == FIRST_VEHICLE - 1 ) )
if( ( ( usCount == giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ) || ( usCount != ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ? !( IsCharacterSelectedForAssignment( ( UINT16 )( usCount + 1 ) ) ) : 0) || ( usCount == FIRST_VEHICLE - 1 ) )
{
LineDraw(TRUE, usX, usY+GetFontHeight(MAP_SCREEN_FONT)+2, usX+ASSIGN_WIDTH, usY+GetFontHeight(MAP_SCREEN_FONT)+2, usColor, pDestBuf);
}
@@ -3397,7 +3397,7 @@ void HighLightDestLine()
UINT16 usColor;
static INT32 iColorNum = STARTING_COLOR_NUM;
static BOOLEAN fDelta=FALSE;
static INT32 uiOldHighlight = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
static INT32 uiOldHighlight = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
UINT16 usCount = 0;
UINT16 usX;
UINT16 usY;
@@ -3406,7 +3406,7 @@ void HighLightDestLine()
if( ( giDestHighLine == -1 ) || fShowInventoryFlag )
{
uiOldHighlight = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
uiOldHighlight = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
return;
}
@@ -3438,7 +3438,7 @@ void HighLightDestLine()
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
for( usCount = 0; usCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; usCount++ )
for( usCount = 0; usCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; usCount++ )
{
if( CharacterIsGettingPathPlotted( usCount ) == TRUE )
{
@@ -3457,7 +3457,7 @@ void HighLightDestLine()
{
LineDraw( TRUE, usX+4, usY, usX+DEST_ETA_WIDTH+4, usY, usColor,pDestBuf);
}
if( ( ( usCount == CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ) || ( usCount != ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ? !( CharacterIsGettingPathPlotted( ( UINT16 )( usCount + 1 ) ) ) : 0) || ( usCount == FIRST_VEHICLE - 1 ) )
if( ( ( usCount == giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ) || ( usCount != ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ? !( CharacterIsGettingPathPlotted( ( UINT16 )( usCount + 1 ) ) ) : 0) || ( usCount == FIRST_VEHICLE - 1 ) )
{
LineDraw(TRUE, usX+4, usY+GetFontHeight(MAP_SCREEN_FONT)+2, usX+DEST_ETA_WIDTH+4, usY+GetFontHeight(MAP_SCREEN_FONT)+2, usColor, pDestBuf);
}
@@ -3483,7 +3483,7 @@ void HighLightSleepLine()
UINT16 usColor;
static INT32 iColorNum = STARTING_COLOR_NUM;
static BOOLEAN fDelta=FALSE;
static INT32 uiOldHighlight = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
static INT32 uiOldHighlight = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
UINT16 usCount = 0;
UINT16 usX, usX2;
UINT16 usY;
@@ -3493,7 +3493,7 @@ void HighLightSleepLine()
// is this a valid line?
if( ( giSleepHighLine == -1 ) || fShowInventoryFlag )
{
uiOldHighlight = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
uiOldHighlight = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1;
return;
}
@@ -3525,7 +3525,7 @@ void HighLightSleepLine()
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
for( usCount = 0; usCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; usCount++ )
for( usCount = 0; usCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; usCount++ )
{
if( IsCharacterSelectedForSleep( usCount ) == TRUE )
{
@@ -3546,7 +3546,7 @@ void HighLightSleepLine()
{
LineDraw( TRUE, usX+4, usY, usX2, usY, usColor,pDestBuf);
}
if( ( ( usCount == CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ) || ( usCount != ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ? !( IsCharacterSelectedForSleep( ( UINT16 )( usCount + 1 ) ) ) : 0) || ( usCount == FIRST_VEHICLE - 1 ) )
if( ( ( usCount == giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ) || ( usCount != ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS - 1 ) ? !( IsCharacterSelectedForSleep( ( UINT16 )( usCount + 1 ) ) ) : 0) || ( usCount == FIRST_VEHICLE - 1 ) )
{
LineDraw(TRUE, usX+4, usY+GetFontHeight(MAP_SCREEN_FONT)+2, usX2, usY+GetFontHeight(MAP_SCREEN_FONT)+2, usColor, pDestBuf);
}
@@ -3583,7 +3583,7 @@ void AddCharacter( SOLDIERTYPE *pCharacter )
// adding a vehicle?
if( pCharacter->flags.uiStatusFlags & SOLDIER_VEHICLE )
{
while( usVehicleLoop < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS )
while( usVehicleLoop < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS )
{
if ( gCharactersList[ usVehicleLoop ].fValid )
{
@@ -3600,15 +3600,15 @@ void AddCharacter( SOLDIERTYPE *pCharacter )
else
{
// go through character list until a blank is reached
while( (gCharactersList[usCount].fValid)&&(usCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS) )
while( (gCharactersList[usCount].fValid)&&(usCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS) )
{
usCount++;
}
}
Assert( usCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS );
if (usCount >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS )
Assert( usCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS );
if (usCount >= giMAXIMUM_NUMBER_OF_PLAYER_SLOTS )
{
return;
}
@@ -3707,7 +3707,7 @@ void DisplayCharacterList()
SetFontBackground(FONT_BLACK);
for (sCount = 0; sCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCount++)
for (sCount = 0; sCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCount++)
{
// skip invalid characters
if ( gCharactersList[sCount].fValid == TRUE )
@@ -3776,6 +3776,8 @@ void DrawMPPlayerList ()
INT16 usX=0;
INT16 usY=0;
static UINT8 pbar_id_player[4];
if (is_networked && is_client && is_connected)
{
wchar_t szPlayerName[30];
@@ -3784,46 +3786,78 @@ void DrawMPPlayerList ()
int row=0;
for(int i=0; i < 4; i++)
{
//if (i != CLIENT_NUM)
//{
if (client_names[i] != NULL)
if (client_names[i] != NULL)
{
// setup bouds for player dirty rect and progress bar
int l,t,b,r;
l = MP_PLAYER_X+1;
r = l + MP_PLAYER_W - 1;
t = MP_ROWSTART_Y+(row*Y_SIZE);
b = t + Y_SIZE - 1;
// set up or destroy progress bar if needed
if (client_downloading[i] == 1 && pbar_id_player[i] == 0)
{
if (client_ready[i]==1)
{
SetFontForeground( FONT_GREEN );
}
else
{
SetFontForeground( FONT_WHITE );
}
if (strcmp(client_names[i],"")!=0)
{
// valid player
memset(szPlayerName,0,30*sizeof(wchar_t));
mbstowcs( szPlayerName,client_names[i],30);
FindFontCenterCoordinates((short)MP_PLAYER_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_PLAYER_W, (short)Y_SIZE, szPlayerName, (long)MAP_SCREEN_FONT, &usX, &usY);
DrawString( (STR16)szPlayerName , usX,usY, MAP_SCREEN_FONT);
// <TODO> check for gametype here
//wcscpy(szTeam,L"N/A");
if (PLAYER_BSIDE==MP_TYPE_DEATHMATCH)
wcscpy(szTeam,L"N/A");
else
wcscpy(szTeam,gszMPTeamNames[client_teams[i]]);
FindFontCenterCoordinates((short)MP_TEAM_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_TEAM_W, (short)Y_SIZE, szTeam, (long)MAP_SCREEN_FONT, &usX, &usY);
DrawString( szTeam,usX,(short)usY, MAP_SCREEN_FONT);
wcscpy(szCompass,(RANDOM_SPAWN==1 ? L"?" : gszMPEdgesText[client_edges[i]]));
FindFontCenterCoordinates((short)MP_COMPASS_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_COMPASS_W, (short)Y_SIZE, szCompass, (long)MAP_SCREEN_FONT, &usX, &usY);
DrawString(szCompass , usX,(short)usY, MAP_SCREEN_FONT);
row++;
}
fTeamPanelDirty = true;
CreateProgressBarNoBorder(i,l,t,r,b);
SetProgressBarColor(i,112,154,209);
SetProgressBarRenderBuffer(i,guiSAVEBUFFER);
pbar_id_player[i] = 1;
}
else if (client_downloading[i] == 0 && pbar_id_player[i] == 1)
{
fTeamPanelDirty = true;
RemoveProgressBar(i);
pbar_id_player[i] = 0;
}
// render the progress bar if needed
if (client_downloading[i] == 1 && pbar_id_player[i] == 1)
{
RenderProgressBar(i,client_progress[i]);
}
//}
if (client_ready[i]==1)
{
SetFontForeground( FONT_GREEN );
}
else
{
SetFontForeground( FONT_WHITE );
}
if (strcmp(client_names[i],"")!=0)
{
// valid player
memset(szPlayerName,0,30*sizeof(wchar_t));
mbstowcs( szPlayerName,client_names[i],30);
FindFontCenterCoordinates((short)MP_PLAYER_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_PLAYER_W, (short)Y_SIZE, szPlayerName, (long)MAP_SCREEN_FONT, &usX, &usY);
// do it manually here so as DrawString overrides the dirty rects
// we want the dirty rect to include progress bar as well as player text
SetFont(MAP_SCREEN_FONT);
mprintf(usX,usY,(STR16)szPlayerName);
int iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, l, t, r, b);
SetBackgroundRectFilled( iBack );
//DrawString( (STR16)szPlayerName , usX,usY, MAP_SCREEN_FONT);
// <TODO> check for gametype here
//wcscpy(szTeam,L"N/A");
if (PLAYER_BSIDE==MP_TYPE_DEATHMATCH)
wcscpy(szTeam,L"N/A");
else
wcscpy(szTeam,gszMPTeamNames[client_teams[i]]);
FindFontCenterCoordinates((short)MP_TEAM_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_TEAM_W, (short)Y_SIZE, szTeam, (long)MAP_SCREEN_FONT, &usX, &usY);
DrawString( szTeam,usX,(short)usY, MAP_SCREEN_FONT);
wcscpy(szCompass,(RANDOM_SPAWN==1 ? L"?" : gszMPEdgesText[client_edges[i]]));
FindFontCenterCoordinates((short)MP_COMPASS_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_COMPASS_W, (short)Y_SIZE, szCompass, (long)MAP_SCREEN_FONT, &usX, &usY);
DrawString(szCompass , usX,(short)usY, MAP_SCREEN_FONT);
row++;
}
}
}
// Draw the Server Info
@@ -3875,15 +3909,28 @@ void DrawMPPlayerList ()
swprintf(szSquadSize,L"%i",MAX_MERCS);
DrawString( szSquadSize , MP_GAMEINFO_X + StringPixLength(gszMPMapscreenText[2],MAP_SCREEN_FONT),MP_ROWSTART_Y+(3*Y_SIZE), MAP_SCREEN_FONT);
row = 4;
if (RANDOM_MERCS)
{
// Random Mercs
SetFontForeground( FONT_YELLOW );
DrawString( gszMPMapscreenText[5] , MP_GAMEINFO_X ,MP_ROWSTART_Y+(4*Y_SIZE), MAP_SCREEN_FONT);
DrawString( gszMPMapscreenText[5] , MP_GAMEINFO_X ,MP_ROWSTART_Y+(row*Y_SIZE), MAP_SCREEN_FONT);
SetFontForeground( FONT_WHITE );
DrawString( gszMPMapscreenText[6] , MP_GAMEINFO_X + StringPixLength(gszMPMapscreenText[5],MAP_SCREEN_FONT),MP_ROWSTART_Y+(4*Y_SIZE), MAP_SCREEN_FONT);
DrawString( gszMPMapscreenText[6] , MP_GAMEINFO_X + StringPixLength(gszMPMapscreenText[5],MAP_SCREEN_FONT),MP_ROWSTART_Y+(row*Y_SIZE), MAP_SCREEN_FONT);
row++;
}
// Server Version
SetFontForeground( FONT_YELLOW );
DrawString( gszMPMapscreenText[8] , MP_GAMEINFO_X ,MP_ROWSTART_Y+(row*Y_SIZE), MAP_SCREEN_FONT);
row++;
wchar_t szServerVer[30];
memset(szServerVer,0,30*sizeof(wchar_t));
mbstowcs( szServerVer,MPVERSION,30);
SetFontForeground( FONT_WHITE );
DrawString( szServerVer , MP_GAMEINFO_X ,MP_ROWSTART_Y+(row*Y_SIZE), MAP_SCREEN_FONT);
}
}
void DestroyMPCompassBox( void )
@@ -5257,9 +5304,9 @@ UINT32 MapScreenHandle(void)
{
fShowInventoryFlag = FALSE;
// CHRISL: Added call to re-render the bottom panel
// RenderMapScreenInterfaceBottom ( TRUE );
RenderMapScreenInterfaceBottom ( TRUE );
// set help text for item glow region
//XXXj? SetRegionFastHelpText( &gCharInfoHandRegion, pMiscMapScreenMouseRegionHelpText[ 0 ] );
SetRegionFastHelpText( &gCharInfoHandRegion, pMiscMapScreenMouseRegionHelpText[ 0 ] );
}
@@ -6536,20 +6583,25 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
case BACKSPACE:
StopAnyCurrentlyTalkingSpeech( );
break;
// multiplayer: Roman: Should be changed, because the keys are already bount to another feature
case F1:
// WANNE: No more needed
/*
if (is_networked)
{
mp_help();
break;
}
*/
case F2:
// WANNE: No more needed
/*
if (is_networked)
{
mp_help2();
break;
}
*/
case F3:
case F4:
case F5:
@@ -9319,7 +9371,7 @@ void CreateMouseRegionsForTeamList( void )
// the info region...is the background for the list itself
// OJW - MP
int max_rows = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS;
int max_rows = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
if (is_networked)
max_rows = 7; // <TODO> check this value is correct / unhardcode it
@@ -9415,7 +9467,7 @@ void DestroyMouseRegionsForTeamList( void )
// will destroy mouse regions overlaying the team list area
INT32 sCounter = 0;
for( sCounter = 0; sCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCounter++ )
for( sCounter = 0; sCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCounter++ )
{
MSYS_RemoveRegion( &gTeamListNameRegion[ sCounter ]);
MSYS_RemoveRegion( &gTeamListAssignmentRegion[ sCounter ]);
@@ -9463,7 +9515,7 @@ void MPReadyButtonCallback( GUI_BUTTON *btn, INT32 reason )
else if (allowlaptop)
{
// warn the user that cannot change once buying has commenced
ScreenMsg( FONT_LTBLUE, MSG_CHAT, gszMPMapscreenText[3]);
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, gszMPMapscreenText[3]);
}
}
else
@@ -9491,11 +9543,11 @@ void MPReadyButtonCallback( GUI_BUTTON *btn, INT32 reason )
else if (allowlaptop)
{
// warn the user that cannot change once buying has commenced
ScreenMsg( FONT_LTBLUE, MSG_CHAT, gszMPMapscreenText[4]);
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, gszMPMapscreenText[4]);
}
else if (RANDOM_SPAWN)
{
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"Cannot change edge, the game is set to random spawn");
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, L"Cannot change edge, the game is set to random spawn");
}
}
else
@@ -9528,7 +9580,7 @@ void MPCompassChangeCallback( MOUSE_REGION * pReason, INT32 iReason)
else if (allowlaptop)
{
// warn the user that cannot change once buying has commenced
ScreenMsg( FONT_LTBLUE, MSG_CHAT, gszMPMapscreenText[3]);
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, gszMPMapscreenText[3]);
}
}
else
@@ -9557,11 +9609,11 @@ void MPTeamChangeCallback( MOUSE_REGION * pReason, INT32 iReason)
else if (allowlaptop)
{
// warn the user that cannot change once buying has commenced
ScreenMsg( FONT_LTBLUE, MSG_CHAT, gszMPMapscreenText[4]);
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, gszMPMapscreenText[4]);
}
else if (RANDOM_SPAWN)
{
ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"Cannot change edge, the game is set to random spawn");
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, L"Cannot change edge, the game is set to random spawn");
}
}
else
@@ -9939,7 +9991,7 @@ void TeamListAssignmentRegionBtnCallBack(MOUSE_REGION *pRegion, INT32 iReason )
// Select all characters in squad
INT16 iCounter;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -11054,20 +11106,22 @@ void ReBuildCharactersList( void )
// add in characters
for ( sCount = 0; sCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCount++)
for ( sCount = 0; sCount < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCount++)
{
// clear this slot
gCharactersList[ sCount ].fValid = FALSE;
gCharactersList[ sCount ].usSolID = 0;
}
for ( sCount = 0; sCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; sCount++)
// fills array with pressence of player controlled characters
for ( INT32 cnt=gTacticalStatus.Team[ OUR_TEAM ].bFirstID; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; cnt++)
{
// add character into the cleared slot
AddCharacter( &Menptr[ gTacticalStatus.Team[ OUR_TEAM ].bFirstID + sCount ] );
if(Menptr[ cnt ].bActive == 1)
{
AddCharacter( &Menptr[ cnt ] );
}
}
// sort them according to current sorting method
SortListOfMercsInTeamPanel( FALSE );
@@ -11156,7 +11210,7 @@ void EnableDisableTeamListRegionsAndHelpText( void )
INT8 bCharNum;
for( bCharNum = 0; bCharNum < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCharNum++ )
for( bCharNum = 0; bCharNum < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCharNum++ )
{
if( gCharactersList[ bCharNum ].fValid == FALSE )
{
@@ -11351,7 +11405,7 @@ BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone )
}
// otherwise, find this character
for( bCounter = 0; bCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
for( bCounter = 0; bCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
{
if( gCharactersList[bCounter].fValid == TRUE )
{
@@ -11378,7 +11432,7 @@ void HandleSpontanousTalking( )
if( DialogueActive() == FALSE )
{
if( ( bSelectedInfoChar != -1 ) && ( bSelectedInfoChar < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
if( ( bSelectedInfoChar != -1 ) && ( bSelectedInfoChar < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
{
ContinueDialogue( ( &Menptr[gCharactersList[bSelectedInfoChar].usSolID] ), TRUE );
}
@@ -11514,7 +11568,7 @@ void RebuildWayPointsForAllSelectedCharsGroups( void )
memset( fGroupIDRebuilt, FALSE, sizeof( fGroupIDRebuilt ) );
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( ( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE ) )
{
@@ -11946,7 +12000,7 @@ INT8 GetLastValidCharacterInTeamPanelList( void )
INT8 iCounter = 0, iValue = 0;
// run through the list and find the last valid guy in the list
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -12254,7 +12308,7 @@ void UpdateBadAssignments( void )
{
UINT32 iCounter;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -12312,7 +12366,7 @@ BOOLEAN AnyMercsLeavingRealSoon()
UINT32 uiTimeInMin = GetWorldTotalMin();
BOOLEAN fFoundOne = FALSE;
for( uiCounter = 0; uiCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; uiCounter++ )
for( uiCounter = 0; uiCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; uiCounter++ )
{
if( gCharactersList[ uiCounter ].fValid == TRUE )
{
@@ -12892,7 +12946,7 @@ void TellPlayerWhyHeCantCompressTime( void )
// WANNE - MP: It is forbidden to compress time in multiplayer
else if (is_networked)
{
ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"You cannot compress time in multiplayer game. Press '3' to start the battle.");
ScreenMsg( FONT_LTGREEN, MSG_MPSYSTEM, MPClientMessage[65]);
}
else if ( !AnyUsableRealMercenariesOnTeam() )
{
@@ -13032,15 +13086,17 @@ void AddTeamPanelSortButtonsForMapScreen( void )
void AddMPButtonsForMapScreen( void )
{
INT32 iCounter = 0;
//SGPFILENAME filename;
SGPFILENAME filename;
INT32 iImageIndex[ MAX_MP_BUTTONS+1 ] = { 0, 1, 3, 5 , 7 }; // sleep image is out or order (last)
INT32 iPressedIndex[ MAX_MP_BUTTONS+1 ] = { 0 , 2 , 4 , 6 , 8 };
GetMLGFilename( filename, MLG_MP_GOLDPIECEBUTTONS );
// <TODO> add start game button and hide it...
for( iCounter = 0; iCounter < MAX_MP_BUTTONS+1; iCounter++ )
{
giMapMPButtonImage[ iCounter ] = LoadButtonImage( "INTERFACE\\MPGOLDPIECEBUTTONS.STI", -1, iImageIndex[ iCounter ] , -1, iPressedIndex[ iCounter ] , -1 );
giMapMPButtonImage[ iCounter ] = LoadButtonImage( filename, -1, iImageIndex[ iCounter ] , -1, iPressedIndex[ iCounter ] , -1 );
if (iCounter < MAX_MP_BUTTONS)
{
@@ -13084,7 +13140,7 @@ void SortListOfMercsInTeamPanel( BOOLEAN fRetainSelectedMercs, BOOLEAN fReverse
}
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// set current entry to null
pSelectedSoldier[ iCounter ] = NULL;
@@ -13321,11 +13377,11 @@ void SortListOfMercsInTeamPanel( BOOLEAN fRetainSelectedMercs, BOOLEAN fReverse
// now select all the soldiers that were selected before
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( pSelectedSoldier[ iCounter ] )
{
for( iCounterA = 0; iCounterA < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounterA++ )
for( iCounterA = 0; iCounterA < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounterA++ )
{
// is this entry even valid
if( gCharactersList[ iCounterA ].fValid == FALSE )
@@ -13463,7 +13519,7 @@ void HandleAssignmentsDoneAndAwaitingFurtherOrders( void )
// update timer so that we only run check so often
giFlashAssignBaseTime = iCurrentTime;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == FALSE )
{
@@ -13501,7 +13557,7 @@ void DisplayIconsForMercsAsleep( void )
GetVideoObject(&hHandle, guiSleepIcon );
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -13618,7 +13674,7 @@ BOOLEAN MapCharacterHasAccessibleInventory( INT8 bCharNumber )
Assert( bCharNumber >= 0 );
Assert( bCharNumber < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS );
Assert( bCharNumber < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS );
// invalid character slot selected?
if( gCharactersList[ bCharNumber ].fValid == FALSE )
@@ -13957,7 +14013,7 @@ BOOLEAN HandleCtrlOrShiftInTeamPanel( INT8 bCharNumber, BOOLEAN fFromRightClickA
INT16 iCounter;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -14012,7 +14068,7 @@ BOOLEAN HandleCtrlOrShiftInTeamPanel( INT8 bCharNumber, BOOLEAN fFromRightClickA
INT16 iCounter;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( gCharactersList[ iCounter ].fValid == TRUE )
{
@@ -14118,7 +14174,7 @@ INT32 GetContractExpiryTime( SOLDIERTYPE *pSoldier )
void ChangeSelectedInfoChar( INT8 bCharNumber, BOOLEAN fResetSelectedList )
{
Assert( ( bCharNumber >= -1 ) && ( bCharNumber < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
Assert( ( bCharNumber >= -1 ) && ( bCharNumber < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
if( ( bCharNumber != -1 ) && ( gCharactersList[ bCharNumber ].fValid == FALSE ) )
return;
@@ -14194,7 +14250,7 @@ void CopyPathToAllSelectedCharacters( PathStPtr pPath )
// run through list and copy paths for each selected character
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE )
{
@@ -14232,7 +14288,7 @@ void CancelPathsOfAllSelectedCharacters()
// cancel destination for the clicked and ALL other valid & selected characters with a route set
for( bCounter = 0; bCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
for( bCounter = 0; bCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
{
// if we've clicked on a selected valid character
if( ( gCharactersList[ bCounter ].fValid == TRUE ) && IsEntryInSelectedListSet( bCounter ) )
@@ -14315,7 +14371,7 @@ INT16 CalcLocationValueForChar( INT32 iCounter )
SOLDIERTYPE *pSoldier = NULL;
INT16 sLocValue = 0;
Assert( iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS );
Assert( iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS );
if( gCharactersList[ iCounter ].fValid == FALSE )
return( sLocValue );
@@ -14620,7 +14676,7 @@ void RandomAwakeSelectedMercConfirmsStrategicMove( void )
UINT8 ubChosenMerc;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( ( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE ) )
{
@@ -14789,10 +14845,10 @@ BOOLEAN CanMoveBullseyeAndClickedOnIt( INT16 sMapX, INT16 sMapY )
// haydent
else if(is_server)
{
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPServerMessage[9] );
ScreenMsg( FONT_LTGREEN, MSG_MPSYSTEM, MPServerMessage[9] );
}
else if(is_client)
ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[38] );
ScreenMsg( FONT_LTGREEN, MSG_MPSYSTEM, MPClientMessage[38] );
}
else
{
@@ -14849,7 +14905,7 @@ void WakeUpAnySleepingSelectedMercsOnFootOrDriving( void )
BOOLEAN fSuccess = FALSE;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( ( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE ) )
{
@@ -15086,7 +15142,7 @@ void InitPreviousPaths( void )
INT32 iCounter = 0;
// init character previous paths
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
gpCharacterPreviousMercPath[ iCounter ] = NULL;
}
@@ -15101,7 +15157,7 @@ void RememberPreviousPathForAllSelectedChars( void )
INT32 iCounter = 0;
SOLDIERTYPE *pSoldier = NULL;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE )
{
@@ -15168,7 +15224,7 @@ void RestorePreviousPaths( void )
}
else // character(s) plotting
{
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
// if selected
if( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE )
@@ -15241,7 +15297,7 @@ void ClearPreviousPaths( void )
{
INT32 iCounter = 0;
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
{
if( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE )
{
@@ -15268,7 +15324,7 @@ void SelectAllCharactersInSquad( INT8 bSquadNumber )
ChangeSelectedInfoChar( -1, TRUE );
// now select all the soldiers that are in this squad
for( bCounter = 0; bCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
for( bCounter = 0; bCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
{
// is this entry is valid
if( gCharactersList[ bCounter ].fValid == TRUE )
@@ -15377,8 +15433,7 @@ void RequestToggleMercInventoryPanel( void )
else
{
// Headrock. New line forces InvBottom rerender when the inventory is opened and closed.
//RenderMapScreenInterfaceBottom ( TRUE );
fMapScreenBottomDirty = TRUE;
RenderMapScreenInterfaceBottom ( TRUE );
SetRegionFastHelpText( &gCharInfoHandRegion, pMiscMapScreenMouseRegionHelpText[ 0 ] );
}
}
+63
View File
@@ -109,6 +109,9 @@
#include "connect.h" //hayden added alot ""'s to get around client spawing random/different placed AI
#include "SaveLoadGame.h"
#include "vfs.h"
#include "PropertyContainer.h"
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
class SOLDIERTYPE;
@@ -1377,6 +1380,7 @@ void EndLoadScreen( )
'A' + gWorldSectorY - 1, gWorldSectorX, gbWorldSectorZ, uiSeconds, uiHundreths );
}
ScreenMsg( FONT_YELLOW, MSG_TESTVERSION, str );
#ifndef USE_VFS
if( fStartNewFile )
{ //start new file
fp = fopen( "TimeResults.txt", "w" );
@@ -1447,6 +1451,65 @@ void EndLoadScreen( )
fclose( fp );
}
#else
CLog timeResults(L"TimeResults.txt", true);
ScreenMsg( FONT_YELLOW, MSG_TESTVERSION, L"See JA2\\Data\\TimeResults.txt for more detailed timings." );
//Record all of the timings.
timeResults << str << CLog::endl;
timeResults << "EnterSector() supersets LoadWorld(). This includes other external sections." << CLog::endl;
//FileRead()
timeResults << CLog::endl << CLog::endl << "VARIOUS FUNCTION TIMINGS (exclusive of actual function timings in second heading)" << CLog::endl;
uiSeconds = uiTotalFileReadTime / 1000;
uiHundreths = (uiTotalFileReadTime / 10) % 100;
//fprintf( fp, "FileRead: %d.%02d (called %d times)\n", uiSeconds, uiHundreths, uiTotalFileReadCalls );
timeResults << "FileRead: " <<uiSeconds<< "." << uiHundreths << " (called " << uiTotalFileReadCalls << " times)" << CLog::endl;
timeResults.Endl().Endl() << "SECTIONS OF LOADWORLD (all parts should add up to 100%)" << CLog::endl;
//TrashWorld()
uiSeconds = uiTrashWorldTime / 1000;
uiHundreths = (uiTrashWorldTime / 10) % 100;
timeResults << "TrashWorld: " << uiSeconds << "." << uiHundreths << CLog::endl;
//LoadMapTilesets()
uiSeconds = uiLoadMapTilesetTime / 1000;
uiHundreths = (uiLoadMapTilesetTime / 10) % 100;
timeResults << "LoadMapTileset: " << uiSeconds << "." << uiHundreths << CLog::endl;
//LoadMapLights()
uiSeconds = uiLoadMapLightsTime / 1000;
uiHundreths = (uiLoadMapLightsTime / 10) % 100;
timeResults << "LoadMapLights: " << uiSeconds << "." << uiHundreths << CLog::endl;
uiSeconds = uiBuildShadeTableTime / 1000;
uiHundreths = (uiBuildShadeTableTime / 10) % 100;
timeResults << " 1) BuildShadeTables: " << uiSeconds << "." << uiHundreths << CLog::endl;
uiPercentage = uiNumImagesReloaded * 100 / NUMBEROFTILETYPES;
timeResults << " 2) " << uiPercentage << "% of the tileset images were actually reloaded." << CLog::endl;
if ( ( uiNumTablesSaved+uiNumTablesLoaded ) != 0 )
{
uiPercentage = uiNumTablesSaved * 100 / (uiNumTablesSaved+uiNumTablesLoaded);
}
else
{
uiPercentage = 0;
}
timeResults << " 3) Of that, " << uiPercentage << "% of the shade tables were generated (not loaded)." << CLog::endl;
if( gfForceBuildShadeTables )
{
timeResults << " NOTE: Force building of shadetables enabled on this local computer." << CLog::endl;
}
//Unaccounted
uiUnaccounted = uiLoadWorldTime - uiTrashWorldTime - uiLoadMapTilesetTime - uiLoadMapLightsTime;
uiSeconds = uiUnaccounted / 1000;
uiHundreths = (uiUnaccounted / 10) % 100;
timeResults << "Unaccounted: " << uiSeconds << "." << uiHundreths << CLog::endl;
//LoadWorld()
uiSeconds = uiLoadWorldTime / 1000;
uiHundreths = (uiLoadWorldTime / 10) % 100;
timeResults.Endl() << "Total: " << uiSeconds << "." << uiHundreths << CLog::endl;
#endif // USE_VFS
#endif
}