Ticket #8251: sdl_gl.patch

File sdl_gl.patch, 3.0 KB (added by SF/luke_br, 21 years ago)

sdl_gl.cpp fixes

Line 
159c59
2< SDL_Rect tmpBlackRect; // Black rectangle at end of the GL screen
3---
4> SDL_Rect tmpBlackRect; // Bottom black border
561a62
6> int _glBorderHeight; // Used if using black borders
780c81
8< _glBilinearFilter = true;
9---
10> _glBilinearFilter = false;
1182a84
12> _glBorderHeight = 0; // Forces _glScreenStart to always be 0
13170c172
14< _scaleFactor = _usingOpenGL ? 2 : 1;
15---
16> _scaleFactor = 1; //_usingOpenGL ? 2 : 1;
17180c182
18< if (_mode != GFX_NORMAL)
19---
20> if (_mode != GFX_NORMAL) {
21182c184,185
22<
23---
24> }
25>
26199a203,215
27>
28> // Note: Our GL screen is vertically stretched (yfix = 15).
29> // That makes visible only 320x240 of the GL screen.
30> // 320x240 visible in GL screen => yfix = 15
31> // 320x200 visible in GL screen => yfix = 72
32> int yfix = 15;
33> _glBorderHeight = 0;
34> if (_screenHeight == 200) {
35> // If we are not using borders, we want 320x200 visible
36> yfix = _glScreenStart? 15: 72;
37> // 20 (top) + 200 (height) + 20 (bottom) = 240
38> _glBorderHeight = 20;
39> }
40201,202c217
41< fb2gl.init(_glWindow.w, _glWindow.h, 0, _glScreenStart? 15: 70,
42< _glFlags);
43---
44> fb2gl.init(_glWindow.w, _glWindow.h, 0, yfix, _glFlags);
45339a355
46> // Top black border
47342c358
48< _glScreenStart,
49---
50> 0, // _glScreenStart,
51419c435
52< if (!(_full_screen) && (tmpBlackRect.h > 0)) {
53---
54> if (_adjustAspectRatio && tmpBlackRect.h > 0) {
55565c581,599
56< _glScreenStart = 20;
57---
58> _glScreenStart = _glBorderHeight;
59> // Top black border
60> SDL_Rect blackrect = {
61> 0,
62> 0, // _glScreenStart,
63> _screenWidth,
64> _newShakePos + _glScreenStart
65> };
66>
67> SDL_FillRect(tmpSurface, &blackrect, 0);
68> fb2gl.blit16(tmpSurface, 1, &blackrect, 0, 0);
69>
70> // Bottom black border
71> int _glBottomOfGameScreen = _screenHeight +
72> _glScreenStart + _currentShakePos;
73>
74> tmpBlackRect.h = _glBottomOfTexture -
75> _glBottomOfGameScreen;
76>
77567c601,602
78< fb2gl.blit16(tmpSurface, 1, &tmpBlackRect, 0, 0);
79---
80> fb2gl.blit16(tmpSurface, 1, &tmpBlackRect, 0,
81> _glBottomOfGameScreen);
82570c605
83< fb2gl.init(0, 0, 0, 70, _glFlags);
84---
85> fb2gl.init(0, 0, 0, 72, _glFlags);
86574,575c609,610
87< SDL_Rect full = {0, 0, _screenWidth, _screenHeight};
88< fb2gl.blit16(_tmpscreen, 1, &full, 0, _glScreenStart);
89---
90> SDL_Rect redraw = {0, 0, _screenWidth, _screenHeight};
91> fb2gl.blit16(_tmpscreen, 1, &redraw, 0, _glScreenStart);
92589a625,626
93> _scaleFactor = 1;
94> _scaler_proc = Normal1x;
95605c642,643
96< if (_usingOpenGL)
97---
98> if (_usingOpenGL) {
99> _glBilinearFilter = false;
100606a645
101> }
102611,613c650,652
103< if (_usingOpenGL) {
104< SDL_Rect full = {0, 0, _screenWidth, _screenHeight};
105< fb2gl.blit16(_tmpscreen, 1, &full, 0, _glScreenStart);
106---
107> /* if (_usingOpenGL) {
108> SDL_Rect redraw = {0, 0, _screenWidth, _screenHeight};
109> fb2gl.blit16(_tmpscreen, 1, &redraw, 0, _glScreenStart);
110615c654
111< }
112---
113> }*/
114622d660
115<