Merge lp:~timfelgentreff/stratagus/timfelgentreff-zoomeable-view into lp:stratagus

Proposed by timfelgentreff
Status: Merged
Approved by: Pali
Approved revision: 8707
Merged at revision: 8727
Proposed branch: lp:~timfelgentreff/stratagus/timfelgentreff-zoomeable-view
Merge into: lp:stratagus
Diff against target: 337 lines (+131/-17)
7 files modified
src/include/video.h (+8/-0)
src/stratagus/stratagus.cpp (+28/-1)
src/ui/interface.cpp (+7/-0)
src/ui/script_ui.cpp (+18/-0)
src/video/movie.cpp (+17/-8)
src/video/sdl.cpp (+37/-3)
src/video/video.cpp (+16/-5)
To merge this branch: bzr merge lp:~timfelgentreff/stratagus/timfelgentreff-zoomeable-view
Reviewer Review Type Date Requested Status
Pali Approve
Joris Dauphin Approve
Review via email: mp+159929@code.launchpad.net

Description of the change

This branch adds an option to zoom the viewport using opengl. This is particularily useful when playing on tablets using the touchscreen, as the zoomed view provides large targets. Also, it looks retro with the pixelation :)

To post a comment you must log in.
Revision history for this message
Kyran Jackson (erstmap) wrote :

Gooooooooooooooooooood.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

oh nice this sounds like a great addition! :)

8699. By timfelgentreff

* Translate touch coordinates when using OpenGL zoom
* have the resolution option affect the viewport when using OpenGL zoom

8700. By timfelgentreff

Fix bogus rectangle select when touch events jump around

8701. By timfelgentreff

Ensure we use absolute mouse coordinates on Windows touchscreen devices in fullscreen

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

The additional commits fix mouse-coordinates and -behaviour on windows in both fullscreen and windowed modes

8702. By timfelgentreff

merge lp:stratagus

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

Hi, just wondering if you can provide any feedback on this (even if it is "we don't want this / we're not going to merge this")

Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

By a quick code review, it seems good, but I don't have touch screen, so I can't test it.
So I let someone else review/commit (Pali ?).

Revision history for this message
Pali (pali) wrote :

I see that all touchscreen code changes are only for windows platform (#ifdef USE_WIN32). I added touchscreen code to Stratagus for Nokia N900 device which is Linux (Xserver/X11) based. So this (windows) not changing anything for my N900.

But I can test OpenGL ES changes on Linux desktop and Nokia N900.

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

@Pali The relative mouse coordinates in fullscreen can on Linux be disabled by setting SDL_MOUSE_RELATIVE (or something like it) in your environment, but not on Windows, so this really only applies to Windows.

On any touchscreen device you'll need to test whether the changes from line 87 in the diff work for you, if not I'll need to #ifdef those, too. I had to click twice very often on my tablet to get rid of the selection rectangle without that change.

Besides that, could you also test whether the viewport zooming works with OpenGL ES? I tested with OpenGL on Windows and Linux (played through half the Tides of Darkness campaign with it).

Revision history for this message
Pali (pali) wrote :

Matchbox Window Manager on Maemo 5 does not support resizing application windows, so I cannot test this on Nokia N900.

But I have working OpenGL ES driver on desktop, so I can test that here.

Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

I suggest to merge if all (partial) tests pass.

Revision history for this message
Pali (pali) wrote :

I tested it on Linux in both opengl and opengles and there is problem. Resolution of monitor is 800x600 and original resolution of stratagus is 1600x900. In this mode I can move mouse only in rectangle (800/1600 * 800) x (600/900 * 600). So I cannot click on exit button, because mouse is only in subrectangle 800x600 from full screen 1600x900 (scaled to 800x600).

review: Needs Fixing
Revision history for this message
timfelgentreff (timfelgentreff) wrote :

ah, okay, i hadn't thought about scaling down. i'll get on it.

Revision history for this message
Pali (pali) wrote :

Fix also function PlayMovie in https://bazaar.launchpad.net/~stratagus/stratagus/trunk/view/head:/src/video/movie.cpp
Because YUV overlay cannot be created in OpenGL mode, that function first turn off OpenGL. And that function using Video.Width Video.Height, so movie is not scaled to full screen.

8703. By timfelgentreff

merge lp:stratagus

8704. By timfelgentreff

use Viewport dimensions for video when using OpenGL

8705. By timfelgentreff

always translate mouse coordinates if we are zoomed

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

@Pali I fixed the video dimensions and the issue with the mouse coordinates.

Revision history for this message
Pali (pali) wrote :

Ok, now scaling working fine on desktop with both OpenGL and OpenGL ES.

But there is problem if I compile stratagus with OpenGL/ES and start it with param -o (disable opengl/es). then stratagus freeze and show this error.

$ ./stratagus-dbg -d /usr/share/games/stratagus/wargus/ -v 800x600 -Z -o
...
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 130 (MIT-SHM)
  Minor opcode of failed request: 3 (X_ShmPutImage)
  Value in failed request: 0x640
  Serial number of failed request: 25
  Current serial number in output stream: 26

And other small note: Help text for -Z should not be visible/compiled if opengl/es is not enabled at compile time (like options -O and -O)

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

Since disabling OpenGL with -Z is illegal, should I just print an error message in this case and exit? Or should it be a warning and I continue launching with zoom disabled in this case?

Revision history for this message
Pali (pali) wrote :

I think that when opengl is disabled (via -o or via preferences/game menu) startagus should write error message when -Z is specified and exit. (Like when opengl is disabled and compile time and stratagus write error message that -Z is incorrect param)

8706. By timfelgentreff

Only show -Z option in help text if compiled with OpenGL(ES) and make certain that -Z only works with OpenGL enabled

8707. By timfelgentreff

print error message to stderr, not stdout

Revision history for this message
timfelgentreff (timfelgentreff) wrote :

@Pali I have clarified that using -Z implies -O. If you use "-Z -o" in that order, it now prints an error message and exits. The other way around works, which I think is consistent with what happens if you do "-o -O".

Revision history for this message
Pali (pali) wrote :

Ok, I think this merge request can be merged to trunk now.

review: Approve
Revision history for this message
Pali (pali) wrote :

@Joris: It is Ok for merging?

Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

No objection.

review: Approve
Revision history for this message
Pali (pali) wrote :

@timfelgentreff: Go ahead and merge code to trunk.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/include/video.h'
--- src/include/video.h 2013-04-13 00:57:39 +0000
+++ src/include/video.h 2013-05-01 16:44:24 +0000
@@ -53,6 +53,7 @@
53#if defined(USE_OPENGL) || defined(USE_GLES)53#if defined(USE_OPENGL) || defined(USE_GLES)
54extern char ForceUseOpenGL;54extern char ForceUseOpenGL;
55extern bool UseOpenGL;55extern bool UseOpenGL;
56extern bool ZoomNoResize;
56#endif57#endif
5758
58class CGraphic : public gcn::Image59class CGraphic : public gcn::Image
@@ -351,6 +352,13 @@
351352
352 int Width;353 int Width;
353 int Height;354 int Height;
355#if defined(USE_OPENGL) || defined(USE_GLES)
356 int ViewportWidth; /// Actual width of the window
357 int ViewportHeight; /// Actual height of the window
358#endif
359#if defined(USE_TOUCHSCREEN) && defined(USE_WIN32)
360 SDL_Cursor *blankCursor;
361#endif
354 int Depth;362 int Depth;
355 bool FullScreen;363 bool FullScreen;
356};364};
357365
=== modified file 'src/stratagus/stratagus.cpp'
--- src/stratagus/stratagus.cpp 2013-04-29 13:31:19 +0000
+++ src/stratagus/stratagus.cpp 2013-05-01 16:44:24 +0000
@@ -456,6 +456,9 @@
456 "\t-u userpath\tPath where stratagus saves preferences, log and savegame\n"456 "\t-u userpath\tPath where stratagus saves preferences, log and savegame\n"
457 "\t-v mode\t\tVideo mode resolution in format <xres>x<yres>\n"457 "\t-v mode\t\tVideo mode resolution in format <xres>x<yres>\n"
458 "\t-W\t\tWindowed video mode\n"458 "\t-W\t\tWindowed video mode\n"
459#if defined(USE_OPENGL) || defined(USE_GLES)
460 "\t-Z\t\tUse OpenGL to scale the screen to the viewport (retro-style). Implies -O.\n"
461#endif
459 "map is relative to StratagusLibPath=datapath, use ./map for relative to cwd\n",462 "map is relative to StratagusLibPath=datapath, use ./map for relative to cwd\n",
460 Parameters::Instance.applicationName.c_str());463 Parameters::Instance.applicationName.c_str());
461}464}
@@ -506,7 +509,7 @@
506void ParseCommandLine(int argc, char **argv, Parameters &parameters)509void ParseCommandLine(int argc, char **argv, Parameters &parameters)
507{510{
508 for (;;) {511 for (;;) {
509 switch (getopt(argc, argv, "ac:d:D:eE:FhiI:lN:oOP:ps:S:u:v:W?")) {512 switch (getopt(argc, argv, "ac:d:D:eE:FhiI:lN:oOP:ps:S:u:v:WZ?")) {
510 case 'a':513 case 'a':
511 EnableAssert = true;514 EnableAssert = true;
512 continue;515 continue;
@@ -550,6 +553,11 @@
550 case 'o':553 case 'o':
551 ForceUseOpenGL = 1;554 ForceUseOpenGL = 1;
552 UseOpenGL = 0;555 UseOpenGL = 0;
556 if (ZoomNoResize) {
557 fprintf(stderr, "Error: -Z only works with OpenGL enabled\n");
558 Usage();
559 ExitFatal(-1);
560 }
553 continue;561 continue;
554 case 'O':562 case 'O':
555 ForceUseOpenGL = 1;563 ForceUseOpenGL = 1;
@@ -586,12 +594,31 @@
586 Usage();594 Usage();
587 ExitFatal(-1);595 ExitFatal(-1);
588 }596 }
597#if defined(USE_OPENGL) || defined(USE_GLES)
598 if (ZoomNoResize) {
599 Video.ViewportHeight = Video.Height;
600 Video.ViewportWidth = Video.Width;
601 Video.Height = 0;
602 Video.Width = 0;
603 }
604#endif
589 continue;605 continue;
590 }606 }
591 case 'W':607 case 'W':
592 VideoForceFullScreen = 1;608 VideoForceFullScreen = 1;
593 Video.FullScreen = 0;609 Video.FullScreen = 0;
594 continue;610 continue;
611#if defined(USE_OPENGL) || defined(USE_GLES)
612 case 'Z':
613 ForceUseOpenGL = 1;
614 UseOpenGL = 1;
615 ZoomNoResize = 1;
616 Video.ViewportHeight = Video.Height;
617 Video.ViewportWidth = Video.Width;
618 Video.Height = 0;
619 Video.Width = 0;
620 continue;
621#endif
595 case -1:622 case -1:
596 break;623 break;
597 case '?':624 case '?':
598625
=== modified file 'src/ui/interface.cpp'
--- src/ui/interface.cpp 2013-04-16 17:55:29 +0000
+++ src/ui/interface.cpp 2013-05-01 16:44:24 +0000
@@ -1367,6 +1367,13 @@
1367 || ((y - buff) <= MouseY && MouseY <= (y + buff)) == 0) {1367 || ((y - buff) <= MouseY && MouseY <= (y + buff)) == 0) {
1368 MouseState = InitialMouseState;1368 MouseState = InitialMouseState;
1369 LastMouseTicks = ticks;1369 LastMouseTicks = ticks;
1370 // Reset rectangle select cursor state if we moved by a lot
1371 // - rectangle select should be a drag, not a tap
1372 if (CursorState == CursorStateRectangle
1373 && (((x - buff * 2) <= MouseX && MouseX <= (x + buff * 2)) == 0
1374 || ((y - buff * 2) <= MouseY && MouseY <= (y + buff * 2)) == 0)) {
1375 CursorState = CursorStatePoint;
1376 }
1370 }1377 }
1371 if (MouseX != x || MouseY != y) {1378 if (MouseX != x || MouseY != y) {
1372 MouseX = x;1379 MouseX = x;
13731380
=== modified file 'src/ui/script_ui.cpp'
--- src/ui/script_ui.cpp 2013-04-25 13:57:02 +0000
+++ src/ui/script_ui.cpp 2013-05-01 16:44:24 +0000
@@ -203,6 +203,23 @@
203 return 0;203 return 0;
204}204}
205205
206static int CclSetZoomNoResize(lua_State *l)
207{
208 LuaCheckArgs(l, 1);
209#if defined(USE_OPENGL) || defined(USE_GLES)
210 if (CclInConfigFile) {
211 // May have been set from the command line
212 if (!ForceUseOpenGL) {
213 ZoomNoResize = LuaToBoolean(l, 1);
214 if (ZoomNoResize) {
215 UseOpenGL = true;
216 }
217 }
218 }
219#endif
220 return 0;
221}
222
206/**223/**
207** Set the video resolution.224** Set the video resolution.
208**225**
@@ -1151,6 +1168,7 @@
11511168
1152 lua_register(Lua, "SetMaxOpenGLTexture", CclSetMaxOpenGLTexture);1169 lua_register(Lua, "SetMaxOpenGLTexture", CclSetMaxOpenGLTexture);
1153 lua_register(Lua, "SetUseOpenGL", CclSetUseOpenGL);1170 lua_register(Lua, "SetUseOpenGL", CclSetUseOpenGL);
1171 lua_register(Lua, "SetZoomNoResize", CclSetZoomNoResize);
1154 lua_register(Lua, "SetVideoResolution", CclSetVideoResolution);1172 lua_register(Lua, "SetVideoResolution", CclSetVideoResolution);
1155 lua_register(Lua, "GetVideoResolution", CclGetVideoResolution);1173 lua_register(Lua, "GetVideoResolution", CclGetVideoResolution);
1156 lua_register(Lua, "SetVideoFullScreen", CclSetVideoFullScreen);1174 lua_register(Lua, "SetVideoFullScreen", CclSetVideoFullScreen);
11571175
=== modified file 'src/video/movie.cpp'
--- src/video/movie.cpp 2013-02-08 17:53:21 +0000
+++ src/video/movie.cpp 2013-05-01 16:44:24 +0000
@@ -175,6 +175,15 @@
175{175{
176 char buffer[PATH_MAX];176 char buffer[PATH_MAX];
177177
178 int videoWidth, videoHeight;
179#if defined(USE_OPENGL) || defined(USE_GLES)
180 videoWidth = Video.ViewportWidth;
181 videoHeight = Video.ViewportHeight;
182#else
183 videoWidth = Video.Width;
184 videoHeight = Video.Height;
185#endif
186
178 LibraryFileName(name.c_str(), buffer, sizeof(buffer));187 LibraryFileName(name.c_str(), buffer, sizeof(buffer));
179188
180 CFile f;189 CFile f;
@@ -195,14 +204,14 @@
195 SDL_Rect rect;204 SDL_Rect rect;
196205
197 if (data.tinfo.frame_width * 300 / 4 > data.tinfo.frame_height * 100) {206 if (data.tinfo.frame_width * 300 / 4 > data.tinfo.frame_height * 100) {
198 rect.w = Video.Width;207 rect.w = videoWidth;
199 rect.h = Video.Width * data.tinfo.frame_height / data.tinfo.frame_width;208 rect.h = videoWidth * data.tinfo.frame_height / data.tinfo.frame_width;
200 rect.x = 0;209 rect.x = 0;
201 rect.y = (Video.Height - rect.h) / 2;210 rect.y = (videoHeight - rect.h) / 2;
202 } else {211 } else {
203 rect.w = Video.Height * data.tinfo.frame_width / data.tinfo.frame_height;212 rect.w = videoHeight * data.tinfo.frame_width / data.tinfo.frame_height;
204 rect.h = Video.Height;213 rect.h = videoHeight;
205 rect.x = (Video.Width - rect.w) / 2;214 rect.x = (videoWidth - rect.w) / 2;
206 rect.y = 0;215 rect.y = 0;
207 }216 }
208217
@@ -210,7 +219,7 @@
210 // When SDL_OPENGL is used, it is not possible to call SDL_CreateYUVOverlay, so turn temporary OpenGL off219 // When SDL_OPENGL is used, it is not possible to call SDL_CreateYUVOverlay, so turn temporary OpenGL off
211 // With GLES is all ok220 // With GLES is all ok
212 if (UseOpenGL) {221 if (UseOpenGL) {
213 SDL_SetVideoMode(Video.Width, Video.Height, Video.Depth, SDL_GetVideoSurface()->flags & ~SDL_OPENGL);222 SDL_SetVideoMode(Video.ViewportWidth, Video.ViewportHeight, Video.Depth, SDL_GetVideoSurface()->flags & ~SDL_OPENGL);
214 }223 }
215#endif224#endif
216225
@@ -291,7 +300,7 @@
291300
292#ifdef USE_OPENGL301#ifdef USE_OPENGL
293 if (UseOpenGL) {302 if (UseOpenGL) {
294 SDL_SetVideoMode(Video.Width, Video.Height, Video.Depth, SDL_GetVideoSurface()->flags | SDL_OPENGL);303 SDL_SetVideoMode(Video.ViewportWidth, Video.ViewportHeight, Video.Depth, SDL_GetVideoSurface()->flags | SDL_OPENGL);
295 ReloadOpenGL();304 ReloadOpenGL();
296 }305 }
297#endif306#endif
298307
=== modified file 'src/video/sdl.cpp'
--- src/video/sdl.cpp 2013-04-13 00:57:39 +0000
+++ src/video/sdl.cpp 2013-05-01 16:44:24 +0000
@@ -270,7 +270,7 @@
270270
271 InitOpenGLExtensions();271 InitOpenGLExtensions();
272272
273 glViewport(0, 0, (GLsizei)Video.Width, (GLsizei)Video.Height);273 glViewport(0, 0, (GLsizei)Video.ViewportWidth, (GLsizei)Video.ViewportHeight);
274274
275#ifdef USE_OPENGL275#ifdef USE_OPENGL
276 glMatrixMode(GL_PROJECTION);276 glMatrixMode(GL_PROJECTION);
@@ -628,11 +628,23 @@
628 Video.Depth = 32;628 Video.Depth = 32;
629 }629 }
630630
631#if defined(USE_OPENGL) || defined(USE_GLES)
632 if (!Video.ViewportWidth || !Video.ViewportHeight) {
633 Video.ViewportWidth = Video.Width;
634 Video.ViewportHeight = Video.Height;
635 }
636 TheScreen = SDL_SetVideoMode(Video.ViewportWidth, Video.ViewportHeight, Video.Depth, flags);
637#else
631 TheScreen = SDL_SetVideoMode(Video.Width, Video.Height, Video.Depth, flags);638 TheScreen = SDL_SetVideoMode(Video.Width, Video.Height, Video.Depth, flags);
639#endif
632 if (TheScreen && (TheScreen->format->BitsPerPixel != 16640 if (TheScreen && (TheScreen->format->BitsPerPixel != 16
633 && TheScreen->format->BitsPerPixel != 32)) {641 && TheScreen->format->BitsPerPixel != 32)) {
634 // Only support 16 and 32 bpp, default to 16642 // Only support 16 and 32 bpp, default to 16
643#if defined(USE_OPENGL) || defined(USE_GLES)
644 TheScreen = SDL_SetVideoMode(Video.ViewportWidth, Video.ViewportHeight, 16, flags);
645#else
635 TheScreen = SDL_SetVideoMode(Video.Width, Video.Height, 16, flags);646 TheScreen = SDL_SetVideoMode(Video.Width, Video.Height, 16, flags);
647#endif
636 }648 }
637 if (TheScreen == NULL) {649 if (TheScreen == NULL) {
638 fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",650 fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
@@ -643,8 +655,17 @@
643 Video.FullScreen = (TheScreen->flags & SDL_FULLSCREEN) ? 1 : 0;655 Video.FullScreen = (TheScreen->flags & SDL_FULLSCREEN) ? 1 : 0;
644 Video.Depth = TheScreen->format->BitsPerPixel;656 Video.Depth = TheScreen->format->BitsPerPixel;
645657
658#if defined(USE_TOUCHSCREEN) && defined(USE_WIN32)
659 // Must not allow SDL to switch to relative mouse coordinates
660 // with touchscreen when going fullscreen. So we don't hide the
661 // cursor, but instead set a transparent 1px cursor
662 Uint8 emptyCursor[] = {'\0'};
663 Video.blankCursor = SDL_CreateCursor(emptyCursor, emptyCursor, 1, 1, 0, 0);
664 SDL_SetCursor(Video.blankCursor);
665#else
646 // Turn cursor off, we use our own.666 // Turn cursor off, we use our own.
647 SDL_ShowCursor(0);667 SDL_ShowCursor(SDL_DISABLE);
668#endif
648669
649 // Make default character translation easier670 // Make default character translation easier
650 SDL_EnableUNICODE(1);671 SDL_EnableUNICODE(1);
@@ -797,8 +818,15 @@
797** @param callbacks Callback structure for events.818** @param callbacks Callback structure for events.
798** @param event SDL event structure pointer.819** @param event SDL event structure pointer.
799*/820*/
800static void SdlDoEvent(const EventCallback &callbacks, const SDL_Event &event)821static void SdlDoEvent(const EventCallback &callbacks, SDL_Event &event)
801{822{
823#if (defined(USE_OPENGL) || defined(USE_GLES))
824 // Scale mouse-coordinates to viewport
825 if (ZoomNoResize && (event.type & (SDL_MOUSEBUTTONUP | SDL_MOUSEBUTTONDOWN | SDL_MOUSEMOTION))) {
826 event.button.x = (Uint16)floor(event.button.x * float(Video.Width) / Video.ViewportWidth);
827 event.button.y = (Uint16)floor(event.button.y * float(Video.Height) / Video.ViewportHeight);
828 }
829#endif
802 switch (event.type) {830 switch (event.type) {
803 case SDL_MOUSEBUTTONDOWN:831 case SDL_MOUSEBUTTONDOWN:
804 InputMouseButtonPress(callbacks, SDL_GetTicks(), event.button.button);832 InputMouseButtonPress(callbacks, SDL_GetTicks(), event.button.button);
@@ -1151,10 +1179,16 @@
1151 }1179 }
1152 }1180 }
11531181
1182#ifndef USE_TOUCHSCREEN
1183 // Cannot hide cursor on Windows with touchscreen, as it switches
1184 // to relative mouse coordinates in fullscreen. See above initial
1185 // call to ShowCursor
1186 //
1154 // Windows shows the SDL cursor when starting in fullscreen mode1187 // Windows shows the SDL cursor when starting in fullscreen mode
1155 // then switching to window mode. This hides the cursor again.1188 // then switching to window mode. This hides the cursor again.
1156 SDL_ShowCursor(SDL_ENABLE);1189 SDL_ShowCursor(SDL_ENABLE);
1157 SDL_ShowCursor(SDL_DISABLE);1190 SDL_ShowCursor(SDL_DISABLE);
1191#endif
11581192
1159#if defined(USE_OPENGL) || defined(USE_GLES)1193#if defined(USE_OPENGL) || defined(USE_GLES)
1160 if (UseOpenGL) {1194 if (UseOpenGL) {
11611195
=== modified file 'src/video/video.cpp'
--- src/video/video.cpp 2013-04-13 00:57:39 +0000
+++ src/video/video.cpp 2013-05-01 16:44:24 +0000
@@ -168,6 +168,7 @@
168#if defined(USE_OPENGL) || defined(USE_GLES)168#if defined(USE_OPENGL) || defined(USE_GLES)
169char ForceUseOpenGL;169char ForceUseOpenGL;
170bool UseOpenGL; /// Use OpenGL170bool UseOpenGL; /// Use OpenGL
171bool ZoomNoResize;
171#endif172#endif
172173
173char VideoForceFullScreen; /// fullscreen set from commandline174char VideoForceFullScreen; /// fullscreen set from commandline
@@ -289,14 +290,24 @@
289 UI.Minimap.FreeOpenGL();290 UI.Minimap.FreeOpenGL();
290 }291 }
291#endif292#endif
293 TheScreen = SDL_SetVideoMode(w, h, TheScreen->format->BitsPerPixel, TheScreen->flags);
294#if defined(USE_OPENGL) || defined(USE_GLES)
295 ViewportWidth = w;
296 ViewportHeight = h;
297 if (ZoomNoResize) {
298 ReloadOpenGL();
299 } else {
300 Width = w;
301 Height = h;
302 SetClipping(0, 0, Video.Width - 1, Video.Height - 1);
303 if (UseOpenGL) {
304 ReloadOpenGL();
305 }
306 }
307#else
292 Width = w;308 Width = w;
293 Height = h;309 Height = h;
294 TheScreen = SDL_SetVideoMode(w, h, TheScreen->format->BitsPerPixel, TheScreen->flags);
295 SetClipping(0, 0, Video.Width - 1, Video.Height - 1);310 SetClipping(0, 0, Video.Width - 1, Video.Height - 1);
296#if defined(USE_OPENGL) || defined(USE_GLES)
297 if (UseOpenGL) {
298 ReloadOpenGL();
299 }
300#endif311#endif
301 return true;312 return true;
302 }313 }

Subscribers

People subscribed via source and target branches

to status/vote changes: