SHERLOCK: 3DO: mouse cursor support
This commit is contained in:
parent
174aa230b6
commit
4858adb72d
3 changed files with 17 additions and 5 deletions
|
@ -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;
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue