- Made the "Highspeed timer game loop (FF-MOD by tazpn)" optional, so we can decide if we like to build an executable with/without the highspeed timer

o See: builddefines.h: #define USE_HIGHSPEED_GAMELOOP_TIMER
o Gamers reported on the Bears Pit, that an executable compiled WITH the highspeed timer enabled makes the game unplayable slow in mapscreen mode when doing certain actions (repair, ...). That is the reason, why I made the compilation of the highspeed timer optional. Currently it is disabled.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5355 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-06-25 15:06:04 +00:00
parent f4d47f38e2
commit e8027d6663
55 changed files with 1277 additions and 687 deletions
+4
View File
@@ -417,7 +417,11 @@ void GetCreditScreenUserInput()
{ {
InputAtom Event; InputAtom Event;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
if( Event.usEvent == KEY_DOWN ) if( Event.usEvent == KEY_DOWN )
{ {
+5
View File
@@ -76,7 +76,12 @@ BOOLEAN MessageBoxHandled()
{ {
InputAtom DummyEvent; InputAtom DummyEvent;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&DummyEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&DummyEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &DummyEvent ) )
#endif
{ {
if ( DummyEvent.usEvent == KEY_DOWN ) if ( DummyEvent.usEvent == KEY_DOWN )
{ {
+6
View File
@@ -397,7 +397,13 @@ void PopupMenuHandle()
return; return;
} }
//Use keyboard input as well. //Use keyboard input as well.
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &InputEvent ) )
#endif
{ {
switch(InputEvent.usEvent) switch(InputEvent.usEvent)
{ {
+8
View File
@@ -2578,7 +2578,11 @@ void GetGIOScreenUserInput()
{ {
InputAtom Event; InputAtom Event;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
if( Event.usEvent == KEY_DOWN ) if( Event.usEvent == KEY_DOWN )
{ {
@@ -5398,7 +5402,11 @@ void GetGIOScreenUserInput()
{ {
InputAtom Event; InputAtom Event;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
if( Event.usEvent == KEY_DOWN ) if( Event.usEvent == KEY_DOWN )
{ {
+17 -2
View File
@@ -38,8 +38,11 @@
#include "InterfaceItemImages.h" #include "InterfaceItemImages.h"
#endif #endif
#include "KeyMap.h" #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#include "Timer Control.h" #include "KeyMap.h"
#include "Timer Control.h"
#endif
#include "Text.h" #include "Text.h"
#include "connect.h" #include "connect.h"
#include "sgp_logger.h" #include "sgp_logger.h"
@@ -240,6 +243,7 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE ); gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_REPAIRING" , FALSE );
gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE ); gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_QUIET_DOCTORING" , FALSE );
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
if (!is_networked) if (!is_networked)
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE ); gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
else else
@@ -248,6 +252,7 @@ BOOLEAN LoadGameSettings()
// The "HIGHSPEED_TIMER" property from the ja2.ini is not set, disable the option // The "HIGHSPEED_TIMER" property from the ja2.ini is not set, disable the option
if (!IsHiSpeedClockMode()) if (!IsHiSpeedClockMode())
gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE; gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
#endif
gGameSettings.fOptions[TOPTION_ZOMBIES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ZOMBIES" , FALSE ); gGameSettings.fOptions[TOPTION_ZOMBIES] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ZOMBIES" , FALSE );
@@ -407,7 +412,11 @@ BOOLEAN SaveGameSettings()
settings << "TOPTION_QUIET_TRAINING = " << (gGameSettings.fOptions[TOPTION_QUIET_TRAINING] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_QUIET_TRAINING = " << (gGameSettings.fOptions[TOPTION_QUIET_TRAINING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_REPAIRING = " << (gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_QUIET_REPAIRING = " << (gGameSettings.fOptions[TOPTION_QUIET_REPAIRING] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_QUIET_DOCTORING = " << (gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_QUIET_DOCTORING = " << (gGameSettings.fOptions[TOPTION_QUIET_DOCTORING] ? "TRUE" : "FALSE" ) << endl;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
settings << "TOPTION_AUTO_FAST_FORWARD_MODE = " << (gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_AUTO_FAST_FORWARD_MODE = " << (gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ? "TRUE" : "FALSE" ) << endl;
#endif
settings << "TOPTION_ZOMBIES = " << (gGameSettings.fOptions[TOPTION_ZOMBIES] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_ZOMBIES = " << (gGameSettings.fOptions[TOPTION_ZOMBIES] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl; settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
@@ -535,7 +544,11 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE; gGameSettings.fOptions[ TOPTION_QUIET_TRAINING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE; gGameSettings.fOptions[ TOPTION_QUIET_REPAIRING ] = FALSE;
gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE; gGameSettings.fOptions[ TOPTION_QUIET_DOCTORING ] = FALSE;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE; gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
#endif
gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies 1.0 gGameSettings.fOptions[ TOPTION_ZOMBIES ] = FALSE; // Flugente Zombies 1.0
@@ -1794,6 +1807,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fEnableInventoryPoolQ = FALSE; gGameExternalOptions.fEnableInventoryPoolQ = FALSE;
#endif #endif
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
////////// CLOCK SETTINGS ////////// ////////// CLOCK SETTINGS //////////
// Key to artificially alter the clock so turns run faster // Key to artificially alter the clock so turns run faster
@@ -1804,6 +1818,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.iFastForwardPeriod = (FLOAT)iniReader.ReadDouble("Clock Settings","FAST_FORWARD_PERIOD", 500, 1, 10000); gGameExternalOptions.iFastForwardPeriod = (FLOAT)iniReader.ReadDouble("Clock Settings","FAST_FORWARD_PERIOD", 500, 1, 10000);
gGameExternalOptions.fClockSpeedPercent = (FLOAT)iniReader.ReadDouble("Clock Settings","CLOCK_SPEED_PERCENT", 150, 100, 300); gGameExternalOptions.fClockSpeedPercent = (FLOAT)iniReader.ReadDouble("Clock Settings","CLOCK_SPEED_PERCENT", 150, 100, 300);
gGameExternalOptions.iNotifyFrequency = iniReader.ReadInteger("Clock Settings","UPDATE_FREQUENCY", 16000, 1000, 20000); gGameExternalOptions.iNotifyFrequency = iniReader.ReadInteger("Clock Settings","UPDATE_FREQUENCY", 16000, 1000, 20000);
#endif
} }
+6
View File
@@ -90,7 +90,11 @@ enum
TOPTION_QUIET_TRAINING, //Madd: mercs don't say gained experience quote while training TOPTION_QUIET_TRAINING, //Madd: mercs don't say gained experience quote while training
TOPTION_QUIET_REPAIRING, //Madd: mercs don't say gained experience quote while repairing items TOPTION_QUIET_REPAIRING, //Madd: mercs don't say gained experience quote while repairing items
TOPTION_QUIET_DOCTORING, //Madd: mercs don't say gained experience quote while doctoring TOPTION_QUIET_DOCTORING, //Madd: mercs don't say gained experience quote while doctoring
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
TOPTION_AUTO_FAST_FORWARD_MODE, // automatically fast forward through AI turns TOPTION_AUTO_FAST_FORWARD_MODE, // automatically fast forward through AI turns
#endif
TOPTION_ZOMBIES, // Flugente Zombies 1.0: allow zombies TOPTION_ZOMBIES, // Flugente Zombies 1.0: allow zombies
// arynn: Debug/Cheat // arynn: Debug/Cheat
@@ -1083,6 +1087,7 @@ typedef struct
INT32 iInitialMercArrivalLocation; INT32 iInitialMercArrivalLocation;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
// Keyboard shortcut (as VK) for fastforward key. See Utils/KeyMap // Keyboard shortcut (as VK) for fastforward key. See Utils/KeyMap
INT32 iFastForwardKey; INT32 iFastForwardKey;
// Turn on fast forward whenever ui is disabled. // Turn on fast forward whenever ui is disabled.
@@ -1093,6 +1098,7 @@ typedef struct
INT32 iNotifyFrequency; INT32 iNotifyFrequency;
// Frequency that the screen is updated // Frequency that the screen is updated
FLOAT fClockSpeedPercent; FLOAT fClockSpeedPercent;
#endif
// Flugente FTW 1: Weapon Overheating // Flugente FTW 1: Weapon Overheating
BOOLEAN fDisplayOverheatThermometer; // Should a 'thermometer' for guns and replacable barrels be displayed? BOOLEAN fDisplayOverheatThermometer; // Should a 'thermometer' for guns and replacable barrels be displayed?
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR #ifdef JA2EDITOR
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.5354 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.5354 (Development Build)" };
#endif #endif
// ------------------------------ // ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION //DEBUG BUILD VERSION
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.5354 (Development Build)" };
#elif defined (JA113DEMO) || defined (JA113NODEMO) #elif defined (JA113DEMO) || defined (JA113NODEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.5354 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: v1.13.5354 (Development Build)" };
#endif #endif
#elif defined CRIPPLED_VERSION #elif defined CRIPPLED_VERSION
@@ -46,16 +46,16 @@
//RELEASE BUILD VERSION //RELEASE BUILD VERSION
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.5354 (Development Build)" };
#elif defined (JA113DEMO) || defined (JA113NODEMO) #elif defined (JA113DEMO) || defined (JA113NODEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.5354 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Release v1.13.5353 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release v1.13.5354 (Development Build)" };
#endif #endif
#endif #endif
CHAR8 czVersionNumber[16] = { "Build 19.06.12" }; //YY.MM.DD CHAR8 czVersionNumber[16] = { "Build 25.06.12" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" }; CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there // SAVE_GAME_VERSION is defined in header, change it there
+5
View File
@@ -5020,7 +5020,12 @@ void HandleAimMemberKeyBoardInput()
{ {
InputAtom InputEvent; InputAtom InputEvent;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{//!HandleTextInput( &InputEvent ) && {//!HandleTextInput( &InputEvent ) &&
if( InputEvent.usEvent == KEY_DOWN ) if( InputEvent.usEvent == KEY_DOWN )
{ {
+2
View File
@@ -4053,10 +4053,12 @@ void HandleBobbyRGunsKeyBoardInput()
break; break;
} }
} }
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
else else
{ {
extern void HandleDefaultEvent(InputAtom *Event); extern void HandleDefaultEvent(InputAtom *Event);
HandleDefaultEvent(&InputEvent); HandleDefaultEvent(&InputEvent);
} }
#endif
} }
} }
+4
View File
@@ -426,7 +426,11 @@ void GetPlayerKeyBoardInputForBriefingRoomHomePage( void )
GetCursorPos(&MousePos); GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
// HOOK INTO MOUSE HOOKS // HOOK INTO MOUSE HOOKS
/* /*
+4
View File
@@ -493,7 +493,11 @@ void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void )
GetCursorPos(&MousePos); GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
// HOOK INTO MOUSE HOOKS // HOOK INTO MOUSE HOOKS
/* /*
+4
View File
@@ -455,7 +455,11 @@ void GetPlayerKeyBoardInputForIMPBeginScreen( void )
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
// handle input events // handle input events
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent(&InputEvent) )
#endif
{ {
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT) ) if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT) )
{ {
+4
View File
@@ -266,7 +266,11 @@ void GetPlayerKeyBoardInputForIMPHomePage( void )
GetCursorPos(&MousePos); GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) ) if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) )
{ {
+4
View File
@@ -1257,7 +1257,11 @@ void HandleFloristOrderKeyBoardInput()
{ {
InputAtom InputEvent; InputAtom InputEvent;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN ) if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN )
{ {
Binary file not shown.
+4
View File
@@ -6419,7 +6419,11 @@ void HandlePersonnelKeyboard( void )
GetCursorPos(&MousePos); GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if ( (InputEvent.usEvent == KEY_DOWN ) && (InputEvent.usParam >= '0' ) && ( InputEvent.usParam <= '9') ) if ( (InputEvent.usEvent == KEY_DOWN ) && (InputEvent.usParam >= '0' ) && ( InputEvent.usParam <= '9') )
{ {
+5
View File
@@ -757,7 +757,12 @@ UINT32 MPChatScreenHandle( )
// carter, need key shortcuts for clearing up message boxes // carter, need key shortcuts for clearing up message boxes
// Check for esc // Check for esc
bool bHandled; bool bHandled;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
bHandled = false; bHandled = false;
if(InputEvent.usEvent == KEY_DOWN ) if(InputEvent.usEvent == KEY_DOWN )
+4
View File
@@ -418,7 +418,11 @@ void GetMPCScreenUserInput()
// GetCursorPos(&MousePos); // GetCursorPos(&MousePos);
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
// check if this event is swallowed by text input, otherwise process key // check if this event is swallowed by text input, otherwise process key
if( Event.usEvent == KEY_DOWN ) if( Event.usEvent == KEY_DOWN )
+4
View File
@@ -2740,7 +2740,11 @@ void GetMPHScreenUserInput()
// GetCursorPos(&MousePos); // GetCursorPos(&MousePos);
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
// check if this event is swallowed by text input, otherwise process key // check if this event is swallowed by text input, otherwise process key
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN ) if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
+4
View File
@@ -665,7 +665,11 @@ void GetMPJScreenUserInput()
{ {
InputAtom Event; InputAtom Event;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
// check if this event is swallowed by text input, otherwise process key // check if this event is swallowed by text input, otherwise process key
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN ) if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
+4
View File
@@ -536,7 +536,11 @@ void GetMPSScreenUserInput()
{ {
InputAtom Event; InputAtom Event;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
// check if this event is swallowed by text input, otherwise process key // check if this event is swallowed by text input, otherwise process key
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN ) if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
+8
View File
@@ -484,7 +484,11 @@ void HandleMainMenuInput()
InputAtom InputEvent; InputAtom InputEvent;
// Check for esc // Check for esc
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if( InputEvent.usEvent == KEY_UP ) if( InputEvent.usEvent == KEY_UP )
{ {
@@ -533,7 +537,11 @@ void HandleHelpScreenInput()
InputAtom InputEvent; InputAtom InputEvent;
// Check for key // Check for key
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
switch( InputEvent.usEvent ) switch( InputEvent.usEvent )
{ {
+4
View File
@@ -1306,7 +1306,11 @@ UINT32 MessageBoxScreenHandle( )
// carter, need key shortcuts for clearing up message boxes // carter, need key shortcuts for clearing up message boxes
// Check for esc // Check for esc
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN ) if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN )
{ {
Binary file not shown.
+2
View File
@@ -3937,7 +3937,9 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
ShutdownNPCQuotes(); ShutdownNPCQuotes();
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
SetFastForwardMode(FALSE); // FF can sometimes be active if quick-load during AI turn transition SetFastForwardMode(FALSE); // FF can sometimes be active if quick-load during AI turn transition
#endif
//very small TODO //very small TODO
//Bugfix = Stop the chopter sound //Bugfix = Stop the chopter sound
+70 -30
View File
@@ -111,7 +111,9 @@ BOOLEAN gfCurrentStringInputState;
StringInput *gpCurrentStringDescriptor; StringInput *gpCurrentStringDescriptor;
// Thread // Thread
static CRITICAL_SECTION gcsInputQueueLock; #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
static CRITICAL_SECTION gcsInputQueueLock;
#endif
// Local function headers // Local function headers
@@ -280,7 +282,9 @@ BOOLEAN InitializeInputManager(void)
// ghKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) KeyboardHandler, (HINSTANCE) 0, GetCurrentThreadId()); // ghKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) KeyboardHandler, (HINSTANCE) 0, GetCurrentThreadId());
// DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set keyboard hook returned %d", ghKeyboardHook)); // DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set keyboard hook returned %d", ghKeyboardHook));
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
InitializeCriticalSection(&gcsInputQueueLock); InitializeCriticalSection(&gcsInputQueueLock);
#endif
ghMouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC) MouseHandler, (HINSTANCE) 0, GetCurrentThreadId()); ghMouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC) MouseHandler, (HINSTANCE) 0, GetCurrentThreadId());
DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set mouse hook returned %d", ghMouseHook)); DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set mouse hook returned %d", ghMouseHook));
@@ -294,7 +298,11 @@ void ShutdownInputManager(void)
UnRegisterDebugTopic(TOPIC_INPUT, "Input Manager"); UnRegisterDebugTopic(TOPIC_INPUT, "Input Manager");
// UnhookWindowsHookEx(ghKeyboardHook); // UnhookWindowsHookEx(ghKeyboardHook);
UnhookWindowsHookEx(ghMouseHook); UnhookWindowsHookEx(ghMouseHook);
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
DeleteCriticalSection(&gcsInputQueueLock); DeleteCriticalSection(&gcsInputQueueLock);
#endif
} }
void QueuePureEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam) void QueuePureEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
@@ -335,7 +343,11 @@ void QueuePureEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
} }
} }
void InternalQueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam) #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
void InternalQueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
#else
void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
#endif
{ {
UINT32 uiTimer; UINT32 uiTimer;
UINT16 usKeyState; UINT16 usKeyState;
@@ -458,20 +470,45 @@ void InternalQueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
} }
} }
void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam) #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
{ void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
EnterCriticalSection(&gcsInputQueueLock); {
__try { EnterCriticalSection(&gcsInputQueueLock);
InternalQueueEvent(ubInputEvent, usParam, uiParam); __try {
}__finally { InternalQueueEvent(ubInputEvent, usParam, uiParam);
LeaveCriticalSection(&gcsInputQueueLock); }__finally {
LeaveCriticalSection(&gcsInputQueueLock);
}
} }
} #endif
BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags ) #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
{ BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags )
EnterCriticalSection(&gcsInputQueueLock); {
__try EnterCriticalSection(&gcsInputQueueLock);
__try
{
// Is there an event to dequeue
if (gusQueueCount > 0)
{
memcpy( Event, &( gEventQueue[gusHeadIndex] ), sizeof( InputAtom ) );
// Check if it has the masks!
if ( ( Event->usEvent & uiMaskFlags ) )
{
return( DequeueEvent( Event) );
}
}
return( FALSE );
}
__finally
{
LeaveCriticalSection(&gcsInputQueueLock);
}
}
#else
BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags )
{ {
// Is there an event to dequeue // Is there an event to dequeue
if (gusQueueCount > 0) if (gusQueueCount > 0)
@@ -487,13 +524,13 @@ BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags )
return( FALSE ); return( FALSE );
} }
__finally #endif
{
LeaveCriticalSection(&gcsInputQueueLock);
}
}
BOOLEAN InternalDequeueEvent(InputAtom *Event) #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
BOOLEAN InternalDequeueEvent(InputAtom *Event)
#else
BOOLEAN DequeueEvent(InputAtom *Event)
#endif
{ {
HandleSingleClicksAndButtonRepeats( ); HandleSingleClicksAndButtonRepeats( );
@@ -524,18 +561,21 @@ BOOLEAN InternalDequeueEvent(InputAtom *Event)
return FALSE; return FALSE;
} }
} }
BOOLEAN DequeueEvent(InputAtom *Event)
{ #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
__try BOOLEAN DequeueEvent(InputAtom *Event)
{ {
EnterCriticalSection(&gcsInputQueueLock); __try
return InternalDequeueEvent(Event); {
EnterCriticalSection(&gcsInputQueueLock);
return InternalDequeueEvent(Event);
}
__finally
{
LeaveCriticalSection(&gcsInputQueueLock);
}
} }
__finally #endif
{
LeaveCriticalSection(&gcsInputQueueLock);
}
}
void KeyChange(UINT32 usParam, UINT32 uiParam, UINT8 ufKeyState) void KeyChange(UINT32 usParam, UINT32 uiParam, UINT8 ufKeyState)
{ {
+137 -97
View File
@@ -56,8 +56,8 @@
#define USE_CONSOLE 0 #define USE_CONSOLE 0
#include <iostream> #include <iostream>
#include <excpt.h> #include <excpt.h>
#include "ExceptionHandling.h" #include "ExceptionHandling.h"
#include "dbt.h" #include "dbt.h"
@@ -146,16 +146,18 @@ extern BOOLEAN CheckIfGameCdromIsInCDromDrive();
extern void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam); extern void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam);
// Prototype Declarations // Prototype Declarations
INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam);
INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam); INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam);
BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow); BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow);
void ShutdownStandardGamingPlatform(void); void ShutdownStandardGamingPlatform(void);
void CreateStandardGamingPlatform(HWND hWindow);
void GetRuntimeSettings( ); void GetRuntimeSettings( );
void SafeSGPExit(void);
static bool CallGameLoop(bool wait); #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
static CRITICAL_SECTION gcsGameLoop; INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam);
void CreateStandardGamingPlatform(HWND hWindow);
void SafeSGPExit(void);
static bool CallGameLoop(bool wait);
static CRITICAL_SECTION gcsGameLoop;
#endif
int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCommandLine, int sCommandShow); int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCommandLine, int sCommandShow);
@@ -214,14 +216,16 @@ BOOLEAN gfIgnoreMessages=FALSE;
// GLOBAL VARIBLE, SET TO DEFAULT BUT CAN BE CHANGED BY THE GAME IF INIT FILE READ // GLOBAL VARIBLE, SET TO DEFAULT BUT CAN BE CHANGED BY THE GAME IF INIT FILE READ
UINT8 gbPixelDepth = PIXEL_DEPTH; UINT8 gbPixelDepth = PIXEL_DEPTH;
INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam) #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
{ INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam)
INT32 retval; {
EnterCriticalSection(&gcsGameLoop); INT32 retval;
retval = WindowProcedure(hWindow, Message, wParam, lParam); EnterCriticalSection(&gcsGameLoop);
LeaveCriticalSection(&gcsGameLoop); retval = WindowProcedure(hWindow, Message, wParam, lParam);
return retval; LeaveCriticalSection(&gcsGameLoop);
} return retval;
}
#endif
bool s_bExportStrings = false; bool s_bExportStrings = false;
extern bool g_bUseXML_Strings;// = false; extern bool g_bUseXML_Strings;// = false;
@@ -531,7 +535,10 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
break; break;
case WM_CREATE: case WM_CREATE:
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
CreateStandardGamingPlatform(hWindow); CreateStandardGamingPlatform(hWindow);
#endif
break; break;
case WM_DESTROY: case WM_DESTROY:
@@ -660,7 +667,11 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
FontTranslationTable *pFontTable; FontTranslationTable *pFontTable;
// now required by all (even JA2) in order to call ShutdownSGP // now required by all (even JA2) in order to call ShutdownSGP
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
atexit(SafeSGPExit); atexit(SafeSGPExit);
#else
atexit(SGPExit);
#endif
// First, initialize the registry keys. // First, initialize the registry keys.
InitializeRegistryKeys( "Wizardry8", "Wizardry8key" ); InitializeRegistryKeys( "Wizardry8", "Wizardry8key" );
@@ -721,7 +732,9 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return FALSE; return FALSE;
} }
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
InitializeCriticalSection(&gcsGameLoop); InitializeCriticalSection(&gcsGameLoop);
#endif
FastDebugMsg("Initializing Video Manager"); FastDebugMsg("Initializing Video Manager");
// Initialize DirectDraw (DirectX 2) // Initialize DirectDraw (DirectX 2)
@@ -748,6 +761,11 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return FALSE; return FALSE;
} }
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#else
InitializeJA2Clock();
#endif
//InitializeJA2TimerID(); //InitializeJA2TimerID();
#ifdef USE_VFS #ifdef USE_VFS
@@ -897,24 +915,26 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return TRUE; return TRUE;
} }
static void TimerActivatedCallback(INT32 timer, PTR state) #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
{ static void TimerActivatedCallback(INT32 timer, PTR state)
if (gfApplicationActive && gfProgramIsRunning)
{ {
if (CallGameLoop(false)) if (gfApplicationActive && gfProgramIsRunning)
YieldProcessor(); {
if (CallGameLoop(false))
YieldProcessor();
}
} }
}
void CreateStandardGamingPlatform(HWND hWindow) void CreateStandardGamingPlatform(HWND hWindow)
{ {
InitializeJA2Clock(); InitializeJA2Clock();
if (!IsHiSpeedClockMode()) if (!IsHiSpeedClockMode())
SetTimer( hWindow, 0, 1, NULL); SetTimer( hWindow, 0, 1, NULL);
else else
AddTimerNotifyCallback(TimerActivatedCallback, hWindow); AddTimerNotifyCallback(TimerActivatedCallback, hWindow);
} }
#endif
void ShutdownStandardGamingPlatform(void) void ShutdownStandardGamingPlatform(void)
{ {
@@ -938,7 +958,10 @@ void ShutdownStandardGamingPlatform(void)
// //
// Shut down the different components of the SGP // Shut down the different components of the SGP
// //
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
ClearTimerNotifyCallbacks(); ClearTimerNotifyCallbacks();
#endif
// TEST // TEST
SoundServiceStreams(); SoundServiceStreams();
@@ -986,7 +1009,9 @@ void ShutdownStandardGamingPlatform(void)
// down the debugging layer // down the debugging layer
UnRegisterDebugTopic(TOPIC_SGP, "Standard Gaming Platform"); UnRegisterDebugTopic(TOPIC_SGP, "Standard Gaming Platform");
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
DeleteCriticalSection(&gcsGameLoop); DeleteCriticalSection(&gcsGameLoop);
#endif
ShutdownDebugManager(); ShutdownDebugManager();
@@ -1252,6 +1277,12 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC
FastDebugMsg("Running Game"); FastDebugMsg("Running Game");
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#else
// 0verhaul: Use the smallest available timer to make sure all animation updates happen at the speed they're supposed to
SetTimer( ghWindow, uiTimer, 1, NULL);
#endif
// At this point the SGP is set up, which means all I/O, Memory, tools, etc... are available. All we need to do is // At this point the SGP is set up, which means all I/O, Memory, tools, etc... are available. All we need to do is
// attend to the gaming mechanics themselves // attend to the gaming mechanics themselves
Message.wParam = 0; Message.wParam = 0;
@@ -1325,6 +1356,11 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC
} }
#endif #endif
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#else
KillTimer( ghWindow, uiTimer);
#endif
// This is the normal exit point // This is the normal exit point
FastDebugMsg("Exiting Game"); FastDebugMsg("Exiting Game");
PostQuitMessage(0); PostQuitMessage(0);
@@ -1685,26 +1721,29 @@ void GetRuntimeSettings( )
s_CodePage = oProps.getStringProperty(L"Ja2 Settings", L"CODE_PAGE"); s_CodePage = oProps.getStringProperty(L"Ja2 Settings", L"CODE_PAGE");
#endif // USE_CODE_PAGE #endif // USE_CODE_PAGE
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
// get timer/clock initialization state // get timer/clock initialization state
SetHiSpeedClockMode( oProps.getBoolProperty("Ja2 Settings", "HIGHSPEED_TIMER", false) ? TRUE : FALSE ); SetHiSpeedClockMode( oProps.getBoolProperty("Ja2 Settings", "HIGHSPEED_TIMER", false) ? TRUE : FALSE );
#endif #endif
#endif
} }
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
void SafeSGPExit(void) void SafeSGPExit(void)
{
// SGPExit tends to use resources that are already uninitialized so handle
__try
{ {
SGPExit(); // SGPExit tends to use resources that are already uninitialized so handle
__try
{
SGPExit();
}
__except( EXCEPTION_EXECUTE_HANDLER )
{
// The application is in exit and best effort to clean up
// has failed so just ignore and continue silently
}
} }
__except( EXCEPTION_EXECUTE_HANDLER ) #endif
{
// The application is in exit and best effort to clean up
// has failed so just ignore and continue silently
}
}
void ShutdownWithErrorBox(CHAR8 *pcMessage) void ShutdownWithErrorBox(CHAR8 *pcMessage)
{ {
@@ -1899,69 +1938,70 @@ static LONG __stdcall SGPExceptionFilter(int exceptionCount, EXCEPTION_POINTERS*
return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_EXECUTE_HANDLER;
} }
static void SGPGameLoop() #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
{ static void SGPGameLoop()
try
{ {
GameLoop(); try
} {
catch(sgp::Exception &ex) GameLoop();
{ }
SGP_ERROR(ex.what()); catch(sgp::Exception &ex)
SHOWEXCEPTION(ex); {
} SGP_ERROR(ex.what());
catch(vfs::Exception &ex) SHOWEXCEPTION(ex);
{ }
SGP_ERROR(ex.what()); catch(vfs::Exception &ex)
SHOWEXCEPTION(ex); {
} SGP_ERROR(ex.what());
catch(std::exception &ex) SHOWEXCEPTION(ex);
{ }
sgp::Exception nex(ex.what()); catch(std::exception &ex)
SGP_ERROR(nex.what()); {
SHOWEXCEPTION(nex); sgp::Exception nex(ex.what());
} SGP_ERROR(nex.what());
catch(const char* msg) SHOWEXCEPTION(nex);
{ }
sgp::Exception ex(msg); catch(const char* msg)
SGP_ERROR(ex.what()); {
SHOWEXCEPTION(ex); sgp::Exception ex(msg);
} SGP_ERROR(ex.what());
} SHOWEXCEPTION(ex);
}
static bool CallGameLoop(bool wait)
{
static int numUnsuccessfulTries = 0;
if (wait)
{
EnterCriticalSection(&gcsGameLoop);
}
else
{
if ( !TryEnterCriticalSection(&gcsGameLoop) )
return false;
} }
__try static bool CallGameLoop(bool wait)
{ {
static int numUnsuccessfulTries = 0;
if (wait)
{
EnterCriticalSection(&gcsGameLoop);
}
else
{
if ( !TryEnterCriticalSection(&gcsGameLoop) )
return false;
}
__try __try
{ {
SGPGameLoop(); __try
numUnsuccessfulTries = 0; {
SGPGameLoop();
numUnsuccessfulTries = 0;
}
__except( SGPExceptionFilter(++numUnsuccessfulTries, GetExceptionInformation()) )
{
}
} }
__except( SGPExceptionFilter(++numUnsuccessfulTries, GetExceptionInformation()) ) __finally
{ {
LeaveCriticalSection(&gcsGameLoop);
} }
// Give it several attempts to recover from random exceptions and to display error screen
if (numUnsuccessfulTries > 5)
ShutdownWithErrorBox("Unhandled exception. Unable to recover.");
return true;
} }
__finally #endif
{
LeaveCriticalSection(&gcsGameLoop);
}
// Give it several attempts to recover from random exceptions and to display error screen
if (numUnsuccessfulTries > 5)
ShutdownWithErrorBox("Unhandled exception. Unable to recover.");
return true;
}
+5
View File
@@ -932,7 +932,12 @@ void HandleViewerInput()
{ {
SECTORINFO *pSector; SECTORINFO *pSector;
InputAtom Event; InputAtom Event;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while( DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP) ) while( DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP) )
#else
while( DequeueEvent( &Event ) )
#endif
{ {
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN ) if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
{ {
+5
View File
@@ -3410,7 +3410,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve3");
InputAtom InputEvent; InputAtom InputEvent;
BOOLEAN fResetAutoResolve = FALSE; BOOLEAN fResetAutoResolve = FALSE;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while( DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT) ) while( DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT) )
#else
while( DequeueEvent( &InputEvent ) )
#endif
{ {
if( InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT ) if( InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT )
{ {
+4
View File
@@ -1311,7 +1311,11 @@ void GetUserInput()
GetCursorPos(&MousePos); GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while( DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT) ) while( DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT) )
#else
while( DequeueEvent( &Event ) )
#endif
{ {
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN ) if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
{ {
+31 -2
View File
@@ -6811,6 +6811,7 @@ void InitializeWorldSize(INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ)
void GetMapKeyboardInput( UINT32 *puiNewEvent ) void GetMapKeyboardInput( UINT32 *puiNewEvent )
{ {
InputAtom InputEvent; InputAtom InputEvent;
POINT MousePos;
INT8 bSquadNumber; INT8 bSquadNumber;
UINT8 ubGroupId = 0; UINT8 ubGroupId = 0;
BOOLEAN fCtrl, fAlt; BOOLEAN fCtrl, fAlt;
@@ -6822,9 +6823,37 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
fCtrl = _KeyDown( CTRL ); fCtrl = _KeyDown( CTRL );
fAlt = _KeyDown( ALT ); fAlt = _KeyDown( ALT );
// while( DequeueEvent( &InputEvent ) ) while( DequeueEvent( &InputEvent ) )
while( DequeueSpecificEvent( &InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT ) ) // doesn't work for some reason -- MM: fixed? it works better for me like this
{ {
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#else
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
// HOOK INTO MOUSE HOOKS
switch(InputEvent.usEvent)
{
case LEFT_BUTTON_DOWN:
MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case LEFT_BUTTON_UP:
MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_DOWN:
MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_UP:
MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_REPEAT:
MouseSystemHook(RIGHT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case LEFT_BUTTON_REPEAT:
MouseSystemHook(LEFT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
}
#endif
if( InputEvent.usEvent == KEY_DOWN ) if( InputEvent.usEvent == KEY_DOWN )
{ {
// if game is paused because of player, unpause with any key // if game is paused because of player, unpause with any key
+4
View File
@@ -279,7 +279,11 @@ BOOLEAN HandleAutoBandage( )
// Deque all game events // Deque all game events
DequeAllGameEvents( TRUE ); DequeAllGameEvents( TRUE );
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if ( InputEvent.usEvent == KEY_UP ) if ( InputEvent.usEvent == KEY_UP )
{ {
+4
View File
@@ -1738,7 +1738,11 @@ void GetShopKeeperInterfaceUserInput()
GetCursorPos(&MousePos); GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords! ScreenToClient(ghWindow, &MousePos); // In window coords!
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
// HOOK INTO MOUSE HOOKS // HOOK INTO MOUSE HOOKS
/* removed warning condition C4060 (jonathanl) /* removed warning condition C4060 (jonathanl)
+4
View File
@@ -620,7 +620,11 @@ void RenderSectorExitMenu( )
gsGlobalCursorYOffset = 0; gsGlobalCursorYOffset = 0;
SetCurrentCursorFromDatabase( CURSOR_NORMAL ); SetCurrentCursorFromDatabase( CURSOR_NORMAL );
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while( DequeueEvent( &Event ) )
#endif
{ {
if( Event.usEvent == KEY_DOWN ) if( Event.usEvent == KEY_DOWN )
{ {
+2
View File
@@ -151,7 +151,9 @@ void HandleTacticalEndTurn( )
// OK, Do a number of things here.... // OK, Do a number of things here....
// Every few turns...... // Every few turns......
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
SetFastForwardMode(FALSE); // Cancel FF at end of battle SetFastForwardMode(FALSE); // Cancel FF at end of battle
#endif
// Get time elasped // Get time elasped
uiTime = GetWorldTotalSeconds( ); uiTime = GetWorldTotalSeconds( );
+9
View File
@@ -167,7 +167,10 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"StartPlayerTeamTurn"); DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"StartPlayerTeamTurn");
// SOLDIERTYPE *pSoldier; // SOLDIERTYPE *pSoldier;
// EV_S_BEGINTURN SBeginTurn; // EV_S_BEGINTURN SBeginTurn;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
SetFastForwardMode(FALSE); SetFastForwardMode(FALSE);
#endif
// Start the turn of player charactors // Start the turn of player charactors
@@ -496,6 +499,7 @@ void BeginTeamTurn( UINT8 ubTeam )
if( !LightningEndOfTurn( ubTeam ) )return; if( !LightningEndOfTurn( ubTeam ) )return;
//end rain //end rain
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
// disable for our turn and enable for other teams // disable for our turn and enable for other teams
if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ) if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] )
{ {
@@ -510,6 +514,7 @@ void BeginTeamTurn( UINT8 ubTeam )
SetFastForwardMode( (ubTeam != OUR_TEAM) ); SetFastForwardMode( (ubTeam != OUR_TEAM) );
} }
} }
#endif
while( 1 ) while( 1 )
{ {
@@ -837,7 +842,9 @@ void StartInterrupt( void )
INT32 iSquad, iCounter; INT32 iSquad, iCounter;
// disable ff mode // disable ff mode
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
SetFastForwardMode(FALSE); SetFastForwardMode(FALSE);
#endif
// build string for display of who gets interrupt // build string for display of who gets interrupt
//while( 1 ) //while( 1 )
@@ -1432,6 +1439,7 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
} }
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ) if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] )
{ {
if (is_networked) if (is_networked)
@@ -1445,6 +1453,7 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
SetFastForwardMode( (gTacticalStatus.ubCurrentTeam != OUR_TEAM) ); SetFastForwardMode( (gTacticalStatus.ubCurrentTeam != OUR_TEAM) );
} }
} }
#endif
} }
+4
View File
@@ -674,7 +674,11 @@ void HandleOverheadUI(void)
ScrollOverheadMap(); ScrollOverheadMap();
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while(DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT) == TRUE) while(DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT) == TRUE)
#else
while(DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT) if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT)
{ {
+4
View File
@@ -101,7 +101,11 @@ UINT32 MapUtilScreenHandle(void)
INT32 cnt, iX, iY, iSubX1, iSubY1, iSubX2, iSubY2, iWindowX, iWindowY, iCount; INT32 cnt, iX, iY, iSubX1, iSubY1, iSubX2, iSubY2, iWindowX, iWindowY, iCount;
FLOAT dX, dY, dStartX, dStartY; FLOAT dX, dY, dStartX, dStartY;
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while(DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP) == TRUE) while(DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP) == TRUE)
#else
while(DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if(InputEvent.usParam == ESC) if(InputEvent.usParam == ESC)
{ {
+679 -497
View File
File diff suppressed because it is too large Load Diff
+82 -32
View File
@@ -54,6 +54,13 @@ enum
NUMTIMERS NUMTIMERS
}; };
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#else
// Base resultion of callback timer
#define BASETIMESLICE 10
#endif
// TIMER INTERVALS // TIMER INTERVALS
extern INT32 giTimerIntervals[ NUMTIMERS ]; extern INT32 giTimerIntervals[ NUMTIMERS ];
// TIMER COUNTERS // TIMER COUNTERS
@@ -70,7 +77,10 @@ BOOLEAN InitializeJA2Clock( void );
void ShutdownJA2Clock( void ); void ShutdownJA2Clock( void );
#define GetJA2Clock() guiBaseJA2Clock #define GetJA2Clock() guiBaseJA2Clock
#define GetJA2NoPauseClock() guiBaseJA2NoPauseClock
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#define GetJA2NoPauseClock() guiBaseJA2NoPauseClock
#endif
UINT32 GetPauseJA2Clock( ); UINT32 GetPauseJA2Clock( );
@@ -82,49 +92,89 @@ void PauseTime( BOOLEAN fPaused );
void SetCustomizableTimerCallbackAndDelay( INT32 iDelay, CUSTOMIZABLE_TIMER_CALLBACK pCallback, BOOLEAN fReplace ); void SetCustomizableTimerCallbackAndDelay( INT32 iDelay, CUSTOMIZABLE_TIMER_CALLBACK pCallback, BOOLEAN fReplace );
void CheckCustomizableTimer( void ); void CheckCustomizableTimer( void );
void SetFastForwardPeriod(DOUBLE value); #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
void SetFastForwardKey(INT32 key); void SetFastForwardPeriod(DOUBLE value);
BOOLEAN IsFastForwardKeyPressed(); void SetFastForwardKey(INT32 key);
void SetFastForwardMode(BOOLEAN enable); BOOLEAN IsFastForwardKeyPressed();
BOOLEAN IsFastForwardMode(); void SetFastForwardMode(BOOLEAN enable);
INT32 GetFastForwardLoopCount(); BOOLEAN IsFastForwardMode();
void SetFastForwardLoopCount(INT32 value); INT32 GetFastForwardLoopCount();
void SetFastForwardLoopCount(INT32 value);
void SetNotifyFrequencyKey(INT32 value); void SetNotifyFrequencyKey(INT32 value);
void SetClockSpeedPercent(FLOAT value); void SetClockSpeedPercent(FLOAT value);
BOOLEAN IsTimerActive(); BOOLEAN IsTimerActive();
BOOLEAN IsJA2TimerThread(); BOOLEAN IsJA2TimerThread();
BOOLEAN IsHiSpeedClockMode(); BOOLEAN IsHiSpeedClockMode();
void SetHiSpeedClockMode(BOOLEAN enable); void SetHiSpeedClockMode(BOOLEAN enable);
#endif
//Don't modify this value //Don't modify this value
extern UINT32 guiBaseJA2Clock; extern UINT32 guiBaseJA2Clock;
extern UINT32 guiBaseJA2NoPauseClock; extern UINT32 guiBaseJA2NoPauseClock;
extern CUSTOMIZABLE_TIMER_CALLBACK gpCustomizableTimerCallback; extern CUSTOMIZABLE_TIMER_CALLBACK gpCustomizableTimerCallback;
typedef void (*TIMER_NOTIFY_CALLBACK) ( INT32 timer, PTR state ); #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
void AddTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state ); typedef void (*TIMER_NOTIFY_CALLBACK) ( INT32 timer, PTR state );
void RemoveTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state ); void AddTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state );
void ClearTimerNotifyCallbacks(); void RemoveTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state );
void ClearTimerNotifyCallbacks();
BOOLEAN UpdateCounter(INT32 iTimer); BOOLEAN UpdateCounter(INT32 iTimer);
void ResetCounter(INT32 iTimer); void ResetCounter(INT32 iTimer);
BOOLEAN CounterDone(INT32 iTimer); BOOLEAN CounterDone(INT32 iTimer);
void ResetTimerCounter(INT32 &timer, INT32 value); void ResetTimerCounter(INT32 &timer, INT32 value);
BOOLEAN TimeCounterDone(INT32 timer); BOOLEAN TimeCounterDone(INT32 timer);
void ZeroTimeCounter(INT32& timer); void ZeroTimeCounter(INT32& timer);
#define UPDATECOUNTER( c ) UpdateCounter(c) #define UPDATECOUNTER( c ) UpdateCounter(c)
#define RESETCOUNTER( c ) ResetCounter(c) #define RESETCOUNTER( c ) ResetCounter(c)
#define COUNTERDONE( c ) CounterDone(c) #define COUNTERDONE( c ) CounterDone(c)
#define UPDATETIMECOUNTER( c ) UpdateTimeCounter(c) #define UPDATETIMECOUNTER( c ) UpdateTimeCounter(c)
#define RESETTIMECOUNTER( c, d ) ResetTimerCounter(c, d) #define RESETTIMECOUNTER( c, d ) ResetTimerCounter(c, d)
#define TIMECOUNTERDONE(c, d) TimeCounterDone(c) #define TIMECOUNTERDONE(c, d) TimeCounterDone(c)
#define SYNCTIMECOUNTER( ) #define SYNCTIMECOUNTER( )
#define ZEROTIMECOUNTER(c) ZeroTimeCounter(c) #define ZEROTIMECOUNTER(c) ZeroTimeCounter(c)
#else
// MACROS
// CHeck if new counter < 0 | set to 0 | Decrement
#ifdef CALLBACKTIMER
#define UPDATECOUNTER( c ) ( ( giTimerCounters[ c ] - BASETIMESLICE ) < 0 ) ? ( giTimerCounters[ c ] = 0 ) : ( giTimerCounters[ c ] -= BASETIMESLICE )
#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giTimerIntervals[ c ] )
#define COUNTERDONE( c ) ( giTimerCounters[ c ] == 0 ) ? TRUE : FALSE
#define UPDATETIMECOUNTER( c ) ( ( c - BASETIMESLICE ) < 0 ) ? ( c = 0 ) : ( c -= BASETIMESLICE )
#define RESETTIMECOUNTER( c, d ) ( c = d )
#ifdef BOUNDS_CHECKER
#define TIMECOUNTERDONE( c, d ) ( TRUE )
#else
#define TIMECOUNTERDONE( c, d ) ( c == 0 ) ? TRUE : FALSE
#endif
#define SYNCTIMECOUNTER( )
#define ZEROTIMECOUNTER( c ) ( c = 0 )
#else
#define UPDATECOUNTER( c )
#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giClockTimer )
#define COUNTERDONE( c ) ( ( ( giClockTimer = GetJA2Clock() ) - giTimerCounters[ c ] ) > giTimerIntervals[ c ] ) ? TRUE : FALSE
#define UPDATETIMECOUNTER( c )
#define RESETTIMECOUNTER( c, d ) ( c = giClockTimer )
#define TIMECOUNTERDONE( c, d ) ( giClockTimer - c > d ) ? TRUE : FALSE
#define SYNCTIMECOUNTER( ) ( giClockTimer = GetJA2Clock() )
#endif
#endif
void SetTileAnimCounter( INT32 iTime ); void SetTileAnimCounter( INT32 iTime );
#endif #endif
+5 -1
View File
@@ -103,7 +103,11 @@
#include "vobject.h" #include "vobject.h"
#include "overhead types.h" #include "overhead types.h"
#include "tactical save.h" #include "tactical save.h"
#include "KeyMap.h"
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
#include "KeyMap.h"
#endif
//#include <windows.h> //#include <windows.h>
//#include <windowsx.h> //#include <windowsx.h>
//#include <mmsystem.h> //#include <mmsystem.h>
+8
View File
@@ -5110,7 +5110,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"自动加速敌军回合", // Automatic fast forward through AI turns L"自动加速敌军回合", // Automatic fast forward through AI turns
#endif
L"Allow Zombies", // TODO.Translate L"Allow Zombies", // TODO.Translate
L"--作弊模式选项--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--作弊模式选项--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"强制 Bobby Ray 送货", // force all pending Bobby Ray shipments L"强制 Bobby Ray 送货", // force all pending Bobby Ray shipments
@@ -5219,7 +5223,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", //TODO.Translate L"When ON, mercs will not report progress during training.", //TODO.Translate
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"打开时,敌军回合将被大幅加速。", L"打开时,敌军回合将被大幅加速。",
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"强制 Bobby Ray 出货", L"强制 Bobby Ray 出货",
+8
View File
@@ -5109,7 +5109,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
#endif
L"Allow Zombies", // TODO.Translate L"Allow Zombies", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
@@ -5218,7 +5222,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", //TODO.Translate L"When ON, mercs will not report progress during training.", //TODO.Translate
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", // TODO.Translate L"When ON, AI turns will be much faster.", // TODO.Translate
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments", L"Force all pending Bobby Ray shipments",
+8
View File
@@ -5108,7 +5108,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training L"Quiet Training", // Madd: mercs don't say quotes while training
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing L"Quiet Repairing", // Madd: mercs don't say quotes while repairing
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
@@ -5217,7 +5221,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", L"When ON, mercs will not report progress during training.",
L"When ON, mercs will not report progress during repairing.", L"When ON, mercs will not report progress during repairing.",
L"When ON, mercs will not report progress during doctoring.", L"When ON, mercs will not report progress during doctoring.",
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", L"When ON, AI turns will be much faster.",
#endif
L"When ON, zombies will spawn. Be aware!", // allow zombies L"When ON, zombies will spawn. Be aware!", // allow zombies
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments", L"Force all pending Bobby Ray shipments",
+8
View File
@@ -5099,7 +5099,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Forcer envois Bobby Ray", // force all pending Bobby Ray shipments L"Forcer envois Bobby Ray", // force all pending Bobby Ray shipments
@@ -5208,7 +5212,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", L"When ON, mercs will not report progress during training.",
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", // TODO.Translate L"When ON, AI turns will be much faster.", // TODO.Translate
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Forcer tous les envois en attente de Bobby Ray", L"Forcer tous les envois en attente de Bobby Ray",
+8
View File
@@ -4957,7 +4957,11 @@ STR16 zOptionsToggleText[] =
L"Stummes Trainieren", // Madd: mercs don't say quotes while training L"Stummes Trainieren", // Madd: mercs don't say quotes while training
L"Stummes Reparieren", // Madd: mercs don't say quotes while repairing L"Stummes Reparieren", // Madd: mercs don't say quotes while repairing
L"Stumme Behandlung", // Madd: mercs don't say quotes while doctoring L"Stumme Behandlung", // Madd: mercs don't say quotes while doctoring
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Autom. schnelle Gegner-Züge", // Automatic fast forward through AI turns L"Autom. schnelle Gegner-Züge", // Automatic fast forward through AI turns
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Erzwinge BR Lieferung", // force all pending Bobby Ray shipments L"Erzwinge BR Lieferung", // force all pending Bobby Ray shipments
@@ -5066,7 +5070,11 @@ STR16 zOptionsScreenHelpText[] =
L"Wenn diese Funktion aktiviert ist, werden die Söldner über ihren Fortschritt während des Trainings nicht mehr berichten.", L"Wenn diese Funktion aktiviert ist, werden die Söldner über ihren Fortschritt während des Trainings nicht mehr berichten.",
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Wenn diese Funktion aktiviert ist, werden gegnerische Züge schneller durchgeführt.", L"Wenn diese Funktion aktiviert ist, werden gegnerische Züge schneller durchgeführt.",
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments", L"Force all pending Bobby Ray shipments",
+8
View File
@@ -5094,7 +5094,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
@@ -5203,7 +5207,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", L"When ON, mercs will not report progress during training.",
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", // TODO.Translate L"When ON, AI turns will be much faster.", // TODO.Translate
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments", L"Force all pending Bobby Ray shipments",
+8
View File
@@ -5106,7 +5106,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
@@ -5215,7 +5219,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", L"When ON, mercs will not report progress during training.",
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", // TODO.Translate L"When ON, AI turns will be much faster.", // TODO.Translate
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"WymuŚ wszystkie oczekiwane dostawy od Bobby Ray's.", L"WymuŚ wszystkie oczekiwane dostawy od Bobby Ray's.",
+8
View File
@@ -5089,7 +5089,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Читерские настройки--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Читерские настройки--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Ускорить доставку Бобби Рэя", // force all pending Bobby Ray shipments L"Ускорить доставку Бобби Рэя", // force all pending Bobby Ray shipments
@@ -5198,7 +5202,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", L"When ON, mercs will not report progress during training.",
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", // TODO.Translate L"When ON, AI turns will be much faster.", // TODO.Translate
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Выберите этот пункт чтобы груз Бобби Рэя прибыл немедленно.", L"Выберите этот пункт чтобы груз Бобби Рэя прибыл немедленно.",
+8
View File
@@ -5110,7 +5110,11 @@ STR16 zOptionsToggleText[] =
L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate L"Quiet Training", // Madd: mercs don't say quotes while training // TODO.Translate
L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate L"Quiet Repairing", // Madd: mercs don't say quotes while repairing //TODO.Translate
L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate L"Quiet Doctoring", // Madd: mercs don't say quotes while doctoring //TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
#endif
L"Allow Zombies", // Flugente Zombies 1.0 L"Allow Zombies", // Flugente Zombies 1.0
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER, L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
@@ -5219,7 +5223,11 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, mercs will not report progress during training.", L"When ON, mercs will not report progress during training.",
L"When ON, mercs will not report progress during repairing.", // TODO.Translate L"When ON, mercs will not report progress during repairing.", // TODO.Translate
L"When ON, mercs will not report progress during doctoring.", // TODO.Translate L"When ON, mercs will not report progress during doctoring.", // TODO.Translate
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
L"When ON, AI turns will be much faster.", // TODO.Translate L"When ON, AI turns will be much faster.", // TODO.Translate
#endif
L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate L"When ON, zombies will span. Be aware!", // allow zombies // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER", L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments", L"Force all pending Bobby Ray shipments",
+4
View File
@@ -185,7 +185,11 @@ UINT32 AniEditScreenHandle(void)
} }
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
if (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) if (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
if (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if ((InputEvent.usEvent == KEY_DOWN)&&(InputEvent.usParam == ESC)) if ((InputEvent.usEvent == KEY_DOWN)&&(InputEvent.usParam == ESC))
{ {
+5
View File
@@ -3,6 +3,11 @@
#include "Language Defines.h" #include "Language Defines.h"
// WANNE: Enable this define, to build the gameloop with the highspeed timer. To use the highspeed timer, you also have to set the HIGHSPEED_TIMER = TRUE in ja2.ini
// CAUTION: A lot of games reported, when the exe is compiled with the highspeed timer on, the game runs very slowly in strategy map screen when doing repair, ..
// This is the reason, why I made a compilation define, where we can turn on/off the highspeed timer.
//#define USE_HIGHSPEED_GAMELOOP_TIMER
// ----------------------------- // -----------------------------
// ***************************** // *****************************
// WANNE: Enable those 2 defines, if you want to build UB-Version!! // WANNE: Enable those 2 defines, if you want to build UB-Version!!
+18 -15
View File
@@ -148,11 +148,12 @@ BOOLEAN InitializeGame(void)
InitButtonSystem(); InitButtonSystem();
InitCursors( ); InitCursors( );
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
SetFastForwardPeriod(gGameExternalOptions.iFastForwardPeriod); SetFastForwardPeriod(gGameExternalOptions.iFastForwardPeriod);
SetFastForwardKey(gGameExternalOptions.iFastForwardKey); SetFastForwardKey(gGameExternalOptions.iFastForwardKey);
SetNotifyFrequencyKey(gGameExternalOptions.iNotifyFrequency); SetNotifyFrequencyKey(gGameExternalOptions.iNotifyFrequency);
SetClockSpeedPercent(gGameExternalOptions.fClockSpeedPercent); SetClockSpeedPercent(gGameExternalOptions.fClockSpeedPercent);
#endif
// Init Fonts // Init Fonts
if ( !InitializeFonts( ) ) if ( !InitializeFonts( ) )
@@ -599,19 +600,21 @@ void NextLoopCheckForEnoughFreeHardDriveSpace()
} }
// Called by any game loop after all known events were handled #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
void HandleDefaultEvent(InputAtom *Event) // Called by any game loop after all known events were handled
{ void HandleDefaultEvent(InputAtom *Event)
const int MouseButtonEvents = LEFT_BUTTON_REPEAT|RIGHT_BUTTON_REPEAT|
LEFT_BUTTON_DOWN|LEFT_BUTTON_UP|MIDDLE_BUTTON_UP|X1_BUTTON_UP|X2_BUTTON_UP|
RIGHT_BUTTON_DOWN|RIGHT_BUTTON_UP|MIDDLE_BUTTON_DOWN|X1_BUTTON_DOWN|X2_BUTTON_DOWN|
MOUSE_WHEEL_UP|MOUSE_WHEEL_DOWN;
if (Event != NULL && Event->usEvent & MouseButtonEvents)
{ {
POINT MousePos; const int MouseButtonEvents = LEFT_BUTTON_REPEAT|RIGHT_BUTTON_REPEAT|
GetCursorPos(&MousePos); LEFT_BUTTON_DOWN|LEFT_BUTTON_UP|MIDDLE_BUTTON_UP|X1_BUTTON_UP|X2_BUTTON_UP|
ScreenToClient(ghWindow, &MousePos); // In window coords! RIGHT_BUTTON_DOWN|RIGHT_BUTTON_UP|MIDDLE_BUTTON_DOWN|X1_BUTTON_DOWN|X2_BUTTON_DOWN|
MouseSystemHook(Event->usEvent, (UINT16)MousePos.x ,(UINT16)MousePos.y ,_LeftButtonDown, _RightButtonDown); MOUSE_WHEEL_UP|MOUSE_WHEEL_DOWN;
if (Event != NULL && Event->usEvent & MouseButtonEvents)
{
POINT MousePos;
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
MouseSystemHook(Event->usEvent, (UINT16)MousePos.x ,(UINT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
}
} }
} #endif
+4 -2
View File
@@ -18,7 +18,9 @@ void HandleShortCutExitState( void );
void SetPendingNewScreen( UINT32 uiNewScreen ); void SetPendingNewScreen( UINT32 uiNewScreen );
struct InputAtom; #ifdef USE_HIGHSPEED_GAMELOOP_TIMER
void HandleDefaultEvent(InputAtom *Event); struct InputAtom;
void HandleDefaultEvent(InputAtom *Event);
#endif
#endif #endif
+4
View File
@@ -321,7 +321,11 @@ UINT32 ErrorScreenHandle(void)
EndFrameBufferRender( ); EndFrameBufferRender( );
// Check for esc // Check for esc
#ifdef USE_HIGHSPEED_GAMELOOP_TIMER
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT)) while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
#else
while (DequeueEvent(&InputEvent) == TRUE)
#endif
{ {
if( InputEvent.usEvent == KEY_DOWN ) if( InputEvent.usEvent == KEY_DOWN )
{ {