aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-06-24 20:09:36 +0000
committerEugene Sandulenko2004-06-24 20:09:36 +0000
commit088676cdb2ae3fc463812771de12745162c1e7a0 (patch)
tree055a05926c79f1c2354fd4840bf9dda61b0de12b
parent08cebae47298a15895fc35e8755dd5bfa85ff6eb (diff)
downloadscummvm-rg350-088676cdb2ae3fc463812771de12745162c1e7a0.tar.gz
scummvm-rg350-088676cdb2ae3fc463812771de12745162c1e7a0.tar.bz2
scummvm-rg350-088676cdb2ae3fc463812771de12745162c1e7a0.zip
Add grabCursorFromBuffer() function.
svn-id: r14033
-rw-r--r--scumm/cursor.cpp17
-rw-r--r--scumm/scumm.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp
index 0a0fbe47e3..10227fb73f 100644
--- a/scumm/cursor.cpp
+++ b/scumm/cursor.cpp
@@ -306,4 +306,21 @@ void ScummEngine::makeCursorColorTransparent(int a) {
updateCursor();
}
+void ScummEngine::grabCursorFromBuffer(byte *ptr, int width, int height) {
+ uint size;
+ byte *dst;
+
+ size = width * height;
+ if (size > sizeof(_grabbedCursor))
+ error("grabCursor: grabbed cursor too big");
+
+ _cursor.width = width;
+ _cursor.height = height;
+ _cursor.animate = 0;
+
+ memcpy(_grabbedCursor, ptr, width * height);
+
+ updateCursor();
+}
+
} // End of namespace Scumm
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 3e21b8ce68..17bc973915 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -315,6 +315,7 @@ class ScummEngine : public Engine {
friend class SmushPlayer;
friend class Insane;
friend class CharsetRenderer;
+ friend class Win32ResExtractor;
void errorString(const char *buf_input, char *buf_output);
public:
@@ -925,6 +926,7 @@ protected:
void setCursorHotspot(int x, int y);
void grabCursor(int x, int y, int w, int h);
void grabCursor(byte *ptr, int width, int height);
+ void grabCursorFromBuffer(byte *ptr, int width, int height);
void makeCursorColorTransparent(int a);
void setupCursor();
void decompressDefaultCursor(int index);