aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/mouse_cursor.cpp18
-rw-r--r--engines/titanic/movie.cpp11
-rw-r--r--engines/titanic/movie.h4
-rw-r--r--engines/titanic/video_surface.cpp6
-rw-r--r--engines/titanic/video_surface.h7
5 files changed, 41 insertions, 5 deletions
diff --git a/engines/titanic/mouse_cursor.cpp b/engines/titanic/mouse_cursor.cpp
index 54c9ce8fbd..3acd871396 100644
--- a/engines/titanic/mouse_cursor.cpp
+++ b/engines/titanic/mouse_cursor.cpp
@@ -50,8 +50,9 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
};
CMouseCursor::CMouseCursor(CScreenManager *screenManager) :
- _screenManager(screenManager), _cursorId(CURSOR_1) {
+ _screenManager(screenManager), _cursorId(CURSOR_15) {
loadCursorImages();
+ setCursor(CURSOR_1);
}
CMouseCursor::~CMouseCursor() {
@@ -89,7 +90,20 @@ void CMouseCursor::hide() {
}
void CMouseCursor::setCursor(CursorId cursorId) {
- warning("CMouseCursor::setCursor");
+ if (cursorId != _cursorId) {
+ CursorEntry &ce = _cursors[cursorId - 1];
+ CVideoSurface &surface = *ce._videoSurface;
+ surface.lock();
+
+ // ***DEBUG*** Dummy cursor
+ Common::fill(surface.getPixels(), surface.getPixels() + 128, 0x5555);
+
+ CursorMan.replaceCursor(surface.getPixels(), surface.getWidth(), surface.getHeight(),
+ ce._centroid.x, ce._centroid.y, 0, false, &g_vm->_screen->format);
+ surface.unlock();
+
+ _cursorId = cursorId;
+ }
}
void CMouseCursor::update() {
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index a41f0f4bc7..d7a54d316d 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -24,8 +24,8 @@
namespace Titanic {
-OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) {
-
+OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
+// _aviDecoder.loadFile(name.getString());
}
void OSMovie::proc8() {
@@ -86,7 +86,12 @@ void *OSMovie::proc21() {
}
void OSMovie::setFrame(uint frameNumber) {
-
+ /*
+ _aviDecoder.seekToFrame(frameNumber);
+ const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
+
+ _videoSurface->blitFrom(Common::Point(0, 0), s);
+ */
}
} // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index 1430e249e5..5285508e78 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -23,6 +23,7 @@
#ifndef TITANIC_MOVIE_H
#define TITANIC_MOVIE_H
+#include "video/avi_decoder.h"
#include "titanic/core/list.h"
#include "titanic/core/resource_key.h"
#include "titanic/video_surface.h"
@@ -48,6 +49,9 @@ public:
};
class OSMovie : public CMovie {
+private:
+ Video::AVIDecoder _aviDecoder;
+ CVideoSurface *_videoSurface;
public:
OSMovie(const CResourceKey &name, CVideoSurface *surface);
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index ef8d7a872f..5cab6d1511 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -58,6 +58,12 @@ void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rec
}
}
+void CVideoSurface::blitFrom(const Point &destPos, const Graphics::Surface *src) {
+ lock();
+ _rawSurface->blitFrom(*src, destPos);
+ unlock();
+}
+
void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
CVideoSurface *srcSurface, const Rect *subRect, const Point *destPos) {
// Figure out initial source rect and dest rect, based on whether
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 8d0b312ef0..c6ecf1a5df 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -158,7 +158,14 @@ public:
*/
void blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect = nullptr);
+ /**
+ * Blit from another surface
+ */
+ void blitFrom(const Point &destPos, const Graphics::Surface *src);
+
void set40(void *v) { _field40 = v; }
+
+ uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
};
class OSVideoSurface : public CVideoSurface {