RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.32
diff -u -r1.32 sdl-common.cpp
|
|
|
423 | 423 | |
424 | 424 | void OSystem_SDL_Common::warp_mouse(int x, int y) { |
425 | 425 | if (_mouseCurState.x != x || _mouseCurState.y != y) |
426 | | SDL_WarpMouse(x * _scaleFactor, y * _scaleFactor); |
| 426 | SDL_WarpMouse(x * _scaleFactor_hmul / _scaleFactor_hdiv, |
| 427 | y * _scaleFactor_vmul / _scaleFactor_vdiv); |
427 | 428 | } |
428 | 429 | |
429 | 430 | void OSystem_SDL_Common::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) { |
… |
… |
|
624 | 625 | km.x = event->mouse.x = ev.motion.x; |
625 | 626 | km.y = event->mouse.y = ev.motion.y; |
626 | 627 | |
627 | | event->mouse.x /= _scaleFactor; |
628 | | event->mouse.y /= _scaleFactor; |
| 628 | event->mouse.x *= _scaleFactor_hdiv; |
| 629 | event->mouse.x /= _scaleFactor_hmul; |
| 630 | event->mouse.y *= _scaleFactor_vdiv; |
| 631 | event->mouse.y /= _scaleFactor_vmul; |
629 | 632 | |
630 | 633 | return true; |
631 | 634 | |
… |
… |
|
644 | 647 | break; |
645 | 648 | km.x = event->mouse.x = ev.motion.x; |
646 | 649 | km.y = event->mouse.y = ev.motion.y; |
647 | | event->mouse.x /= _scaleFactor; |
648 | | event->mouse.y /= _scaleFactor; |
| 650 | event->mouse.x *= _scaleFactor_hdiv; |
| 651 | event->mouse.x /= _scaleFactor_hmul; |
| 652 | event->mouse.y *= _scaleFactor_vdiv; |
| 653 | event->mouse.y /= _scaleFactor_vmul; |
649 | 654 | |
650 | 655 | return true; |
651 | 656 | |
… |
… |
|
658 | 663 | break; |
659 | 664 | event->mouse.x = ev.button.x; |
660 | 665 | event->mouse.y = ev.button.y; |
661 | | event->mouse.x /= _scaleFactor; |
662 | | event->mouse.y /= _scaleFactor; |
| 666 | event->mouse.x *= _scaleFactor_hdiv; |
| 667 | event->mouse.x /= _scaleFactor_hmul; |
| 668 | event->mouse.y *= _scaleFactor_vdiv; |
| 669 | event->mouse.y /= _scaleFactor_vmul; |
663 | 670 | return true; |
664 | 671 | |
665 | 672 | case SDL_JOYBUTTONDOWN: |
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.15
diff -u -r1.15 sdl-common.h
|
|
|
125 | 125 | |
126 | 126 | protected: |
127 | 127 | typedef void ScalerProc(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, |
128 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 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.21
diff -u -r1.21 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 | |
| 112 | case GFX_RATIO800: |
| 113 | _scaleFactor_hmul = 5; |
| 114 | _scaleFactor_hdiv = 2; |
| 115 | _scaleFactor_vmul = 3; |
| 116 | _scaleFactor_vdiv = 1; |
| 117 | _scaler_proc = Ratio800; |
| 118 | break; |
| 119 | |
107 | 120 | case GFX_DOUBLESIZE: |
108 | | _scaleFactor = 2; |
| 121 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 122 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
109 | 123 | _scaler_proc = Normal2x; |
110 | 124 | break; |
111 | 125 | |
… |
… |
|
114 | 128 | warning("full screen in useless in triplesize mode, reverting to normal mode"); |
115 | 129 | goto normal_mode; |
116 | 130 | } |
117 | | _scaleFactor = 3; |
| 131 | _scaleFactor_hmul = _scaleFactor_vmul = 3; |
| 132 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
118 | 133 | _scaler_proc = Normal3x; |
119 | 134 | break; |
120 | 135 | |
121 | 136 | case GFX_NORMAL: |
122 | 137 | normal_mode:; |
123 | | _scaleFactor = 1; |
| 138 | _scaleFactor_hmul = _scaleFactor_vmul = 1; |
| 139 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
124 | 140 | _scaler_proc = Normal1x; |
125 | 141 | break; |
126 | 142 | default: |
127 | 143 | error("unknown gfx mode"); |
128 | | _scaleFactor = 1; |
| 144 | _scaleFactor_hmul = _scaleFactor_vmul = 1; |
| 145 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
129 | 146 | _scaler_proc = NULL; |
130 | 147 | } |
131 | 148 | |
… |
… |
|
140 | 157 | // |
141 | 158 | // Create the surface that contains the scaled graphics in 16 bit mode |
142 | 159 | // |
143 | | _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor, _screenHeight * _scaleFactor, 16, |
| 160 | _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv, 16, |
144 | 161 | _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE |
145 | 162 | ); |
146 | 163 | if (_hwscreen == NULL) |
… |
… |
|
169 | 186 | error("_tmpscreen failed"); |
170 | 187 | |
171 | 188 | // keyboard cursor control, some other better place for it? |
172 | | km.x_max = _screenWidth * _scaleFactor - 1; |
173 | | km.y_max = _screenHeight * _scaleFactor - 1; |
| 189 | km.x_max = _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv - 1; |
| 190 | km.y_max = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv - 1; |
174 | 191 | km.delay_time = 25; |
175 | 192 | km.last_time = 0; |
176 | 193 | |
… |
… |
|
231 | 248 | |
232 | 249 | // If the shake position changed, fill the dirty area with blackness |
233 | 250 | if (_currentShakePos != _newShakePos) { |
234 | | SDL_Rect blackrect = {0, 0, _screenWidth*_scaleFactor, _newShakePos*_scaleFactor}; |
| 251 | /* ratio: FIXME */ |
| 252 | SDL_Rect blackrect = {0, 0, _screenWidth*_scaleFactor_hmul / _scaleFactor_hdiv, _newShakePos*_scaleFactor_vmul / _scaleFactor_vdiv}; |
235 | 253 | SDL_FillRect(_hwscreen, &blackrect, 0); |
236 | 254 | |
237 | 255 | _currentShakePos = _newShakePos; |
… |
… |
|
297 | 315 | if (dst_h > _screenHeight - dst_y) |
298 | 316 | dst_h = _screenHeight - dst_y; |
299 | 317 | |
300 | | dst_y *= _scaleFactor; |
| 318 | dst_y *= _scaleFactor_vmul; |
| 319 | dst_y /= _scaleFactor_vdiv; |
301 | 320 | |
302 | 321 | _scaler_proc((byte*)_tmpscreen->pixels + (r->x*2+2) + (r->y+1)*srcPitch, srcPitch, NULL, |
303 | | (byte*)_hwscreen->pixels + r->x*2*_scaleFactor + dst_y*dstPitch, dstPitch, r->w, dst_h); |
| 322 | (byte*)_hwscreen->pixels + (r->x*_scaleFactor_hmul / _scaleFactor_hdiv) * 2 + dst_y*dstPitch, dstPitch, r->x, r->y, r->w, dst_h); |
304 | 323 | } |
305 | 324 | |
306 | | r->x *= _scaleFactor; |
| 325 | r->w = (r->x + r->w) * _scaleFactor_hmul / _scaleFactor_hdiv; |
| 326 | r->x *= _scaleFactor_hmul; |
| 327 | r->x /= _scaleFactor_hdiv; |
| 328 | r->w -= r->x; |
| 329 | r->h = (r->y + r->h) * _scaleFactor_vmul / _scaleFactor_vdiv; |
307 | 330 | r->y = dst_y; |
308 | | r->w *= _scaleFactor; |
309 | | r->h = dst_h * _scaleFactor; |
| 331 | r->h -= r->y; |
310 | 332 | } |
311 | 333 | |
312 | 334 | SDL_UnlockSurface(_tmpscreen); |
… |
… |
|
316 | 338 | // This is necessary if shaking is active. |
317 | 339 | if (_forceFull) { |
318 | 340 | _dirty_rect_list[0].y = 0; |
319 | | _dirty_rect_list[0].h = _screenHeight * _scaleFactor; |
| 341 | _dirty_rect_list[0].h = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv; |
320 | 342 | } |
321 | 343 | |
322 | 344 | // Finally, blit all our changes to the screen |
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.66
diff -u -r1.66 gameDetector.cpp
|
|
|
47 | 47 | "\t-p<path> - look for game in <path>\n" |
48 | 48 | "\t-x[<num>] - load this savegame (default: 0 - autosave)\n" |
49 | 49 | "\t-f - fullscreen mode\n" |
50 | | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n" |
| 50 | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x,ratio800)\n" |
51 | 51 | "\t-e<mode> - set music engine (see README for details)\n" |
52 | 52 | "\t-a - specify game is amiga version\n" |
53 | 53 | "\t-q<lang> - specify language (en,de,fr,it,pt,es,ja,zh,ko,hb)\n" |
… |
… |
|
184 | 184 | {"supereagle", "SuperEagle", GFX_SUPEREAGLE}, |
185 | 185 | {"advmame2x", "AdvMAME2x", GFX_ADVMAME2X}, |
186 | 186 | {"tv2x", "TV2x", GFX_TV2X}, |
| 187 | {"ratio800", "Ratio800", GFX_RATIO800}, |
187 | 188 | {0, 0} |
188 | 189 | }; |
189 | 190 | |
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.6
diff -u -r1.6 scaler.cpp
|
|
|
146 | 146 | #define GREEN_MASK555 0x03E003E0 |
147 | 147 | |
148 | 148 | void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, |
149 | | uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height) |
| 149 | uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, |
| 150 | int x, int y, int width, int height) |
150 | 151 | { |
151 | 152 | uint16 *bP; |
152 | 153 | uint8 *dP; |
… |
… |
|
265 | 266 | } |
266 | 267 | |
267 | 268 | void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, |
268 | | uint8 *dstPtr, uint32 dstPitch, int width, int height) |
| 269 | uint8 *dstPtr, uint32 dstPitch, |
| 270 | int x, int y, int width, int height) |
269 | 271 | { |
270 | 272 | uint8 *dP; |
271 | 273 | uint16 *bP; |
… |
… |
|
385 | 387 | } |
386 | 388 | |
387 | 389 | void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, |
388 | | uint8 *dstPtr, uint32 dstPitch, int width, int height) |
| 390 | uint8 *dstPtr, uint32 dstPitch, |
| 391 | int x, int y, int width, int height) |
389 | 392 | { |
390 | 393 | uint8 *dP; |
391 | 394 | uint16 *bP; |
… |
… |
|
582 | 585 | return (result & redblueMask) | ((result >> 16) & greenMask); |
583 | 586 | } |
584 | 587 | |
| 588 | /* not used */ |
585 | 589 | void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 * /* deltaPtr */ , |
586 | 590 | uint8 *dstPtr, uint32 dstPitch, |
587 | | uint32 dstWidth, uint32 dstHeight, int width, int height) |
| 591 | uint32 dstWidth, uint32 dstHeight, |
| 592 | int x, int y, int width, int height) |
588 | 593 | { |
589 | 594 | uint8 *dP; |
590 | 595 | uint16 *bP; |
… |
… |
|
716 | 721 | } |
717 | 722 | |
718 | 723 | void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
719 | | int width, int height) |
| 724 | int x, int y, int width, int height) |
720 | 725 | { |
721 | 726 | unsigned int nextlineSrc = srcPitch / sizeof(short); |
722 | 727 | short *p = (short *)srcPtr; |
… |
… |
|
748 | 753 | |
749 | 754 | |
750 | 755 | void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
751 | | int width, int height) |
| 756 | int x, int y, int width, int height) |
752 | 757 | { |
753 | 758 | while (height--) { |
754 | 759 | memcpy(dstPtr, srcPtr, 2 * width); |
… |
… |
|
758 | 763 | } |
759 | 764 | |
760 | 765 | void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
761 | | int width, int height) |
| 766 | int x, int y, int width, int height) |
762 | 767 | { |
763 | 768 | uint8 *r; |
764 | 769 | |
… |
… |
|
778 | 783 | } |
779 | 784 | |
780 | 785 | void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
781 | | int width, int height) |
| 786 | int x, int y, int width, int height) |
782 | 787 | { |
783 | 788 | uint8 *r; |
784 | 789 | uint32 dstPitch2 = dstPitch * 2; |
… |
… |
|
805 | 810 | } |
806 | 811 | |
807 | 812 | void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
808 | | int width, int height) |
| 813 | int x, int y, int width, int height) |
809 | 814 | { |
810 | 815 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
811 | 816 | uint16 *p = (uint16 *)srcPtr; |
… |
… |
|
828 | 833 | } |
829 | 834 | p += nextlineSrc; |
830 | 835 | q += nextlineDst << 1; |
| 836 | } |
| 837 | } |
| 838 | |
| 839 | void Ratio800(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, |
| 840 | int x, int y, int width, int height) |
| 841 | { |
| 842 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
| 843 | uint16 *p = (uint16 *)srcPtr; |
| 844 | |
| 845 | unsigned int nextlineDst = dstPitch / sizeof(uint16); |
| 846 | uint16 *q0 = (uint16 *)dstPtr; |
| 847 | uint16 *q; |
| 848 | |
| 849 | int i, j; |
| 850 | uint16 c; |
| 851 | |
| 852 | for(i = 0; i < height; i++) { |
| 853 | q = q0; |
| 854 | for(j = 0; j < width; j++) { |
| 855 | c = *p; |
| 856 | if((j ^ x) & 1) { |
| 857 | q[0] = q[nextlineDst] = q[nextlineDst * 2] = |
| 858 | INTERPOLATE(c, p[-1]); |
| 859 | q++; |
| 860 | } |
| 861 | p++; |
| 862 | q[0] = q[nextlineDst] = q[nextlineDst * 2] = |
| 863 | q[1] = q[nextlineDst + 1] = q[nextlineDst * 2 + 1] = |
| 864 | c; |
| 865 | q += 2; |
| 866 | } |
| 867 | p += nextlineSrc - width; |
| 868 | q0 += nextlineDst * 3; |
831 | 869 | } |
832 | 870 | } |
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.2
diff -u -r1.2 scaler.h
|
|
|
23 | 23 | |
24 | 24 | extern int Init_2xSaI (uint32 BitFormat); |
25 | 25 | extern void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr, |
26 | | uint32 dstPitch, int width, int height); |
| 26 | uint32 dstPitch, int x, int y, int width, int height); |
27 | 27 | extern void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, |
28 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 28 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
29 | 29 | extern void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, |
30 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 30 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
31 | 31 | extern void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, |
32 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 32 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
33 | 33 | extern void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, |
34 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 34 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
35 | 35 | extern void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, |
36 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 36 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
37 | 37 | extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, |
38 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 38 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
39 | 39 | extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, |
40 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 40 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
| 41 | extern void Ratio800(uint8 *srcPtr, uint32 srcPitch, uint8 *null, |
| 42 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
41 | 43 | |
42 | 44 | #endif |
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.19
diff -u -r1.19 system.h
|
|
|
223 | 223 | GFX_SUPER2XSAI = 4, |
224 | 224 | GFX_SUPEREAGLE = 5, |
225 | 225 | GFX_ADVMAME2X = 6, |
226 | | GFX_TV2X = 7 |
| 226 | GFX_TV2X = 7, |
| 227 | GFX_RATIO800 = 8 |
227 | 228 | }; |
228 | 229 | |
229 | 230 | |