Ticket #8155: comi-cannon.diff

File comi-cannon.diff, 3.3 KB (added by eriktorbjorn, 22 years ago)

Patch against a January 8 CVS snapshot

  • scummvm/backends/sdl/sdl-common.cpp

    diff -ur ScummVM-cvs20030108/scummvm/backends/sdl/sdl-common.cpp ScummVM-cvs20030108+hack/scummvm/backends/sdl/sdl-common.cpp
    old new  
    398398                undraw_mouse();
    399399        }
    400400}
     401
     402void OSystem_SDL_Common::warp_mouse(int x, int y) {
     403        // FIXME: For whatever reason, I can't get CMI's cannon scene to work
     404        // properly in fullscreen mode unless I temporarily show the mouse
     405        // cursor here.
     406        if (_full_screen) SDL_ShowCursor(SDL_ENABLE);
     407        SDL_WarpMouse(x * _scaleFactor, y * _scaleFactor);
     408        if (_full_screen) SDL_ShowCursor(SDL_DISABLE);
     409        set_mouse_pos(x, y);
     410}
    401411       
    402412void OSystem_SDL_Common::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {
    403413
  • scummvm/backends/sdl/sdl-common.h

    diff -ur ScummVM-cvs20030108/scummvm/backends/sdl/sdl-common.h ScummVM-cvs20030108+hack/scummvm/backends/sdl/sdl-common.h
    old new  
    5252       
    5353        // Set the position of the mouse cursor
    5454        void set_mouse_pos(int x, int y);
     55
     56        // Warp the mouse cursor. Where set_mouse_pos() only informs the
     57        // backend of the mouse cursor's current position, this function
     58        // actually moves the cursor to the specified position.
     59        void warp_mouse(int x, int y);
    5560       
    5661        // Set the bitmap that's used when drawing the cursor.
    5762        void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y);
  • scummvm/common/system.h

    diff -ur ScummVM-cvs20030108/scummvm/common/system.h ScummVM-cvs20030108+hack/scummvm/common/system.h
    old new  
    109109       
    110110        // Set the position of the mouse cursor
    111111        virtual void set_mouse_pos(int x, int y) = 0;
     112
     113        // Warp the mouse cursor. Where set_mouse_pos() only informs the
     114        // backend of the mouse cursor's current position, this function
     115        // actually moves the cursor to the specified position.
     116        virtual void warp_mouse(int x, int y) = 0;
    112117       
    113118        // Set the bitmap that's used when drawing the cursor.
    114119        virtual void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) = 0;
  • scummvm/scumm/script_v8.cpp

    diff -ur ScummVM-cvs20030108/scummvm/scumm/script_v8.cpp ScummVM-cvs20030108+hack/scummvm/scumm/script_v8.cpp
    old new  
    801801                        _charsetColorMap[i] = _charsetData[_string[1].t_charset][i] = (unsigned char)args[i];
    802802                break;
    803803        case 0xE9:              // SO_CURSOR_PUT
    804                 _virtual_mouse_x = pop();
    805804                _virtual_mouse_y = pop();
     805                _virtual_mouse_x = pop();
    806806
    807807                mouse.x = _virtual_mouse_x - virtscr[0].xstart;
    808808                mouse.y = _virtual_mouse_y - camera._cur.y + (_realHeight / 2);
    809                 mouse.y += 16;
     809                mouse.y += virtscr[0].topline;
    810810
    811                 _system->set_mouse_pos(mouse.x, mouse.y);
     811                _system->warp_mouse(mouse.x, mouse.y);
    812812                _system->update_screen();
    813813//              warning("warped mouse to (%d, %d) from %d-%d", _virtual_mouse_x, _virtual_mouse_y, _roomResource, vm.slot[_currentScript].number);
    814814                break;