Ticket #1863: loom-cursor.diff

File loom-cursor.diff, 3.2 KB (added by eriktorbjorn, 19 years ago)

Patch against a January 5 CVS snapshot

  • scumm/cursor.cpp

    diff -ur ScummVM-cvs20050105/scumm/cursor.cpp ScummVM-cvs20050105+hack/scumm/cursor.cpp
    old new  
    2626#include "scumm/intern.h"
    2727#include "scumm/object.h"
    2828#include "scumm/resource_v7he.h"
     29#include "scumm/saveload.h"
    2930#include "scumm/scumm.h"
    3031
    3132
     
    395396        updateCursor();
    396397}
    397398
     399void ScummEngine_v5::saveOrLoadCursorImages(Serializer *s) {
     400        const SaveLoadEntry cursorEntries[] = {
     401                MKARRAY2(ScummEngine_v5, _cursorImages[0][0], sleUint16, 16, 4, (byte*)_cursorImages[1] - (byte*)_cursorImages[0], VER(44)),
     402                MKARRAY(ScummEngine_v5, _cursorHotspots[0], sleByte, 8, VER(44)),
     403                MKEND()
     404        };
     405
     406        s->saveLoadEntries(this, cursorEntries);
     407}
     408
    398409} // End of namespace Scumm
  • scumm/intern.h

    diff -ur ScummVM-cvs20050105/scumm/intern.h ScummVM-cvs20050105+hack/scumm/intern.h
    old new  
    7676        void setBuiltinCursor(int index);
    7777        void redefineBuiltinCursorFromChar(int index, int chr);
    7878        void redefineBuiltinCursorHotspot(int index, int x, int y);
     79        void saveOrLoadCursorImages(Serializer *s);
    7980
    8081        /* Version 5 script opcodes */
    8182        void o5_actorFollowCamera();
  • scumm/saveload.cpp

    diff -ur ScummVM-cvs20050105/scumm/saveload.cpp ScummVM-cvs20050105+hack/scumm/saveload.cpp
    old new  
    877877                _imuseDigital->saveOrLoad(s);
    878878        }
    879879
     880        // This is probably only needed for Loom.
     881        saveOrLoadCursorImages(s);
     882
    880883        if (s->isLoading())
    881884                setupVolumes();
    882885}
  • scumm/saveload.h

    diff -ur ScummVM-cvs20050105/scumm/saveload.h ScummVM-cvs20050105+hack/scumm/saveload.h
    old new  
    3232// Can be useful for other ports too :)
    3333
    3434#define VER(x) x
    35 #define CURRENT_VER 43
     35#define CURRENT_VER 44
    3636
    3737// To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types,
    3838// we use a small trick: instead of 0 we use 42. Why? Well, it seems newer GCC
    39 // versions hae a heuristic built in to detect "offset-of" patterns - which is exactly
     39// versions have a heuristic built in to detect "offset-of" patterns - which is exactly
    4040// what our OFFS macro does. Now, for non-POD types this is not really legal, because
    4141// member need not be at a fixed offset relative to the variable, even if they are in
    4242// current reality (many of our complex structs are non-POD; for an explanation of
  • scumm/scumm.h

    diff -ur ScummVM-cvs20050105/scumm/scumm.h ScummVM-cvs20050105+hack/scumm/scumm.h
    old new  
    386386        void updateCursor();
    387387        virtual void animateCursor() {}
    388388        void updatePalette();
     389        virtual void saveOrLoadCursorImages(Serializer *s) {}
    389390
    390391        /**
    391392         * Flag which signals that the SMUSH video playback should end now