Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37840707
en ru br
Репозитории ALT
S:1.3.3-alt1
5.1: 1.1.2-alt1.2
4.1: 1.1.2-alt1
4.0: 1.1.2-alt1
3.0: 1.0.0-alt2.1
www.altlinux.org/Changes

Группа :: Игры/Аркады
Пакет: trackballs

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: trackballs-1.1.4-rh555877.patch
Скачать


--- trackballs-1.1.4/src/settingsMode.cc	2007-04-07 15:18:40.000000000 +0200
+++ trackballs.new/src/settingsMode.cc	2010-01-18 02:52:57.000000000 +0100
@@ -38,7 +38,7 @@ using namespace std;
 SettingsMode *SettingsMode::settingsMode;
 
 /* Not properly abstracted, part of global stuff in mmad.cc */
-extern int screenResolutions[5][2],nScreenResolutions;
+extern int screenResolutions[11][2],nScreenResolutions;
 extern void changeScreenResolution();
 
 void SettingsMode::init() {
@@ -61,17 +61,23 @@
 void SettingsMode::deactivated() {
   Settings *settings=Settings::settings;
 
-  settings->save(); 
-  regenerateSphereDisplaylists();  /* In case we have changed detail level */
-
   /* Switch back to the last verified resolution */
   if(settings->resolution != restoreResolution || settings->colorDepth != restoreColorDepth) {
 	settings->resolution = restoreResolution;
 	settings->colorDepth = restoreColorDepth;
+        fprintf(stderr,
+                "New video mode not confirmed, restoring old mode\n");
 	changeScreenResolution();
+        if (!screen) {
+          fprintf(stderr, "Error failed to restore video mode!\n");
+          exit(1);
+        }
   }
 
+  settings->save(); 
+  regenerateSphereDisplaylists();  /* In case we have changed detail level */
 }
+
 void SettingsMode::display() {
   int w,h,i;
   int menucount;
@@ -233,7 +239,13 @@
 	  settings->colorDepth = restoreColorDepth;
 	  resolution=restoreResolution;
 	  colorDepth=restoreColorDepth;
+	  fprintf(stderr,
+	          "New video mode not confirmed, restoring old mode\n");
 	  changeScreenResolution();
+	  if (!screen) {
+	    fprintf(stderr, "Error failed to restore video mode!\n");
+	    exit(1);
+	  }
 	}
   }
 }
@@ -266,6 +278,21 @@
 	settings->resolution=resolution;
 	settings->colorDepth=colorDepth;
 	changeScreenResolution();
+	if (!screen) {
+	  /* Failed miserably */
+	  fprintf(stderr,
+	          "Error failed to set new video mode, restoring old mode\n");
+	  settings->resolution = restoreResolution;
+	  settings->colorDepth = restoreColorDepth;
+	  resolution=restoreResolution;
+	  colorDepth=restoreColorDepth;
+	  changeScreenResolution();
+	  if (!screen) {
+	    fprintf(stderr, "Error failed to restore video mode!\n");
+	    exit(1);
+	  }
+	  break;
+	}
 	testingResolution=10.0;
 	break;
   case MENU_RESOLUTION_OK:
@@ -279,13 +306,30 @@
 	settings->colorDepth = restoreColorDepth;
 	resolution=restoreResolution;
 	colorDepth=restoreColorDepth;
+        fprintf(stderr,
+                "New video mode cancelled, restoring old mode\n");
 	changeScreenResolution();
+        if (!screen) {
+          fprintf(stderr, "Error failed to restore video mode!\n");
+          exit(1);
+        }
 	break;
 
 
   case MENU_WINDOWED:
 	Settings::settings->is_windowed = Settings::settings->is_windowed ? 0 : 1;
-    changeScreenResolution();
+        changeScreenResolution();
+	if (!screen) {
+	  /* Failed miserably */
+	  fprintf(stderr,
+	          "Error failed to switch fullscreen <-> windowed\n");
+	  Settings::settings->is_windowed = Settings::settings->is_windowed ? 0 : 1;
+          changeScreenResolution();
+	  if (!screen) {
+	    fprintf(stderr, "Error failed to restore old mode!\n");
+	    exit(1);
+	  }
+	}
 	break;
   case MENU_GFX_DETAILS:
 	// Change level of graphic details */
--- trackballs-1.1.4/src/mmad.cc~	2007-05-17 15:24:06.000000000 +0200
+++ trackballs-1.1.4/src/mmad.cc	2010-01-18 03:12:09.000000000 +0100
@@ -64,7 +64,7 @@ int silent=0;
 int debug_joystick,repair_joystick;
 
 char effectiveShareDir[256];
-int screenResolutions[5][2] = {{640,480}, {800,600}, {1024,768}, {1280,1024}, {1600,1200}}, nScreenResolutions=5;
+int screenResolutions[11][2] = {{640,480}, {800,600}, {1024,768}, {1280,1024}, {1600,1200}, {1280,800}, {1366,768}, {1440,900}, {1680,1050}, {1920,1080}, {1920,1200}}, nScreenResolutions=11;
 
 void changeScreenResolution() {
   screenWidth = screenResolutions[Settings::settings->resolution][0]; 
@@ -492,6 +492,17 @@ void innerMain(void *closure,int argc,ch
 	    else if(event.key.keysym.sym == 'f' && SDL_GetModState() & KMOD_CTRL) {
 	      Settings::settings->is_windowed = Settings::settings->is_windowed ? 0 : 1;
 	      changeScreenResolution();
+              if (!screen) {
+                /* Failed miserably */
+                fprintf(stderr,
+                        "Error failed to switch fullscreen <-> windowed\n");
+                Settings::settings->is_windowed = Settings::settings->is_windowed ? 0 : 1;
+                changeScreenResolution();
+                if (!screen) {
+                  fprintf(stderr, "Error failed to restore old mode!\n");
+                  exit(1);
+                }
+              }
 	      /* Flush all events that occured while switching screen
 		 resolution */
 	      while(SDL_PollEvent(&event)) {}	      
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin