SHERLOCK: 3DO: mouse cursor support

This commit is contained in:
Martin Kiewitz 2015-06-12 18:33:23 +02:00
parent 174aa230b6
commit 4858adb72d
3 changed files with 17 additions and 5 deletions

View file

@ -54,7 +54,13 @@ void Events::loadCursors(const Common::String &filename) {
hideCursor();
delete _cursorImages;
_cursorImages = new ImageFile(filename);
if (_vm->getPlatform() != Common::kPlatform3DO) {
// PC
_cursorImages = new ImageFile3DO(filename);
} else {
// 3DO
_cursorImages = new ImageFile3DO(filename, true);
}
_cursorId = INVALID_CURSOR;
}
@ -82,7 +88,13 @@ void Events::setCursor(CursorId cursorId) {
void Events::setCursor(const Graphics::Surface &src, int hotspotX, int hotspotY) {
_cursorId = INVALID_CURSOR;
CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0xff);
if (_vm->getPlatform() != Common::kPlatform3DO) {
// PC 8-bit palettized
CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0xff);
} else {
// 3DO RGB565
CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0x0000, false, &src.format);
}
showCursor();
}

View file

@ -243,14 +243,14 @@ void ImageFile3DO::setVm(SherlockEngine *vm) {
_vm = vm;
}
ImageFile3DO::ImageFile3DO(const Common::String &name) {
ImageFile3DO::ImageFile3DO(const Common::String &name, bool isRoomDataFormat) {
Common::File *dataStream = new Common::File();
if (!dataStream->open(name)) {
error("unable to open %s\n", name.c_str());
}
load(*dataStream, false); // this is never called for room data
load(*dataStream, isRoomDataFormat);
delete dataStream;
}

View file

@ -135,7 +135,7 @@ private:
void loadAnimationFile(Common::SeekableReadStream &stream);
public:
ImageFile3DO(const Common::String &name);
ImageFile3DO(const Common::String &name, bool isRoomDataFormat = false);
ImageFile3DO(Common::SeekableReadStream &stream, bool isRoomData = false);
~ImageFile3DO();
static void setVm(SherlockEngine *vm);