diff src/video/qtopia/SDL_sysvideo.cc @ 481:c96e2137f9eb

Date: Sat, 31 Aug 2002 15:42:45 +0200 From: Alexandre Courbot Subject: [SDL] Qtopia port fixes/improvments -Whenever the screen is rotated, the pad is rotated as well, -Fixed a mouse bug: when tapping on the screen, the click event was often sent at the previous position of the stylus (resulting in strange behavior in Scummvm for instance) -Added the SDL_QT_INVERT_ROTATION environment variable which, when set, rotates the screen (and the mouse, and the pad) the other way. This can be useful for left-handed people.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 01 Sep 2002 00:37:24 +0000
parents 11c8a7684f74
children 969fbd4dcd4e
line wrap: on
line diff
--- a/src/video/qtopia/SDL_sysvideo.cc	Sat Aug 31 21:00:28 2002 +0000
+++ b/src/video/qtopia/SDL_sysvideo.cc	Sun Sep 01 00:37:24 2002 +0000
@@ -53,6 +53,12 @@
   //#define QTOPIA_DEBUG
 #define QT_HIDDEN_SIZE	32	/* starting hidden window size */
 
+/* Name of the environment variable used to invert the screen rotation or not:
+   Possible values:
+   !=0 : Screen is 270° rotated
+   0: Screen is 90° rotated*/
+#define SDL_QT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
+
   /* Initialization/Query functions */
   static int QT_VideoInit(_THIS, SDL_PixelFormat *vformat);
   static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
@@ -277,12 +283,15 @@
     
     current->flags = SDL_FULLSCREEN; // We always run fullscreen.
 
-    if(width <= desktop_size.width() && height <= desktop_size.height()) {
+    if(width <= desktop_size.width()
+	      && height <= desktop_size.height()) {
       current->w = desktop_size.width();
       current->h = desktop_size.height();
-    } else if(width <= desktop_size.height()
-	      && height <= desktop_size.width()) {
+    } else if(width <= desktop_size.height() && height <= desktop_size.width()) {
       // Landscape mode
+      char * envString = getenv(SDL_QT_ROTATION_ENV_NAME);
+      int envValue = envString ? atoi(envString) : 0;
+      screenRotation = envValue ? SDL_QT_ROTATION_270 : SDL_QT_ROTATION_90;
       current->h = desktop_size.width();
       current->w = desktop_size.height();
     } else {