mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-13 09:36:21 +00:00
- fixes copyright of kyra3.h
- implements a bit more init functions for kyra3 - removes hacked mouse cursor - changes Resource::fileData to accept a null pointer for size svn-id: r23622
This commit is contained in:
parent
8d453f2267
commit
92649de672
@ -42,6 +42,11 @@ KyraEngine_v3::KyraEngine_v3(OSystem *system) : KyraEngine(system) {
|
||||
_curMusicTrack = -1;
|
||||
_unkPage1 = _unkPage2 = 0;
|
||||
_interfaceCPS1 = _interfaceCPS2 = 0;
|
||||
memset(_gameShapes, 0, sizeof(_gameShapes));
|
||||
_shapePoolBuffer = 0;
|
||||
_unkBuffer17 = 0;
|
||||
_itemBuffer1 = _itemBuffer2 = 0;
|
||||
_mouseSHPBuf = 0;
|
||||
}
|
||||
|
||||
KyraEngine_v3::~KyraEngine_v3() {
|
||||
@ -51,6 +56,15 @@ KyraEngine_v3::~KyraEngine_v3() {
|
||||
delete [] _unkPage2;
|
||||
delete [] _interfaceCPS1;
|
||||
delete [] _interfaceCPS2;
|
||||
|
||||
delete [] _unkBuffer17;
|
||||
|
||||
delete [] _itemBuffer1;
|
||||
delete [] _itemBuffer2;
|
||||
|
||||
delete [] _shapePoolBuffer;
|
||||
|
||||
delete [] _mouseSHPBuf;
|
||||
}
|
||||
|
||||
int KyraEngine_v3::setupGameFlags() {
|
||||
@ -96,8 +110,33 @@ int KyraEngine_v3::init() {
|
||||
|
||||
_screen->loadFont(Screen::FID_6_FNT, "6.FNT");
|
||||
_screen->loadFont(Screen::FID_8_FNT, "8FAT.FNT");
|
||||
_screen->loadFont(Screen::FID_BOOKFONT_FNT, "BOOKFONT.FNT");
|
||||
_screen->setAnimBlockPtr(3500);
|
||||
_screen->setScreenDim(0);
|
||||
|
||||
|
||||
_shapePoolBuffer = new uint8[300000];
|
||||
assert(_shapePoolBuffer);
|
||||
|
||||
// XXX game_setUnkBuffer(_shapePoolBuffer)
|
||||
|
||||
_unkBuffer17 = new uint8[1850];
|
||||
assert(_unkBuffer17);
|
||||
|
||||
_itemBuffer1 = new uint8[72];
|
||||
_itemBuffer2 = new uint8[144];
|
||||
assert(_itemBuffer1 && _itemBuffer2);
|
||||
|
||||
_mouseSHPBuf = _res->fileData("MOUSE.SHP", 0);
|
||||
assert(_mouseSHPBuf);
|
||||
|
||||
for (int i = 0; i <= 6; ++i) {
|
||||
_gameShapes[i] = _screen->getPtrToShape(_mouseSHPBuf, i);
|
||||
}
|
||||
|
||||
// XXX
|
||||
|
||||
_screen->setMouseCursor(0, 0, *_gameShapes);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -328,35 +367,9 @@ int KyraEngine_v3::handleMainMenu(Movie *logo) {
|
||||
|
||||
drawMainMenu(strings, selected);
|
||||
|
||||
#define A 0x00
|
||||
#define B 0xFF
|
||||
#define C 0x7F
|
||||
|
||||
// TODO: This is just a mock-up of the real mouse cursor.
|
||||
const byte cursorImage[] = {
|
||||
A, A, C, C, C, C, C, C, C, C,
|
||||
A, B, A, C, C, C, C, C, C, C,
|
||||
A, B, B, A, C, C, C, C, C, C,
|
||||
A, B, B, B, A, C, C, C, C, C,
|
||||
A, B, B, B, B, A, C, C, C, C,
|
||||
A, B, B, B, B, B, A, C, C, C,
|
||||
A, B, B, B, B, B, B, A, C, C,
|
||||
A, B, B, B, B, B, B, B, A, C,
|
||||
A, B, B, B, B, B, B, B, B, A,
|
||||
C, A, A, A, B, B, B, A, A, C,
|
||||
C, C, C, C, A, B, B, B, A, C,
|
||||
C, C, C, C, C, A, B, B, B, A,
|
||||
C, C, C, C, C, C, A, A, A, C
|
||||
};
|
||||
|
||||
_system->warpMouse(300, 180);
|
||||
CursorMan.replaceCursor(cursorImage, 10, 13, 1, 1, C);
|
||||
_screen->showMouse();
|
||||
|
||||
#undef A
|
||||
#undef B
|
||||
#undef C
|
||||
|
||||
int fh = _screen->getFontHeight();
|
||||
int textPos = ((_screen->_curDim->w >> 1) + _screen->_curDim->sx) << 3;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ScummVM - Scumm Interpreter
|
||||
* Copyright (C) 2004-2006 The ScummVM project
|
||||
* Copyright (C) 2006 The ScummVM project
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -84,10 +84,22 @@ private:
|
||||
private:
|
||||
uint8 *_unkPage1;
|
||||
uint8 *_unkPage2;
|
||||
|
||||
|
||||
uint8 *_unkBuffer17;
|
||||
|
||||
// interface?
|
||||
uint8 *_interfaceCPS1;
|
||||
uint8 *_interfaceCPS2;
|
||||
|
||||
// shapes
|
||||
uint8 *_gameShapes[50];
|
||||
uint8 *_shapePoolBuffer;
|
||||
|
||||
uint8 *_mouseSHPBuf;
|
||||
|
||||
// items
|
||||
uint8 *_itemBuffer1;
|
||||
uint8 *_itemBuffer2;
|
||||
};
|
||||
|
||||
} // end of namespace Kyra
|
||||
|
@ -150,10 +150,14 @@ uint8 *Resource::fileData(const char *file, uint32 *size) {
|
||||
uint8 *buffer = 0;
|
||||
Common::File file_;
|
||||
|
||||
if (size)
|
||||
*size = 0;
|
||||
|
||||
// test to open it in the main dir
|
||||
if (file_.open(file)) {
|
||||
|
||||
*size = file_.size();
|
||||
if (size)
|
||||
*size = file_.size();
|
||||
buffer = new uint8[*size];
|
||||
assert(buffer);
|
||||
|
||||
@ -164,18 +168,22 @@ uint8 *Resource::fileData(const char *file, uint32 *size) {
|
||||
// opens the file in a PAK File
|
||||
Common::List<ResourceFile*>::iterator start = _pakfiles.begin();
|
||||
|
||||
uint32 temp = 0;
|
||||
for (;start != _pakfiles.end(); ++start) {
|
||||
*size = (*start)->getFileSize(file);
|
||||
|
||||
if (!(*size))
|
||||
temp = (*start)->getFileSize(file);
|
||||
|
||||
if (!temp)
|
||||
continue;
|
||||
|
||||
|
||||
if (size)
|
||||
*size = temp;
|
||||
|
||||
buffer = (*start)->getFile(file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!buffer || !(*size)) {
|
||||
if (!buffer) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2232,4 +2232,18 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *
|
||||
delete [] srcData;
|
||||
}
|
||||
|
||||
// kyra3 specific
|
||||
|
||||
uint8 *Screen::getPtrToShape(uint8 *shpFile, int shape) {
|
||||
debugC(9, kDebugLevelScreen, "KyraEngine::getPtrToShape(%p, %d)", (void *)shpFile, shape);
|
||||
uint16 shapes = READ_LE_UINT16(shpFile);
|
||||
|
||||
if (shapes <= shape)
|
||||
return 0;
|
||||
|
||||
uint32 offset = READ_LE_UINT32(shpFile + (shape << 1) + 2);
|
||||
|
||||
return shpFile + offset + 2;
|
||||
}
|
||||
|
||||
} // End of namespace Kyra
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
FID_8_FNT,
|
||||
FID_CRED6_FNT,
|
||||
FID_CRED8_FNT,
|
||||
FID_BOOKFONT_FNT,
|
||||
FID_NUM
|
||||
};
|
||||
|
||||
@ -187,6 +188,8 @@ public:
|
||||
// maybe subclass screen for kyra3
|
||||
static const ScreenDim _screenDimTableK3[];
|
||||
static const int _screenDimTableCountK3;
|
||||
|
||||
uint8 *getPtrToShape(uint8 *shpFile, int shape);
|
||||
private:
|
||||
uint8 *getPagePtr(int pageNum);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user