aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-23 21:41:36 -0400
committerPaul Gilbert2016-03-23 21:41:36 -0400
commit2f532c086d5cd466a54763fc4fee14d0940e0abb (patch)
tree139b70605ddee8d18ffd58af53d917f810c8f1a7
parent7d2d624908e9265be108d650a161a378add9d40d (diff)
downloadscummvm-rg350-2f532c086d5cd466a54763fc4fee14d0940e0abb.tar.gz
scummvm-rg350-2f532c086d5cd466a54763fc4fee14d0940e0abb.tar.bz2
scummvm-rg350-2f532c086d5cd466a54763fc4fee14d0940e0abb.zip
TITANIC: Unsuccessful initial attempt to load ycursors.avi file
Unfortunately, whilst the cursors video plays fine in standard video players, the ScummVM AVIDecoder can't seem to handle it. So for now I've left the decode in place but commented out, and I'm setting up a dummy cursor
-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 {