Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37713497
en ru br
Репозитории ALT

Группа :: Игры/Прочее
Пакет: shippy

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

Патч: shippy-1.5.0-sdl2-fs-toggle.patch
Скачать


diff -up shippy-1.5.0/shipsdl2.c~ shippy-1.5.0/shipsdl2.c
--- shippy-1.5.0/shipsdl2.c~	2019-05-18 17:27:52.000000000 +0200
+++ shippy-1.5.0/shipsdl2.c	2019-05-20 17:10:32.618036429 +0200
@@ -1,4 +1,5 @@
 #include <string.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <SDL2/SDL.h>
 #include <SDL2/SDL_mixer.h>
@@ -29,6 +30,7 @@ SDL_Texture *BackBuffer = NULL;
 SDL_Texture *Graphics = NULL;
 SDL_Joystick *Joystick = NULL;
 Uint8 key[1337];
+static bool fullscreen = true;
 
 SDL_Rect src;
 SDL_Rect dest;
@@ -212,8 +215,10 @@ void SYSTEM_CLEANBMP()
 void SYSTEM_SETVID()
 {
 	Uint32 flags = SDL_WINDOW_FULLSCREEN;
-	if (start_windowed)
+	if (start_windowed) {
 		flags &= ~SDL_WINDOW_FULLSCREEN;
+		fullscreen = false;
+	}
 	screen = SDL_CreateWindow("Shippy1984 by Ryan Broomfield SDL2 VERSION", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, screen_width, screen_height, flags);
 	SDL_ShowCursor(SDL_DISABLE);
 	renderer = SDL_CreateRenderer(screen, -1, 0);
@@ -482,6 +487,12 @@ void SYSTEM_IDLE()
 				key[keyIndx] = 0;
 			}
 		}
+		if ((event.type == SDL_KEYDOWN) && key[SHIPPY_LALT] &&
+		    (event.key.keysym.sym == SDLK_RETURN)) {
+			fullscreen = !fullscreen;
+			SDL_SetWindowFullscreen(screen,
+					fullscreen ? SDL_WINDOW_FULLSCREEN : 0);
+		}
 	}
 
 }
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin