@@ -230,9 +230,9 @@ void CRenderDevice::on_idle()
230230 }
231231
232232 if (psDeviceFlags.test (rsStatistic))
233- g_bEnableStatGather = TRUE ; // XXX: why not use either rsStatistic or g_bEnableStatGather?
233+ g_bEnableStatGather = true ; // XXX: why not use either rsStatistic or g_bEnableStatGather?
234234 else
235- g_bEnableStatGather = FALSE ;
235+ g_bEnableStatGather = false ;
236236
237237 if (g_loading_events.size ())
238238 {
@@ -505,17 +505,19 @@ void CRenderDevice::Pause(BOOL bOn, BOOL bTimer, BOOL bSound, LPCSTR reason)
505505 if (bOn)
506506 {
507507 if (!Paused ())
508- bShowPauseString = editor () ? FALSE :
508+ {
509+ bShowPauseString = editor () ? FALSE : TRUE ;
509510#ifdef DEBUG
510- !xr_strcmp (reason, " li_pause_key_no_clip" ) ? FALSE :
511- #endif // DEBUG
512- TRUE ;
511+ if (xr_strcmp (reason, " li_pause_key_no_clip" ) == 0 )
512+ bShowPauseString = FALSE ;
513+ #endif
514+ }
513515 if (bTimer && (!g_pGamePersistent || g_pGamePersistent->CanBePaused ()))
514516 {
515- g_pauseMngr ().Pause (TRUE );
517+ g_pauseMngr ().Pause (true );
516518#ifdef DEBUG
517- if (! xr_strcmp (reason, " li_pause_key_no_clip" ))
518- TimerGlobal.Pause (FALSE );
519+ if (xr_strcmp (reason, " li_pause_key_no_clip" ) == 0 )
520+ TimerGlobal.Pause (false );
519521#endif
520522 }
521523 if (bSound && GEnv.Sound )
@@ -526,7 +528,7 @@ void CRenderDevice::Pause(BOOL bOn, BOOL bTimer, BOOL bSound, LPCSTR reason)
526528 if (bTimer && g_pauseMngr ().Paused ())
527529 {
528530 fTimeDelta = EPS_S + EPS_S;
529- g_pauseMngr ().Pause (FALSE );
531+ g_pauseMngr ().Pause (false );
530532 }
531533 if (bSound)
532534 {
@@ -545,7 +547,10 @@ void CRenderDevice::Pause(BOOL bOn, BOOL bTimer, BOOL bSound, LPCSTR reason)
545547BOOL CRenderDevice::Paused () { return g_pauseMngr ().Paused (); }
546548void CRenderDevice::OnWM_Activate (WPARAM wParam, LPARAM /* lParam*/ )
547549{
548- const BOOL isWndActive = (1 == wParam) ? TRUE : FALSE ;
550+ u16 fActive = LOWORD (wParam);
551+ const BOOL fMinimized = (BOOL)HIWORD (wParam);
552+
553+ const BOOL isWndActive = (fActive != WA_INACTIVE && !fMinimized ) ? TRUE : FALSE ;
549554
550555 if (!editor () && !GEnv.isDedicatedServer && isWndActive)
551556 pInput->ClipCursor (true );
@@ -589,10 +594,16 @@ CRenderDevice* get_device() { return &Device; }
589594u32 script_time_global () { return Device.dwTimeGlobal ; }
590595u32 script_time_global_async () { return Device.TimerAsync_MMT (); }
591596
592- SCRIPT_EXPORT (Device, (), {
597+ SCRIPT_EXPORT (Device, (),
598+ {
593599 using namespace luabind ;
594- module (luaState)[def (" time_global" , &script_time_global), def (" time_global_async" , &script_time_global_async),
595- def (" device" , &get_device), def (" is_enough_address_space_available" , &is_enough_address_space_available)];
600+ module (luaState)
601+ [
602+ def (" time_global" , &script_time_global),
603+ def (" time_global_async" , &script_time_global_async),
604+ def (" device" , &get_device),
605+ def (" is_enough_address_space_available" , &is_enough_address_space_available)
606+ ];
596607});
597608
598609CLoadScreenRenderer::CLoadScreenRenderer () : b_registered(false ), b_need_user_input(false ) {}
0 commit comments