Ticket #8031: patch_screeneffects2.diff

File patch_screeneffects2.diff, 11.7 KB (added by SF/roever, 22 years ago)

new patch, last one contained error

  • backends/dc/display.cpp

    diff -ur scummvm_my/backends/dc/display.cpp scummvm_my_save/backends/dc/display.cpp
    old new  
    132132  } while (--h);
    133133}
    134134
     135void OSystem_Dreamcast::move_screen(int dx, int dy) {
     136
     137        if ((dx == 0) && (dy == 0))
     138                return;
     139
     140        if (dx == 0) {
     141                // vertical movement
     142                if (dy > 0) {
     143                        // move down
     144                        // copy from bottom to top
     145                        for (int y = 200; y >= dy; y--)
     146                                copy_rect(screen + SCREEN_W * (y - dy), SCREEN_W, 0, y, SCREEN_W, 1);
     147                } else {
     148                        // move up
     149                        // copy from top to bottom
     150                        for (int y = 0; y < 200 + dx; y++)
     151                                copy_rect(screen + SCREEN_W * (y - dy), SCREEN_W, 0, y, SCREEN_W, 1);
     152                }
     153        } else if (dy == 0) {
     154                // horizontal movement
     155                if (dx > 0) {
     156                        // move right
     157                        // copy from right to left
     158                        for (int x = 320; x >= dx; x--)
     159                                copy_rect(screen + x - dx, SCREEN_W, x, 0, 1, SCREEN_H);
     160                } else {
     161                        // move left
     162                        // copy from left to right
     163                        for (int x = 0; x < 320; x++)
     164                                copy_rect(screen + x - dx, SCREEN_W, x, 0, 1, SCREEN_H);
     165                }
     166        } else {
     167                // free movement
     168                // not neccessary for now
     169        }
     170
     171
     172}
     173
     174
    135175bool OSystem_Dreamcast::show_mouse(bool visible)
    136176{       
    137177  bool last = _ms_visible;
  • backends/mac/mac.cpp

    diff -ur scummvm_my/backends/mac/mac.cpp scummvm_my_save/backends/mac/mac.cpp
    old new  
    772772        } while(--h);
    773773}
    774774
     775void OSystem_MAC::move_screen(int dx, int dy) {
     776
     777
     778}
     779
     780
    775781void OSystem_MAC::add_dirty_rect(int x, int y, int w, int h) {
    776782        if (force_full)
    777783                return;
  • backends/morphos/morphos.cpp

    diff -ur scummvm_my/backends/morphos/morphos.cpp scummvm_my_save/backends/morphos/morphos.cpp
    old new  
    926926        }
    927927}
    928928
     929void OSystem_MorphOS::move_screen(int dx, int dy) {
     930
     931        if ((dx == 0) && (dy == 0))
     932                return;
     933
     934        if (dx == 0) {
     935                // vertical movement
     936                if (dy > 0) {
     937                        // move down
     938                        // copy from bottom to top
     939                        for (int y = 200; y >= dy; y--)
     940                                copy_rect((byte *)ScummBuffer + ScummBufferWidth * (y - dy), ScummBufferWidth, 0, y, ScummBufferWidth, 1);
     941                } else {
     942                        // move up
     943                        // copy from top to bottom
     944                        for (int y = 0; y < 200 + dx; y++)
     945                                copy_rect((byte *)ScummBuffer + ScummBufferWidth * (y - dy), ScummBufferWidth, 0, y, ScummBufferWidth, 1);
     946                }
     947        } else if (dy == 0) {
     948                // horizontal movement
     949                if (dx > 0) {
     950                        // move right
     951                        // copy from right to left
     952                        for (int x = 320; x >= dx; x--)
     953                                copy_rect((byte *)ScummBuffer + x - dx, ScummBufferWidth, x, 0, 1, ScummBufferHeight);
     954                } else {
     955                        // move left
     956                        // copy from left to right
     957                        for (int x = 0; x < 320; x++)
     958                                copy_rect((byte *)ScummBuffer + x - dx, ScummBufferWidth, x, 0, 1, ScummBufferHeight);
     959                }
     960        } else {
     961                // free movement
     962                // not neccessary for now
     963        }
     964
     965
     966}
     967
     968
    929969bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h)
    930970{
    931971        if (x < 0) { w+=x; x = 0; }
  • backends/null/null.cpp

    diff -ur scummvm_my/backends/null/null.cpp scummvm_my_save/backends/null/null.cpp
    old new  
    3030        void set_palette(const byte *colors, uint start, uint num) {}
    3131        void init_size(uint w, uint h);
    3232        void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {}
     33        void move_screen(int dx, int dy) {}
    3334        void update_screen() {}
    3435        bool show_mouse(bool visible) { return false; }
    3536        void set_mouse_pos(int x, int y) {}
  • backends/sdl/sdl-common.cpp

    diff -ur scummvm_my/backends/sdl/sdl-common.cpp scummvm_my_save/backends/sdl/sdl-common.cpp
    old new  
    135135}
    136136
    137137
     138void OSystem_SDL_Common::move_screen(int dx, int dy) {
     139
     140        if ((dx == 0) && (dy == 0))
     141                return;
     142
     143        if (dx == 0) {
     144                // vertical movement
     145                if (dy > 0) {
     146                        // move down
     147                        // copy from bottom to top
     148                        for (int y = 200; y >= dy; y--)
     149                                copy_rect((byte *)sdl_screen->pixels + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
     150                } else {
     151                        // move up
     152                        // copy from top to bottom
     153                        for (int y = 0; y < 200 + dx; y++)
     154                                copy_rect((byte *)sdl_screen->pixels + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
     155                }
     156        } else if (dy == 0) {
     157                // horizontal movement
     158                if (dx > 0) {
     159                        // move right
     160                        // copy from right to left
     161                        for (int x = 320; x >= dx; x--)
     162                                copy_rect((byte *)sdl_screen->pixels + x - dx, SCREEN_WIDTH, x, 0, 1, SCREEN_HEIGHT);
     163                } else {
     164                        // move left
     165                        // copy from left to right
     166                        for (int x = 0; x < 320; x++)
     167                                copy_rect((byte *)sdl_screen->pixels + x - dx, SCREEN_WIDTH, x, 0, 1, SCREEN_HEIGHT);
     168                }
     169        } else {
     170                // free movement
     171                // not neccessary for now
     172        }
     173}
     174
    138175void OSystem_SDL_Common::add_dirty_rect(int x, int y, int w, int h) {
    139176        if (force_full)
    140177                return;
  • backends/sdl/sdl-common.h

    diff -ur scummvm_my/backends/sdl/sdl-common.h scummvm_my_save/backends/sdl/sdl-common.h
    old new  
    4242        // The screen will not be updated to reflect the new bitmap
    4343        void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h);
    4444
     45        void move_screen(int dx, int dy);
     46
    4547        // Update the dirty areas of the screen
    4648        void update_screen() = 0;
    4749
  • backends/wince/pocketpc.cpp

    diff -ur scummvm_my/backends/wince/pocketpc.cpp scummvm_my_save/backends/wince/pocketpc.cpp
    old new  
    12151215        } while (--h);
    12161216}
    12171217
     1218void OSystem_WINCE3::move_screen(int dx, int dy) {
     1219
     1220        if ((dx == 0) && (dy == 0))
     1221                return;
     1222
     1223        if (dx == 0) {
     1224                // vertical movement
     1225                if (dy > 0) {
     1226                        // move down
     1227                        // copy from bottom to top
     1228                        for (int y = 200; y >= dy; y--)
     1229                                copy_rect(_gfx_buf + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
     1230                } else {
     1231                        // move up
     1232                        // copy from top to bottom
     1233                        for (int y = 0; y < 200 + dx; y++)
     1234                                copy_rect(_gfx_buf + SCREEN_WIDTH * (y - dy), SCREEN_WIDTH, 0, y, SCREEN_WIDTH, 1);
     1235                }
     1236        } else if (dy == 0) {
     1237                // horizontal movement
     1238                if (dx > 0) {
     1239                        // move right
     1240                        // copy from right to left
     1241                        for (int x = 320; x >= dx; x--)
     1242                                copy_rect(_gfx_buf + x - dx, SCREEN_WIDTH, x, 0, 1, SCREEN_HEIGHT);
     1243                } else {
     1244                        // move left
     1245                        // copy from left to right
     1246                        for (int x = 0; x < 320; x++)
     1247                                copy_rect(_gfx_buf + x - dx, SCREEN_WIDTH, x, 0, 1, SCREEN_HEIGHT);
     1248                }
     1249        } else {
     1250                // free movement
     1251                // not neccessary for now
     1252        }
     1253
     1254
     1255}
     1256
     1257
    12181258void OSystem_WINCE3::update_screen() {
    12191259
    12201260        if (!hide_cursor)
  • backends/x11/x11.cpp

    diff -ur scummvm_my/backends/x11/x11.cpp scummvm_my_save/backends/x11/x11.cpp
    old new  
    6060
    6161        // Draw a bitmap to screen.
    6262        // The screen will not be updated to reflect the new bitmap
    63         void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h);
     63        void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h);
     64
     65        void move_screen(int dx, int dy);
    6466
    6567        // Update the dirty areas of the screen
    6668        void update_screen();
     
    508510                buf += pitch;
    509511        }
    510512}
     513
     514void OSystem_X11::move_screen(int dx, int dy) {
     515
     516        if ((dx == 0) && (dy == 0))
     517                return;
     518
     519        if (dx == 0) {
     520                // vertical movement
     521                if (dy > 0) {
     522                        // move down
     523                        // copy from bottom to top
     524                        for (int y = 200; y >= dy; y--)
     525                                copy_rect(local_fb + fb_width * (y - dy), fb_width, 0, y, fb_width, 1);
     526                } else {
     527                        // move up
     528                        // copy from top to bottom
     529                        for (int y = 0; y < 200 + dx; y++)
     530                                copy_rect(local_fb + fb_width * (y - dy), fb_width, 0, y, fb_width, 1);
     531                }
     532        } else if (dy == 0) {
     533                // horizontal movement
     534                if (dx > 0) {
     535                        // move right
     536                        // copy from right to left
     537                        for (int x = 320; x >= dx; x--)
     538                                copy_rect(local_fb + x - dx, fb_width, x, 0, 1, fb_height);
     539                } else {
     540                        // move left
     541                        // copy from left to right
     542                        for (int x = 0; x < 320; x++)
     543                                copy_rect(local_fb + x - dx, fb_width, x, 0, 1, fb_height);
     544                }
     545        } else {
     546                // free movement
     547                // not neccessary for now
     548        }
     549
     550
     551}
     552
    511553
    512554void OSystem_X11::update_screen_helper(const dirty_square * d, dirty_square * dout)
    513555{
  • common/system.h

    diff -ur scummvm_my/common/system.h scummvm_my_save/common/system.h
    old new  
    9090        // The screen will not be updated to reflect the new bitmap
    9191        virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) = 0;
    9292
     93        // Moves the screen content around by the given amount of pixels
     94        virtual void move_screen(int dx, int dy) = 0;
     95
    9396        // Update the dirty areas of the screen
    9497        virtual void update_screen() = 0;
    9598
  • scumm/gfx.cpp

    diff -ur scummvm_my/scumm/gfx.cpp scummvm_my_save/scumm/gfx.cpp
    old new  
    677677                dissolveEffect(8, 8);
    678678                break;
    679679        case 130:
    680                 unkScreenEffect1();
     680                scrollEffect(3); // right   unkScreenEffect1();
    681681                break;
    682682        case 131:
    683                 unkScreenEffect2();
     683                scrollEffect(2); // left     unkScreenEffect2();
    684684                break;
    685685        case 132:
    686                 unkScreenEffect3();
     686                scrollEffect(1);  // up    unkScreenEffect3();
    687687                break;
    688688        case 133:
    689                 unkScreenEffect4();
     689                scrollEffect(0);  // down   unkScreenEffect4();
    690690                break;
    691691        case 134:
    692692                dissolveEffect(1, 1);
     
    20872087                waitForTimer(30);
    20882088        }
    20892089}
     2090
     2091void Scumm::scrollEffect(int dir) {
     2092
     2093        VirtScreen *vs = &virtscr[0];
     2094
     2095        int x, y;
     2096        int step;
     2097
     2098        if ((dir == 0) || (dir == 1))
     2099                step = vs->height;
     2100        else
     2101                step = vs->width;
     2102
     2103#define scrolltime 500  // ms the scroll is supposed to take
     2104#define picturedelay 20
     2105
     2106        step /= (scrolltime/picturedelay);
     2107
     2108        switch (dir) {
     2109        case 0:
     2110                //up
     2111                y = 1 + step;
     2112                while (y < vs->height) {
     2113                        _system->move_screen(0, -step);
     2114                        _system->copy_rect(vs->screenPtr + vs->xstart, vs->width, 0, vs->height-y, vs->width, y);
     2115                        _system->update_screen();
     2116                        waitForTimer(picturedelay);
     2117
     2118                        y += step;
     2119                }
     2120                break;
     2121        case 1:
     2122                // down
     2123                y = 1 + step;
     2124                while (y < vs->height) {
     2125                        _system->move_screen(0, step);
     2126                        _system->copy_rect(vs->screenPtr + vs->xstart + vs->width * (vs->height-y), vs->width, 0, 0, vs->width, y);
     2127                        _system->update_screen();
     2128                        waitForTimer(picturedelay);
     2129
     2130                        y += step;
     2131                }
     2132                break;
     2133        case 2:
     2134                // left
     2135                x = 1 + step;
     2136                while (x < vs->width) {
     2137                        _system->move_screen(-step, 0);
     2138                        _system->copy_rect(vs->screenPtr + vs->xstart, vs->width, vs->width-x, 0, x, vs->height);
     2139                        _system->update_screen();
     2140                        waitForTimer(picturedelay);
     2141
     2142                        x += step;
     2143                }
     2144                break;
     2145        case 3:
     2146                // right
     2147                x = 1 + step;
     2148                while (x < vs->width) {
     2149                        _system->move_screen(step, 0);
     2150                        _system->copy_rect(vs->screenPtr + vs->xstart + vs->width - x, vs->width, 0, 0, x, vs->height);
     2151                        _system->update_screen();
     2152                        waitForTimer(picturedelay);
     2153
     2154                        x += step;
     2155                }
     2156                break;
     2157        }
     2158}
     2159
    20902160
    20912161void Scumm::unkScreenEffect5(int a) {
    20922162        // unkScreenEffect5(0), which is used by FOA during the opening
  • scumm/scumm.h

    diff -ur scummvm_my/scumm/scumm.h scummvm_my_save/scumm/scumm.h
    old new  
    837837        void unkScreenEffect5(int a);
    838838        void transitionEffect(int a);           // former unkScreenEffect7
    839839        void dissolveEffect(int width, int height);     // former unkScreenEffect5(0) and unkScreenEffect6
     840        void scrollEffect(int dir);     // former unkScreenEffects 1-4
    840841
    841842        void decompressBomp(byte *dst, byte *src, int w, int h);
    842843        uint _shakeFrame;