[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl_gl.cpp,1.46,1.47
Travis Howell
kirben at users.sourceforge.net
Sat Jul 5 06:42:08 CEST 2003
Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1:/tmp/cvs-serv9946/backends/sdl
Modified Files:
sdl_gl.cpp
Log Message:
Add more OpenGL fixes, patch #762815
Index: sdl_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl_gl.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- sdl_gl.cpp 3 Jul 2003 19:12:24 -0000 1.46
+++ sdl_gl.cpp 5 Jul 2003 13:41:14 -0000 1.47
@@ -222,6 +222,44 @@
Gmask,
Bmask,
Amask);
+
+ tmpBlackRect.x = 0;
+ tmpBlackRect.y = 0;
+ tmpBlackRect.w = _screenWidth;
+ tmpBlackRect.h = 256-_screenHeight-_glScreenStart;
+
+ if (!_adjustAspectRatio) {
+ // Don't use the whole screen (black borders)
+ fb2gl.init(0, 0, 0, 15, _glFlags);
+ _glScreenStart = _glBorderHeight;
+
+ // Top black border
+ SDL_Rect blackrect = {
+ 0,
+ 0, // _glScreenStart,
+ _screenWidth,
+ _newShakePos + _glScreenStart
+ };
+
+ SDL_FillRect(tmpSurface, &blackrect, 0);
+ fb2gl.blit16(tmpSurface, 1, &blackrect, 0, 0);
+
+ // Bottom black border
+ int _glBottomOfGameScreen = _screenHeight +
+ _glScreenStart + _currentShakePos;
+
+ tmpBlackRect.h = _glBottomOfTexture -
+ _glBottomOfGameScreen;
+
+ SDL_FillRect(tmpSurface, &tmpBlackRect, 0);
+ fb2gl.blit16(tmpSurface, 1, &tmpBlackRect, 0,
+ _glBottomOfGameScreen);
+ } else {
+ // Use the whole screen
+ fb2gl.init(0, 0, 0, 72, _glFlags);
+ _glScreenStart = 0;
+ }
+
} else { // SDL backend
_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen,
_tmpScreenWidth,
@@ -242,12 +280,7 @@
Gmask,
Bmask,
Amask);
-
- tmpBlackRect.x = 0;
- tmpBlackRect.y = 0;
- tmpBlackRect.w = _screenWidth;
- tmpBlackRect.h = 256-_screenHeight-_glScreenStart;
-
+
if (_tmpscreen == NULL)
error("_tmpscreen failed");
@@ -546,10 +579,11 @@
_adjustAspectRatio ^= true;
if (_usingOpenGL) {
- if (_adjustAspectRatio) {
+ if (!_adjustAspectRatio) {
// Don't use the whole screen (black borders)
fb2gl.init(0, 0, 0, 15, _glFlags);
_glScreenStart = _glBorderHeight;
+
// Top black border
SDL_Rect blackrect = {
0,
More information about the Scummvm-git-logs
mailing list