[Scummvm-cvs-logs] SF.net SVN: scummvm: [29497] scummvm/trunk/backends/platform/wince/CEDevice .cpp

knakos at users.sourceforge.net knakos at users.sourceforge.net
Tue Nov 13 20:46:21 CET 2007


Revision: 29497
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29497&view=rev
Author:   knakos
Date:     2007-11-13 11:46:21 -0800 (Tue, 13 Nov 2007)

Log Message:
-----------
don't trash the registry if proper startup has failed

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wince/CEDevice.cpp

Modified: scummvm/trunk/backends/platform/wince/CEDevice.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/CEDevice.cpp	2007-11-13 19:42:52 UTC (rev 29496)
+++ scummvm/trunk/backends/platform/wince/CEDevice.cpp	2007-11-13 19:46:21 UTC (rev 29497)
@@ -35,6 +35,7 @@
 static HANDLE _hPowerManagement = NULL;
 static DWORD _lastTime = 0;
 static DWORD REG_bat = 0, REG_ac = 0, REG_disp = 0, bat_timeout = 0;
+static bool REG_tampered = false;
 #ifdef __GNUC__
 extern "C" void WINAPI SystemIdleTimerReset(void);
 #define SPI_SETBATTERYIDLETIMEOUT	251
@@ -99,6 +100,7 @@
 	// older devices
 	REG_bat = REG_ac = REG_disp = 2 * 60 * 60 * 1000;	// 2hrs should do it
 	backlight_xchg();
+	REG_tampered = true;
 	SystemParametersInfo(SPI_GETBATTERYIDLETIMEOUT, 0, (void *) &bat_timeout, 0);
 	SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, 60 * 60 * 2, NULL, SPIF_SENDCHANGE);	
 }
@@ -106,8 +108,8 @@
 void CEDevice::end() {
 	if (_ReleasePowerRequirement && _hPowerManagement)
 		_ReleasePowerRequirement(_hPowerManagement);
-
-	backlight_xchg();
+	if (REG_tampered)
+		backlight_xchg();
 	SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, bat_timeout, NULL, SPIF_SENDCHANGE);	
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list