diff options
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/events/psp2sdl/psp2sdl-events.cpp | 252 | ||||
| -rw-r--r-- | backends/events/psp2sdl/psp2sdl-events.h | 21 | ||||
| -rw-r--r-- | backends/events/symbiansdl/symbiansdl-events.cpp | 2 | ||||
| -rw-r--r-- | backends/graphics/psp2sdl/psp2sdl-graphics.cpp | 225 | ||||
| -rw-r--r-- | backends/graphics/psp2sdl/psp2sdl-graphics.h | 3 | ||||
| -rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.h | 2 | ||||
| -rw-r--r-- | backends/keymapper/remap-dialog.cpp | 12 | ||||
| -rw-r--r-- | backends/platform/androidsdl/androidsdl.mk | 6 | ||||
| -rw-r--r-- | backends/platform/maemo/maemo.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/null/null.cpp | 4 | ||||
| -rw-r--r-- | backends/platform/sdl/posix/posix-main.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/sdl/ps3/ps3.cpp | 1 | ||||
| -rw-r--r-- | backends/platform/sdl/psp2/psp2.cpp | 28 | ||||
| -rw-r--r-- | backends/platform/sdl/psp2/psp2.h | 14 | ||||
| -rw-r--r-- | backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg | 2 | ||||
| -rw-r--r-- | backends/platform/symbian/src/portdefs.h | 21 | ||||
| -rw-r--r-- | backends/vkeybd/virtual-keyboard.cpp | 42 | ||||
| -rw-r--r-- | backends/vkeybd/virtual-keyboard.h | 4 | 
18 files changed, 365 insertions, 278 deletions
| diff --git a/backends/events/psp2sdl/psp2sdl-events.cpp b/backends/events/psp2sdl/psp2sdl-events.cpp index 4ea528b00f..3f447b7435 100644 --- a/backends/events/psp2sdl/psp2sdl-events.cpp +++ b/backends/events/psp2sdl/psp2sdl-events.cpp @@ -25,6 +25,7 @@  #if defined(PSP2)  #include <psp2/kernel/processmgr.h> +#include <psp2/touch.h>  #include "backends/platform/sdl/psp2/psp2.h"  #include "backends/events/psp2sdl/psp2sdl-events.h"  #include "backends/platform/sdl/sdl.h" @@ -36,11 +37,260 @@  #include "math.h" +PSP2EventSource::PSP2EventSource() { +	for (int i = 0; i < SCE_TOUCH_PORT_MAX_NUM; i++) { +		for (int j = 0; j < MAX_NUM_FINGERS; j++) { +			_finger[i][j].id = -1; +		} +	} +} +  void PSP2EventSource::preprocessEvents(SDL_Event *event) { -	// prevent suspend (scummvm games contains a lot of cutscenes..) +	// prevent suspend (scummvm games contain a lot of cutscenes..)  	sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND);  	sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF); + +	// Supported touch gestures: +	// left mouse click: single finger short tap +	// right mouse click: second finger short tap while first finger is still down +	// pointer motion: single finger drag +	if (event->type == SDL_FINGERDOWN || event->type == SDL_FINGERUP || event->type == SDL_FINGERMOTION) { +		// front (0) or back (1) panel +		SDL_TouchID port = event->tfinger.touchId; +		if (port < SCE_TOUCH_PORT_MAX_NUM && port >= 0) { +			// touchpad_mouse_mode off: use only front panel for direct touch control of pointer +			// touchpad_mouse_mode on: also enable rear touch with indirect touch control +			// where the finger can be somewhere else than the pointer and still move it +			if (port == 0 || ConfMan.getBool("touchpad_mouse_mode")) { +				switch (event->type) { +				case SDL_FINGERDOWN: +					preprocessFingerDown(event); +					break; +				case SDL_FINGERUP: +					preprocessFingerUp(event); +					break; +				case SDL_FINGERMOTION: +					preprocessFingerMotion(event); +					break; +				} +			} +		} +	} +} + +void PSP2EventSource::preprocessFingerDown(SDL_Event *event) { +	// front (0) or back (1) panel +	SDL_TouchID port = event->tfinger.touchId; +	// id (for multitouch) +	SDL_FingerID id = event->tfinger.fingerId; + +	// find out how many fingers were down before this event +	int numFingersDown = 0; +	for (int i = 0; i < MAX_NUM_FINGERS; i++) { +		if (_finger[port][i].id >= 0) { +			numFingersDown++; +		} +	} + +	for (int i = 0; i < MAX_NUM_FINGERS; i++) { +		if (_finger[port][i].id == -1) { +			_finger[port][i].id = id; +			_finger[port][i].timeLastDown = event->tfinger.timestamp; +			break; +		} +	} +} + +void PSP2EventSource::preprocessFingerUp(SDL_Event *event) { +	// front (0) or back (1) panel +	SDL_TouchID port = event->tfinger.touchId; +	// id (for multitouch) +	SDL_FingerID id = event->tfinger.fingerId; + +	// find out how many fingers were down before this event +	int numFingersDown = 0; +	for (int i = 0; i < MAX_NUM_FINGERS; i++) { +		if (_finger[port][i].id >= 0) { +			numFingersDown++; +		} +	} + +	int x = _km.x / MULTIPLIER; +	int y = _km.y / MULTIPLIER; + +	if (port == 0) { +		convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y); +	} + +	for (int i = 0; i < MAX_NUM_FINGERS; i++) { +		if (_finger[port][i].id == id) { +			_finger[port][i].id = -1; +			if ((event->tfinger.timestamp - _finger[port][i].timeLastDown) <= 250) { +				// short (<250 ms) tap is interpreted as right/left mouse click depending on # fingers already down +				if (numFingersDown == 2 || numFingersDown == 1) { +					Uint8 simulatedButton = 0; +					if (numFingersDown == 2) { +						simulatedButton = SDL_BUTTON_RIGHT; +					} else if (numFingersDown == 1) { +						simulatedButton = SDL_BUTTON_LEFT; +					} + +					event->type = SDL_MOUSEBUTTONDOWN; +					event->button.button = simulatedButton; +					event->button.x = x; +					event->button.y = y; + +					SDL_Event ev; +					ev.type = SDL_MOUSEBUTTONUP; +					ev.button.button = simulatedButton; +					ev.button.x = x; +					ev.button.y = y; +					SDL_PushEvent(&ev); +				} +			} +		} +	} +} + +void PSP2EventSource::preprocessFingerMotion(SDL_Event *event) { +	// front (0) or back (1) panel +	SDL_TouchID port = event->tfinger.touchId; + +	// find out how many fingers were down before this event +	int numFingersDown = 0; +	for (int i = 0; i < MAX_NUM_FINGERS; i++) { +		if (_finger[port][i].id >= 0) { +			numFingersDown++; +		} +	} + +	if (numFingersDown == 1) { + +		int x = _km.x / MULTIPLIER; +		int y = _km.y / MULTIPLIER; + +		if (port == 0) { +			convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y); +		} else { +			// for relative mode, use the pointer speed setting +			float speedFactor = 1.0; + +			switch (ConfMan.getInt("kbdmouse_speed")) { +			// 0.25 keyboard pointer speed +			case 0: +				speedFactor = 0.25; +				break; +			// 0.5 speed +			case 1: +				speedFactor = 0.5; +				break; +			// 0.75 speed +			case 2: +				speedFactor = 0.75; +				break; +			// 1.0 speed +			case 3: +				speedFactor = 1.0; +				break; +			// 1.25 speed +			case 4: +				speedFactor = 1.25; +				break; +			// 1.5 speed +			case 5: +				speedFactor = 1.5; +				break; +			// 1.75 speed +			case 6: +				speedFactor = 1.75; +				break; +			// 2.0 speed +			case 7: +				speedFactor = 2.0; +				break; +			default: +				speedFactor = 1.0; +			} + +			// convert touch events to relative mouse pointer events +			// Whenever an SDL_event involving the mouse is processed, +			// _km.x/y are truncated from subpixel precision to regular pixel precision. +			// Therefore, there's no need here to deal with subpixel precision in _km.x/y. +			x = (_km.x / MULTIPLIER + (event->tfinger.dx * 1.25 * speedFactor * _km.x_max)); +			y = (_km.y / MULTIPLIER + (event->tfinger.dy * 1.25 * speedFactor * _km.y_max)); +		} + +		if (x > _km.x_max) { +			x = _km.x_max; +		} else if (x < 0) { +			x = 0; +		} +		if (y > _km.y_max) { +			y = _km.y_max; +		} else if (y < 0) { +			y = 0; +		} + +		event->type = SDL_MOUSEMOTION; +		event->motion.x = x; +		event->motion.y = y; +	} +} + +void PSP2EventSource::convertTouchXYToGameXY(float touchX, float touchY, int *gameX, int *gameY) { +	int screenWidth = 960; +	int screenHeight = 544; +	// Find touch coordinates in terms of Vita screen pixels +	int screenTouchX = (int) (touchX * (float)screenWidth); +	int screenTouchY = (int) (touchY * (float)screenHeight); + +	// Find four corners of game screen in Vita screen coordinates +	// This depends on the fullscreen and aspect ratio correction settings (at least on Vita) + +	int gameXMin = 0; +	int gameXMax = 0; +	int gameYMin = 0; +	int gameYMax = 0; +	float aspectRatio = 4.0 / 3.0; + +	// vertical +	if (ConfMan.getBool("fullscreen")) { +		gameYMin = 0; +		gameYMax = screenHeight; +	} else { +		if (_km.y_max <= 272) { +			gameYMin = (screenHeight - (_km.y_max * 2)) / 2; +			gameYMax = screenHeight - gameYMin; +		} else { +			gameYMin = (screenHeight - (_km.y_max)) / 2; +			gameYMax = screenHeight - gameYMin; +		} +	} +	// horizontal +	if (ConfMan.getBool("aspect_ratio")) { +		aspectRatio = 4.0/3.0; +	} else { +		aspectRatio = (float)_km.x_max / (float)_km.y_max; +	} +	gameXMin = (960 - ((float)(gameYMax - gameYMin) * aspectRatio)) / 2; +	gameXMax = 960 - gameXMin; + +	// find game pixel coordinates corresponding to front panel touch coordinates +	int x = ((screenTouchX - gameXMin) * _km.x_max) / (gameXMax - gameXMin); +	int y = ((screenTouchY - gameYMin) * _km.y_max) / (gameYMax - gameYMin); + +	if (x < 0) { +		x = 0; +	} else if (x > _km.x_max) { +		x = _km.x_max; +	} else if (y < 0) { +		y = 0; +	} else if (y > _km.y_max) { +		y = _km.y_max; +	} +	*gameX = x; +	*gameY = y;  }  #endif diff --git a/backends/events/psp2sdl/psp2sdl-events.h b/backends/events/psp2sdl/psp2sdl-events.h index 5593e8a504..42101fefe9 100644 --- a/backends/events/psp2sdl/psp2sdl-events.h +++ b/backends/events/psp2sdl/psp2sdl-events.h @@ -24,13 +24,32 @@  #define BACKEND_EVENTS_PSP2_H  #include "backends/events/sdl/sdl-events.h" +#include <psp2/touch.h>  /**   * SDL Events manager for the PSP2.   */  class PSP2EventSource : public SdlEventSource { +public: +	PSP2EventSource();  protected: -	void preprocessEvents(SDL_Event *event); +	void preprocessEvents(SDL_Event *event) override; +private: +	typedef struct { +		int id; // -1: no touch +		int timeLastDown; +	} Touch; + +	enum { +		MAX_NUM_FINGERS = 3, +	}; // track three fingers per panel +	Touch _finger[SCE_TOUCH_PORT_MAX_NUM][MAX_NUM_FINGERS]; // keep track of finger status + +	void preprocessFingerDown(SDL_Event *event); +	void preprocessFingerUp(SDL_Event *event); +	void preprocessFingerMotion(SDL_Event *event); +	void convertTouchXYToGameXY(float touchX, float touchY, int *gameX, int *gameY); +	SceTouchPanelInfo panelInfo;  };  #endif /* BACKEND_EVENTS_PSP2_H */ diff --git a/backends/events/symbiansdl/symbiansdl-events.cpp b/backends/events/symbiansdl/symbiansdl-events.cpp index 0ae5824681..fde748f444 100644 --- a/backends/events/symbiansdl/symbiansdl-events.cpp +++ b/backends/events/symbiansdl/symbiansdl-events.cpp @@ -124,7 +124,7 @@ bool SymbianSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {  				if (ev.type == SDL_KEYDOWN) {  					for (int i = 0; i < TOTAL_ZONES; i++)  						if ( (_km.x / MULTIPLIER) >= _zones[i].x && (_km.y / MULTIPLIER) >= _zones[i].y && -							(_km.x / MULTIPLIER) <= _zones[i].x + _zones[i].width && (_km.y / MULTIPLIER <= _zones[i].y + _zones[i].height +							(_km.x / MULTIPLIER) <= _zones[i].x + _zones[i].width && (_km.y / MULTIPLIER <= _zones[i].y + _zones[i].height)  							) {  							_mouseXZone[i] = _km.x / MULTIPLIER;  							_mouseYZone[i] = _km.y / MULTIPLIER; diff --git a/backends/graphics/psp2sdl/psp2sdl-graphics.cpp b/backends/graphics/psp2sdl/psp2sdl-graphics.cpp index 4be48b55e0..28e1e71332 100644 --- a/backends/graphics/psp2sdl/psp2sdl-graphics.cpp +++ b/backends/graphics/psp2sdl/psp2sdl-graphics.cpp @@ -214,229 +214,6 @@ void PSP2SdlGraphicsManager::updateShader() {  	}  } -void PSP2SdlGraphicsManager::internUpdateScreen() { -	SDL_Surface *srcSurf, *origSurf; -	int height, width; -	ScalerProc *scalerProc; -	int scale1; - -	// definitions not available for non-DEBUG here. (needed this to compile in SYMBIAN32 & linux?) -#if defined(DEBUG) -	assert(_hwScreen != NULL); -	assert(_hwScreen->map->sw_data != NULL); -#endif - -	// If the shake position changed, fill the dirty area with blackness -	if (_currentShakePos != _newShakePos || -		(_cursorNeedsRedraw && _mouseBackup.y <= _currentShakePos)) { -		SDL_Rect blackrect = {0, 0, (Uint16)(_videoMode.screenWidth * _videoMode.scaleFactor), (Uint16)(_newShakePos * _videoMode.scaleFactor)}; - -		if (_videoMode.aspectRatioCorrection && !_overlayVisible) -			blackrect.h = real2Aspect(blackrect.h - 1) + 1; - -		SDL_FillRect(_hwScreen, &blackrect, 0); - -		_currentShakePos = _newShakePos; - -		_forceRedraw = true; -	} - -	// Check whether the palette was changed in the meantime and update the -	// screen surface accordingly. -	if (_screen && _paletteDirtyEnd != 0) { -		SDL_SetColors(_screen, _currentPalette + _paletteDirtyStart, -			_paletteDirtyStart, -			_paletteDirtyEnd - _paletteDirtyStart); - -		_paletteDirtyEnd = 0; - -		_forceRedraw = true; -	} - -	if (!_overlayVisible) { -		origSurf = _screen; -		srcSurf = _tmpscreen; -		width = _videoMode.screenWidth; -		height = _videoMode.screenHeight; -		scalerProc = _scalerProc; -		scale1 = _videoMode.scaleFactor; -	} else { -		origSurf = _overlayscreen; -		srcSurf = _tmpscreen2; -		width = _videoMode.overlayWidth; -		height = _videoMode.overlayHeight; -		scalerProc = Normal1x; - -		scale1 = 1; -	} - -	// Add the area covered by the mouse cursor to the list of dirty rects if -	// we have to redraw the mouse. -	if (_cursorNeedsRedraw) -		undrawMouse(); - -#ifdef USE_OSD -	updateOSD(); -#endif - -	// Force a full redraw if requested -	if (_forceRedraw) { -		_numDirtyRects = 1; -		_dirtyRectList[0].x = 0; -		_dirtyRectList[0].y = 0; -		_dirtyRectList[0].w = width; -		_dirtyRectList[0].h = height; -	} - -	// Only draw anything if necessary -	if (_numDirtyRects > 0 || _cursorNeedsRedraw) { -		SDL_Rect *r; -		SDL_Rect dst; -		uint32 srcPitch, dstPitch; -		SDL_Rect *lastRect = _dirtyRectList + _numDirtyRects; - -		for (r = _dirtyRectList; r != lastRect; ++r) { -			dst = *r; -			dst.x++;	// Shift rect by one since 2xSai needs to access the data around -			dst.y++;	// any pixel to scale it, and we want to avoid mem access crashes. - -			if (SDL_BlitSurface(origSurf, r, srcSurf, &dst) != 0) -				error("SDL_BlitSurface failed: %s", SDL_GetError()); -		} - -		SDL_LockSurface(srcSurf); -		srcPitch = srcSurf->pitch; -		dstPitch = _hwScreen->pitch; - -		for (r = _dirtyRectList; r != lastRect; ++r) { -			register int dst_y = r->y + _currentShakePos; -			register int dst_h = 0; -#ifdef USE_SCALERS -			register int orig_dst_y = 0; -#endif -			register int rx1 = r->x * scale1; - -			if (dst_y < height) { -				dst_h = r->h; -				if (dst_h > height - dst_y) -					dst_h = height - dst_y; - -#ifdef USE_SCALERS -				orig_dst_y = dst_y; -#endif -				dst_y = dst_y * scale1; - -				if (_videoMode.aspectRatioCorrection && !_overlayVisible) -					dst_y = real2Aspect(dst_y); - -				assert(scalerProc != NULL); -				scalerProc((byte *)srcSurf->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, -					(byte *)_hwScreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h); -			} - -			r->x = rx1; -			r->y = dst_y; -			r->w = r->w * scale1; -			r->h = dst_h * scale1; - -#ifdef USE_SCALERS -			if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible) -				r->h = stretch200To240((uint8 *) _hwScreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1); -#endif -		} -		SDL_UnlockSurface(srcSurf); -		// Readjust the dirty rect list in case we are doing a full update. -		// This is necessary if shaking is active. -		if (_forceRedraw) { -			_dirtyRectList[0].y = 0; -			_dirtyRectList[0].h = _videoMode.hardwareHeight; -		} - -		drawMouse(); - -#ifdef USE_OSD -		drawOSD(); -#endif - -#ifdef USE_SDL_DEBUG_FOCUSRECT -		// We draw the focus rectangle on top of everything, to assure it's easily visible. -		// Of course when the overlay is visible we do not show it, since it is only for game -		// specific focus. -		if (_enableFocusRect && !_overlayVisible) { -			int y = _focusRect.top + _currentShakePos; -			int h = 0; -			int x = _focusRect.left * scale1; -			int w = _focusRect.width() * scale1; - -			if (y < height) { -				h = _focusRect.height(); -				if (h > height - y) -					h = height - y; - -				y *= scale1; - -				if (_videoMode.aspectRatioCorrection && !_overlayVisible) -					y = real2Aspect(y); - -				if (h > 0 && w > 0) { -					// Use white as color for now. -					Uint32 rectColor = SDL_MapRGB(_hwScreen->format, 0xFF, 0xFF, 0xFF); - -					// First draw the top and bottom lines -					// then draw the left and right lines -					if (_hwScreen->format->BytesPerPixel == 2) { -						uint16 *top = (uint16 *)((byte *)_hwScreen->pixels + y * _hwScreen->pitch + x * 2); -						uint16 *bottom = (uint16 *)((byte *)_hwScreen->pixels + (y + h) * _hwScreen->pitch + x * 2); -						byte *left = ((byte *)_hwScreen->pixels + y * _hwScreen->pitch + x * 2); -						byte *right = ((byte *)_hwScreen->pixels + y * _hwScreen->pitch + (x + w - 1) * 2); - -						while (w--) { -							*top++ = rectColor; -							*bottom++ = rectColor; -						} - -						while (h--) { -							*(uint16 *)left = rectColor; -							*(uint16 *)right = rectColor; - -							left += _hwScreen->pitch; -							right += _hwScreen->pitch; -						} -					} else if (_hwScreen->format->BytesPerPixel == 4) { -						uint32 *top = (uint32 *)((byte *)_hwScreen->pixels + y * _hwScreen->pitch + x * 4); -						uint32 *bottom = (uint32 *)((byte *)_hwScreen->pixels + (y + h) * _hwScreen->pitch + x * 4); -						byte *left = ((byte *)_hwScreen->pixels + y * _hwScreen->pitch + x * 4); -						byte *right = ((byte *)_hwScreen->pixels + y * _hwScreen->pitch + (x + w - 1) * 4); - -						while (w--) { -							*top++ = rectColor; -							*bottom++ = rectColor; -						} - -						while (h--) { -							*(uint32 *)left = rectColor; -							*(uint32 *)right = rectColor; - -							left += _hwScreen->pitch; -							right += _hwScreen->pitch; -						} -					} -				} -			} -		} -#endif - -		// Finally, blit all our changes to the screen -		if (!_displayDisabled) { -			PSP2_UpdateRects(_hwScreen, _numDirtyRects, _dirtyRectList); -		} -	} - -	_numDirtyRects = 0; -	_forceRedraw = false; -	_cursorNeedsRedraw = false; -} -  void PSP2SdlGraphicsManager::setAspectRatioCorrection(bool enable) {  	Common::StackLock lock(_graphicsMutex); @@ -473,7 +250,7 @@ SDL_Surface *PSP2SdlGraphicsManager::SDL_SetVideoMode(int width, int height, int  	return screen;  } -void PSP2SdlGraphicsManager::PSP2_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects) { +void PSP2SdlGraphicsManager::SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects) {  	int x, y, w, h;  	float sx, sy;  	float ratio = (float)screen->w / (float)screen->h; diff --git a/backends/graphics/psp2sdl/psp2sdl-graphics.h b/backends/graphics/psp2sdl/psp2sdl-graphics.h index 0cabeb094d..3264323d1e 100644 --- a/backends/graphics/psp2sdl/psp2sdl-graphics.h +++ b/backends/graphics/psp2sdl/psp2sdl-graphics.h @@ -39,11 +39,10 @@ protected:  	virtual void unloadGFXMode() override;  	virtual bool hotswapGFXMode() override; -	virtual void internUpdateScreen() override;  	virtual void updateShader() override;  	virtual void setAspectRatioCorrection(bool enable) override;  	virtual SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) override; -	void PSP2_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects); +	virtual void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects) override;  	void PSP2_UpdateFiltering();  	bool _hardwareAspectRatioCorrection; diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h index 60f5d29f55..9e8e75772d 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.h +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h @@ -188,7 +188,7 @@ protected:  	void recreateScreenTexture();  	virtual SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags); -	void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects); +	virtual void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);  #endif  	/** Unseen game screen */ diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 3aa3647048..9c52a922c5 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -267,7 +267,7 @@ void RemapDialog::startRemapping(uint i) {  	_remapTimeout = g_system->getMillis() + kRemapTimeoutDelay;  	Action *activeRemapAction = _currentActions[_topAction + i].action;  	_keymapWidgets[i].keyButton->setLabel("..."); -	_keymapWidgets[i].keyButton->draw(); +	_keymapWidgets[i].keyButton->markAsDirty();  	_keymapper->startRemappingMode(activeRemapAction);  } @@ -414,8 +414,8 @@ void RemapDialog::refreshKeymap() {  	_topAction = newTopAction; -	//_container->draw(); -	_scrollBar->draw(); +	//_container->markAsDirty(); +	_scrollBar->markAsDirty();  	uint actionI = _topAction; @@ -446,12 +446,12 @@ void RemapDialog::refreshKeymap() {  			widg.keyButton->setVisible(false);  			widg.clearButton->setVisible(false);  		} -		//widg.actionText->draw(); -		//widg.keyButton->draw(); +		//widg.actionText->markAsDirty(); +		//widg.keyButton->markAsDirty();  	}  	// need to redraw entire Dialog so that invisible  	// widgets disappear -	draw(); +	g_gui.scheduleTopDialogRedraw();  } diff --git a/backends/platform/androidsdl/androidsdl.mk b/backends/platform/androidsdl/androidsdl.mk index 53c0d27666..cf6ab6a930 100644 --- a/backends/platform/androidsdl/androidsdl.mk +++ b/backends/platform/androidsdl/androidsdl.mk @@ -4,8 +4,8 @@ androidsdl:  	$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) release  	$(INSTALL) -c -m 644 $(DIST_FILES_DOCS)  release  	$(CP) $(srcdir)/backends/vkeybd/packs/vkeybd_default.zip release -	zip -j scummvm_1_10_0-git-appdata.zip release/* -	split -d -b 1000000 scummvm_1_10_0-git-appdata.zip scummvm_1_10_0-git-appdata.zip0 -	$(RM) -r scummvm_1_10_0-git-appdata.zip +	zip -j scummvm_2_1_0-git-appdata.zip release/* +	split -d -b 1000000 scummvm_2_1_0-git-appdata.zip scummvm_2_1_0-git-appdata.zip0 +	$(RM) -r scummvm_2_1_0-git-appdata.zip  .PHONY: androidsdl diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp index dc1054940e..326c35a28f 100644 --- a/backends/platform/maemo/maemo.cpp +++ b/backends/platform/maemo/maemo.cpp @@ -108,8 +108,6 @@ void OSystem_SDL_Maemo::initBackend() {  		_keymapperDefaultBindings = new Common::KeymapperDefaultBindings();  #endif -	ConfMan.set("vkeybdpath", DATA_PATH); -  	_model = detectModel();  #ifdef ENABLE_KEYMAPPER diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp index a5eea06f7a..be50fde27c 100644 --- a/backends/platform/null/null.cpp +++ b/backends/platform/null/null.cpp @@ -47,6 +47,8 @@  	#include "backends/fs/amigaos4/amigaos4-fs-factory.h"  #elif defined(POSIX)  	#include "backends/fs/posix/posix-fs-factory.h" +#elif defined(RISCOS) +	#include "backends/fs/riscos/riscos-fs-factory.h"  #elif defined(WIN32)  	#include "backends/fs/windows/windows-fs-factory.h"  #endif @@ -73,6 +75,8 @@ OSystem_NULL::OSystem_NULL() {  		_fsFactory = new AmigaOSFilesystemFactory();  	#elif defined(POSIX)  		_fsFactory = new POSIXFilesystemFactory(); +	#elif defined(RISCOS) +		_fsFactory = new RISCOSFilesystemFactory();  	#elif defined(WIN32)  		_fsFactory = new WindowsFilesystemFactory();  	#else diff --git a/backends/platform/sdl/posix/posix-main.cpp b/backends/platform/sdl/posix/posix-main.cpp index e378c37849..92354b273e 100644 --- a/backends/platform/sdl/posix/posix-main.cpp +++ b/backends/platform/sdl/posix/posix-main.cpp @@ -22,7 +22,7 @@  #include "common/scummsys.h" -#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3) && !defined(PSP2) && !defined(ANDROIDSDL) && !defined(RISCOS) +#if defined(POSIX) && !defined(MACOSX) && !defined(SAMSUNGTV) && !defined(MAEMO) && !defined(WEBOS) && !defined(LINUXMOTO) && !defined(GPH_DEVICE) && !defined(GP2X) && !defined(DINGUX) && !defined(OPENPANDORA) && !defined(PLAYSTATION3) && !defined(PSP2) && !defined(ANDROIDSDL)  #include "backends/platform/sdl/posix/posix.h"  #include "backends/plugins/sdl/sdl-provider.h" diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp index 0bb8300014..b13088afd3 100644 --- a/backends/platform/sdl/ps3/ps3.cpp +++ b/backends/platform/sdl/ps3/ps3.cpp @@ -59,7 +59,6 @@ void OSystem_PS3::init() {  void OSystem_PS3::initBackend() {  	ConfMan.set("joystick_num", 0); -	ConfMan.set("vkeybdpath", PREFIX "/data");  	ConfMan.registerDefault("fullscreen", true);  	ConfMan.registerDefault("aspect_ratio", true); diff --git a/backends/platform/sdl/psp2/psp2.cpp b/backends/platform/sdl/psp2/psp2.cpp index 12154ba7d0..29be31f267 100644 --- a/backends/platform/sdl/psp2/psp2.cpp +++ b/backends/platform/sdl/psp2/psp2.cpp @@ -73,7 +73,6 @@ void OSystem_PSP2::init() {  void OSystem_PSP2::initBackend() {  	ConfMan.set("joystick_num", 0); -	ConfMan.set("vkeybdpath", PREFIX "/data");  	ConfMan.registerDefault("fullscreen", true);  	ConfMan.registerDefault("aspect_ratio", false);  	ConfMan.registerDefault("gfx_mode", "2x"); @@ -81,6 +80,7 @@ void OSystem_PSP2::initBackend() {  	ConfMan.registerDefault("kbdmouse_speed", 3);  	ConfMan.registerDefault("joystick_deadzone", 2);  	ConfMan.registerDefault("shader", 0); +	ConfMan.registerDefault("touchpad_mouse_mode", false);  	if (!ConfMan.hasKey("fullscreen")) {  		ConfMan.setBool("fullscreen", true); @@ -97,7 +97,10 @@ void OSystem_PSP2::initBackend() {  	if (!ConfMan.hasKey("shader")) {  		ConfMan.setInt("shader", 2);  	} - +	if (!ConfMan.hasKey("touchpad_mouse_mode")) { +		ConfMan.setBool("touchpad_mouse_mode", false); +	} +	  	// Create the savefile manager  	if (_savefileManager == 0)  		_savefileManager = new DefaultSaveFileManager("ux0:data/scummvm/saves"); @@ -126,9 +129,30 @@ bool OSystem_PSP2::hasFeature(Feature f) {  	return (f == kFeatureKbdMouseSpeed ||  		f == kFeatureJoystickDeadzone ||  		f == kFeatureShader || +		f == kFeatureTouchpadMode ||  		OSystem_SDL::hasFeature(f));  } +void OSystem_PSP2::setFeatureState(Feature f, bool enable) { +	switch (f) { +	case kFeatureTouchpadMode: +		ConfMan.setBool("touchpad_mouse_mode", enable); +		break; +	} +	OSystem_SDL::setFeatureState(f, enable); +} + +bool OSystem_PSP2::getFeatureState(Feature f) { +	switch (f) { +	case kFeatureTouchpadMode: +		return ConfMan.getBool("touchpad_mouse_mode"); +		break; +	default: +		return OSystem_SDL::getFeatureState(f); +		break; +	} +} +  void OSystem_PSP2::logMessage(LogMessageType::Type type, const char *message) {  #if __PSP2_DEBUG__  	psp2shell_print(message); diff --git a/backends/platform/sdl/psp2/psp2.h b/backends/platform/sdl/psp2/psp2.h index 65d98098be..db9140e4c1 100644 --- a/backends/platform/sdl/psp2/psp2.h +++ b/backends/platform/sdl/psp2/psp2.h @@ -34,19 +34,21 @@ public:  	OSystem_PSP2(Common::String baseConfigName = "scummvm.ini");  	virtual ~OSystem_PSP2() {} -	virtual void init(); -	virtual void initBackend(); -	virtual bool hasFeature(Feature f); -	virtual void logMessage(LogMessageType::Type type, const char *message); +	virtual void init() override; +	virtual void initBackend() override; +	virtual bool hasFeature(Feature f) override; +	virtual void setFeatureState(Feature f, bool enable) override; +	virtual bool getFeatureState(Feature f) override; +	virtual void logMessage(LogMessageType::Type type, const char *message) override;  protected:  	// Base string for creating the default path and filename  	// for the configuration file  	Common::String _baseConfigName; -	virtual Common::String getDefaultConfigFileName(); +	virtual Common::String getDefaultConfigFileName() override; -	virtual Common::WriteStream *createLogFile(); +	virtual Common::WriteStream *createLogFile() override;  };  #endif diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg index 30d2aa3db6..7dc58f4a61 100644 --- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg +++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg @@ -33,7 +33,7 @@  :"ScummVM"  ; UID is the app's UID -#{"ScummVM S60v3"},(0xA0000657),1,80,0 +#{"ScummVM S60v3"},(0xA0000657),2,00,0  ;Supports Series 60 v 3.0  [0x101F7961], 0, 0, 0, {"Series60ProductID"} diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index f9e0d04064..7729145eac 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -30,9 +30,17 @@  #include <stdlib.h>  #include <stdio.h>  #include <unistd.h> -#include <e32def.h> +#if (__GNUC__ && __cplusplus) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-local-addr" +#endif +#include <e32def.h>  #include <e32std.h> +#if (__GNUC__ && __cplusplus) +#pragma GCC diagnostic pop +#endif +  #include <libc\math.h>  /* define pi */ @@ -53,6 +61,17 @@ typedef unsigned short int uint16;  typedef signed short int int16;  typedef unsigned long int uint32;  typedef signed long int int32; +typedef signed long long int64; +typedef unsigned long long uint64; + +#ifdef __cplusplus +namespace std +	{ + +	using ::size_t; + +	} // namespace std +#endif  // Define SCUMMVM_DONT_DEFINE_TYPES to prevent scummsys.h from trying to  // re-define those data types. diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp index 80d7313a8c..267448c859 100644 --- a/backends/vkeybd/virtual-keyboard.cpp +++ b/backends/vkeybd/virtual-keyboard.cpp @@ -38,21 +38,21 @@  namespace Common { -VirtualKeyboard::VirtualKeyboard() : _currentMode(0) { +VirtualKeyboard::VirtualKeyboard() : +		_currentMode(nullptr), +		_fileArchive(nullptr, DisposeAfterUse::NO) {  	assert(g_system);  	_system = g_system;  	_parser = new VirtualKeyboardParser(this);  	_kbdGUI = new VirtualKeyboardGUI(this);  	_submitKeys = _loaded = false; -	_fileArchive = 0;  }  VirtualKeyboard::~VirtualKeyboard() {  	deleteEvents();  	delete _kbdGUI;  	delete _parser; -	delete _fileArchive;  }  void VirtualKeyboard::deleteEvents() { @@ -74,33 +74,31 @@ void VirtualKeyboard::reset() {  	_kbdGUI->reset();  } -bool VirtualKeyboard::openPack(const String &packName, const FSNode &node) { -	if (node.getChild(packName + ".xml").exists()) { -		_fileArchive = new FSDirectory(node, 1); +bool VirtualKeyboard::openPack(const String &packName, Archive *searchPath, DisposeAfterUse::Flag disposeSearchPath) { +	if (searchPath->hasFile(packName + ".xml")) { +		_fileArchive.reset(searchPath, disposeSearchPath);  		// uncompressed keyboard pack -		if (!_parser->loadFile(node.getChild(packName + ".xml"))) { -			delete _fileArchive; -			_fileArchive = 0; +		if (!_parser->loadStream(searchPath->createReadStreamForMember(packName + ".xml"))) { +			_fileArchive.reset();  			return false;  		}  		return true;  	} -	if (node.getChild(packName + ".zip").exists()) { +	if (searchPath->hasFile(packName + ".zip")) {  		// compressed keyboard pack -		_fileArchive = makeZipArchive(node.getChild(packName + ".zip")); +		Archive *zip = makeZipArchive(searchPath->createReadStreamForMember(packName + ".zip")); +		_fileArchive.reset(zip, DisposeAfterUse::YES);  		if (_fileArchive && _fileArchive->hasFile(packName + ".xml")) {  			if (!_parser->loadStream(_fileArchive->createReadStreamForMember(packName + ".xml"))) { -				delete _fileArchive; -				_fileArchive = 0; +				_fileArchive.reset();  				return false;  			}  		} else {  			warning("Could not find %s.xml file in %s.zip virtual keyboard pack", packName.c_str(), packName.c_str()); -			delete _fileArchive; -			_fileArchive = 0; +			_fileArchive.reset();  			return false;  		} @@ -113,19 +111,18 @@ bool VirtualKeyboard::openPack(const String &packName, const FSNode &node) {  bool VirtualKeyboard::loadKeyboardPack(const String &packName) {  	_kbdGUI->initSize(_system->getOverlayWidth(), _system->getOverlayHeight()); -	delete _fileArchive; -	_fileArchive = 0; +	_fileArchive.reset();  	_loaded = false;  	bool opened = false;  	if (ConfMan.hasKey("vkeybdpath")) -		opened = openPack(packName, FSNode(ConfMan.get("vkeybdpath"))); +		opened = openPack(packName, new FSDirectory(ConfMan.get("vkeybdpath")), DisposeAfterUse::YES);  	else if (ConfMan.hasKey("extrapath")) -		opened = openPack(packName, FSNode(ConfMan.get("extrapath"))); +		opened = openPack(packName, new FSDirectory(ConfMan.get("extrapath")), DisposeAfterUse::YES); -	// fallback to the current dir +	// fallback to SearchMan  	if (!opened) -		opened = openPack(packName, FSNode(".")); +		opened = openPack(packName, &SearchMan, DisposeAfterUse::NO);  	if (opened) {  		_parser->setParseMode(VirtualKeyboardParser::kParseFull); @@ -136,8 +133,7 @@ bool VirtualKeyboard::loadKeyboardPack(const String &packName) {  		} else {  			warning("Error parsing the virtual keyboard pack '%s'", packName.c_str()); -			delete _fileArchive; -			_fileArchive = 0; +			_fileArchive.reset();  		}  	} else {  		warning("Virtual keyboard disabled due to missing pack file"); diff --git a/backends/vkeybd/virtual-keyboard.h b/backends/vkeybd/virtual-keyboard.h index 3b2b2196bd..38139e2ad8 100644 --- a/backends/vkeybd/virtual-keyboard.h +++ b/backends/vkeybd/virtual-keyboard.h @@ -226,7 +226,7 @@ public:  protected:  	OSystem *_system; -	Archive *_fileArchive; +	DisposablePtr<Archive> _fileArchive;  	friend class VirtualKeyboardGUI;  	VirtualKeyboardGUI *_kbdGUI; @@ -237,7 +237,7 @@ protected:  	VirtualKeyboardParser *_parser;  	void reset(); -	bool openPack(const String &packName, const FSNode &node); +	bool openPack(const String &packName, Archive *searchPath, DisposeAfterUse::Flag disposeSearchPath);  	void deleteEvents();  	bool checkModeResolutions();  	void switchMode(Mode *newMode); | 
