mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-13 09:36:21 +00:00
- fixes bug in fileData (introduced with last commit)
- show mouse cursor in Screen::setMouseCursor if it's allready shown - a little bit more kyra3 init stuff svn-id: r23623
This commit is contained in:
parent
92649de672
commit
6cc1a57d3b
@ -133,6 +133,7 @@ int KyraEngine_v3::init() {
|
||||
_gameShapes[i] = _screen->getPtrToShape(_mouseSHPBuf, i);
|
||||
}
|
||||
|
||||
initItems();
|
||||
// XXX
|
||||
|
||||
_screen->setMouseCursor(0, 0, *_gameShapes);
|
||||
@ -531,4 +532,28 @@ void KyraEngine_v3::realInit() {
|
||||
debugC(9, kDebugLevelMain, "KyraEngine::realInit()");
|
||||
}
|
||||
|
||||
#pragma mark - items
|
||||
|
||||
void KyraEngine_v3::initItems() {
|
||||
debugC(9, kDebugLevelMain, "KyraEngine::initItems()");
|
||||
|
||||
_screen->loadBitmap("ITEMS.CSH", 3, 3, 0);
|
||||
|
||||
// XXX
|
||||
|
||||
_screen->loadBitmap("ITEMS2.CSH", 3, 3, 0);
|
||||
|
||||
uint32 size = 0;
|
||||
uint8 *itemsDat = _res->fileData("_ITEMS.DAT", &size);
|
||||
|
||||
assert(size >= 72+144);
|
||||
|
||||
memcpy(_itemBuffer1, itemsDat , 72);
|
||||
memcpy(_itemBuffer2, itemsDat+72, 144);
|
||||
|
||||
delete [] itemsDat;
|
||||
|
||||
_screen->_curPage = 0;
|
||||
}
|
||||
|
||||
} // end of namespace Kyra
|
||||
|
@ -100,6 +100,8 @@ private:
|
||||
// items
|
||||
uint8 *_itemBuffer1;
|
||||
uint8 *_itemBuffer2;
|
||||
|
||||
void initItems();
|
||||
};
|
||||
|
||||
} // end of namespace Kyra
|
||||
|
@ -156,12 +156,14 @@ uint8 *Resource::fileData(const char *file, uint32 *size) {
|
||||
// test to open it in the main dir
|
||||
if (file_.open(file)) {
|
||||
|
||||
if (size)
|
||||
*size = file_.size();
|
||||
buffer = new uint8[*size];
|
||||
uint32 temp = file_.size();
|
||||
buffer = new uint8[temp];
|
||||
assert(buffer);
|
||||
|
||||
file_.read(buffer, *size);
|
||||
file_.read(buffer, temp);
|
||||
|
||||
if (size)
|
||||
*size = temp;
|
||||
|
||||
file_.close();
|
||||
} else {
|
||||
|
@ -1907,9 +1907,11 @@ void Screen::setMouseCursor(int x, int y, byte *shape) {
|
||||
fillRect(0, 0, mouseWidth, mouseHeight, 0, 8);
|
||||
drawShape(8, shape, 0, 0, 0, 0);
|
||||
|
||||
if (!_mouseLockCount)
|
||||
CursorMan.showMouse(false);
|
||||
copyRegionToBuffer(8, 0, 0, mouseWidth, mouseHeight, cursor);
|
||||
CursorMan.replaceCursor(cursor, mouseWidth, mouseHeight, x, y, 0);
|
||||
if (!_mouseLockCount)
|
||||
CursorMan.showMouse(true);
|
||||
free(cursor);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user