- new menu option: Low CPU Usage (patch from MTX/defrog)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@725 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-02-21 17:17:00 +00:00
parent ff2aa4f8e1
commit 81f5b6e748
12 changed files with 76 additions and 40 deletions
+1
View File
@@ -260,6 +260,7 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_USE_RANDOM_PERSONALITY ] = FALSE;
gGameSettings.fOptions[ TOPTION_USE_AUTO_SAVE ] = FALSE;
gGameSettings.fOptions[ TOPTION_SILENT_SKYRIDER ] = FALSE;
gGameSettings.fOptions[ TOPTION_LOW_CPU_USAGE ] = FALSE;
gGameSettings.ubSizeOfDisplayCover = 4;
gGameSettings.ubSizeOfLOS = 4;
+1
View File
@@ -54,6 +54,7 @@ enum
TOPTION_USE_RANDOM_PERSONALITY,
TOPTION_USE_AUTO_SAVE,
TOPTION_SILENT_SKYRIDER,
TOPTION_LOW_CPU_USAGE,
NUM_GAME_OPTIONS, //Toggle up this will be able to be Toggled by the player
+2 -2
View File
@@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
INT16 zVersionLabel[256] = { L"Release v1.13.687" };
INT16 zVersionLabel[256] = { L"Release v1.13.725" };
#endif
INT8 czVersionNumber[16] = { "Build 07.01.28" }; //YY.MM.DD
INT8 czVersionNumber[16] = { "Build 07.02.21" }; //YY.MM.DD
INT16 zTrackingNumber[16] = { L"Z" };
+1 -1
View File
@@ -546,7 +546,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_867_en.exe"
OutputFile="D:\games\Jagged Alliance 2 v1.13\ja2 v1.13.725_EN.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
+2
View File
@@ -3481,6 +3481,7 @@ STR16 zOptionsToggleText[] =
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3560,6 +3561,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"Low CPU Usage",
};
+2
View File
@@ -3483,6 +3483,7 @@ STR16 zOptionsToggleText[] =
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3562,6 +3563,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"Low CPU Usage",
};
+2
View File
@@ -3470,6 +3470,7 @@ STR16 zOptionsToggleText[] =
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3549,6 +3550,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"Low CPU Usage",
};
+2
View File
@@ -3289,6 +3289,7 @@ STR16 zOptionsToggleText[] =
L"Zufällige B.S.E Personalität",
L"Automatisch speichern",
L"Stummer Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3368,6 +3369,7 @@ STR16 zOptionsScreenHelpText[] =
L"Wenn diese Funktion aktiviert ist, erhalten B.S.E Charaktere zufällige Persönlichkeit und Gesinnung.",
L"Wenn diese Funktion aktiviert ist, wird nach jeder Runde automatisch gespeichert.",
L"Wenn diese Funktion aktiviert ist, wird Skyrider nichts mehr sprechen.",
L"Low CPU Usage",
};
STR16 gzGIOScreenText[] =
+4
View File
@@ -3463,6 +3463,7 @@ STR16 zOptionsToggleText[] =
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3540,6 +3541,9 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, you will hear rain noises when it is raining.",
L"When ON, the crows are present in game.",
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"Low CPU Usage",
};
+2
View File
@@ -3463,6 +3463,7 @@ STR16 zOptionsToggleText[] =
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3542,6 +3543,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"Low CPU Usage",
};
+2
View File
@@ -3474,6 +3474,7 @@ STR16 zOptionsToggleText[] =
L"Random I.M.P personality",
L"Auto save",
L"Silent Skyrider",
L"Low CPU Usage",
};
//This is the help text associated with the above toggles.
@@ -3553,6 +3554,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved in tactical after each players turn.",
L"When ON, Skyrider will not talk anymore.",
L"Low CPU Usage",
};
+55 -37
View File
@@ -45,7 +45,7 @@ UINT8 gubCheckForFreeSpaceOnHardDriveCount=DONT_CHECK_FOR_FREE_SPACE;
extern BOOLEAN DoSkiMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback );
extern void NotEnoughHardDriveSpaceForQuickSaveMessageBoxCallBack( UINT8 bExitValue );
extern void NotEnoughHardDriveSpaceForQuickSaveMessageBoxCallBack( UINT8 bExitValue );
extern BOOLEAN gfTacticalPlacementGUIActive;
extern BOOLEAN gfTacticalPlacementGUIDirty;
extern BOOLEAN gfValidLocationsChanged;
@@ -88,7 +88,7 @@ BOOLEAN InitializeGame(void)
giStartingMemValue = MemGetFree( );
ClearAllDebugTopics();
RegisterJA2DebugTopic( TOPIC_JA2OPPLIST, "Reg" );
//RegisterJA2DebugTopic( TOPIC_MEMORY_MANAGER, "Reg" );
@@ -116,13 +116,13 @@ BOOLEAN InitializeGame(void)
InitTacticalSave( TRUE );
// Initialize Game Screens.
for (uiIndex = 0; uiIndex < MAX_SCREENS; uiIndex++)
{
if ((*(GameScreens[uiIndex].InitializeScreen))() == FALSE)
{ // Failed to initialize one of the screens.
return FALSE;
}
}
for (uiIndex = 0; uiIndex < MAX_SCREENS; uiIndex++)
{
if ((*(GameScreens[uiIndex].InitializeScreen))() == FALSE)
{ // Failed to initialize one of the screens.
return FALSE;
}
}
//Init the help screen system
InitHelpScreenSystem();
@@ -132,19 +132,19 @@ BOOLEAN InitializeGame(void)
//Initialize the Game options ( Gun nut, scifi and dif. levels
InitGameOptions();
// preload mapscreen graphics
HandlePreloadOfMapGraphics( );
guiCurrentScreen = INIT_SCREEN;
return TRUE;
return TRUE;
}
// The ShutdownGame function will free up/undo all things that were started in InitializeGame()
// It will also be responsible to making sure that all Gaming Engine tasks exit properly
void ShutdownGame(void)
void ShutdownGame(void)
{
// handle shutdown of game with respect to preloaded mapscreen graphics
HandleRemovalOfPreLoadedMapGraphics( );
@@ -164,7 +164,7 @@ void ShutdownGame(void)
}
// This is the main Gameloop. This should eventually by one big switch statement which represents
// This is the main Gameloop. This should eventually be one big switch statement which represents
// the state of the game (i.e. Main Menu, PC Generation, Combat loop, etc....)
// This function exits constantly and reenters constantly
@@ -173,14 +173,16 @@ static BOOLEAN gfSkipFrame = FALSE;
void GameLoop(void)
{
// DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop");
// DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop");
InputAtom InputEvent;
POINT MousePos;
UINT32 uiOldScreen=guiCurrentScreen;
InputAtom InputEvent;
POINT MousePos;
UINT32 uiOldScreen=guiCurrentScreen;
clock_t startTime = clock(); // decrease CPU load patch from defrog
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: get mouse position");
GetCursorPos(&MousePos);
// Hook into mouse stuff for MOVEMENT MESSAGES
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: get mouse hook");
MouseSystemHook(MOUSE_POS, (UINT16)MousePos.x ,(UINT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
@@ -188,8 +190,8 @@ void GameLoop(void)
MusicPoll( FALSE );
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: check for mouse events");
while (DequeueSpecificEvent(&InputEvent, LEFT_BUTTON_REPEAT|RIGHT_BUTTON_REPEAT|LEFT_BUTTON_DOWN|LEFT_BUTTON_UP|RIGHT_BUTTON_DOWN|RIGHT_BUTTON_UP ) == TRUE )
{
while (DequeueSpecificEvent(&InputEvent, LEFT_BUTTON_REPEAT|RIGHT_BUTTON_REPEAT|LEFT_BUTTON_DOWN|LEFT_BUTTON_UP|RIGHT_BUTTON_DOWN|RIGHT_BUTTON_UP ) == TRUE )
{
// HOOK INTO MOUSE HOOKS
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GameLoop: mouse event %d", InputEvent.usEvent ));
switch(InputEvent.usEvent)
@@ -215,7 +217,7 @@ void GameLoop(void)
}
}
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: check for errors");
if ( gfGlobalError )
@@ -282,15 +284,15 @@ void GameLoop(void)
{
switch( guiCurrentScreen )
{
case MAP_SCREEN:
if( guiPendingScreen != MSG_BOX_SCREEN )
{
EndMapScreen( FALSE );
}
break;
case LAPTOP_SCREEN:
ExitLaptop();
break;
case MAP_SCREEN:
if( guiPendingScreen != MSG_BOX_SCREEN )
{
EndMapScreen( FALSE );
}
break;
case LAPTOP_SCREEN:
ExitLaptop();
break;
}
}
@@ -308,9 +310,9 @@ void GameLoop(void)
}
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: screen changed");
uiOldScreen = (*(GameScreens[guiCurrentScreen].HandleScreen))();
uiOldScreen = (*(GameScreens[guiCurrentScreen].HandleScreen))();
// if the screen has chnaged
if( uiOldScreen != guiCurrentScreen )
@@ -325,22 +327,38 @@ void GameLoop(void)
if( gfSkipFrame )
gfSkipFrame = FALSE;
else
// end rain
// end rain
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: refresh screen");
RefreshScreen( NULL );
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: refresh screen");
RefreshScreen( NULL );
guiGameCycleCounter++;
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: update clock");
UpdateClock();
#ifdef JA2BETAVERSION
#ifdef JA2BETAVERSION
if( gubReportMapscreenLock )
{
ReportMapscreenErrorLock();
}
#endif
#endif
if( gGameSettings.fOptions[ TOPTION_LOW_CPU_USAGE ] == TRUE )
{
// decrease CPU load patch from MTX (http://www.ja-galaxy-forum.com/board/ubbthreads.php/ubb/showflat/Number/102405/page/1#Post102405)
//OK! 12% CPU:
//Sleep(10);
// decrease CPU load patch from defrog
clock_t endTime = clock();
//long sleeptime = 33 - (endTime-startTime)/(CLK_TCK/1000);
long sleeptime = 33 - (endTime-startTime);
if( sleeptime > 0 )
Sleep(sleeptime);
}
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop done");
}