RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.45
diff -u -r1.45 sdl-common.cpp
|
|
|
456 | 456 | |
457 | 457 | void OSystem_SDL_Common::warp_mouse(int x, int y) { |
458 | 458 | if (_mouseCurState.x != x || _mouseCurState.y != y) |
459 | | SDL_WarpMouse(x * _scaleFactor, y * _scaleFactor); |
| 459 | SDL_WarpMouse(x * _scaleFactor_hmul / _scaleFactor_hdiv, |
| 460 | y * _scaleFactor_vmul / _scaleFactor_vdiv); |
460 | 461 | } |
461 | 462 | |
462 | 463 | void OSystem_SDL_Common::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { |
… |
… |
|
656 | 657 | km.x = event->mouse.x = ev.motion.x; |
657 | 658 | km.y = event->mouse.y = ev.motion.y; |
658 | 659 | |
659 | | event->mouse.x /= _scaleFactor; |
660 | | event->mouse.y /= _scaleFactor; |
| 660 | event->mouse.x *= _scaleFactor_hdiv; |
| 661 | event->mouse.x /= _scaleFactor_hmul; |
| 662 | event->mouse.y *= _scaleFactor_vdiv; |
| 663 | event->mouse.y /= _scaleFactor_vmul; |
661 | 664 | |
662 | 665 | return true; |
663 | 666 | |
… |
… |
|
676 | 679 | break; |
677 | 680 | km.x = event->mouse.x = ev.button.x; |
678 | 681 | km.y = event->mouse.y = ev.button.y; |
679 | | event->mouse.x /= _scaleFactor; |
680 | | event->mouse.y /= _scaleFactor; |
| 682 | event->mouse.x *= _scaleFactor_hdiv; |
| 683 | event->mouse.x /= _scaleFactor_hmul; |
| 684 | event->mouse.y *= _scaleFactor_vdiv; |
| 685 | event->mouse.y /= _scaleFactor_vmul; |
681 | 686 | |
682 | 687 | return true; |
683 | 688 | |
… |
… |
|
690 | 695 | break; |
691 | 696 | event->mouse.x = ev.button.x; |
692 | 697 | event->mouse.y = ev.button.y; |
693 | | event->mouse.x /= _scaleFactor; |
694 | | event->mouse.y /= _scaleFactor; |
| 698 | event->mouse.x *= _scaleFactor_hdiv; |
| 699 | event->mouse.x /= _scaleFactor_hmul; |
| 700 | event->mouse.y *= _scaleFactor_vdiv; |
| 701 | event->mouse.y /= _scaleFactor_vmul; |
695 | 702 | return true; |
696 | 703 | |
697 | 704 | case SDL_JOYBUTTONDOWN: |
… |
… |
|
794 | 801 | } |
795 | 802 | event->mouse.x = km.x; |
796 | 803 | event->mouse.y = km.y; |
797 | | event->mouse.x /= _scaleFactor; |
798 | | event->mouse.y /= _scaleFactor; |
| 804 | event->mouse.x *= _scaleFactor_hdiv; |
| 805 | event->mouse.x /= _scaleFactor_hmul; |
| 806 | event->mouse.y *= _scaleFactor_vdiv; |
| 807 | event->mouse.y /= _scaleFactor_vmul; |
799 | 808 | return true; |
800 | 809 | |
801 | 810 | case SDL_VIDEOEXPOSE: |
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.20
diff -u -r1.20 sdl-common.h
|
|
|
124 | 124 | static OSystem *create(int gfx_mode, bool full_screen); |
125 | 125 | |
126 | 126 | protected: |
127 | | typedef void ScalerProc(uint8 *srcPtr, uint32 srcPitch, |
128 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 127 | typedef void ScalerProc(uint8 *srcPtr, uint32 srcPitch, |
| 128 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
129 | 129 | |
130 | 130 | OSystem_SDL_Common(); |
131 | 131 | virtual ~OSystem_SDL_Common(); |
… |
… |
|
150 | 150 | }; |
151 | 151 | |
152 | 152 | bool _forceFull; // Force full redraw on next update_screen |
153 | | int _scaleFactor; |
| 153 | int _scaleFactor_hmul; |
| 154 | int _scaleFactor_hdiv; |
| 155 | int _scaleFactor_vmul; |
| 156 | int _scaleFactor_vdiv; |
154 | 157 | int _mode; |
155 | 158 | bool _full_screen; |
156 | 159 | uint32 _mode_flags; |
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.28
diff -u -r1.28 sdl.cpp
|
|
|
84 | 84 | |
85 | 85 | switch(_mode) { |
86 | 86 | case GFX_2XSAI: |
87 | | _scaleFactor = 2; |
| 87 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 88 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
88 | 89 | _scaler_proc = _2xSaI; |
89 | 90 | break; |
90 | 91 | case GFX_SUPER2XSAI: |
91 | | _scaleFactor = 2; |
| 92 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 93 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
92 | 94 | _scaler_proc = Super2xSaI; |
93 | 95 | break; |
94 | 96 | case GFX_SUPEREAGLE: |
95 | | _scaleFactor = 2; |
| 97 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 98 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
96 | 99 | _scaler_proc = SuperEagle; |
97 | 100 | break; |
98 | 101 | case GFX_ADVMAME2X: |
99 | | _scaleFactor = 2; |
| 102 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 103 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
100 | 104 | _scaler_proc = AdvMame2x; |
101 | 105 | break; |
102 | 106 | case GFX_TV2X: |
103 | | _scaleFactor = 2; |
| 107 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 108 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
104 | 109 | _scaler_proc = TV2x; |
105 | 110 | break; |
106 | 111 | case GFX_DOTMATRIX: |
107 | | _scaleFactor = 2; |
| 112 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 113 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
108 | 114 | _scaler_proc = DotMatrix; |
109 | 115 | break; |
110 | 116 | |
| 117 | case GFX_RATIO800: |
| 118 | _scaleFactor_hmul = 5; |
| 119 | _scaleFactor_hdiv = 2; |
| 120 | _scaleFactor_vmul = 3; |
| 121 | _scaleFactor_vdiv = 1; |
| 122 | _scaler_proc = Ratio800; |
| 123 | break; |
| 124 | |
111 | 125 | case GFX_DOUBLESIZE: |
112 | | _scaleFactor = 2; |
| 126 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 127 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
113 | 128 | _scaler_proc = Normal2x; |
114 | 129 | break; |
115 | 130 | |
… |
… |
|
118 | 133 | warning("full screen in useless in triplesize mode, reverting to normal mode"); |
119 | 134 | goto normal_mode; |
120 | 135 | } |
121 | | _scaleFactor = 3; |
| 136 | _scaleFactor_hmul = _scaleFactor_vmul = 3; |
| 137 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
122 | 138 | _scaler_proc = Normal3x; |
123 | 139 | break; |
124 | 140 | |
125 | 141 | case GFX_NORMAL: |
126 | 142 | normal_mode:; |
127 | | _scaleFactor = 1; |
| 143 | _scaleFactor_hmul = _scaleFactor_vmul = 1; |
| 144 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
128 | 145 | _scaler_proc = Normal1x; |
129 | 146 | break; |
130 | 147 | default: |
131 | 148 | error("unknown gfx mode"); |
132 | | _scaleFactor = 1; |
| 149 | _scaleFactor_hmul = _scaleFactor_vmul = 1; |
| 150 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
133 | 151 | _scaler_proc = NULL; |
134 | 152 | } |
135 | 153 | |
… |
… |
|
143 | 161 | // |
144 | 162 | // Create the surface that contains the scaled graphics in 16 bit mode |
145 | 163 | // |
146 | | _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor, _screenHeight * _scaleFactor, 16, |
| 164 | _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv, 16, |
147 | 165 | _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE |
148 | 166 | ); |
149 | 167 | if (_hwscreen == NULL) |
… |
… |
|
172 | 190 | error("_tmpscreen failed"); |
173 | 191 | |
174 | 192 | // keyboard cursor control, some other better place for it? |
175 | | km.x_max = _screenWidth * _scaleFactor - 1; |
176 | | km.y_max = _screenHeight * _scaleFactor - 1; |
| 193 | km.x_max = _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv - 1; |
| 194 | km.y_max = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv - 1; |
177 | 195 | km.delay_time = 25; |
178 | 196 | km.last_time = 0; |
179 | 197 | } |
… |
… |
|
234 | 252 | |
235 | 253 | // If the shake position changed, fill the dirty area with blackness |
236 | 254 | if (_currentShakePos != _newShakePos) { |
237 | | SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor, _newShakePos * _scaleFactor}; |
| 255 | /* ratio: FIXME */ |
| 256 | SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _newShakePos * _scaleFactor_vmul / _scaleFactor_vdiv}; |
238 | 257 | SDL_FillRect(_hwscreen, &blackrect, 0); |
239 | 258 | |
240 | 259 | _currentShakePos = _newShakePos; |
… |
… |
|
300 | 319 | if (_scaler_proc != Normal1x) { |
301 | 320 | SDL_LockSurface(_tmpscreen); |
302 | 321 | SDL_LockSurface(_hwscreen); |
303 | | |
| 322 | |
304 | 323 | srcPitch = _tmpscreen->pitch; |
305 | 324 | dstPitch = _hwscreen->pitch; |
306 | | |
| 325 | |
307 | 326 | for(r = _dirty_rect_list; r != last_rect; ++r) { |
308 | 327 | register int dst_y = r->y + _currentShakePos; |
309 | 328 | register int dst_h = 0; |
… |
… |
|
312 | 331 | if (dst_h > _screenHeight - dst_y) |
313 | 332 | dst_h = _screenHeight - dst_y; |
314 | 333 | |
315 | | dst_y *= _scaleFactor; |
| 334 | dst_y *= _scaleFactor_vmul; |
| 335 | dst_y /= _scaleFactor_vdiv; |
316 | 336 | |
317 | 337 | _scaler_proc((byte *)_tmpscreen->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, |
318 | | (byte *)_hwscreen->pixels + r->x * 2 * _scaleFactor + dst_y * dstPitch, dstPitch, r->w, dst_h); |
| 338 | (byte *)_hwscreen->pixels + (r->x * _scaleFactor_hmul / _scaleFactor_hdiv) * 2 + dst_y*dstPitch, dstPitch, r->x, r->y, r->w, dst_h); |
319 | 339 | } |
320 | 340 | |
321 | | r->x *= _scaleFactor; |
| 341 | r->w = (r->x + r->w) * _scaleFactor_hmul / _scaleFactor_hdiv; |
| 342 | r->x *= _scaleFactor_hmul; |
| 343 | r->x /= _scaleFactor_hdiv; |
| 344 | r->w -= r->x; |
| 345 | r->h = (r->y + r->h) * _scaleFactor_vmul / _scaleFactor_vdiv; |
322 | 346 | r->y = dst_y; |
323 | | r->w *= _scaleFactor; |
324 | | r->h = dst_h * _scaleFactor; |
| 347 | r->h -= r->y; |
325 | 348 | } |
326 | 349 | |
327 | 350 | SDL_UnlockSurface(_tmpscreen); |
… |
… |
|
332 | 355 | // This is necessary if shaking is active. |
333 | 356 | if (_forceFull) { |
334 | 357 | _dirty_rect_list[0].y = 0; |
335 | | _dirty_rect_list[0].h = _screenHeight * _scaleFactor; |
| 358 | _dirty_rect_list[0].h = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv; |
336 | 359 | } |
337 | 360 | |
338 | 361 | // Finally, blit all our changes to the screen |
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.88
diff -u -r1.88 gameDetector.cpp
|
|
|
49 | 49 | "\t-p<path> - look for game in <path>\n" |
50 | 50 | "\t-x[<num>] - load this savegame (default: 0 - autosave)\n" |
51 | 51 | "\t-f - fullscreen mode\n" |
52 | | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x,dotmatrix)\n" |
| 52 | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x,dotmatrix,ratio800)\n" |
53 | 53 | "\t-e<mode> - set music engine (see README for details)\n" |
54 | 54 | "\t-a - specify game is amiga version\n" |
55 | 55 | "\t-q<lang> - specify language (en,de,fr,it,pt,es,ja,zh,ko,hb)\n" |
… |
… |
|
92 | 92 | {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X}, |
93 | 93 | {"tv2x", "TV2x", GFX_TV2X}, |
94 | 94 | {"dotmatrix", "DotMatrix", GFX_DOTMATRIX}, |
| 95 | {"ratio800", "Ratio800", GFX_RATIO800}, |
95 | 96 | #else |
96 | 97 | {"flipping", "Page Flipping", GFX_FLIPPING}, |
97 | 98 | {"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER}, |
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.11
diff -u -r1.11 scaler.cpp
|
|
|
155 | 155 | #define RED_MASK555 0x7C007C00 |
156 | 156 | #define GREEN_MASK555 0x03E003E0 |
157 | 157 | |
158 | | void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { |
| 158 | void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) { |
159 | 159 | uint16 *bP; |
160 | 160 | uint8 *dP; |
161 | 161 | uint32 inc_bP; |
… |
… |
|
271 | 271 | } |
272 | 272 | } |
273 | 273 | |
274 | | void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { |
| 274 | void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) { |
275 | 275 | uint8 *dP; |
276 | 276 | uint16 *bP; |
277 | 277 | uint32 inc_bP; |
… |
… |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | | void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { |
| 391 | void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) { |
392 | 392 | uint8 *dP; |
393 | 393 | uint16 *bP; |
394 | 394 | uint32 inc_bP; |
… |
… |
|
583 | 583 | // it seems to allow for arbitrary scale factors, not just 2x... hence I leave this in |
584 | 584 | // for now, as that seems to be a very useful feature |
585 | 585 | void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
586 | | uint32 dstWidth, uint32 dstHeight, int width, int height) { |
| 586 | uint32 dstWidth, uint32 dstHeight, int x, int y, int width, int height) { |
587 | 587 | uint8 *dP; |
588 | 588 | uint16 *bP; |
589 | 589 | |
… |
… |
|
714 | 714 | } |
715 | 715 | |
716 | 716 | void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
717 | | int width, int height) { |
| 717 | int x, int y, int width, int height) { |
718 | 718 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
719 | 719 | uint16 *p = (uint16 *)srcPtr; |
720 | 720 | |
… |
… |
|
747 | 747 | } |
748 | 748 | |
749 | 749 | void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
750 | | int width, int height) { |
| 750 | int x, int y, int width, int height) { |
751 | 751 | while (height--) { |
752 | 752 | memcpy(dstPtr, srcPtr, 2 * width); |
753 | 753 | srcPtr += srcPitch; |
… |
… |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
759 | | int width, int height) { |
| 759 | int x, int y, int width, int height) { |
760 | 760 | uint8 *r; |
761 | 761 | |
762 | 762 | while (height--) { |
… |
… |
|
775 | 775 | } |
776 | 776 | |
777 | 777 | void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
778 | | int width, int height) { |
| 778 | int x, int y, int width, int height) { |
779 | 779 | uint8 *r; |
780 | 780 | uint32 dstPitch2 = dstPitch * 2; |
781 | 781 | uint32 dstPitch3 = dstPitch * 3; |
… |
… |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
804 | | int width, int height) { |
| 804 | int x, int y, int width, int height) { |
805 | 805 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
806 | 806 | uint16 *p = (uint16 *)srcPtr; |
807 | 807 | |
… |
… |
|
831 | 831 | } |
832 | 832 | |
833 | 833 | void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
834 | | int width, int height) |
| 834 | int x, int y, int width, int height) |
835 | 835 | { |
836 | 836 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
837 | 837 | uint16 *p = (uint16 *)srcPtr; |
… |
… |
|
849 | 849 | } |
850 | 850 | p += nextlineSrc; |
851 | 851 | q += nextlineDst << 1; |
| 852 | } |
| 853 | } |
| 854 | |
| 855 | void Ratio800(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
| 856 | int x, int y, int width, int height) |
| 857 | { |
| 858 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
| 859 | uint16 *p = (uint16 *)srcPtr; |
| 860 | |
| 861 | unsigned int nextlineDst = dstPitch / sizeof(uint16); |
| 862 | uint16 *q0 = (uint16 *)dstPtr; |
| 863 | uint16 *q; |
| 864 | |
| 865 | int i, j; |
| 866 | uint16 c; |
| 867 | |
| 868 | for(i = 0; i < height; i++) { |
| 869 | q = q0; |
| 870 | for(j = 0; j < width; j++) { |
| 871 | c = *p; |
| 872 | if((j ^ x) & 1) { |
| 873 | q[0] = q[nextlineDst] = q[nextlineDst * 2] = |
| 874 | INTERPOLATE(c, p[-1]); |
| 875 | q++; |
| 876 | } |
| 877 | p++; |
| 878 | q[0] = q[nextlineDst] = q[nextlineDst * 2] = |
| 879 | q[1] = q[nextlineDst + 1] = q[nextlineDst * 2 + 1] = |
| 880 | c; |
| 881 | q += 2; |
| 882 | } |
| 883 | p += nextlineSrc - width; |
| 884 | q0 += nextlineDst * 3; |
852 | 885 | } |
853 | 886 | } |
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.7
diff -u -r1.7 scaler.h
|
|
|
25 | 25 | |
26 | 26 | #define DECLARE_SCALER(x) \ |
27 | 27 | extern void x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, \ |
28 | | uint32 dstPitch, int width, int height) |
| 28 | uint32 dstPitch, int x, int y, int width, int height) |
29 | 29 | |
30 | 30 | DECLARE_SCALER(_2xSaI); |
31 | 31 | DECLARE_SCALER(Super2xSaI); |
… |
… |
|
36 | 36 | DECLARE_SCALER(Normal3x); |
37 | 37 | DECLARE_SCALER(TV2x); |
38 | 38 | DECLARE_SCALER(DotMatrix); |
| 39 | DECLARE_SCALER(Ratio800); |
39 | 40 | |
40 | 41 | |
41 | 42 | enum { |
… |
… |
|
48 | 49 | GFX_ADVMAME2X = 6, |
49 | 50 | GFX_TV2X = 7, |
50 | 51 | GFX_DOTMATRIX = 8, |
| 52 | GFX_RATIO800 = 9, |
51 | 53 | |
52 | 54 | GFX_FLIPPING = 100, // Palmos |
53 | 55 | GFX_DOUBLEBUFFER = 101 // Palmos |