RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.59
diff -u -r1.59 sdl-common.cpp
|
|
|
458 | 458 | |
459 | 459 | void OSystem_SDL_Common::warp_mouse(int x, int y) { |
460 | 460 | if (_mouseCurState.x != x || _mouseCurState.y != y) { |
461 | | SDL_WarpMouse(x * _scaleFactor, y * _scaleFactor); |
| 461 | SDL_WarpMouse(x * _scaleFactor_hmul / _scaleFactor_hdiv, |
| 462 | y * _scaleFactor_vmul / _scaleFactor_vdiv); |
462 | 463 | |
463 | 464 | // SDL_WarpMouse() generates a mouse movement event, so |
464 | 465 | // set_mouse_pos() would be called eventually. However, the |
… |
… |
|
674 | 675 | km.x = event->mouse.x = ev.motion.x; |
675 | 676 | km.y = event->mouse.y = ev.motion.y; |
676 | 677 | |
677 | | event->mouse.x /= _scaleFactor; |
678 | | event->mouse.y /= _scaleFactor; |
| 678 | event->mouse.x *= _scaleFactor_hdiv; |
| 679 | event->mouse.x /= _scaleFactor_hmul; |
| 680 | event->mouse.y *= _scaleFactor_vdiv; |
| 681 | event->mouse.y /= _scaleFactor_vmul; |
679 | 682 | |
680 | 683 | return true; |
681 | 684 | |
… |
… |
|
694 | 697 | break; |
695 | 698 | km.x = event->mouse.x = ev.button.x; |
696 | 699 | km.y = event->mouse.y = ev.button.y; |
697 | | event->mouse.x /= _scaleFactor; |
698 | | event->mouse.y /= _scaleFactor; |
| 700 | event->mouse.x *= _scaleFactor_hdiv; |
| 701 | event->mouse.x /= _scaleFactor_hmul; |
| 702 | event->mouse.y *= _scaleFactor_vdiv; |
| 703 | event->mouse.y /= _scaleFactor_vmul; |
699 | 704 | |
700 | 705 | return true; |
701 | 706 | |
… |
… |
|
708 | 713 | break; |
709 | 714 | event->mouse.x = ev.button.x; |
710 | 715 | event->mouse.y = ev.button.y; |
711 | | event->mouse.x /= _scaleFactor; |
712 | | event->mouse.y /= _scaleFactor; |
| 716 | event->mouse.x *= _scaleFactor_hdiv; |
| 717 | event->mouse.x /= _scaleFactor_hmul; |
| 718 | event->mouse.y *= _scaleFactor_vdiv; |
| 719 | event->mouse.y /= _scaleFactor_vmul; |
713 | 720 | return true; |
714 | 721 | |
715 | 722 | case SDL_JOYBUTTONDOWN: |
… |
… |
|
812 | 819 | } |
813 | 820 | event->mouse.x = km.x; |
814 | 821 | event->mouse.y = km.y; |
815 | | event->mouse.x /= _scaleFactor; |
816 | | event->mouse.y /= _scaleFactor; |
| 822 | event->mouse.x *= _scaleFactor_hdiv; |
| 823 | event->mouse.x /= _scaleFactor_hmul; |
| 824 | event->mouse.y *= _scaleFactor_vdiv; |
| 825 | event->mouse.y /= _scaleFactor_vmul; |
817 | 826 | return true; |
818 | 827 | |
819 | 828 | case SDL_VIDEOEXPOSE: |
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.27
diff -u -r1.27 sdl-common.h
|
|
|
153 | 153 | }; |
154 | 154 | |
155 | 155 | bool _forceFull; // Force full redraw on next update_screen |
156 | | int _scaleFactor; |
| 156 | int _scaleFactor_hmul; |
| 157 | int _scaleFactor_hdiv; |
| 158 | int _scaleFactor_vmul; |
| 159 | int _scaleFactor_vdiv; |
157 | 160 | int _mode; |
158 | 161 | bool _full_screen; |
159 | 162 | uint32 _mode_flags; |
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.33
diff -u -r1.33 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_ADVMAME3X: |
103 | | _scaleFactor = 3; |
| 107 | _scaleFactor_hmul = _scaleFactor_vmul = 3; |
| 108 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
104 | 109 | _scaler_proc = AdvMame3x; |
105 | 110 | break; |
106 | 111 | case GFX_TV2X: |
107 | | _scaleFactor = 2; |
| 112 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 113 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
108 | 114 | _scaler_proc = TV2x; |
109 | 115 | break; |
110 | 116 | case GFX_DOTMATRIX: |
111 | | _scaleFactor = 2; |
| 117 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 118 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
112 | 119 | _scaler_proc = DotMatrix; |
113 | 120 | break; |
114 | 121 | |
| 122 | case GFX_RATIO800: |
| 123 | _scaleFactor_hmul = 5; |
| 124 | _scaleFactor_hdiv = 2; |
| 125 | _scaleFactor_vmul = 3; |
| 126 | _scaleFactor_vdiv = 1; |
| 127 | _scaler_proc = Ratio800; |
| 128 | break; |
| 129 | |
115 | 130 | case GFX_DOUBLESIZE: |
116 | | _scaleFactor = 2; |
| 131 | _scaleFactor_hmul = _scaleFactor_vmul = 2; |
| 132 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
117 | 133 | _scaler_proc = Normal2x; |
118 | 134 | break; |
119 | 135 | |
… |
… |
|
122 | 138 | warning("full screen in useless in triplesize mode, reverting to normal mode"); |
123 | 139 | goto normal_mode; |
124 | 140 | } |
125 | | _scaleFactor = 3; |
| 141 | _scaleFactor_hmul = _scaleFactor_vmul = 3; |
| 142 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
126 | 143 | _scaler_proc = Normal3x; |
127 | 144 | break; |
128 | 145 | |
129 | 146 | case GFX_NORMAL: |
130 | 147 | normal_mode:; |
131 | | _scaleFactor = 1; |
| 148 | _scaleFactor_hmul = _scaleFactor_vmul = 1; |
| 149 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
132 | 150 | _scaler_proc = Normal1x; |
133 | 151 | break; |
134 | 152 | default: |
135 | 153 | error("unknown gfx mode"); |
136 | | _scaleFactor = 1; |
| 154 | _scaleFactor_hmul = _scaleFactor_vmul = 1; |
| 155 | _scaleFactor_hdiv = _scaleFactor_vdiv = 1; |
137 | 156 | _scaler_proc = NULL; |
138 | 157 | } |
139 | 158 | |
… |
… |
|
147 | 166 | // |
148 | 167 | // Create the surface that contains the scaled graphics in 16 bit mode |
149 | 168 | // |
150 | | _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor, _screenHeight * _scaleFactor, 16, |
| 169 | _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv, 16, |
151 | 170 | _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE |
152 | 171 | ); |
153 | 172 | if (_hwscreen == NULL) |
… |
… |
|
176 | 195 | error("_tmpscreen failed"); |
177 | 196 | |
178 | 197 | // keyboard cursor control, some other better place for it? |
179 | | km.x_max = _screenWidth * _scaleFactor - 1; |
180 | | km.y_max = _screenHeight * _scaleFactor - 1; |
| 198 | km.x_max = _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv - 1; |
| 199 | km.y_max = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv - 1; |
181 | 200 | km.delay_time = 25; |
182 | 201 | km.last_time = 0; |
183 | 202 | } |
… |
… |
|
240 | 259 | |
241 | 260 | // If the shake position changed, fill the dirty area with blackness |
242 | 261 | if (_currentShakePos != _newShakePos) { |
243 | | SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor, _newShakePos * _scaleFactor}; |
| 262 | /* ratio: FIXME */ |
| 263 | SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor_hmul / _scaleFactor_hdiv, _newShakePos * _scaleFactor_vmul / _scaleFactor_vdiv}; |
244 | 264 | SDL_FillRect(_hwscreen, &blackrect, 0); |
245 | 265 | |
246 | 266 | _currentShakePos = _newShakePos; |
… |
… |
|
307 | 327 | |
308 | 328 | SDL_LockSurface(_tmpscreen); |
309 | 329 | SDL_LockSurface(_hwscreen); |
310 | | |
| 330 | |
311 | 331 | srcPitch = _tmpscreen->pitch; |
312 | 332 | dstPitch = _hwscreen->pitch; |
313 | | |
| 333 | |
314 | 334 | for(r = _dirty_rect_list; r != last_rect; ++r) { |
315 | 335 | register int dst_y = r->y + _currentShakePos; |
316 | 336 | register int dst_h = 0; |
… |
… |
|
319 | 339 | if (dst_h > _screenHeight - dst_y) |
320 | 340 | dst_h = _screenHeight - dst_y; |
321 | 341 | |
322 | | dst_y *= _scaleFactor; |
| 342 | dst_y *= _scaleFactor_vmul; |
| 343 | dst_y /= _scaleFactor_vdiv; |
323 | 344 | |
324 | 345 | _scaler_proc((byte *)_tmpscreen->pixels + (r->x * 2 + 2) + (r->y + 1) * srcPitch, srcPitch, |
325 | | (byte *)_hwscreen->pixels + r->x * 2 * _scaleFactor + dst_y * dstPitch, dstPitch, r->w, dst_h); |
| 346 | (byte *)_hwscreen->pixels + (r->x * _scaleFactor_hmul / _scaleFactor_hdiv) * 2 + dst_y*dstPitch, dstPitch, r->x, r->y, r->w, dst_h); |
326 | 347 | } |
327 | 348 | |
328 | | r->x *= _scaleFactor; |
| 349 | r->w = (r->x + r->w) * _scaleFactor_hmul / _scaleFactor_hdiv; |
| 350 | r->x *= _scaleFactor_hmul; |
| 351 | r->x /= _scaleFactor_hdiv; |
| 352 | r->w -= r->x; |
| 353 | r->h = (r->y + r->h) * _scaleFactor_vmul / _scaleFactor_vdiv; |
329 | 354 | r->y = dst_y; |
330 | | r->w *= _scaleFactor; |
331 | | r->h = dst_h * _scaleFactor; |
| 355 | r->h -= r->y; |
332 | 356 | } |
333 | 357 | |
334 | 358 | SDL_UnlockSurface(_tmpscreen); |
… |
… |
|
339 | 363 | // This is necessary if shaking is active. |
340 | 364 | if (_forceFull) { |
341 | 365 | _dirty_rect_list[0].y = 0; |
342 | | _dirty_rect_list[0].h = _screenHeight * _scaleFactor; |
| 366 | _dirty_rect_list[0].h = _screenHeight * _scaleFactor_vmul / _scaleFactor_vdiv; |
343 | 367 | } |
344 | 368 | |
345 | 369 | // Finally, blit all our changes to the screen |
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.110
diff -u -r1.110 gameDetector.cpp
|
|
|
53 | 53 | "\t-p<path> - look for game in <path>\n" |
54 | 54 | "\t-x[<num>] - load this savegame (default: 0 - autosave)\n" |
55 | 55 | "\t-f - fullscreen mode\n" |
56 | | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,advmame3x,tv2x,dotmatrix)\n" |
| 56 | "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,advmame3x,tv2x,dotmatrix,ratio800)\n" |
57 | 57 | "\t-e<mode> - set music engine (see README for details)\n" |
58 | 58 | "\t-a - specify game is amiga version\n" |
59 | 59 | "\t-q<lang> - specify language (en,de,fr,it,pt,es,jp,zh,kr,hb)\n" |
… |
… |
|
100 | 100 | {"advmame3x", "AdvMAME3x", GFX_ADVMAME3X}, |
101 | 101 | {"tv2x", "TV2x", GFX_TV2X}, |
102 | 102 | {"dotmatrix", "DotMatrix", GFX_DOTMATRIX}, |
| 103 | {"ratio800", "Ratio800", GFX_RATIO800}, |
103 | 104 | #else |
104 | 105 | {"flipping", "Page Flipping", GFX_FLIPPING}, |
105 | 106 | {"dbuffer", "Double Buffer", GFX_DOUBLEBUFFER}, |
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.21
diff -u -r1.21 scaler.cpp
|
|
|
106 | 106 | return x + y; |
107 | 107 | } |
108 | 108 | |
109 | | void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { |
| 109 | void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) { |
110 | 110 | const uint16 *bP; |
111 | 111 | uint16 *dP; |
112 | 112 | const uint32 nextlineSrc = srcPitch >> 1; |
… |
… |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | | void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { |
| 215 | void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) { |
216 | 216 | const uint16 *bP; |
217 | 217 | uint16 *dP; |
218 | 218 | const uint32 nextlineSrc = srcPitch >> 1; |
… |
… |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
320 | | void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) { |
| 320 | void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height) { |
321 | 321 | const uint16 *bP; |
322 | 322 | uint16 *dP; |
323 | 323 | const uint32 nextlineSrc = srcPitch >> 1; |
… |
… |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | void AdvMame2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
454 | | int width, int height) { |
| 454 | int x, int y, int width, int height) { |
455 | 455 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
456 | 456 | const uint16 *p = (const uint16 *)srcPtr; |
457 | 457 | |
… |
… |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | void AdvMame3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
490 | | int width, int height) { |
| 490 | int x, int y, int width, int height) { |
491 | 491 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
492 | 492 | const uint16 *p = (const uint16 *)srcPtr; |
493 | 493 | |
… |
… |
|
528 | 528 | } |
529 | 529 | |
530 | 530 | void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
531 | | int width, int height) { |
| 531 | int x, int y, int width, int height) { |
532 | 532 | while (height--) { |
533 | 533 | memcpy(dstPtr, srcPtr, 2 * width); |
534 | 534 | srcPtr += srcPitch; |
… |
… |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | void Normal2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
540 | | int width, int height) { |
| 540 | int x, int y, int width, int height) { |
541 | 541 | uint8 *r; |
542 | 542 | |
543 | 543 | while (height--) { |
… |
… |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | void Normal3x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
559 | | int width, int height) { |
| 559 | int x, int y, int width, int height) { |
560 | 560 | uint8 *r; |
561 | 561 | uint32 dstPitch2 = dstPitch * 2; |
562 | 562 | uint32 dstPitch3 = dstPitch * 3; |
… |
… |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | void TV2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
585 | | int width, int height) { |
| 585 | int x, int y, int width, int height) { |
586 | 586 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
587 | 587 | const uint16 *p = (const uint16 *)srcPtr; |
588 | 588 | |
… |
… |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | void DotMatrix(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
615 | | int width, int height) |
| 615 | int x, int y, int width, int height) |
616 | 616 | { |
617 | 617 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
618 | 618 | const uint16 *p = (const uint16 *)srcPtr; |
… |
… |
|
630 | 630 | } |
631 | 631 | p += nextlineSrc; |
632 | 632 | q += nextlineDst << 1; |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | void Ratio800(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, |
| 637 | int x, int y, int width, int height) |
| 638 | { |
| 639 | unsigned int nextlineSrc = srcPitch / sizeof(uint16); |
| 640 | uint16 *p = (uint16 *)srcPtr; |
| 641 | |
| 642 | unsigned int nextlineDst = dstPitch / sizeof(uint16); |
| 643 | uint16 *q0 = (uint16 *)dstPtr; |
| 644 | uint16 *q; |
| 645 | |
| 646 | int i, j; |
| 647 | uint16 c; |
| 648 | |
| 649 | for(i = 0; i < height; i++) { |
| 650 | q = q0; |
| 651 | for(j = 0; j < width; j++) { |
| 652 | c = *p; |
| 653 | if((j ^ x) & 1) { |
| 654 | q[0] = q[nextlineDst] = q[nextlineDst * 2] = |
| 655 | INTERPOLATE(c, p[-1]); |
| 656 | q++; |
| 657 | } |
| 658 | p++; |
| 659 | q[0] = q[nextlineDst] = q[nextlineDst * 2] = |
| 660 | q[1] = q[nextlineDst + 1] = q[nextlineDst * 2 + 1] = |
| 661 | c; |
| 662 | q += 2; |
| 663 | } |
| 664 | p += nextlineSrc - width; |
| 665 | q0 += nextlineDst * 3; |
633 | 666 | } |
634 | 667 | } |
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.10
diff -u -r1.10 scaler.h
|
|
|
24 | 24 | extern int Init_2xSaI (uint32 BitFormat); |
25 | 25 | |
26 | 26 | typedef void ScalerProc(const uint8 *srcPtr, uint32 srcPitch, |
27 | | uint8 *dstPtr, uint32 dstPitch, int width, int height); |
| 27 | uint8 *dstPtr, uint32 dstPitch, int x, int y, int width, int height); |
28 | 28 | |
29 | 29 | #define DECLARE_SCALER(x) \ |
30 | 30 | extern void x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, \ |
31 | | uint32 dstPitch, int width, int height) |
| 31 | uint32 dstPitch, int x, int y, int width, int height) |
32 | 32 | |
33 | 33 | DECLARE_SCALER(_2xSaI); |
34 | 34 | DECLARE_SCALER(Super2xSaI); |
… |
… |
|
40 | 40 | DECLARE_SCALER(Normal3x); |
41 | 41 | DECLARE_SCALER(TV2x); |
42 | 42 | DECLARE_SCALER(DotMatrix); |
| 43 | DECLARE_SCALER(Ratio800); |
43 | 44 | |
44 | 45 | |
45 | 46 | enum { |
… |
… |
|
53 | 54 | GFX_ADVMAME3X = 7, |
54 | 55 | GFX_TV2X = 8, |
55 | 56 | GFX_DOTMATRIX = 9, |
| 57 | GFX_RATIO800 = 10, |
56 | 58 | |
57 | 59 | GFX_FLIPPING = 100, // Palmos |
58 | 60 | GFX_DOUBLEBUFFER = 101, // Palmos |