[Scummvm-cvs-logs] SF.net SVN: scummvm: [28537] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sat Aug 11 23:08:09 CEST 2007
Revision: 28537
http://scummvm.svn.sourceforge.net/scummvm/?rev=28537&view=rev
Author: peres001
Date: 2007-08-11 14:08:08 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Added partial cursor support for Big Red Adventure. Small adjustments to generalize disk code for multiple cursors.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk.h
scummvm/trunk/engines/parallaction/disk_br.cpp
scummvm/trunk/engines/parallaction/disk_ns.cpp
scummvm/trunk/engines/parallaction/parallaction.h
scummvm/trunk/engines/parallaction/parallaction_br.cpp
scummvm/trunk/engines/parallaction/parallaction_ns.cpp
Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h 2007-08-11 20:59:08 UTC (rev 28536)
+++ scummvm/trunk/engines/parallaction/disk.h 2007-08-11 21:08:08 UTC (rev 28537)
@@ -54,7 +54,7 @@
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 @@
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 @@
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 @@
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);
Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp 2007-08-11 20:59:08 UTC (rev 28536)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp 2007-08-11 21:08:08 UTC (rev 28537)
@@ -75,9 +75,28 @@
}
-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;
}
Modified: scummvm/trunk/engines/parallaction/disk_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_ns.cpp 2007-08-11 20:59:08 UTC (rev 28536)
+++ scummvm/trunk/engines/parallaction/disk_ns.cpp 2007-08-11 21:08:08 UTC (rev 28537)
@@ -475,8 +475,8 @@
}
-Graphics::Surface* DosDisk_ns::loadPointer() {
- return loadExternalStaticCnv("pointer");
+Graphics::Surface* DosDisk_ns::loadPointer(const char *name) {
+ return loadExternalStaticCnv(name);
}
@@ -1053,12 +1053,12 @@
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);
}
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2007-08-11 20:59:08 UTC (rev 28536)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2007-08-11 21:08:08 UTC (rev 28537)
@@ -594,7 +594,12 @@
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);
void invertMenuItem(Graphics::Surface &surf);
Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp 2007-08-11 20:59:08 UTC (rev 28536)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp 2007-08-11 21:08:08 UTC (rev 28537)
@@ -54,6 +54,7 @@
initResources();
initFonts();
+ initCursors();
Parallaction::init();
@@ -62,6 +63,15 @@
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 selectedItem = -1, oldSelectedItem = -2;
- _system->showMouse(true);
+ setMousePointer(0);
while (_mouseButtons != kMouseLeftUp) {
@@ -223,10 +233,21 @@
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);
+
+}
+
} // namespace Parallaction
Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp 2007-08-11 20:59:08 UTC (rev 28536)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp 2007-08-11 21:08:08 UTC (rev 28537)
@@ -116,7 +116,7 @@
void Parallaction_ns::initCursors() {
- _mouseComposedArrow = _disk->loadPointer();
+ _mouseComposedArrow = _disk->loadPointer("pointer");
byte temp[MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT];
memcpy(temp, _mouseArrow, MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list