[Scummvm-cvs-logs] scummvm master -> 86db21467edd666e037a76bf735eccd9e7977d8a

lordhoto lordhoto at gmail.com
Sun Dec 13 23:54:07 CET 2015


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
898773e12f OPENGLSDL: Set proper mouse emulation dimensions.
86db21467e SDL: Slight formatting fixes.


Commit: 898773e12f7115e4f67b55c27fd87e2c796e598a
    https://github.com/scummvm/scummvm/commit/898773e12f7115e4f67b55c27fd87e2c796e598a
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2015-12-13T23:53:27+01:00

Commit Message:
OPENGLSDL: Set proper mouse emulation dimensions.

Formerly we did not initialize the mouse emulation from SdlEventSource
properly. Now hopefully joysticks etc. should work fine with the SDL OpenGL
output too.

Changed paths:
    backends/graphics/openglsdl/openglsdl-graphics.cpp



diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 892dfc6..0d140ee 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "backends/graphics/openglsdl/openglsdl-graphics.h"
+#include "backends/events/sdl/sdl-events.h"
 
 #include "common/textconsole.h"
 #include "common/config-manager.h"
@@ -244,6 +245,7 @@ void OpenGLSdlGraphicsManager::notifyVideoExpose() {
 void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
 #if SDL_VERSION_ATLEAST(2, 0, 0)
 	setActualScreenSize(width, height);
+	_eventSource->resetKeyboadEmulation(width - 1, height - 1);
 #else
 	if (!_ignoreResizeEvents && _hwScreen && !(_hwScreen->flags & SDL_FULLSCREEN)) {
 		// We save that we handled a resize event here. We need to know this
@@ -404,6 +406,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
 	int actualWidth, actualHeight;
 	getWindowDimensions(&actualWidth, &actualHeight);
 	setActualScreenSize(actualWidth, actualHeight);
+	_eventSource->resetKeyboadEmulation(actualWidth - 1, actualHeight - 1);
 	return true;
 #else
 	// WORKAROUND: Working around infamous SDL bugs when switching
@@ -449,6 +452,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
 	if (_hwScreen) {
 		notifyContextCreate(rgba8888, rgba8888);
 		setActualScreenSize(_hwScreen->w, _hwScreen->h);
+		_eventSource->resetKeyboadEmulation(_hwScreen->w - 1, _hwScreen->h - 1);
 	}
 
 	// Ignore resize events (from SDL) for a few frames, if this isn't


Commit: 86db21467edd666e037a76bf735eccd9e7977d8a
    https://github.com/scummvm/scummvm/commit/86db21467edd666e037a76bf735eccd9e7977d8a
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2015-12-13T23:53:27+01:00

Commit Message:
SDL: Slight formatting fixes.

Changed paths:
    backends/events/sdl/sdl-events.cpp



diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 1e5119d..038f616 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -737,16 +737,16 @@ bool SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
 
 bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
 	int axis = ev.jaxis.value;
-	if ( axis > JOY_DEADZONE) {
+	if (axis > JOY_DEADZONE) {
 		axis -= JOY_DEADZONE;
 		event.type = Common::EVENT_MOUSEMOVE;
-	} else if ( axis < -JOY_DEADZONE ) {
+	} else if (axis < -JOY_DEADZONE) {
 		axis += JOY_DEADZONE;
 		event.type = Common::EVENT_MOUSEMOVE;
 	} else
 		axis = 0;
 
-	if ( ev.jaxis.axis == JOY_XAXIS) {
+	if (ev.jaxis.axis == JOY_XAXIS) {
 #ifdef JOY_ANALOG
 		_km.x_vel = axis / 2000;
 		_km.x_down_count = 0;
@@ -759,7 +759,6 @@ bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
 			_km.x_down_count = 0;
 		}
 #endif
-
 	} else if (ev.jaxis.axis == JOY_YAXIS) {
 #ifndef JOY_INVERT_Y
 		axis = -axis;






More information about the Scummvm-git-logs mailing list