diff options
author | Nicola Mettifogo | 2007-08-11 21:08:08 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-08-11 21:08:08 +0000 |
commit | ccfd109e2539c3d1ec46d1f93ffda7001f86d326 (patch) | |
tree | 37864fc01e6f41df4f872f8b6d2869fc6c5eccf7 /engines/parallaction | |
parent | f1cbf3f9b636edf0360bb4287d987d85f7aa2cab (diff) | |
download | scummvm-rg350-ccfd109e2539c3d1ec46d1f93ffda7001f86d326.tar.gz scummvm-rg350-ccfd109e2539c3d1ec46d1f93ffda7001f86d326.tar.bz2 scummvm-rg350-ccfd109e2539c3d1ec46d1f93ffda7001f86d326.zip |
Added partial cursor support for Big Red Adventure. Small adjustments to generalize disk code for multiple cursors.
svn-id: r28537
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/disk.h | 8 | ||||
-rw-r--r-- | engines/parallaction/disk_br.cpp | 23 | ||||
-rw-r--r-- | engines/parallaction/disk_ns.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 25 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 2 |
6 files changed, 59 insertions, 14 deletions
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index a0b20b8378..7c3856bf4e 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -54,7 +54,7 @@ public: virtual Script* loadScript(const char* name) = 0; virtual Cnv* loadTalk(const char *name) = 0; virtual Cnv* loadObjects(const char *name) = 0; - virtual Graphics::Surface* loadPointer() = 0; + virtual Graphics::Surface* loadPointer(const char *name) = 0; virtual Graphics::Surface* loadHead(const char* name) = 0; virtual Font* loadFont(const char* name) = 0; virtual Graphics::Surface* loadStatic(const char* name) = 0; @@ -146,7 +146,7 @@ public: Script* loadScript(const char* name); Cnv* loadTalk(const char *name); Cnv* loadObjects(const char *name); - Graphics::Surface* loadPointer(); + Graphics::Surface* loadPointer(const char *name); Graphics::Surface* loadHead(const char* name); Font* loadFont(const char* name); Graphics::Surface* loadStatic(const char* name); @@ -180,7 +180,7 @@ public: Script* loadScript(const char* name); Cnv* loadTalk(const char *name); Cnv* loadObjects(const char *name); - Graphics::Surface* loadPointer(); + Graphics::Surface* loadPointer(const char *name); Graphics::Surface* loadHead(const char* name); Font* loadFont(const char* name); Graphics::Surface* loadStatic(const char* name); @@ -215,7 +215,7 @@ public: Script* loadScript(const char* name); Cnv* loadTalk(const char *name); Cnv* loadObjects(const char *name); - Graphics::Surface* loadPointer(); + Graphics::Surface* loadPointer(const char *name); Graphics::Surface* loadHead(const char* name); Font* loadFont(const char* name); Graphics::Surface* loadStatic(const char* name); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index babe6043a6..a889e9c298 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -75,9 +75,28 @@ Graphics::Surface* DosDisk_br::loadHead(const char* name) { } -Graphics::Surface* DosDisk_br::loadPointer() { +Graphics::Surface* DosDisk_br::loadPointer(const char *name) { debugC(5, kDebugDisk, "DosDisk_br::loadPointer"); - return 0; + + char path[PATH_LEN]; + sprintf(path, "%s.ras", name); + + Common::File stream; + if (!stream.open(path)) + errorFileNotFound(path); + + stream.skip(4); + uint width = stream.readUint32BE(); + uint height = stream.readUint32BE(); + stream.skip(20); + stream.skip(768); + + Graphics::Surface *surf = new Graphics::Surface; + + surf->create(width, height, 1); + stream.read(surf->pixels, width * height); + + return surf; } diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index cfcb9552e4..e8301d2dd8 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -475,8 +475,8 @@ Graphics::Surface* DosDisk_ns::loadHead(const char* name) { } -Graphics::Surface* DosDisk_ns::loadPointer() { - return loadExternalStaticCnv("pointer"); +Graphics::Surface* DosDisk_ns::loadPointer(const char *name) { + return loadExternalStaticCnv(name); } @@ -1053,12 +1053,12 @@ Script* AmigaDisk_ns::loadScript(const char* name) { return new Script(new DummyArchiveStream(_resArchive), true); } -Graphics::Surface* AmigaDisk_ns::loadPointer() { +Graphics::Surface* AmigaDisk_ns::loadPointer(const char* name) { debugC(1, kDebugDisk, "AmigaDisk_ns::loadPointer"); Common::File stream; - if (!stream.open("pointer")) - errorFileNotFound("pointer"); + if (!stream.open(name)) + errorFileNotFound(name); return makeStaticCnv(stream); } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 22568d9b6e..8a331cbe39 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -594,6 +594,11 @@ private: void setMousePointer(int16 index); void initCursors(); + Graphics::Surface *_dinoCursor; + Graphics::Surface *_dougCursor; + Graphics::Surface *_donnaCursor; + Graphics::Surface *_mouseArrow; + int showMenu(); void renderMenuItem(Graphics::Surface &surf, const char *text); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 3ac36a75fa..0db3fb8518 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -54,6 +54,7 @@ int Parallaction_br::init() { initResources(); initFonts(); + initCursors(); Parallaction::init(); @@ -62,6 +63,15 @@ int Parallaction_br::init() { Parallaction_br::~Parallaction_br() { freeFonts(); + + _dinoCursor->free(); + _dougCursor->free(); + _donnaCursor->free(); + + delete _dinoCursor; + delete _dougCursor; + delete _donnaCursor; + } void Parallaction_br::callFunction(uint index, void* parm) { @@ -152,7 +162,7 @@ int Parallaction_br::showMenu() { int selectedItem = -1, oldSelectedItem = -2; - _system->showMouse(true); + setMousePointer(0); while (_mouseButtons != kMouseLeftUp) { @@ -223,9 +233,20 @@ void Parallaction_br::freeFonts() { return; } -void Parallaction_br::setMousePointer(int16 index) { +void Parallaction_br::initCursors() { + + _dinoCursor = _disk->loadPointer("pointer1"); + _dougCursor = _disk->loadPointer("pointer2"); + _donnaCursor = _disk->loadPointer("pointer3"); + _mouseArrow = _donnaCursor; +} + +void Parallaction_br::setMousePointer(int16 index) { + + _system->setMouseCursor((byte*)_mouseArrow->pixels, _mouseArrow->w, _mouseArrow->h, 0, 0, 0); + _system->showMouse(true); } diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index ab9a6894f1..e3a706d794 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -116,7 +116,7 @@ void Parallaction_ns::renderLabel(Graphics::Surface *cnv, char *text) { void Parallaction_ns::initCursors() { - _mouseComposedArrow = _disk->loadPointer(); + _mouseComposedArrow = _disk->loadPointer("pointer"); byte temp[MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT]; memcpy(temp, _mouseArrow, MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT); |