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

knakos at users.sourceforge.net knakos at users.sourceforge.net
Sun Nov 12 22:07:00 CET 2006


Revision: 24702
          http://svn.sourceforge.net/scummvm/?rev=24702&view=rev
Author:   knakos
Date:     2006-11-12 13:06:56 -0800 (Sun, 12 Nov 2006)

Log Message:
-----------
Cleanup

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

Modified: scummvm/trunk/backends/platform/wince/wince-sdl.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2006-11-12 19:55:18 UTC (rev 24701)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.cpp	2006-11-12 21:06:56 UTC (rev 24702)
@@ -267,19 +267,6 @@
 }
 
 void OSystem_WINCE3::initScreenInfos() {
-	/*
-	// Check if we're running Ozone
-	int result;
-	RawFrameBufferInfo frameBufferInfo;
-	HDC hdc = GetDC(NULL);
-	result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *)&frameBufferInfo);
-	ReleaseDC(NULL, hdc);
-	_isOzone = (result > 0);
-	// And obtain the real screen size
-	_platformScreenWidth = (result > 0 ? frameBufferInfo.cxPixels : GetSystemMetrics(SM_CXSCREEN));
-	_platformScreenHeight = (result > 0 ? frameBufferInfo.cyPixels : GetSystemMetrics(SM_CYSCREEN));
-	*/
-
 	// sdl port ensures that we use correctly full screen
 	_isOzone = 0;
 	_platformScreenWidth = GetSystemMetrics(SM_CXSCREEN);
@@ -597,9 +584,7 @@
 
 	EventsBuffer::simulateMouseMove(_mouseXZone[_currentZone], _mouseYZone[_currentZone]);
 }
-//#endif
 
-
 void OSystem_WINCE3::create_toolbar() {
 	PanelKeyboard *keyboard;
 
@@ -622,7 +607,6 @@
 	desired.freq = _sampleRate;
 	desired.format = AUDIO_S16SYS;
 	desired.channels = 2;
-	//desired.samples = 2048;
 	desired.samples = 128;
 	desired.callback = private_sound_proc;
 	desired.userdata = param;
@@ -697,10 +681,10 @@
 	}
 
 #ifdef USE_VORBIS
-    // Modify the sample rate on the fly if OGG is involved
-    if (_sampleRate == SAMPLES_PER_SEC_OLD)
-     if (checkOggHighSampleRate())
-		 _sampleRate = SAMPLES_PER_SEC_NEW;
+	// Modify the sample rate on the fly if OGG is involved
+	if (_sampleRate == SAMPLES_PER_SEC_OLD)
+		if (checkOggHighSampleRate())
+			 _sampleRate = SAMPLES_PER_SEC_NEW;
 #endif
 }
 
@@ -717,6 +701,9 @@
 	get_sample_rate();
 	bool result = setSoundCallback(Audio::Mixer::mixCallback, _mixer);
 	_mixer->setReady(result);
+
+	// handle the actual event
+	OSystem_SDL::setWindowCaption(caption);
 }
 
 bool OSystem_WINCE3::openCD(int drive) {
@@ -731,8 +718,7 @@
 }
 
 bool OSystem_WINCE3::hasFeature(Feature f) {
-return
-		(f == kFeatureAutoComputeDirtyRects || f == kFeatureVirtualKeyboard);
+	return (f == kFeatureAutoComputeDirtyRects || f == kFeatureVirtualKeyboard);
 }
 
 void OSystem_WINCE3::setFeatureState(Feature f, bool enable) {
@@ -1051,7 +1037,6 @@
 	if (ConfMan.hasKey("landscape"))
 		if (ConfMan.get("landscape")[0] > 57) {
 			_newOrientation = _orientationLandscape = ConfMan.getBool("landscape");
-			//ConfMan.removeKey("landscape", String::emptyString);
 			ConfMan.setInt("landscape", _orientationLandscape);
 		} else
 			_newOrientation = _orientationLandscape = ConfMan.getInt("landscape");
@@ -1127,10 +1112,8 @@
 	}
 
 	// Check if the scaler can be accepted, if not get back to normal scaler
-	if (_scaleFactor && ((_scaleFactor * _screenWidth > getScreenWidth() &&
-						  _scaleFactor * _screenWidth > getScreenHeight())
-					 || (_scaleFactor * _screenHeight > getScreenWidth() &&
-						_scaleFactor * _screenHeight > getScreenHeight()))) {
+	if (_scaleFactor && ((_scaleFactor * _screenWidth > getScreenWidth() && _scaleFactor * _screenWidth > getScreenHeight())
+		 || (_scaleFactor * _screenHeight > getScreenWidth() &&	_scaleFactor * _screenHeight > getScreenHeight()))) {
 				_scaleFactor = 1;
 				_scalerProc = Normal1x;
 	}
@@ -1173,15 +1156,12 @@
 	// Recompute scalers if necessary
 	update_scalers();
 
-	//
 	// Create the surface that contains the 8 bit game data
 	_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _screenWidth, _screenHeight, 8, 0, 0, 0, 0);
 	if (_screen == NULL)
 		error("_screen failed");
 
-	//
 	// Create the surface that contains the scaled graphics in 16 bit mode
-	//
 
 	// Always use full screen mode to have a "clean screen"
 	displayWidth = _screenWidth * _scaleFactorXm / _scaleFactorXd;
@@ -1218,9 +1198,7 @@
 		quit();
 	}
 
-	//
 	// Create the surface used for the graphics in 16 bit before scaling, and also the overlay
-	//
 
 	// Distinguish 555 and 565 mode
 	if (_hwscreen->format->Rmask == 0x7C00)
@@ -1230,20 +1208,11 @@
 	initCEScaler();
 
 	// Need some extra bytes around when using 2xSaI
-	_tmpscreen = SDL_CreateRGBSurface(SDL_SWSURFACE,
-						_screenWidth + 3,
-						_screenHeight + 3,
-						16,
-						_hwscreen->format->Rmask,
-						_hwscreen->format->Gmask,
-						_hwscreen->format->Bmask,
-						_hwscreen->format->Amask);
+	_tmpscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _screenWidth + 3, _screenHeight + 3, 16, _hwscreen->format->Rmask, _hwscreen->format->Gmask, _hwscreen->format->Bmask, _hwscreen->format->Amask);
 
 	if (_tmpscreen == NULL)
-		error("_tmpscreen failed");
+		error("_tmpscreen creation failed");
 
-
-
 	// Overlay
 	if (CEDevice::hasDesktopResolution()) {
 		_overlayscreen = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth * _scaleFactorXm / _scaleFactorXd, _overlayHeight * _scaleFactorYm / _scaleFactorYd, 16, 0, 0, 0, 0);
@@ -1263,29 +1232,18 @@
 
 	// Toolbar
 	uint16 *toolbar_screen = (uint16 *)calloc(320 * 40, sizeof(uint16));
-	_toolbarLow = SDL_CreateRGBSurfaceFrom(toolbar_screen,
-						320, 40, 16, 320 * 2,
-						_hwscreen->format->Rmask,
-						_hwscreen->format->Gmask,
-						_hwscreen->format->Bmask,
-						_hwscreen->format->Amask
-					);
+	_toolbarLow = SDL_CreateRGBSurfaceFrom(toolbar_screen, 320, 40, 16, 320 * 2, _hwscreen->format->Rmask, _hwscreen->format->Gmask, _hwscreen->format->Bmask, _hwscreen->format->Amask);
+
 	if (_toolbarLow == NULL)
 		error("_toolbarLow failed");
 
 	if (_screenHeight > 240) {
 		uint16 *toolbar_screen = (uint16 *)calloc(640 * 80, sizeof(uint16));
-		_toolbarHigh = SDL_CreateRGBSurfaceFrom(toolbar_screen,
-							640, 80, 16, 640 * 2,
-							_hwscreen->format->Rmask,
-							_hwscreen->format->Gmask,
-							_hwscreen->format->Bmask,
-							_hwscreen->format->Amask
-						);
+		_toolbarHigh = SDL_CreateRGBSurfaceFrom(toolbar_screen, 640, 80, 16, 640 * 2, _hwscreen->format->Rmask, _hwscreen->format->Gmask, _hwscreen->format->Bmask, _hwscreen->format->Amask);
+
 		if (_toolbarHigh == NULL)
 			error("_toolbarHigh failed");
-	}
-	else
+	} else
 		_toolbarHigh = NULL;
 
 
@@ -1664,7 +1622,7 @@
 	assert (_transactionMode == kTransactionNone);
 	assert(src);
 
-	if (_screen == NULL)
+	if (_screen == NULL) 
 		return;
 
 	Common::StackLock lock(_graphicsMutex);	// Lock the mutex until this function ends
@@ -2029,7 +1987,7 @@
 }
 
 void OSystem_WINCE3::warpMouse(int x, int y) {
-		if (_mouseCurState.x != x || _mouseCurState.y != y) {
+	if (_mouseCurState.x != x || _mouseCurState.y != y) {
 		SDL_WarpMouse(x * _scaleFactorXm / _scaleFactorXd, y * _scaleFactorYm / _scaleFactorYd);
 
 		// SDL_WarpMouse() generates a mouse movement event, so
@@ -2243,8 +2201,7 @@
 			if (_toolbarHandler.action(temp_event.mouse.x, temp_event.mouse.y, false)) {
 				if (!_toolbarHandler.drawn())
 					internUpdateScreen();
-			}
-			else {
+			} else {
 				if (!_freeLook)
 					memcpy(&event, &temp_event, sizeof(Event));
 			}

Modified: scummvm/trunk/backends/platform/wince/wince-sdl.h
===================================================================
--- scummvm/trunk/backends/platform/wince/wince-sdl.h	2006-11-12 19:55:18 UTC (rev 24701)
+++ scummvm/trunk/backends/platform/wince/wince-sdl.h	2006-11-12 21:06:56 UTC (rev 24702)
@@ -170,17 +170,17 @@
 	CEGUI::ToolbarHandler _toolbarHandler;
 
 	SDL_Surface *_toolbarLow;	// toolbar 320x40
-	SDL_Surface *_toolbarHigh;  // toolbar 640x80
+	SDL_Surface *_toolbarHigh;	// toolbar 640x80
 	bool _toolbarHighDrawn;		// cache toolbar 640x80
 
-	uint16 _sampleRate;			// current audio sample rate
+	uint16 _sampleRate;		// current audio sample rate
 
-	bool _freeLook;				// freeLook mode (do not send mouse button events)
+	bool _freeLook;			// freeLook mode (do not send mouse button events)
 
 	bool _forceHideMouse;		// force invisible mouse cursor
 
-	bool _forcePanelInvisible;  // force panel visibility for some cases
-	bool _panelVisible;			// panel visibility
+	bool _forcePanelInvisible;	// force panel visibility for some cases
+	bool _panelVisible;		// panel visibility
 	bool _panelStateForced;		// panel visibility forced by external call
 
 	bool _panelInitialized;		// only initialize the toolbar once
@@ -195,17 +195,17 @@
 	String _saveActiveToolbar;	// save active toolbar when forced
 
 	bool _saveToolbarZoom;		// save visibility when zooming
-	bool _zoomUp;				// zooming up mode
-	bool _zoomDown;				// zooming down mode
+	bool _zoomUp;			// zooming up mode
+	bool _zoomDown;			// zooming down mode
 
-	bool _rbutton;				// double tap -> right button simulation
+	bool _rbutton;			// double tap -> right button simulation
 
 	bool _usesEmulatedMouse;	// emulated mousemove ever been used in this session
 
-	int _scaleFactorXm;			// scaler X *
-	int _scaleFactorXd;			// scaler X /
-	int _scaleFactorYm;			// scaler Y *
-	int _scaleFactorYd;			// scaler Y /
+	int _scaleFactorXm;		// scaler X *
+	int _scaleFactorXd;		// scaler X /
+	int _scaleFactorYm;		// scaler Y *
+	int _scaleFactorYd;		// scaler Y /
 	bool _scalersChanged;
 
 	static int _platformScreenWidth;
@@ -224,10 +224,10 @@
 
 	// Smartphone specific variables
 
-	int _lastKeyPressed;		// last key pressed
+	int _lastKeyPressed;			// last key pressed
 	int _keyRepeat;				// number of time the last key was repeated
 	int _keyRepeatTime;			// elapsed time since the key was pressed
-	int _keyRepeatTrigger;		// minimum time to consider the key was repeated
+	int _keyRepeatTrigger;			// minimum time to consider the key was repeated
 
 	int _repeatX;				// repeat trigger for left and right cursor moves
 	int _repeatY;				// repeat trigger for up and down cursor moves


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