mirror of
https://github.com/libretro/scummvm.git
synced 2025-05-13 09:36:21 +00:00
JANITORIAL: Remove trailing whitespace
This commit is contained in:
parent
6e4217e1ba
commit
989ea7cb56
@ -163,7 +163,7 @@ int MidiDriver_FluidSynth::open() {
|
||||
|
||||
Common::String interpolation = ConfMan.get("fluidsynth_misc_interpolation");
|
||||
int interpMethod = FLUID_INTERP_4THORDER;
|
||||
|
||||
|
||||
if (interpolation == "none") {
|
||||
interpMethod = FLUID_INTERP_NONE;
|
||||
} else if (interpolation == "linear") {
|
||||
|
@ -773,7 +773,7 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
|
||||
|
||||
if (_displayDisabled) {
|
||||
_hwscreen = g_eventRec.getSurface(_videoMode.hardwareWidth, _videoMode.hardwareHeight);
|
||||
} else
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
_hwscreen = SDL_SetVideoMode(_videoMode.hardwareWidth, _videoMode.hardwareHeight, 16,
|
||||
|
@ -316,16 +316,16 @@ void TizenAppForm::invokeShortcut() {
|
||||
case kControlMouse:
|
||||
setButtonShortcut();
|
||||
break;
|
||||
|
||||
|
||||
case kEscapeKey:
|
||||
pushKey(Common::KEYCODE_ESCAPE);
|
||||
break;
|
||||
|
||||
|
||||
case kGameMenu:
|
||||
_buttonState = kLeftButton;
|
||||
pushKey(Common::KEYCODE_F5);
|
||||
break;
|
||||
|
||||
|
||||
case kShowKeypad:
|
||||
showKeypad();
|
||||
break;
|
||||
|
@ -231,7 +231,7 @@ bool NEResources::readResourceTable(uint32 offset) {
|
||||
if (id & 0x8000)
|
||||
res.id = id & 0x7FFF;
|
||||
else
|
||||
res.id = getResourceString(*_exe, offset + id);
|
||||
res.id = getResourceString(*_exe, offset + id);
|
||||
|
||||
if (typeID & 0x8000 && ((typeID & 0x7FFF) < ARRAYSIZE(s_resTypeNames)) && s_resTypeNames[typeID & 0x7FFF][0] != 0)
|
||||
debug(2, "Found resource %s %s", s_resTypeNames[typeID & 0x7FFF], res.id.toString().c_str());
|
||||
|
@ -69,13 +69,13 @@ bool loadExe(const char *filename) {
|
||||
|
||||
bool validateMd5() {
|
||||
uint8 digest[16];
|
||||
|
||||
|
||||
md5_buffer(data, dataSize, digest);
|
||||
|
||||
|
||||
printf("MD5 of nhc.exe is %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
|
||||
digest[0], digest[1], digest[2], digest[3], digest[4], digest[5], digest[6], digest[7],
|
||||
digest[0], digest[1], digest[2], digest[3], digest[4], digest[5], digest[6], digest[7],
|
||||
digest[8], digest[9], digest[10], digest[11], digest[12], digest[13], digest[14], digest[15]);
|
||||
|
||||
|
||||
if (memcmp(kNhcExeMd5, digest, 16)) {
|
||||
printf("MD5 hash of nhc.exe doesn't match the expected value! Quitting...\n");
|
||||
return false;
|
||||
@ -112,7 +112,7 @@ uint32 calcHash(const char *value) {
|
||||
struct HitRect {
|
||||
int16 x1, y1, x2, y2;
|
||||
uint16 messageNum;
|
||||
|
||||
|
||||
void load(uint32 offset) {
|
||||
byte *item = getData(offset);
|
||||
x1 = READ_LE_UINT16(item + 0);
|
||||
@ -120,7 +120,7 @@ struct HitRect {
|
||||
x2 = READ_LE_UINT16(item + 4);
|
||||
y2 = READ_LE_UINT16(item + 6);
|
||||
messageNum = READ_LE_UINT16(item + 8);
|
||||
}
|
||||
}
|
||||
|
||||
void save(FILE *fd) {
|
||||
writeUint16LE(fd, x1);
|
||||
@ -129,11 +129,11 @@ struct HitRect {
|
||||
writeUint16LE(fd, y2);
|
||||
writeUint16LE(fd, messageNum);
|
||||
}
|
||||
|
||||
|
||||
int getItemSize() const {
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct MessageItem {
|
||||
@ -141,22 +141,22 @@ struct MessageItem {
|
||||
uint32 messageParam;
|
||||
MessageItem() {}
|
||||
MessageItem(uint16 msgNum, uint32 msgParam) : messageNum(msgNum), messageParam(msgParam) {}
|
||||
|
||||
|
||||
void load(uint32 offset) {
|
||||
byte *item = getData(offset);
|
||||
messageNum = READ_LE_UINT16(item + 0);
|
||||
messageParam = READ_LE_UINT32(item + 4);
|
||||
}
|
||||
}
|
||||
|
||||
void save(FILE *fd) {
|
||||
writeUint16LE(fd, messageNum);
|
||||
writeUint32LE(fd, messageParam);
|
||||
}
|
||||
|
||||
|
||||
int getItemSize() const {
|
||||
return 8;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct SubRectItem {
|
||||
@ -175,7 +175,7 @@ struct SubRectItem {
|
||||
// Add the message to the message list
|
||||
addMessageList(messageListCount, messageListOffset);
|
||||
}
|
||||
|
||||
|
||||
void save(FILE *fd) {
|
||||
writeUint16LE(fd, x1);
|
||||
writeUint16LE(fd, y1);
|
||||
@ -183,11 +183,11 @@ struct SubRectItem {
|
||||
writeUint16LE(fd, y2);
|
||||
writeUint32LE(fd, messageListOffset);
|
||||
}
|
||||
|
||||
|
||||
int getItemSize() const {
|
||||
return 16;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct RectItem {
|
||||
@ -212,7 +212,7 @@ struct RectItem {
|
||||
subItemOffset += 16;
|
||||
subRectItems.push_back(subRectItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void save(FILE *fd) {
|
||||
writeUint16LE(fd, x1);
|
||||
@ -223,11 +223,11 @@ struct RectItem {
|
||||
for (uint32 j = 0; j < subRectItems.size(); j++)
|
||||
subRectItems[j].save(fd);
|
||||
}
|
||||
|
||||
|
||||
int getItemSize() const {
|
||||
return 16;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct NavigationItem {
|
||||
@ -238,10 +238,10 @@ struct NavigationItem {
|
||||
byte interactive;
|
||||
byte middleFlag;
|
||||
uint32 mouseCursorFileHash;
|
||||
|
||||
|
||||
void load(uint32 offset) {
|
||||
byte *item = getData(offset);
|
||||
fileHash = READ_LE_UINT32(item + 0);
|
||||
fileHash = READ_LE_UINT32(item + 0);
|
||||
leftSmackerFileHash = READ_LE_UINT32(item + 4);
|
||||
rightSmackerFileHash = READ_LE_UINT32(item + 8);
|
||||
middleSmackerFileHash = READ_LE_UINT32(item + 12);
|
||||
@ -263,7 +263,7 @@ struct NavigationItem {
|
||||
int getItemSize() const {
|
||||
return 24;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct SceneInfo140Item {
|
||||
@ -347,24 +347,24 @@ struct SceneInfo2700Item {
|
||||
template<class ITEMCLASS>
|
||||
class StaticDataList {
|
||||
public:
|
||||
uint32 id;
|
||||
uint32 id;
|
||||
std::vector<ITEMCLASS> items;
|
||||
|
||||
|
||||
virtual ~StaticDataList() {
|
||||
}
|
||||
|
||||
|
||||
void add(ITEMCLASS item) {
|
||||
items.push_back(item);
|
||||
}
|
||||
|
||||
|
||||
int getCount() const {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
|
||||
ITEMCLASS *getListItem(int index) {
|
||||
return &items[index];
|
||||
}
|
||||
|
||||
|
||||
virtual bool specialLoadList(uint32 count, uint32 offset) {
|
||||
return false;
|
||||
}
|
||||
@ -398,7 +398,7 @@ class RectList : public StaticDataList<RectItem> {
|
||||
};
|
||||
|
||||
class MessageList : public StaticDataList<MessageItem> {
|
||||
public:
|
||||
public:
|
||||
|
||||
virtual bool specialLoadList(uint32 count, uint32 offset) {
|
||||
// Special code for message lists which are set at runtime (but otherwise constant)
|
||||
@ -455,7 +455,7 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
class NavigationList : public StaticDataList<NavigationItem> {
|
||||
@ -465,11 +465,11 @@ template<class LISTCLASS>
|
||||
class StaticDataListVector {
|
||||
public:
|
||||
std::vector<LISTCLASS*> lists;
|
||||
|
||||
|
||||
void add(LISTCLASS *list) {
|
||||
lists.push_back(list);
|
||||
}
|
||||
|
||||
|
||||
void loadListVector(const uint32 *offsets) {
|
||||
for (int i = 0; offsets[i] != 0; i += 2) {
|
||||
LISTCLASS *list = new LISTCLASS();
|
||||
@ -486,7 +486,7 @@ public:
|
||||
lists.push_back(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void saveListVector(FILE *fd) {
|
||||
writeUint32LE(fd, lists.size());
|
||||
for (typename std::vector<LISTCLASS*>::iterator it = lists.begin(); it != lists.end(); it++) {
|
||||
@ -500,7 +500,7 @@ template<class ITEMCLASS>
|
||||
class StaticDataVector {
|
||||
public:
|
||||
std::vector<ITEMCLASS> items;
|
||||
|
||||
|
||||
void loadVector(const uint32 *offsets) {
|
||||
for (int i = 0; offsets[i] != 0; i++) {
|
||||
ITEMCLASS item;
|
||||
@ -508,7 +508,7 @@ public:
|
||||
items.push_back(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void saveVector(FILE *fd) {
|
||||
writeUint32LE(fd, items.size());
|
||||
for (typename std::vector<ITEMCLASS>::iterator it = items.begin(); it != items.end(); it++) {
|
||||
@ -522,8 +522,8 @@ StaticDataListVector<HitRectList> hitRectLists;
|
||||
StaticDataListVector<RectList> rectLists;
|
||||
StaticDataListVector<MessageList> messageLists;
|
||||
StaticDataListVector<NavigationList> navigationLists;
|
||||
StaticDataVector<SceneInfo140Item> sceneInfo140Items;
|
||||
StaticDataVector<SceneInfo2700Item> sceneInfo2700Items;
|
||||
StaticDataVector<SceneInfo140Item> sceneInfo140Items;
|
||||
StaticDataVector<SceneInfo2700Item> sceneInfo2700Items;
|
||||
|
||||
void addMessageList(uint32 messageListCount, uint32 messageListOffset) {
|
||||
MessageList *messageList = new MessageList();
|
||||
@ -550,7 +550,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
writeUint32LE(datFile, 0x11223344); // Some magic
|
||||
writeUint32LE(datFile, DAT_VERSION);
|
||||
|
||||
|
||||
messageLists.saveListVector(datFile);
|
||||
rectLists.saveListVector(datFile);
|
||||
hitRectLists.saveListVector(datFile);
|
||||
|
@ -122,7 +122,7 @@ static const uint32 rectListOffsets[] = {
|
||||
// Scene2406
|
||||
1, 0x004B78C8,
|
||||
1, 0x004B78D8,
|
||||
// Scene2501
|
||||
// Scene2501
|
||||
1, 0x004B2608,
|
||||
// Scene2732
|
||||
1, 0x004AE360,
|
||||
|
@ -15148,7 +15148,7 @@ const static char* dialog_162[] = {
|
||||
};
|
||||
|
||||
// Note:
|
||||
// The usage of this in the engine overlaps the previous dialog i.e. the
|
||||
// The usage of this in the engine overlaps the previous dialog i.e. the
|
||||
// starting offset used is two bytes early, thus implicitly changing the
|
||||
// first command of this dialog from NEW_LINE to CHANGE_CHARACTER.
|
||||
const static char* dialog_163[] = {
|
||||
|
@ -598,8 +598,8 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
|
||||
_console = NULL;
|
||||
|
||||
_egoHoldKey = false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AgiEngine::initialize() {
|
||||
|
@ -121,7 +121,7 @@ static const CgeGameDescription gameDescriptions[] = {
|
||||
"sfinx", "Sfinx Freeware",
|
||||
{
|
||||
{"vol.cat", 0, "21197b287d397c53261b6616bf0dd880", 129024},
|
||||
{"vol.dat", 0, "de14291869a8eb7c2732ab783c7542ef", 34180844},
|
||||
{"vol.dat", 0, "de14291869a8eb7c2732ab783c7542ef", 34180844},
|
||||
AD_LISTEND
|
||||
},
|
||||
Common::PL_POL, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO0()
|
||||
|
@ -494,7 +494,7 @@ void CGEEngine::snGame(Sprite *spr, int num) {
|
||||
_sprK3->step(newRandom(6));
|
||||
|
||||
// check the ALT key as it's the solution of the puzzle
|
||||
// the test has been restricted to some specific OSes
|
||||
// the test has been restricted to some specific OSes
|
||||
// in order to avoid some obvious issues (like Android, iOS, NDS, N64...)
|
||||
// Not perfect, but at least better than nothing.
|
||||
#if defined(WIN32) || defined(UNIX) || defined(MACOSX) || defined(MOTOEZX) || defined(LINUPY) || defined(LINUXMOTO_SDL)
|
||||
|
@ -661,7 +661,7 @@ public:
|
||||
void animation_3_1(); // John talks with the bartender to book a room
|
||||
void animation_4_1(); // John talks with the pianist
|
||||
//
|
||||
void animation_2_2(); // John enters the chapel via the window
|
||||
void animation_2_2(); // John enters the chapel via the window
|
||||
void animation_4_2(); // John talks with the blind man (closeup)
|
||||
void animation_5_2(); // John breaks the chapel window with the pike
|
||||
void animation_6_2(); // The blind man (closeup) thanks John for giving him money and hands him the sickle
|
||||
|
@ -104,7 +104,7 @@ void DreamWebEngine::useMon() {
|
||||
redrawMainScrn();
|
||||
workToScreenM();
|
||||
}
|
||||
|
||||
|
||||
int DreamWebEngine::findCommand(const char *const cmdList[]) {
|
||||
// Loop over all commands in the list and see if we get a match
|
||||
int cmd = 0;
|
||||
@ -135,7 +135,7 @@ bool DreamWebEngine::execCommand() {
|
||||
"KEYS",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static const char *const comlistFR[] = {
|
||||
"SORTIR",
|
||||
"AIDE",
|
||||
@ -145,7 +145,7 @@ bool DreamWebEngine::execCommand() {
|
||||
"TOUCHES", // should be CLES but it is translated as TOUCHES in the game...
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static const char *const comlistDE[] = {
|
||||
"ENDE",
|
||||
"HILF",
|
||||
@ -155,7 +155,7 @@ bool DreamWebEngine::execCommand() {
|
||||
"DATEN",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static const char *const comlistIT[] = {
|
||||
"ESCI",
|
||||
"AIUTO",
|
||||
@ -165,7 +165,7 @@ bool DreamWebEngine::execCommand() {
|
||||
"CHIAVI",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static const char *const comlistES[] = {
|
||||
"SALIR",
|
||||
"AYUDA",
|
||||
|
@ -67,7 +67,7 @@ void DreamWebEngine::printChar(const GraphicsFile &charSet, uint16* x, uint16 y,
|
||||
// characters (0 - 31).
|
||||
if (c < 32 || c == 255)
|
||||
return;
|
||||
|
||||
|
||||
uint8 dummyWidth, dummyHeight;
|
||||
if (width == NULL)
|
||||
width = &dummyWidth;
|
||||
|
@ -249,7 +249,7 @@ void StuffItArchive::update14(uint16 first, uint16 last, byte *code, uint16 *fre
|
||||
do {
|
||||
while (++i < last && code[first] > code[i])
|
||||
;
|
||||
|
||||
|
||||
while (--j > first && code[first] < code[j])
|
||||
;
|
||||
|
||||
|
@ -505,7 +505,7 @@ void DialogsManager::inventAnim() {
|
||||
return;
|
||||
|
||||
if (_vm->_objectsMan->_eraseVisibleCounter && !_vm->_objectsMan->_visibleFl) {
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, _oldInventX, 27, 48, 38,
|
||||
_vm->_graphicsMan->copySurface(_vm->_graphicsMan->_backBuffer, _oldInventX, 27, 48, 38,
|
||||
_vm->_graphicsMan->_frontBuffer, _oldInventX, 27);
|
||||
_vm->_graphicsMan->addDirtyRect(_oldInventX, 27, _oldInventX + 48, 65);
|
||||
--_vm->_objectsMan->_eraseVisibleCounter;
|
||||
|
@ -134,7 +134,7 @@ Globals::~Globals() {
|
||||
void Globals::setConfig() {
|
||||
// CHECKME: Should be in Globals() but it doesn't work
|
||||
// The Polish version is a translation of the English version. The filenames are the same.
|
||||
// The Russian version looks like a translation of the English version, based on the filenames.
|
||||
// The Russian version looks like a translation of the English version, based on the filenames.
|
||||
switch (_vm->getLanguage()) {
|
||||
case Common::EN_ANY:
|
||||
case Common::PL_POL:
|
||||
|
@ -1179,7 +1179,7 @@ void GraphicsManager::displayZones() {
|
||||
Common::Rect r(_vm->_objectsMan->_bob[bobId]._oldX, _vm->_objectsMan->_bob[bobId]._oldY,
|
||||
_vm->_objectsMan->_bob[bobId]._oldX + _vm->_objectsMan->_bob[bobId]._oldWidth,
|
||||
_vm->_objectsMan->_bob[bobId]._oldY + _vm->_objectsMan->_bob[bobId]._oldHeight);
|
||||
|
||||
|
||||
displayDebugRect(screenSurface, r, 0xff0000);
|
||||
}
|
||||
}
|
||||
@ -1204,7 +1204,7 @@ void GraphicsManager::displayLines() {
|
||||
|
||||
uint16* pixels = (uint16*)screenSurface->pixels;
|
||||
|
||||
for (int lineIndex = 0; lineIndex < _vm->_linesMan->_linesNumb; lineIndex++) {
|
||||
for (int lineIndex = 0; lineIndex < _vm->_linesMan->_linesNumb; lineIndex++) {
|
||||
int i = 0;
|
||||
do {
|
||||
int x = _vm->_linesMan->_lineItem[lineIndex]._lineData[i] - _scrollPosX;
|
||||
@ -1230,7 +1230,7 @@ void GraphicsManager::displayDebugRect(Graphics::Surface *surface, const Common:
|
||||
r.top = MAX(r.top, (int16)0);
|
||||
r.right = MIN(r.right, (int16)SCREEN_WIDTH);
|
||||
r.bottom = MIN(r.bottom, (int16)SCREEN_HEIGHT);
|
||||
|
||||
|
||||
// If there's an on-screen portion, display it
|
||||
if (r.isValidRect())
|
||||
surface->frameRect(r, color);
|
||||
|
@ -125,7 +125,7 @@ public:
|
||||
public:
|
||||
GraphicsManager(HopkinsEngine *vm);
|
||||
~GraphicsManager();
|
||||
|
||||
|
||||
void clearPalette();
|
||||
void clearScreen();
|
||||
void clearVesaScreen();
|
||||
|
@ -92,7 +92,7 @@ bool HopkinsEngine::canLoadGameStateCurrently() {
|
||||
* Returns true if it is currently okay to save the game
|
||||
*/
|
||||
bool HopkinsEngine::canSaveGameStateCurrently() {
|
||||
return !_globals->_exitId && !_globals->_cityMapEnabledFl && _events->_mouseFl
|
||||
return !_globals->_exitId && !_globals->_cityMapEnabledFl && _events->_mouseFl
|
||||
&& _globals->_curRoomNum != 0 && !isUnderwaterSubScene();
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ HugoEngine::HugoEngine(OSystem *syst, const HugoGameDescription *gd) : Engine(sy
|
||||
|
||||
_console = new HugoConsole(this);
|
||||
_rnd = 0;
|
||||
|
||||
|
||||
_screen = NULL;
|
||||
_mouse = NULL;
|
||||
_inventory = NULL;
|
||||
|
@ -33,11 +33,11 @@ Background::Background(NeverhoodEngine *vm, int objectPriority)
|
||||
|
||||
Background::Background(NeverhoodEngine *vm, uint32 fileHash, int objectPriority, int surfacePriority)
|
||||
: Entity(vm, objectPriority), _surface(NULL), _spriteResource(vm) {
|
||||
|
||||
|
||||
_spriteResource.load(fileHash);
|
||||
createSurface(surfacePriority, _spriteResource.getDimensions().width, _spriteResource.getDimensions().height);
|
||||
_surface->drawSpriteResource(_spriteResource);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Background::~Background() {
|
||||
|
@ -58,8 +58,8 @@ BlbArchive::~BlbArchive() {
|
||||
void BlbArchive::open(const Common::String &filename) {
|
||||
BlbHeader header;
|
||||
uint16 *extDataOffsets;
|
||||
|
||||
_entries.clear();
|
||||
|
||||
_entries.clear();
|
||||
|
||||
if (!_fd.open(filename))
|
||||
error("BlbArchive::open() Could not open %s", filename.c_str());
|
||||
@ -83,16 +83,16 @@ void BlbArchive::open(const Common::String &filename) {
|
||||
entry.fileHash = _fd.readUint32LE();
|
||||
_entries.push_back(entry);
|
||||
}
|
||||
|
||||
|
||||
extDataOffsets = new uint16[header.fileCount];
|
||||
|
||||
|
||||
// Load file records
|
||||
for (uint i = 0; i < header.fileCount; i++) {
|
||||
BlbArchiveEntry &entry = _entries[i];
|
||||
entry.type = _fd.readByte();
|
||||
entry.comprType = _fd.readByte();
|
||||
entry.extData = NULL;
|
||||
extDataOffsets[i] = _fd.readUint16LE();
|
||||
extDataOffsets[i] = _fd.readUint16LE();
|
||||
entry.timeStamp = _fd.readUint32LE();
|
||||
entry.offset = _fd.readUint32LE();
|
||||
entry.diskSize = _fd.readUint32LE();
|
||||
@ -101,7 +101,7 @@ void BlbArchive::open(const Common::String &filename) {
|
||||
entry.fileHash, entry.type, entry.comprType, extDataOffsets[i], entry.timeStamp,
|
||||
entry.offset, entry.diskSize, entry.size);
|
||||
}
|
||||
|
||||
|
||||
// Load ext data
|
||||
if (header.extDataSize > 0) {
|
||||
_extData = new byte[header.extDataSize];
|
||||
@ -120,9 +120,9 @@ void BlbArchive::load(uint index, byte *buffer, uint32 size) {
|
||||
|
||||
void BlbArchive::load(BlbArchiveEntry *entry, byte *buffer, uint32 size) {
|
||||
Common::StackLock lock(_mutex);
|
||||
|
||||
|
||||
_fd.seek(entry->offset);
|
||||
|
||||
|
||||
switch (entry->comprType) {
|
||||
case 1: // Uncompressed
|
||||
if (size == 0)
|
||||
|
@ -81,7 +81,7 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
|
||||
DebugPrintf(" music - shows the correct index in the radio music puzzle, module 2800, scene 1\n");
|
||||
DebugPrintf(" radio - enables the radio, module 3000, scene 9 - same as pulling the rightmost cord in the flytrap room\n");
|
||||
DebugPrintf(" symbols - solves the symbols puzzle, module 1600, scene 8. Only available in that room\n");
|
||||
DebugPrintf(" tubes - shows the correct test tube combination in module 2800, scenes 7 and 10\n");
|
||||
DebugPrintf(" tubes - shows the correct test tube combination in module 2800, scenes 7 and 10\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ static const uint32 kDiskplayerSmackerFileHashes[] = {
|
||||
0x04002810
|
||||
};
|
||||
|
||||
static const uint32 kDiskplayerSlotFileHashes1[] = {
|
||||
static const uint32 kDiskplayerSlotFileHashes1[] = {
|
||||
0x81312280,
|
||||
0x01312281,
|
||||
0x01312282,
|
||||
@ -84,7 +84,7 @@ static const uint32 kDiskplayerSlotFileHashes1[] = {
|
||||
0x04312281
|
||||
};
|
||||
|
||||
static const uint32 kDiskplayerSlotFileHashes2[] = {
|
||||
static const uint32 kDiskplayerSlotFileHashes2[] = {
|
||||
0x90443A00,
|
||||
0x90443A18,
|
||||
0x90443A28,
|
||||
@ -107,8 +107,8 @@ static const uint32 kDiskplayerSlotFileHashes2[] = {
|
||||
0xC0443A18
|
||||
};
|
||||
|
||||
static const uint32 kDiskplayerSlotFileHashes3[] = {
|
||||
0x10357320,
|
||||
static const uint32 kDiskplayerSlotFileHashes3[] = {
|
||||
0x10357320,
|
||||
0x10557320,
|
||||
0x10957320,
|
||||
0x11157320,
|
||||
@ -130,7 +130,7 @@ static const uint32 kDiskplayerSlotFileHashes3[] = {
|
||||
0x10543320
|
||||
};
|
||||
|
||||
static const uint32 kDiskplayerSlotFileHashes4[] = {
|
||||
static const uint32 kDiskplayerSlotFileHashes4[] = {
|
||||
0xDC8020E4,
|
||||
0xDC802164,
|
||||
0xDC802264,
|
||||
@ -155,7 +155,7 @@ static const uint32 kDiskplayerSlotFileHashes4[] = {
|
||||
|
||||
AsDiskplayerSceneKey::AsDiskplayerSceneKey(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1100) {
|
||||
|
||||
|
||||
createSurface1(0x100B90B4, 1200);
|
||||
_x = 211;
|
||||
_y = 195;
|
||||
@ -193,7 +193,7 @@ void AsDiskplayerSceneKey::stDropKeyDone() {
|
||||
|
||||
DiskplayerPlayButton::DiskplayerPlayButton(NeverhoodEngine *vm, DiskplayerScene *diskplayerScene)
|
||||
: StaticSprite(vm, 1400), _diskplayerScene(diskplayerScene), _isPlaying(false) {
|
||||
|
||||
|
||||
loadSprite(0x24A4A664, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
loadSound(0, 0x44043000);
|
||||
@ -317,10 +317,10 @@ void DiskplayerSlot::stop() {
|
||||
|
||||
DiskplayerScene::DiskplayerScene(NeverhoodEngine *vm, Module *parentModule, int paletteIndex)
|
||||
: Scene(vm, parentModule), _diskIndex(0), _appearCountdown(0), _tuneInCountdown(0),
|
||||
_hasAllDisks(false), _dropKey(false), _inputDisabled(true), _updateStatus(kUSStopped) {
|
||||
_hasAllDisks(false), _dropKey(false), _inputDisabled(true), _updateStatus(kUSStopped) {
|
||||
|
||||
int availableDisksCount = 0;
|
||||
|
||||
|
||||
setBackground(0x8A000044);
|
||||
setPalette(kDiskplayerPaletteFileHashes[paletteIndex]);
|
||||
|
||||
@ -344,7 +344,7 @@ DiskplayerScene::DiskplayerScene(NeverhoodEngine *vm, Module *parentModule, int
|
||||
}
|
||||
|
||||
_hasAllDisks = availableDisksCount == 20;
|
||||
|
||||
|
||||
if (_hasAllDisks && !getGlobalVar(V_HAS_FINAL_KEY))
|
||||
_dropKey = true;
|
||||
|
||||
@ -360,8 +360,8 @@ DiskplayerScene::DiskplayerScene(NeverhoodEngine *vm, Module *parentModule, int
|
||||
|
||||
_palette->usePalette();
|
||||
|
||||
SetMessageHandler(&DiskplayerScene::handleMessage);
|
||||
SetUpdateHandler(&DiskplayerScene::update);
|
||||
SetMessageHandler(&DiskplayerScene::handleMessage);
|
||||
SetUpdateHandler(&DiskplayerScene::update);
|
||||
_appearCountdown = 6;
|
||||
|
||||
}
|
||||
@ -417,7 +417,7 @@ void DiskplayerScene::update() {
|
||||
}
|
||||
_diskIndex++;
|
||||
while (!_diskAvailable[_diskIndex] && _diskIndex < 19)
|
||||
_diskIndex++;
|
||||
_diskIndex++;
|
||||
if (_diskIndex < 20) {
|
||||
_appearCountdown = 1;
|
||||
} else {
|
||||
@ -448,7 +448,7 @@ uint32 DiskplayerScene::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
} else if (!_dropKey &&
|
||||
param.asPoint().x > 38 && param.asPoint().x < 598 &&
|
||||
param.asPoint().y > 400 && param.asPoint().y < 460) {
|
||||
|
||||
|
||||
_diskSlots[_diskIndex]->stop();
|
||||
_diskIndex = (param.asPoint().x - 38) / 28;
|
||||
_diskSlots[_diskIndex]->activate();
|
||||
@ -462,10 +462,10 @@ uint32 DiskplayerScene::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
break;
|
||||
case 0x2000:
|
||||
tuneIn();
|
||||
break;
|
||||
break;
|
||||
case 0x2001:
|
||||
stop();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -36,7 +36,7 @@ class AsDiskplayerSceneKey : public AnimatedSprite {
|
||||
public:
|
||||
AsDiskplayerSceneKey(NeverhoodEngine *vm);
|
||||
void stDropKey();
|
||||
protected:
|
||||
protected:
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
void stDropKeyDone();
|
||||
};
|
||||
@ -47,7 +47,7 @@ public:
|
||||
void press();
|
||||
void release();
|
||||
protected:
|
||||
DiskplayerScene *_diskplayerScene;
|
||||
DiskplayerScene *_diskplayerScene;
|
||||
bool _isPlaying;
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
@ -69,7 +69,7 @@ protected:
|
||||
int _blinkCountdown;
|
||||
bool _isLocked;
|
||||
bool _isBlinking;
|
||||
void update();
|
||||
void update();
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -25,25 +25,25 @@
|
||||
|
||||
namespace Neverhood {
|
||||
|
||||
uint32 MessageParam::asInteger() const {
|
||||
assert(_type == mptInteger);
|
||||
return _integer;
|
||||
uint32 MessageParam::asInteger() const {
|
||||
assert(_type == mptInteger);
|
||||
return _integer;
|
||||
}
|
||||
|
||||
NPoint MessageParam::asPoint() const {
|
||||
NPoint MessageParam::asPoint() const {
|
||||
assert(_type == mptInteger || _type == mptPoint);
|
||||
if (_type == mptInteger) {
|
||||
NPoint pt;
|
||||
pt.x = _integer & 0xFFFF;
|
||||
pt.y = (_integer >> 16) & 0xFFFF;
|
||||
pt.y = (_integer >> 16) & 0xFFFF;
|
||||
return pt;
|
||||
}
|
||||
return _point;
|
||||
}
|
||||
return _point;
|
||||
}
|
||||
|
||||
Entity *MessageParam::asEntity() const {
|
||||
assert(_type == mptEntity);
|
||||
return _entity;
|
||||
assert(_type == mptEntity);
|
||||
return _entity;
|
||||
}
|
||||
|
||||
Entity::Entity(NeverhoodEngine *vm, int priority)
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
void incGlobalVar(uint32 nameHash, int incrValue);
|
||||
void incSubVar(uint32 nameHash, uint32 subNameHash, int incrValue);
|
||||
int getPriority() const { return _priority; }
|
||||
bool hasMessageHandler() const { return _messageHandlerCb != NULL; }
|
||||
bool hasMessageHandler() const { return _messageHandlerCb != NULL; }
|
||||
protected:
|
||||
void (Entity::*_updateHandlerCb)();
|
||||
uint32 (Entity::*_messageHandlerCb)(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
@ -77,7 +77,7 @@ GameModule::GameModule(NeverhoodEngine *vm)
|
||||
: Module(vm, NULL), _moduleNum(-1), _prevChildObject(NULL), _prevModuleNum(-1),
|
||||
_restoreGameRequested(false), _restartGameRequested(false), _canRequestMainMenu(true),
|
||||
_mainMenuRequested(false) {
|
||||
|
||||
|
||||
// Other initializations moved to actual engine class
|
||||
_vm->_soundMan->playSoundThree(0x002D0031, 0x8861079);
|
||||
SetMessageHandler(&GameModule::handleMessage);
|
||||
@ -96,7 +96,7 @@ void GameModule::handleMouseMove(int16 x, int16 y) {
|
||||
mousePos.y = y;
|
||||
debug(2, "GameModule::handleMouseMove(%d, %d)", x, y);
|
||||
sendPointMessage(_childObject, 0, mousePos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameModule::handleMouseDown(int16 x, int16 y) {
|
||||
@ -106,7 +106,7 @@ void GameModule::handleMouseDown(int16 x, int16 y) {
|
||||
mousePos.y = y;
|
||||
debug(2, "GameModule::handleMouseDown(%d, %d)", x, y);
|
||||
sendPointMessage(_childObject, 0x0001, mousePos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameModule::handleMouseUp(int16 x, int16 y) {
|
||||
@ -116,21 +116,21 @@ void GameModule::handleMouseUp(int16 x, int16 y) {
|
||||
mousePos.y = y;
|
||||
debug(2, "GameModule::handleMouseUp(%d, %d)", x, y);
|
||||
sendPointMessage(_childObject, 0x0002, mousePos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameModule::handleSpaceKey() {
|
||||
if (_childObject) {
|
||||
debug(2, "GameModule::handleSpaceKey()");
|
||||
sendMessage(_childObject, 0x0009, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameModule::handleAsciiKey(char key) {
|
||||
if (_childObject) {
|
||||
debug(2, "GameModule::handleAsciiKey()");
|
||||
sendMessage(_childObject, 0x000A, (uint32)key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameModule::handleKeyDown(Common::KeyCode keyCode) {
|
||||
@ -141,7 +141,7 @@ void GameModule::handleKeyDown(Common::KeyCode keyCode) {
|
||||
handleSpaceKey();
|
||||
debug(2, "GameModule::handleKeyDown()");
|
||||
sendMessage(_childObject, 0x000B, keyCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameModule::handleEscapeKey() {
|
||||
@ -166,7 +166,7 @@ void GameModule::initKeySlotsPuzzle() {
|
||||
|
||||
void GameModule::initMemoryPuzzle() {
|
||||
if (!getSubVar(VA_IS_PUZZLE_INIT, 0xC8606803)) {
|
||||
NonRepeatingRandomNumbers diceIndices(_vm->_rnd, 3);
|
||||
NonRepeatingRandomNumbers diceIndices(_vm->_rnd, 3);
|
||||
NonRepeatingRandomNumbers availableTiles(_vm->_rnd, 48);
|
||||
NonRepeatingRandomNumbers tileSymbols(_vm->_rnd, 10);
|
||||
for (uint32 i = 0; i < 3; i++)
|
||||
@ -320,11 +320,11 @@ uint32 GameModule::handleMessage(int messageNum, const MessageParam ¶m, Enti
|
||||
switch (messageNum) {
|
||||
case 0x0800:
|
||||
_canRequestMainMenu = true;
|
||||
break;
|
||||
break;
|
||||
case 0x1009:
|
||||
_moduleResult = param.asInteger();
|
||||
_done = true;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
void initWaterPipesPuzzle();
|
||||
void initRadioPuzzle();
|
||||
void initTestTubes1Puzzle();
|
||||
void initTestTubes2Puzzle();
|
||||
void initTestTubes2Puzzle();
|
||||
void initCannonSymbolsPuzzle();
|
||||
void initCodeSymbolsPuzzle();
|
||||
void initCubeSymbolsPuzzle();
|
||||
|
@ -75,7 +75,7 @@ uint32 GameVars::getSubVar(uint32 nameHash, uint32 subNameHash) {
|
||||
int16 subVarIndex = findSubVarIndex(varIndex, subNameHash);
|
||||
if (subVarIndex != -1)
|
||||
value = _vars[subVarIndex].value;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ enum {
|
||||
VA_HAS_KEY = 0x0090EA95,
|
||||
VA_IS_KEY_INSERTED = 0x08D0AB11,
|
||||
VA_LOCKS_DISABLED = 0x14800353,
|
||||
V_END_
|
||||
V_END_
|
||||
};
|
||||
|
||||
struct GameVar {
|
||||
|
@ -29,7 +29,7 @@ namespace Neverhood {
|
||||
BaseSurface::BaseSurface(NeverhoodEngine *vm, int priority, int16 width, int16 height, Common::String name)
|
||||
: _vm(vm), _priority(priority), _visible(true), _transparent(true),
|
||||
_clipRects(NULL), _clipRectsCount(0), _version(0), _name(name) {
|
||||
|
||||
|
||||
_drawRect.x = 0;
|
||||
_drawRect.y = 0;
|
||||
_drawRect.width = width;
|
||||
@ -68,7 +68,7 @@ void BaseSurface::clear() {
|
||||
}
|
||||
|
||||
void BaseSurface::drawSpriteResource(SpriteResource &spriteResource) {
|
||||
if (spriteResource.getDimensions().width <= _drawRect.width &&
|
||||
if (spriteResource.getDimensions().width <= _drawRect.width &&
|
||||
spriteResource.getDimensions().height <= _drawRect.height) {
|
||||
clear();
|
||||
spriteResource.draw(_surface, false, false);
|
||||
@ -77,7 +77,7 @@ void BaseSurface::drawSpriteResource(SpriteResource &spriteResource) {
|
||||
}
|
||||
|
||||
void BaseSurface::drawSpriteResourceEx(SpriteResource &spriteResource, bool flipX, bool flipY, int16 width, int16 height) {
|
||||
if (spriteResource.getDimensions().width <= _sysRect.width &&
|
||||
if (spriteResource.getDimensions().width <= _sysRect.width &&
|
||||
spriteResource.getDimensions().height <= _sysRect.height) {
|
||||
if (width > 0 && width <= _sysRect.width)
|
||||
_drawRect.width = width;
|
||||
@ -145,7 +145,7 @@ void ShadowSurface::draw() {
|
||||
FontSurface::FontSurface(NeverhoodEngine *vm, NPointArray *tracking, uint charsPerRow, uint16 numRows, byte firstChar, uint16 charWidth, uint16 charHeight)
|
||||
: BaseSurface(vm, 0, charWidth * charsPerRow, charHeight * numRows, "font"), _charsPerRow(charsPerRow), _numRows(numRows),
|
||||
_firstChar(firstChar), _charWidth(charWidth), _charHeight(charHeight), _tracking(NULL) {
|
||||
|
||||
|
||||
_tracking = new NPointArray();
|
||||
*_tracking = *tracking;
|
||||
|
||||
@ -154,7 +154,7 @@ FontSurface::FontSurface(NeverhoodEngine *vm, NPointArray *tracking, uint charsP
|
||||
FontSurface::FontSurface(NeverhoodEngine *vm, uint32 fileHash, uint charsPerRow, uint16 numRows, byte firstChar, uint16 charWidth, uint16 charHeight)
|
||||
: BaseSurface(vm, 0, charWidth * charsPerRow, charHeight * numRows, "font"), _charsPerRow(charsPerRow), _numRows(numRows),
|
||||
_firstChar(firstChar), _charWidth(charWidth), _charHeight(charHeight), _tracking(NULL) {
|
||||
|
||||
|
||||
SpriteResource fontSpriteResource(_vm);
|
||||
fontSpriteResource.load(fileHash, true);
|
||||
drawSpriteResourceEx(fontSpriteResource, false, false, 0, 0);
|
||||
@ -182,7 +182,7 @@ void FontSurface::drawString(BaseSurface *destSurface, int16 x, int16 y, const b
|
||||
for (; stringLen > 0; --stringLen, ++string) {
|
||||
drawChar(destSurface, x, y, *string);
|
||||
x += _tracking ? (*_tracking)[*string - _firstChar].x : _charWidth;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ FontSurface *FontSurface::createFontSurface(NeverhoodEngine *vm, uint32 fileHash
|
||||
uint16 charHeight = fontData.getPoint(calcHash("meCharHeight")).x;
|
||||
NPointArray *tracking = fontData.getPointArray(calcHash("meTracking"));
|
||||
fontSprite.load(fileHash, true);
|
||||
fontSurface = new FontSurface(vm, tracking, 16, numRows, firstChar, charWidth, charHeight);
|
||||
fontSurface = new FontSurface(vm, tracking, 16, numRows, firstChar, charWidth, charHeight);
|
||||
fontSurface->drawSpriteResourceEx(fontSprite, false, false, 0, 0);
|
||||
return fontSurface;
|
||||
}
|
||||
@ -219,7 +219,7 @@ enum BitmapFlags {
|
||||
void parseBitmapResource(const byte *sprite, bool *rle, NDimensions *dimensions, NPoint *position, const byte **palette, const byte **pixels) {
|
||||
|
||||
uint16 flags;
|
||||
|
||||
|
||||
flags = READ_LE_UINT16(sprite);
|
||||
sprite += 2;
|
||||
|
||||
@ -278,7 +278,7 @@ void unpackSpriteRle(const byte *source, int width, int height, byte *dest, int
|
||||
rows = READ_LE_UINT16(source);
|
||||
chunks = READ_LE_UINT16(source + 2);
|
||||
source += 4;
|
||||
|
||||
|
||||
do {
|
||||
if (chunks == 0) {
|
||||
dest += rows * destPitch;
|
||||
@ -316,7 +316,7 @@ void unpackSpriteRle(const byte *source, int width, int height, byte *dest, int
|
||||
void unpackSpriteNormal(const byte *source, int width, int height, byte *dest, int destPitch, bool flipX, bool flipY) {
|
||||
|
||||
const int sourcePitch = (width + 3) & 0xFFFC;
|
||||
|
||||
|
||||
if (flipY) {
|
||||
dest += destPitch * (height - 1);
|
||||
destPitch = -destPitch;
|
||||
|
@ -62,12 +62,12 @@ struct NRect {
|
||||
|
||||
typedef Common::Array<NRect> NRectArray;
|
||||
|
||||
// TODO: Use Common::Rect
|
||||
// TODO: Use Common::Rect
|
||||
struct NDrawRect {
|
||||
int16 x, y, width, height;
|
||||
NDrawRect() : x(0), y(0), width(0), height(0) {}
|
||||
NDrawRect(int16 x0, int16 y0, int16 width0, int16 height0) : x(x0), y(y0), width(width0), height(height0) {}
|
||||
int16 x2() { return x + width; }
|
||||
int16 x2() { return x + width; }
|
||||
int16 y2() { return y + height; }
|
||||
void set(int16 x0, int16 y0, int16 width0, int16 height0) {
|
||||
x = x0;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -77,24 +77,24 @@ public:
|
||||
void stIdleArms();
|
||||
void evIdleArmsDone();
|
||||
uint32 hmIdleArms(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
|
||||
void stIdleChest();
|
||||
uint32 hmIdleChest(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
|
||||
void stIdleHeadOff();
|
||||
uint32 hmIdleHeadOff(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
void stIdleWonderAbout();
|
||||
|
||||
void stIdleTeleporterHands();
|
||||
|
||||
|
||||
void stIdleTeleporterHands2();
|
||||
|
||||
void stTryStandIdle();
|
||||
void stStandAround();
|
||||
void upStandIdle();
|
||||
void stIdleBlink();
|
||||
|
||||
|
||||
bool stStartAction(AnimationCb callback3);
|
||||
bool stStartActionFromIdle(AnimationCb callback);
|
||||
uint32 hmStartAction(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
@ -134,7 +134,7 @@ public:
|
||||
|
||||
void stPickUpTube();
|
||||
uint32 hmPickUpTube(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
|
||||
void stTurnToUse();
|
||||
void stTurnToUseHalf();
|
||||
void stTurnAwayFromUse();
|
||||
@ -263,10 +263,10 @@ public:
|
||||
void stJumpToGrabFall();
|
||||
uint32 hmJumpToGrab(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
void suJumpToGrab();
|
||||
|
||||
|
||||
void stJumpToGrabRelease();
|
||||
uint32 hmJumpToGrabRelease(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
|
||||
void stSitInTeleporter();
|
||||
uint32 hmSitInTeleporter(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
@ -326,7 +326,7 @@ public:
|
||||
|
||||
void stFinishGrow();
|
||||
uint32 hmFinishGrow(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
|
||||
void stJumpToRingVenusFlyTrap();
|
||||
uint32 hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
@ -363,7 +363,7 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void stopWalking();
|
||||
|
||||
|
||||
void suAction();
|
||||
void suUpdateDestX();
|
||||
void suWalkingTestExit();
|
||||
@ -375,7 +375,7 @@ public:
|
||||
void setKlaymenIdleTable1();
|
||||
void setKlaymenIdleTable2();
|
||||
void setKlaymenIdleTable3();
|
||||
|
||||
|
||||
void setSoundFlag(bool value) { _soundFlag = value; }
|
||||
|
||||
void spitIntoPipe();
|
||||
@ -416,7 +416,7 @@ protected:
|
||||
|
||||
NPointArray *_pathPoints;
|
||||
bool _soundFlag;
|
||||
|
||||
|
||||
int16 _spitOutCountdown;
|
||||
|
||||
bool _isSittingInTeleporter;
|
||||
@ -456,16 +456,16 @@ protected:
|
||||
|
||||
void stStartWalkingSmall();
|
||||
uint32 hmWalkingSmall(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
||||
|
||||
void enterIdleAnimation(uint idleAnimation);
|
||||
void walkAlongPathPoints();
|
||||
|
||||
|
||||
};
|
||||
|
||||
class KmScene1001 : public Klaymen {
|
||||
public:
|
||||
KmScene1001(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
|
||||
protected:
|
||||
protected:
|
||||
uint32 xHandleMessage(int messageNum, const MessageParam ¶m);
|
||||
};
|
||||
|
||||
@ -473,7 +473,7 @@ class KmScene1002 : public Klaymen {
|
||||
public:
|
||||
KmScene1002(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y);
|
||||
protected:
|
||||
void xUpdate();
|
||||
void xUpdate();
|
||||
uint32 xHandleMessage(int messageNum, const MessageParam ¶m);
|
||||
};
|
||||
|
||||
|
@ -73,9 +73,9 @@ static const uint32 kMakingOfSmackerFileHashList[] = {
|
||||
|
||||
MenuModule::MenuModule(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule), _savegameList(NULL) {
|
||||
|
||||
|
||||
SetMessageHandler(&MenuModule::handleMessage);
|
||||
|
||||
|
||||
_savedPaletteData = _vm->_screen->getPaletteData();
|
||||
_vm->_mixer->pauseAll(true);
|
||||
_vm->toggleSoundUpdate(false);
|
||||
@ -266,7 +266,7 @@ void MenuModule::loadSavegameList() {
|
||||
Neverhood::NeverhoodEngine::SaveHeader header;
|
||||
Common::String pattern = _vm->getTargetName();
|
||||
pattern += ".???";
|
||||
|
||||
|
||||
Common::StringArray filenames;
|
||||
filenames = saveFileMan->listSavefiles(pattern.c_str());
|
||||
Common::sort(filenames.begin(), filenames.end());
|
||||
@ -324,7 +324,7 @@ uint32 MenuButton::handleMessage(int messageNum, const MessageParam ¶m, Enti
|
||||
|
||||
MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
static const uint32 kMenuButtonFileHashes[] = {
|
||||
0x36C62120,
|
||||
0x56C62120,
|
||||
@ -336,7 +336,7 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
|
||||
0x16C62130,
|
||||
0x16C62100
|
||||
};
|
||||
|
||||
|
||||
static const NRect kMenuButtonCollisionBounds[] = {
|
||||
NRect(52, 121, 110, 156),
|
||||
NRect(52, 192, 109, 222),
|
||||
@ -348,14 +348,14 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
|
||||
NRect(527, 384, 580, 412),
|
||||
NRect(522, 255, 580, 289)
|
||||
};
|
||||
|
||||
|
||||
setBackground(0x08C0020C);
|
||||
setPalette(0x08C0020C);
|
||||
insertScreenMouse(0x00208084);
|
||||
|
||||
|
||||
insertStaticSprite(0x41137051, 100);
|
||||
insertStaticSprite(0xC10B2015, 100);
|
||||
|
||||
|
||||
// TODO Only if music is enabled
|
||||
_musicOnButton = insertStaticSprite(0x0C24C0EE, 100);
|
||||
|
||||
@ -364,9 +364,9 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
|
||||
kMenuButtonFileHashes[buttonIndex], kMenuButtonCollisionBounds[buttonIndex]);
|
||||
addCollisionSprite(menuButton);
|
||||
}
|
||||
|
||||
SetUpdateHandler(&Scene::update);
|
||||
SetMessageHandler(&MainMenu::handleMessage);
|
||||
|
||||
SetUpdateHandler(&Scene::update);
|
||||
SetMessageHandler(&MainMenu::handleMessage);
|
||||
|
||||
}
|
||||
|
||||
@ -396,18 +396,18 @@ CreditsScene::CreditsScene(NeverhoodEngine *vm, Module *parentModule, bool canAb
|
||||
: Scene(vm, parentModule), _canAbort(canAbort), _screenIndex(0), _ticksDuration(0),
|
||||
_countdown(216) {
|
||||
|
||||
SetUpdateHandler(&CreditsScene::update);
|
||||
SetUpdateHandler(&CreditsScene::update);
|
||||
SetMessageHandler(&CreditsScene::handleMessage);
|
||||
|
||||
|
||||
setBackground(0x6081128C);
|
||||
setPalette(0x6081128C);
|
||||
|
||||
_ticksTime = _vm->_system->getMillis() + 202100;
|
||||
|
||||
|
||||
_musicResource = new MusicResource(_vm);
|
||||
_musicResource->load(0x30812225);
|
||||
_musicResource->play(0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
CreditsScene::~CreditsScene() {
|
||||
@ -469,7 +469,7 @@ Widget::Widget(NeverhoodEngine *vm, int16 x, int16 y, GameStateMenu *parentScene
|
||||
|
||||
SetUpdateHandler(&Widget::update);
|
||||
SetMessageHandler(&Widget::handleMessage);
|
||||
|
||||
|
||||
setPosition(x, y);
|
||||
}
|
||||
|
||||
@ -532,7 +532,7 @@ TextLabelWidget::TextLabelWidget(NeverhoodEngine *vm, int16 x, int16 y, GameStat
|
||||
const byte *string, int stringLen, BaseSurface *drawSurface, int16 tx, int16 ty, FontSurface *fontSurface)
|
||||
: Widget(vm, x, y, parentScene, baseObjectPriority, baseSurfacePriority),
|
||||
_string(string), _stringLen(stringLen), _drawSurface(drawSurface), _tx(tx), _ty(ty), _fontSurface(fontSurface) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
void TextLabelWidget::initialize() {
|
||||
@ -573,7 +573,7 @@ TextEditWidget::TextEditWidget(NeverhoodEngine *vm, int16 x, int16 y, GameStateM
|
||||
|
||||
_maxVisibleChars = (_rect.x2 - _rect.x1) / _fontSurface->getCharWidth();
|
||||
_cursorPos = 0;
|
||||
|
||||
|
||||
SetUpdateHandler(&TextEditWidget::update);
|
||||
SetMessageHandler(&TextEditWidget::handleMessage);
|
||||
}
|
||||
@ -804,7 +804,7 @@ void SavegameListBox::buildItems() {
|
||||
|
||||
void SavegameListBox::drawItems() {
|
||||
for (int i = 0; i < (int)_textLabelItems.size(); ++i) {
|
||||
TextLabelWidget *label = _textLabelItems[i];
|
||||
TextLabelWidget *label = _textLabelItems[i];
|
||||
if (i >= _firstVisibleItem && i <= _lastVisibleItem) {
|
||||
label->setY(_rect.y1 + (i - _firstVisibleItem) * _fontSurface->getCharHeight());
|
||||
label->updateBounds();
|
||||
@ -886,12 +886,12 @@ int GameStateMenu::scummVMSaveLoadDialog(bool isSave, Common::String &saveDesc)
|
||||
GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList,
|
||||
const uint32 *buttonFileHashes, const NRect *buttonCollisionBounds,
|
||||
uint32 backgroundFileHash, uint32 fontFileHash,
|
||||
uint32 mouseFileHash, const NRect *mouseRect,
|
||||
uint32 mouseFileHash, const NRect *mouseRect,
|
||||
uint32 listBoxBackgroundFileHash, int16 listBoxX, int16 listBoxY, const NRect &listBoxRect,
|
||||
uint32 textEditBackgroundFileHash, uint32 textEditCursorFileHash, int16 textEditX, int16 textEditY, const NRect &textEditRect,
|
||||
uint32 textFileHash1, uint32 textFileHash2)
|
||||
uint32 textFileHash1, uint32 textFileHash2)
|
||||
: Scene(vm, parentModule), _currWidget(NULL), _savegameList(savegameList) {
|
||||
|
||||
|
||||
bool isSave = (textEditCursorFileHash != 0);
|
||||
|
||||
_fontSurface = new FontSurface(_vm, fontFileHash, 32, 7, 32, 11, 17);
|
||||
@ -933,7 +933,7 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame
|
||||
_textEditWidget->setReadOnly(true);
|
||||
_textEditWidget->initialize();
|
||||
setCurrWidget(_textEditWidget);
|
||||
|
||||
|
||||
for (uint buttonIndex = 0; buttonIndex < 6; ++buttonIndex) {
|
||||
Sprite *menuButton = insertSprite<MenuButton>(this, buttonIndex,
|
||||
buttonFileHashes[buttonIndex], buttonCollisionBounds[buttonIndex]);
|
||||
@ -1107,7 +1107,7 @@ static const NRect kDeleteGameMenuTextEditRect(0, 0, 320, 17);
|
||||
DeleteGameMenu::DeleteGameMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList)
|
||||
: GameStateMenu(vm, parentModule, savegameList, kDeleteGameMenuButtonFileHashes, kDeleteGameMenuButtonCollisionBounds,
|
||||
0x4080E01C, 0x728523ED,
|
||||
0x0E018400, NULL,
|
||||
0x0E018400, NULL,
|
||||
0xA5584211, 61, 64, kDeleteGameMenuListBoxRect,
|
||||
0x250A3060, 0, 49, 414, kDeleteGameMenuTextEditRect,
|
||||
0x80083C01, 0x84181E81) {
|
||||
@ -1131,7 +1131,7 @@ QueryOverwriteMenu::QueryOverwriteMenu(NeverhoodEngine *vm, Module *parentModule
|
||||
NRect(145, 334, 260, 385),
|
||||
NRect(365, 340, 477, 388)
|
||||
};
|
||||
|
||||
|
||||
setBackground(0x043692C4);
|
||||
setPalette(0x043692C4);
|
||||
insertScreenMouse(0x692C004B);
|
||||
@ -1154,7 +1154,7 @@ QueryOverwriteMenu::QueryOverwriteMenu(NeverhoodEngine *vm, Module *parentModule
|
||||
fontSurface->drawString(_background->getSurface(), 106 + (423 - textLines[i].size() * 11) / 2,
|
||||
127 + 31 + i * 17, (const byte*)textLines[i].c_str());
|
||||
delete fontSurface;
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene::update);
|
||||
SetMessageHandler(&QueryOverwriteMenu::handleMessage);
|
||||
}
|
||||
|
@ -124,8 +124,8 @@ protected:
|
||||
class TextLabelWidget : public Widget {
|
||||
public:
|
||||
TextLabelWidget(NeverhoodEngine *vm, int16 x, int16 y, GameStateMenu *parentScene,
|
||||
int baseObjectPriority, int baseSurfacePriority,
|
||||
const byte *string, int stringLen, BaseSurface *drawSurface, int16 tx, int16 ty, FontSurface *fontSurface);
|
||||
int baseObjectPriority, int baseSurfacePriority,
|
||||
const byte *string, int stringLen, BaseSurface *drawSurface, int16 tx, int16 ty, FontSurface *fontSurface);
|
||||
virtual void initialize();
|
||||
virtual int16 getWidth();
|
||||
virtual int16 getHeight();
|
||||
@ -206,13 +206,13 @@ protected:
|
||||
uint _currIndex;
|
||||
int _maxVisibleItemsCount;
|
||||
};
|
||||
|
||||
|
||||
class GameStateMenu : public Scene {
|
||||
public:
|
||||
GameStateMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList,
|
||||
const uint32 *buttonFileHashes, const NRect *buttonCollisionBounds,
|
||||
uint32 backgroundFileHash, uint32 fontFileHash,
|
||||
uint32 mouseFileHash, const NRect *mouseRect,
|
||||
uint32 mouseFileHash, const NRect *mouseRect,
|
||||
uint32 listBoxBackgroundFileHash, int16 listBoxX, int16 listBoxY, const NRect &listBoxRect,
|
||||
uint32 textEditBackgroundFileHash, uint32 textEditCursorFileHash, int16 textEditX, int16 textEditY, const NRect &textEditRect,
|
||||
uint32 textFileHash1, uint32 textFileHash2);
|
||||
|
@ -31,9 +31,9 @@ namespace Neverhood {
|
||||
Module::Module(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Entity(vm, 0), _parentModule(parentModule), _childObject(NULL),
|
||||
_done(false), _sceneType(kSceneTypeNormal) {
|
||||
|
||||
|
||||
SetMessageHandler(&Module::handleMessage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Module::~Module() {
|
||||
|
@ -26,8 +26,8 @@ namespace Neverhood {
|
||||
|
||||
Module1000::Module1000(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
_musicFileHash = getGlobalVar(V_ENTRANCE_OPEN) ? 0x81106480 : 0x00103144;
|
||||
|
||||
_musicFileHash = getGlobalVar(V_ENTRANCE_OPEN) ? 0x81106480 : 0x00103144;
|
||||
|
||||
_vm->_soundMan->addMusic(0x03294419, 0x061880C6);
|
||||
_vm->_soundMan->addMusic(0x03294419, _musicFileHash);
|
||||
@ -118,11 +118,11 @@ void Module1000::updateScene() {
|
||||
}
|
||||
}
|
||||
|
||||
// Scene1001
|
||||
// Scene1001
|
||||
|
||||
AsScene1001Door::AsScene1001Door(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1100) {
|
||||
|
||||
|
||||
createSurface(800, 137, 242);
|
||||
_x = 726;
|
||||
_y = 440;
|
||||
@ -151,16 +151,16 @@ void AsScene1001Door::hammerHitsDoor() {
|
||||
case 1:
|
||||
playSound(0, 0x65482F03);
|
||||
startAnimation(0x624C0498, 1, 3);
|
||||
NextState(&AsScene1001Door::stShowIdleDoor);
|
||||
NextState(&AsScene1001Door::stShowIdleDoor);
|
||||
break;
|
||||
case 2:
|
||||
playSound(1);
|
||||
startAnimation(0x624C0498, 6, 6);
|
||||
NextState(&AsScene1001Door::stBustedDoorMove);
|
||||
NextState(&AsScene1001Door::stBustedDoorMove);
|
||||
break;
|
||||
default:
|
||||
// Nothing
|
||||
break;
|
||||
break;
|
||||
}
|
||||
incGlobalVar(V_DOOR_STATUS, 1);
|
||||
}
|
||||
@ -196,9 +196,9 @@ void AsScene1001Door::stBustedDoorMove() {
|
||||
void AsScene1001Door::stBustedDoorGone() {
|
||||
playSound(0);
|
||||
stopAnimation();
|
||||
setVisible(false);
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
AsScene1001Hammer::AsScene1001Hammer(NeverhoodEngine *vm, Sprite *asDoor)
|
||||
: AnimatedSprite(vm, 1100), _asDoor(asDoor) {
|
||||
|
||||
@ -262,7 +262,7 @@ uint32 AsScene1001Window::handleMessage(int messageNum, const MessageParam ¶
|
||||
|
||||
AsScene1001Lever::AsScene1001Lever(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y, int deltaXType)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene) {
|
||||
|
||||
|
||||
createSurface(1010, 71, 73);
|
||||
setDoDeltaX(deltaXType);
|
||||
startAnimation(0x04A98C36, 0, -1);
|
||||
@ -302,22 +302,22 @@ uint32 AsScene1001Lever::handleMessage(int messageNum, const MessageParam ¶m
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
SsCommonButtonSprite::SsCommonButtonSprite(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash, int surfacePriority, uint32 soundFileHash)
|
||||
: StaticSprite(vm, fileHash, surfacePriority), _parentScene(parentScene), _countdown(0) {
|
||||
|
||||
_priority = 1100;
|
||||
_soundFileHash = soundFileHash ? soundFileHash : 0x44141000;
|
||||
_soundFileHash = soundFileHash ? soundFileHash : 0x44141000;
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&SsCommonButtonSprite::update);
|
||||
SetMessageHandler(&SsCommonButtonSprite::handleMessage);
|
||||
}
|
||||
|
||||
|
||||
void SsCommonButtonSprite::update() {
|
||||
if (_countdown != 0 && (--_countdown) == 0)
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
uint32 SsCommonButtonSprite::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -330,19 +330,19 @@ uint32 SsCommonButtonSprite::handleMessage(int messageNum, const MessageParam &p
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _asDoor(NULL), _asWindow(NULL) {
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
SetMessageHandler(&Scene1001::handleMessage);
|
||||
|
||||
|
||||
setHitRects(0x004B4860);
|
||||
setBackground(0x4086520E);
|
||||
setPalette(0x4086520E);
|
||||
insertScreenMouse(0x6520A400);
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
// Restoring game
|
||||
setRectList(0x004B49F0);
|
||||
@ -373,7 +373,7 @@ Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
tempSprite = insertStaticSprite(0x2080A3A8, 1300);
|
||||
|
||||
_klaymen->setClipRect(0, 0, tempSprite->getDrawRect().x2(), 480);
|
||||
|
||||
|
||||
if (!getGlobalVar(V_DOOR_BUSTED)) {
|
||||
_asDoor = insertSprite<AsScene1001Door>();
|
||||
_asDoor->setClipRect(0, 0, tempSprite->getDrawRect().x2(), 480);
|
||||
@ -445,7 +445,7 @@ AsScene1002Ring::AsScene1002Ring(NeverhoodEngine *vm, Scene *parentScene, bool i
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _isSpecial(isSpecial) {
|
||||
|
||||
SetUpdateHandler(&AsScene1002Ring::update);
|
||||
|
||||
|
||||
if (_isSpecial) {
|
||||
createSurface(990, 68, 314);
|
||||
if (isRingLow) {
|
||||
@ -581,7 +581,7 @@ uint32 AsScene1002Ring::hmRingReleased(int messageNum, const MessageParam ¶m
|
||||
|
||||
AsScene1002Door::AsScene1002Door(NeverhoodEngine *vm, NRect &clipRect)
|
||||
: StaticSprite(vm, 1200) {
|
||||
|
||||
|
||||
loadSprite(0x1052370F, kSLFDefDrawOffset | kSLFSetPosition, 800, 526, getGlobalVar(V_FLYTRAP_RING_DOOR) ? 49 : 239);
|
||||
setClipRect(clipRect);
|
||||
SetUpdateHandler(&AsScene1002Door::update);
|
||||
@ -637,7 +637,7 @@ AsScene1002BoxingGloveHitEffect::AsScene1002BoxingGloveHitEffect(NeverhoodEngine
|
||||
createSurface(1025, 88, 165);
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene1002BoxingGloveHitEffect::handleMessage);
|
||||
SetMessageHandler(&AsScene1002BoxingGloveHitEffect::handleMessage);
|
||||
}
|
||||
|
||||
uint32 AsScene1002BoxingGloveHitEffect::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -716,7 +716,7 @@ void AsScene1002DoorSpy::stDoorSpyBoxingGlove() {
|
||||
NextState(&AsScene1002DoorSpy::stDoorSpyIdle);
|
||||
}
|
||||
|
||||
SsCommonPressButton::SsCommonPressButton(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int surfacePriority, uint32 soundFileHash)
|
||||
SsCommonPressButton::SsCommonPressButton(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash1, uint32 fileHash2, int surfacePriority, uint32 soundFileHash)
|
||||
: StaticSprite(vm, 1100), _parentScene(parentScene), _status(0), _countdown(0) {
|
||||
|
||||
_soundFileHash = soundFileHash != 0 ? soundFileHash : 0x44141000;
|
||||
@ -788,7 +788,7 @@ AsScene1002VenusFlyTrap::AsScene1002VenusFlyTrap(NeverhoodEngine *vm, Scene *par
|
||||
stRingGrabbed();
|
||||
} else {
|
||||
stIdle();
|
||||
}
|
||||
}
|
||||
}
|
||||
_flags = 4;
|
||||
SetUpdateHandler(&AsScene1002VenusFlyTrap::update);
|
||||
@ -850,12 +850,12 @@ uint32 AsScene1002VenusFlyTrap::handleMessage(int messageNum, const MessageParam
|
||||
if (_isSecond) {
|
||||
if (_x >= 154 && _x <= 346)
|
||||
messageResult = 1;
|
||||
else
|
||||
else
|
||||
messageResult = 0;
|
||||
} else {
|
||||
if (_x >= 174 && _x <= 430)
|
||||
messageResult = 1;
|
||||
else
|
||||
else
|
||||
messageResult = 0;
|
||||
}
|
||||
break;
|
||||
@ -1023,7 +1023,7 @@ AsScene1002OutsideDoorBackground::AsScene1002OutsideDoorBackground(NeverhoodEngi
|
||||
} else
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&AsScene1002OutsideDoorBackground::update);
|
||||
SetMessageHandler(&AsScene1002OutsideDoorBackground::handleMessage);
|
||||
SetMessageHandler(&AsScene1002OutsideDoorBackground::handleMessage);
|
||||
}
|
||||
|
||||
void AsScene1002OutsideDoorBackground::update() {
|
||||
@ -1083,7 +1083,7 @@ void AsScene1002OutsideDoorBackground::stDoorClosed() {
|
||||
|
||||
AsScene1002KlaymenLadderHands::AsScene1002KlaymenLadderHands(NeverhoodEngine *vm, Klaymen *klaymen)
|
||||
: AnimatedSprite(vm, 1200), _klaymen(klaymen) {
|
||||
|
||||
|
||||
createSurface(1200, 40, 163);
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&AsScene1002KlaymenLadderHands::update);
|
||||
@ -1095,15 +1095,15 @@ void AsScene1002KlaymenLadderHands::update() {
|
||||
startAnimation(0xBA280522, _klaymen->getFrameIndex(), -1);
|
||||
_newStickFrameIndex = _klaymen->getFrameIndex();
|
||||
setVisible(true);
|
||||
_x = _klaymen->getX();
|
||||
_y = _klaymen->getY();
|
||||
_x = _klaymen->getX();
|
||||
_y = _klaymen->getY();
|
||||
setDoDeltaX(_klaymen->isDoDeltaX() ? 1 : 0);
|
||||
} else if (_klaymen->getCurrAnimFileHash() == 0x122D1505) {
|
||||
startAnimation(0x1319150C, _klaymen->getFrameIndex(), -1);
|
||||
_newStickFrameIndex = _klaymen->getFrameIndex();
|
||||
setVisible(true);
|
||||
_x = _klaymen->getX();
|
||||
_y = _klaymen->getY();
|
||||
_x = _klaymen->getX();
|
||||
_y = _klaymen->getY();
|
||||
setDoDeltaX(_klaymen->isDoDeltaX() ? 1 : 0);
|
||||
} else
|
||||
setVisible(false);
|
||||
@ -1113,7 +1113,7 @@ void AsScene1002KlaymenLadderHands::update() {
|
||||
AsScene1002KlaymenPeekHand::AsScene1002KlaymenPeekHand(NeverhoodEngine *vm, Scene *parentScene, Klaymen *klaymen)
|
||||
: AnimatedSprite(vm, 1200), _parentScene(parentScene), _klaymen(klaymen),
|
||||
_isClipRectSaved(false) {
|
||||
|
||||
|
||||
createSurface(1000, 33, 41);
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&AsScene1002KlaymenPeekHand::update);
|
||||
@ -1245,7 +1245,7 @@ Scene1002::Scene1002(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
sendEntityMessage(_klaymen, 0x2007, _asVenusFlyTrap);
|
||||
|
||||
_asOutsideDoorBackground = insertSprite<AsScene1002OutsideDoorBackground>();
|
||||
|
||||
|
||||
setRectList(0x004B43A0);
|
||||
|
||||
loadSound(1, 0x60755842);
|
||||
@ -1322,11 +1322,11 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
break;
|
||||
case 0x2002:
|
||||
_messageList = NULL;
|
||||
break;
|
||||
break;
|
||||
case 0x2005:
|
||||
_isClimbingLadder = true;
|
||||
setRectList(0x004B4418);
|
||||
break;
|
||||
break;
|
||||
case 0x2006:
|
||||
_isClimbingLadder = false;
|
||||
setRectList(0x004B43A0);
|
||||
@ -1360,11 +1360,11 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
if (getGlobalVar(V_FLYTRAP_RING_DOOR)) {
|
||||
sendMessage(_asRing3, 0x4807, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x480B:
|
||||
sendEntityMessage(_klaymen, 0x1014, _asDoorSpy);
|
||||
break;
|
||||
break;
|
||||
case 0x480F:
|
||||
setGlobalVar(V_RADIO_ENABLED, 0);
|
||||
playSound(1);
|
||||
@ -1379,7 +1379,7 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
setSpriteSurfacePriority(_ssCeiling, 1015);
|
||||
setSpriteSurfacePriority(_ssLadderArch, 1015);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
@ -1389,7 +1389,7 @@ StaticScene::StaticScene(NeverhoodEngine *vm, Module *parentModule, uint32 backg
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
SetMessageHandler(&StaticScene::handleMessage);
|
||||
|
||||
|
||||
setBackground(backgroundFileHash);
|
||||
setPalette(backgroundFileHash);
|
||||
insertPuzzleMouse(cursorFileHash, 20, 620);
|
||||
@ -1442,7 +1442,7 @@ Scene1004::Scene1004(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _paletteAreaStatus(-1) {
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene1004::update);
|
||||
SetMessageHandler(&Scene1004::handleMessage);
|
||||
|
||||
@ -1475,16 +1475,16 @@ Scene1004::Scene1004(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
insertKlaymen<KmScene1004>(_dataResource.getPoint(0x80052A29).x, 27);
|
||||
setMessageList(0x004B7BF0);
|
||||
}
|
||||
|
||||
|
||||
updatePaletteArea();
|
||||
|
||||
|
||||
_asKlaymenLadderHands = insertSprite<AsScene1002KlaymenLadderHands>(_klaymen);
|
||||
|
||||
insertStaticSprite(0x800034A0, 1100);
|
||||
insertStaticSprite(0x64402020, 1100);
|
||||
insertStaticSprite(0x3060222E, 1300);
|
||||
tempSprite = insertStaticSprite(0x0E002004, 1300);
|
||||
|
||||
|
||||
_klaymen->setClipRect(0, tempSprite->getDrawRect().y, 640, 480);
|
||||
_asKlaymenLadderHands->setClipRect(_klaymen->getClipRect());
|
||||
|
||||
@ -1518,7 +1518,7 @@ uint32 Scene1004::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
}
|
||||
|
||||
void Scene1004::updatePaletteArea() {
|
||||
if (_klaymen->getY() < 150) {
|
||||
@ -1557,7 +1557,7 @@ Scene1005::Scene1005(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
drawTextToBackground();
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene1005::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -1565,7 +1565,7 @@ uint32 Scene1005::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
switch (messageNum) {
|
||||
case 0x0001:
|
||||
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
|
||||
leaveScene(0);
|
||||
leaveScene(0);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@ -1614,19 +1614,19 @@ uint32 Scene1005::getTextIndex1() {
|
||||
textIndex = 23;
|
||||
else if (!getSubVar(VA_HAS_KEY, 0) && !getSubVar(VA_IS_KEY_INSERTED, 0))
|
||||
textIndex = 24;
|
||||
else if (!getGlobalVar(V_HAS_FINAL_KEY))
|
||||
else if (!getGlobalVar(V_HAS_FINAL_KEY))
|
||||
textIndex = 26;
|
||||
else if (!getSubVar(VA_HAS_KEY, 1) && !getSubVar(VA_IS_KEY_INSERTED, 1))
|
||||
textIndex = 27;
|
||||
else if (!getGlobalVar(V_HAS_FINAL_KEY))
|
||||
else if (!getGlobalVar(V_HAS_FINAL_KEY))
|
||||
textIndex = 28;
|
||||
else
|
||||
else
|
||||
textIndex = 29;
|
||||
} else if (!getGlobalVar(V_FELL_DOWN_HOLE))
|
||||
textIndex = 20;
|
||||
else if (!getGlobalVar(V_SEEN_SYMBOLS_NO_LIGHT))
|
||||
textIndex = 21;
|
||||
else
|
||||
else
|
||||
textIndex = 22;
|
||||
} else if (getGlobalVar(V_BOLT_DOOR_UNLOCKED)) {
|
||||
if (!getGlobalVar(V_WALL_BROKEN))
|
||||
@ -1641,7 +1641,7 @@ uint32 Scene1005::getTextIndex1() {
|
||||
textIndex = 15;
|
||||
else if (!getGlobalVar(V_BEEN_STATUE_ROOM))
|
||||
textIndex = 16;
|
||||
else
|
||||
else
|
||||
textIndex = 17;
|
||||
} else if (!getGlobalVar(V_FLYTRAP_RING_EATEN)) {
|
||||
textIndex = 0;
|
||||
@ -1660,7 +1660,7 @@ uint32 Scene1005::getTextIndex1() {
|
||||
textIndex = 9;
|
||||
else if (!getSubVar(VA_LOCKS_DISABLED, 0x01180951))
|
||||
textIndex = 10;
|
||||
else
|
||||
else
|
||||
textIndex = 11;
|
||||
} else if (!getGlobalVar(V_CREATURE_ANGRY)) {
|
||||
textIndex = 1;
|
||||
|
@ -85,7 +85,7 @@ protected:
|
||||
Scene *_parentScene;
|
||||
uint32 _soundFileHash;
|
||||
int16 _countdown;
|
||||
void update();
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
|
||||
|
@ -40,7 +40,7 @@ static const uint32 kModule1100SoundList[] = {
|
||||
|
||||
Module1100::Module1100(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
} else if (which == 1) {
|
||||
@ -271,7 +271,7 @@ static const uint32 kSsScene1105SymbolDieFileHashes[] = {
|
||||
|
||||
SsScene1105Button::SsScene1105Button(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash, NRect &collisionBounds)
|
||||
: StaticSprite(vm, fileHash, 200), _parentScene(parentScene), _countdown(0) {
|
||||
|
||||
|
||||
_collisionBounds = collisionBounds;
|
||||
SetMessageHandler(&SsScene1105Button::handleMessage);
|
||||
SetUpdateHandler(&SsScene1105Button::update);
|
||||
@ -347,7 +347,7 @@ void SsScene1105SymbolDie::hide() {
|
||||
|
||||
AsScene1105TeddyBear::AsScene1105TeddyBear(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene) {
|
||||
|
||||
|
||||
createSurface(100, 556, 328);
|
||||
_x = 320;
|
||||
_y = 240;
|
||||
@ -396,7 +396,7 @@ void AsScene1105TeddyBear::hide() {
|
||||
|
||||
SsScene1105OpenButton::SsScene1105OpenButton(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: StaticSprite(vm, 900), _parentScene(parentScene), _countdown(0), _isClicked(false) {
|
||||
|
||||
|
||||
loadSprite(0x8228A46C, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
loadSound(0, 0x44045140);
|
||||
@ -432,26 +432,26 @@ uint32 SsScene1105OpenButton::handleMessage(int messageNum, const MessageParam &
|
||||
Scene1105::Scene1105(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule), _countdown(0), _isPanelOpen(false), _isActionButtonClicked(false), _doMoveTeddy(false),
|
||||
_isClosePanelDone(false), _leaveResult(0), _backgroundIndex(0) {
|
||||
|
||||
|
||||
Sprite *ssOpenButton;
|
||||
|
||||
|
||||
_vm->gameModule()->initMemoryPuzzle();
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene1105::update);
|
||||
SetMessageHandler(&Scene1105::handleMessage);
|
||||
|
||||
|
||||
setBackground(0x20010002);
|
||||
setPalette(0x20010002);
|
||||
|
||||
|
||||
_asTeddyBear = insertSprite<AsScene1105TeddyBear>(this);
|
||||
ssOpenButton = insertSprite<SsScene1105OpenButton>(this);
|
||||
addCollisionSprite(ssOpenButton);
|
||||
insertPuzzleMouse(0x10006208, 20, 620);
|
||||
|
||||
|
||||
loadSound(0, 0x48442057);
|
||||
loadSound(1, 0xC025014F);
|
||||
loadSound(2, 0x68E25540);
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene1105::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -569,13 +569,13 @@ void Scene1105::createObjects() {
|
||||
addCollisionSprite(_ssSymbol3DownButton);
|
||||
_ssActionButton = insertSprite<SsScene1105Button>(this, 0x8248AD35, NRect(280, 170, 354, 245));
|
||||
addCollisionSprite(_ssActionButton);
|
||||
|
||||
|
||||
_isPanelOpen = true;
|
||||
|
||||
|
||||
_asTeddyBear->show();
|
||||
|
||||
insertPuzzleMouse(0x18666208, 20, 620);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene1105::upOpenPanel() {
|
||||
@ -639,13 +639,13 @@ void Scene1105::update() {
|
||||
|
||||
Scene1109::Scene1109(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1109::handleMessage);
|
||||
|
||||
|
||||
setBackground(0x8449E02F);
|
||||
setPalette(0x8449E02F);
|
||||
insertScreenMouse(0x9E02B84C);
|
||||
|
||||
|
||||
_sprite1 = insertStaticSprite(0x600CEF01, 1100);
|
||||
|
||||
if (which < 0) {
|
||||
|
@ -26,7 +26,7 @@ namespace Neverhood {
|
||||
|
||||
Module1200::Module1200(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
SetMessageHandler(&Module1200::handleMessage);
|
||||
|
||||
if (which < 0)
|
||||
@ -124,7 +124,7 @@ static const uint32 kScene1201TntFileHashList2[] = {
|
||||
0xB140A1E6, 0x5088A068, 0x5088A068,
|
||||
0x74C4C866, 0x3192C059, 0x3192C059
|
||||
};
|
||||
|
||||
|
||||
SsScene1201Tnt::SsScene1201Tnt(NeverhoodEngine *vm, uint32 elemIndex, uint32 pointIndex, int16 clipY2)
|
||||
: StaticSprite(vm, 900) {
|
||||
|
||||
@ -136,10 +136,10 @@ SsScene1201Tnt::SsScene1201Tnt(NeverhoodEngine *vm, uint32 elemIndex, uint32 poi
|
||||
loadSprite(kScene1201TntFileHashList2[elemIndex], kSLFCenteredDrawOffset | kSLFSetPosition, 50, x, y - 20);
|
||||
setClipRect(0, 0, 640, clipY2);
|
||||
}
|
||||
|
||||
|
||||
AsScene1201Tape::AsScene1201Tape(NeverhoodEngine *vm, Scene *parentScene, uint32 nameHash, int surfacePriority, int16 x, int16 y, uint32 fileHash)
|
||||
: AnimatedSprite(vm, fileHash, surfacePriority, x, y), _parentScene(parentScene), _nameHash(nameHash) {
|
||||
|
||||
|
||||
if (!getSubVar(VA_HAS_TAPE, _nameHash) && !getSubVar(VA_IS_TAPE_INSERTED, _nameHash)) {
|
||||
SetMessageHandler(&AsScene1201Tape::handleMessage);
|
||||
} else {
|
||||
@ -253,10 +253,10 @@ void AsScene1201RightDoor::stCloseDoorDone() {
|
||||
stopAnimation();
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
AsScene1201KlaymenHead::AsScene1201KlaymenHead(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1200) {
|
||||
|
||||
|
||||
createSurface(1200, 69, 98);
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene1201KlaymenHead::handleMessage);
|
||||
@ -301,7 +301,7 @@ AsScene1201TntMan::AsScene1201TntMan(NeverhoodEngine *vm, Scene *parentScene, Sp
|
||||
|
||||
AsScene1201TntMan::~AsScene1201TntMan() {
|
||||
_vm->_soundMan->deleteSoundGroup(0x01D00560);
|
||||
}
|
||||
}
|
||||
|
||||
uint32 AsScene1201TntMan::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
@ -396,7 +396,7 @@ void AsScene1201TntManFlame::suUpdate() {
|
||||
|
||||
AsScene1201Match::AsScene1201Match(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _countdown(0) {
|
||||
|
||||
|
||||
createSurface(1100, 57, 60);
|
||||
SetUpdateHandler(&AsScene1201Match::update);
|
||||
SetMessageHandler(&AsScene1201Match::hmOnDoorFrameAboutToMove);
|
||||
@ -518,7 +518,7 @@ AsScene1201Creature::AsScene1201Creature(NeverhoodEngine *vm, Scene *parentScene
|
||||
: AnimatedSprite(vm, 900), _parentScene(parentScene), _klaymen(klaymen), _klaymenTooClose(false) {
|
||||
|
||||
// NOTE: _countdown2 and _countdown3 were unused/without effect and thus removed
|
||||
|
||||
|
||||
createSurface(1100, 203, 199);
|
||||
SetUpdateHandler(&AsScene1201Creature::update);
|
||||
SetMessageHandler(&AsScene1201Creature::hmWaiting);
|
||||
@ -664,7 +664,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
SetMessageHandler(&Scene1201::handleMessage);
|
||||
|
||||
setHitRects(0x004AEBD0);
|
||||
|
||||
|
||||
if (!getSubVar(VA_IS_PUZZLE_INIT, 0xE8058B52)) {
|
||||
setSubVar(VA_IS_PUZZLE_INIT, 0xE8058B52, 1);
|
||||
for (uint32 index = 0; index < 18; index++)
|
||||
@ -672,25 +672,25 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
insertScreenMouse(0x9A2C0409);
|
||||
|
||||
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 3, 1100, 243, 340, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
|
||||
|
||||
tempSprite = insertStaticSprite(0x03C82530, 100);
|
||||
topY1 = tempSprite->getY() + tempSprite->getDrawRect().height;
|
||||
topY1 = tempSprite->getY() + tempSprite->getDrawRect().height;
|
||||
|
||||
tempSprite = insertStaticSprite(0x88182069, 200);
|
||||
topY2 = tempSprite->getY() + tempSprite->getDrawRect().height;
|
||||
topY2 = tempSprite->getY() + tempSprite->getDrawRect().height;
|
||||
|
||||
tempSprite = insertStaticSprite(0x476014E0, 300);
|
||||
topY3 = tempSprite->getY() + tempSprite->getDrawRect().height;
|
||||
topY3 = tempSprite->getY() + tempSprite->getDrawRect().height;
|
||||
|
||||
tempSprite = insertStaticSprite(0x04063110, 500);
|
||||
topY4 = tempSprite->getY() + 1;
|
||||
topY4 = tempSprite->getY() + 1;
|
||||
|
||||
_asTntManRope = insertSprite<AsScene1201TntManRope>(getGlobalVar(V_TNT_DUMMY_BUILT) && which != 1);
|
||||
_asTntManRope->setClipRect(0, topY4, 640, 480);
|
||||
|
||||
|
||||
insertStaticSprite(0x400B04B0, 1200);
|
||||
|
||||
tempSprite = insertStaticSprite(0x40295462, 1200);
|
||||
@ -735,7 +735,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
_klaymen->setClipRect(x1, 0, x2, 480);
|
||||
_klaymen->setRepl(64, 0);
|
||||
|
||||
|
||||
if (getGlobalVar(V_CREATURE_ANGRY) && !getGlobalVar(V_CREATURE_EXPLODED)) {
|
||||
setBackground(0x4019A2C4);
|
||||
setPalette(0x4019A2C4);
|
||||
@ -756,8 +756,8 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
tempSprite = insertSprite<AsScene1201TntManFlame>(_asTntMan);
|
||||
tempSprite->setClipRect(x1, 0, x2, 480);
|
||||
}
|
||||
|
||||
uint32 tntIndex = 1;
|
||||
|
||||
uint32 tntIndex = 1;
|
||||
while (tntIndex < 18) {
|
||||
uint32 elemIndex = getSubVar(VA_TNT_POSITIONS, tntIndex);
|
||||
int16 clipY2;
|
||||
@ -783,10 +783,10 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setRectList(0x004AEE58);
|
||||
} else {
|
||||
setRectList(0x004AEDC8);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
insertStaticSprite(0x8E8A1981, 900);
|
||||
|
||||
uint32 tntIndex = 0;
|
||||
@ -795,7 +795,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
int16 clipY2;
|
||||
if (kScene1201PointArray[elemIndex].x < 300) {
|
||||
clipY2 = 480;
|
||||
} else {
|
||||
} else {
|
||||
if (kScene1201PointArray[elemIndex].y < 175)
|
||||
clipY2 = topY1;
|
||||
else if (kScene1201PointArray[elemIndex].y < 230)
|
||||
@ -811,7 +811,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setRectList(0x004AEE18);
|
||||
else
|
||||
setRectList(0x004AED88);
|
||||
|
||||
|
||||
}
|
||||
|
||||
tempSprite = insertStaticSprite(0x63D400BC, 900);
|
||||
@ -875,7 +875,7 @@ uint32 Scene1201::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
setMessageList2(0x004AECC0);
|
||||
}
|
||||
break;
|
||||
case 0x2002:
|
||||
case 0x2002:
|
||||
if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) {
|
||||
// Move the TNT dummy if the fuse is burning
|
||||
sendEntityMessage(_klaymen, 0x1014, _asTntMan);
|
||||
@ -903,7 +903,7 @@ uint32 Scene1201::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
break;
|
||||
case 0x8000:
|
||||
sendMessage(_asKlaymenHead, 0x2006, 0);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -956,7 +956,7 @@ uint32 AsScene1202TntItem::hmShowIdle(int messageNum, const MessageParam ¶m,
|
||||
case 0x2001:
|
||||
_newPosition = (int)param.asInteger();
|
||||
stChangePositionFadeOut();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -998,7 +998,7 @@ void AsScene1202TntItem::stChangePositionDone() {
|
||||
}
|
||||
|
||||
Scene1202::Scene1202(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule), _paletteResource(vm),
|
||||
: Scene(vm, parentModule), _paletteResource(vm),
|
||||
_soundToggle(true), _isPuzzleSolved(false), _counter(0), _clickedIndex(-1) {
|
||||
|
||||
SetMessageHandler(&Scene1202::handleMessage);
|
||||
@ -1093,8 +1093,8 @@ uint32 Scene1202::hmSolved(int messageNum, const MessageParam ¶m, Entity *se
|
||||
}
|
||||
|
||||
bool Scene1202::isSolved() {
|
||||
return
|
||||
getSubVar(VA_TNT_POSITIONS, 0) == 0 && getSubVar(VA_TNT_POSITIONS, 3) == 3 &&
|
||||
return
|
||||
getSubVar(VA_TNT_POSITIONS, 0) == 0 && getSubVar(VA_TNT_POSITIONS, 3) == 3 &&
|
||||
getSubVar(VA_TNT_POSITIONS, 6) == 6 && getSubVar(VA_TNT_POSITIONS, 9) == 9 &&
|
||||
getSubVar(VA_TNT_POSITIONS, 12) == 12 && getSubVar(VA_TNT_POSITIONS, 15) == 15;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ static const uint32 kModule1300SoundList[] = {
|
||||
|
||||
Module1300::Module1300(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
_vm->_soundMan->addMusic(0x61C090, 0x00203197);
|
||||
_vm->_soundMan->addSoundList(0x61C090, kModule1300SoundList);
|
||||
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 50, 600, 20, 150);
|
||||
@ -56,7 +56,7 @@ Module1300::Module1300(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
if (which < 0) {
|
||||
if (_vm->gameState().sceneNum >= 1 && _vm->gameState().sceneNum <= 17)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else
|
||||
else
|
||||
createScene(11, 0);
|
||||
} else {
|
||||
switch (which) {
|
||||
@ -101,7 +101,7 @@ Module1300::Module1300(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Module1300::~Module1300() {
|
||||
@ -218,7 +218,7 @@ void Module1300::createScene(int sceneNum, int which) {
|
||||
SetUpdateHandler(&Module1300::updateScene);
|
||||
_childObject->handleUpdate();
|
||||
}
|
||||
|
||||
|
||||
void Module1300::updateScene() {
|
||||
if (!updateChild()) {
|
||||
switch (_sceneNum) {
|
||||
@ -274,7 +274,7 @@ void Module1300::updateScene() {
|
||||
createScene(11, 1);
|
||||
break;
|
||||
case 12:
|
||||
if (_moduleResult == 0)
|
||||
if (_moduleResult == 0)
|
||||
createScene(14, 1);
|
||||
else if (_moduleResult == 1)
|
||||
createScene(15, 1);
|
||||
@ -367,7 +367,7 @@ void AsScene1302Bridge::cbLowerBridgeEvent() {
|
||||
|
||||
SsScene1302Fence::SsScene1302Fence(NeverhoodEngine *vm)
|
||||
: StaticSprite(vm, 0x11122122, 200) {
|
||||
|
||||
|
||||
_firstY = _y;
|
||||
if (getGlobalVar(V_FLYTRAP_RING_FENCE))
|
||||
_y += 152;
|
||||
@ -459,7 +459,7 @@ Scene1302::Scene1302(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
addCollisionSprite(_asVenusFlyTrap);
|
||||
|
||||
sendEntityMessage(_klaymen, 0x2007, _asVenusFlyTrap);
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -513,7 +513,7 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
case 0x2000:
|
||||
if (_klaymen->getY() > 360) {
|
||||
sendEntityMessage(_klaymen, 0x1014, _asVenusFlyTrap);
|
||||
setMessageList2(0x004B08F0);
|
||||
setMessageList2(0x004B08F0);
|
||||
} else
|
||||
setMessageList2(0x004B0920);
|
||||
break;
|
||||
@ -583,7 +583,7 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
AsScene1303Balloon::AsScene1303Balloon(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene) {
|
||||
|
||||
|
||||
createSurface(200, 128, 315);
|
||||
_x = 289;
|
||||
_y = 390;
|
||||
@ -643,7 +643,7 @@ Scene1303::Scene1303(NeverhoodEngine *vm, Module *parentModule)
|
||||
_asBalloon = insertSprite<AsScene1303Balloon>(this);
|
||||
addCollisionSprite(_asBalloon);
|
||||
}
|
||||
|
||||
|
||||
_sprite1 = insertStaticSprite(0xA014216B, 1100);
|
||||
|
||||
insertKlaymen<KmScene1303>(207, 332);
|
||||
@ -671,7 +671,7 @@ uint32 Scene1303::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
AsScene1304Needle::AsScene1304Needle(NeverhoodEngine *vm, Scene *parentScene, int surfacePriority, int16 x, int16 y)
|
||||
: AnimatedSprite(vm, 0x548E9411, surfacePriority, x, y), _parentScene(parentScene) {
|
||||
|
||||
// NOTE: Skipped check if Klaymen already has the needle since that's done in the scene itself
|
||||
// NOTE: Skipped check if Klaymen already has the needle since that's done in the scene itself
|
||||
SetMessageHandler(&AsScene1304Needle::handleMessage);
|
||||
}
|
||||
|
||||
@ -693,14 +693,14 @@ uint32 AsScene1304Needle::handleMessage(int messageNum, const MessageParam ¶
|
||||
|
||||
Scene1304::Scene1304(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _asNeedle(NULL) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1304::handleMessage);
|
||||
|
||||
setRectList(0x004B91A8);
|
||||
setBackground(0x062C0214);
|
||||
setPalette(0x062C0214);
|
||||
insertScreenMouse(0xC021006A);
|
||||
|
||||
|
||||
if (getGlobalVar(V_BALLOON_POPPED)) {
|
||||
_asKey = insertSprite<AsCommonKey>(this, 0, 1100, 278, 347);
|
||||
addCollisionSprite(_asKey);
|
||||
@ -774,7 +774,7 @@ Scene1305::Scene1305(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
insertKlaymen<KmScene1305>(212, 441);
|
||||
setMessageList(0x004B6E48);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene1305::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -868,10 +868,10 @@ void AsScene1306Elevator::cbGoingDownEvent() {
|
||||
|
||||
Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0)
|
||||
setGlobalVar(V_KEY3_LOCATION, 4);
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1306::handleMessage);
|
||||
|
||||
setBackground(0x05303114);
|
||||
@ -949,7 +949,7 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Scene1306::~Scene1306() {
|
||||
setGlobalVar(V_KLAYMEN_IS_DELTA_X, _klaymen->isDoDeltaX() ? 1 : 0);
|
||||
}
|
||||
@ -1073,7 +1073,7 @@ static const NPoint kAsScene1307KeyPoints[] = {
|
||||
const uint kAsScene1307KeyFrameIndicesCount = 20;
|
||||
|
||||
static const int16 kAsScene1307KeyFrameIndices[] = {
|
||||
1, 4, 8, 11, 15, 16, 17, 17, 17, 16,
|
||||
1, 4, 8, 11, 15, 16, 17, 17, 17, 16,
|
||||
15, 14, 12, 10, 9, 7, 5, 3, 2, 1
|
||||
};
|
||||
|
||||
@ -1084,10 +1084,10 @@ const int16 kAsScene1307KeyYDelta = -12;
|
||||
AsScene1307Key::AsScene1307Key(NeverhoodEngine *vm, Scene *parentScene, uint keyIndex, NRect *clipRects)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _keyIndex(keyIndex), _clipRects(clipRects),
|
||||
_isClickable(true) {
|
||||
|
||||
|
||||
NPoint pt;
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
|
||||
_dataResource.load(0x22102142);
|
||||
_pointList = _dataResource.getPointArray(0xAC849240);
|
||||
pt = (*_pointList)[getSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex)];
|
||||
@ -1173,7 +1173,7 @@ void AsScene1307Key::suMoveKey() {
|
||||
}
|
||||
|
||||
void AsScene1307Key::stRemoveKey() {
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
_pointIndex = 0;
|
||||
startAnimation(fileHashes[0], 0, -1);
|
||||
playSound(1);
|
||||
@ -1199,7 +1199,7 @@ void AsScene1307Key::stMoveKey() {
|
||||
if (newX == _x && newY == _y) {
|
||||
stInsertKey();
|
||||
} else {
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
_pointIndex = 0;
|
||||
_frameIndex = 0;
|
||||
_deltaX = newX - _x;
|
||||
@ -1210,13 +1210,13 @@ void AsScene1307Key::stMoveKey() {
|
||||
}
|
||||
|
||||
void AsScene1307Key::stUnlock() {
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
startAnimation(fileHashes[1], 0, -1);
|
||||
_newStickFrameIndex = STICK_LAST_FRAME;
|
||||
}
|
||||
|
||||
void AsScene1307Key::stInsert() {
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
const uint32 *fileHashes = kAsScene1307KeyResourceLists[_keyIndex];
|
||||
startAnimation(fileHashes[2], 0, -1);
|
||||
_newStickFrameIndex = STICK_LAST_FRAME;
|
||||
}
|
||||
@ -1226,9 +1226,9 @@ Scene1307::Scene1307(NeverhoodEngine *vm, Module *parentModule)
|
||||
_isInsertingKey(false), _doLeaveScene(false), _isPuzzleSolved(false) {
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
|
||||
_vm->gameModule()->initKeySlotsPuzzle();
|
||||
|
||||
|
||||
_dataResource.load(0x22102142);
|
||||
_keyHolePoints = _dataResource.getPointArray(0xAC849240);
|
||||
|
||||
@ -1279,7 +1279,7 @@ void Scene1307::update() {
|
||||
if (_doLeaveScene && !isSoundPlaying(0)) {
|
||||
leaveScene(1);
|
||||
setGlobalVar(V_KEYDOOR_UNLOCKED, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Scene1307::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -1294,7 +1294,7 @@ uint32 Scene1307::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
int16 mouseY = param.asPoint().y;
|
||||
uint clickedKeyHoleIndex;
|
||||
for (clickedKeyHoleIndex = 0; clickedKeyHoleIndex < 16; clickedKeyHoleIndex++) {
|
||||
if (mouseX >= _keyHoleRects[clickedKeyHoleIndex].x1 && mouseX <= _keyHoleRects[clickedKeyHoleIndex].x2 &&
|
||||
if (mouseX >= _keyHoleRects[clickedKeyHoleIndex].x1 && mouseX <= _keyHoleRects[clickedKeyHoleIndex].x2 &&
|
||||
mouseY >= _keyHoleRects[clickedKeyHoleIndex].y1 && mouseY <= _keyHoleRects[clickedKeyHoleIndex].y2)
|
||||
break;
|
||||
}
|
||||
@ -1362,7 +1362,7 @@ static const uint32 kScene1308NumberFileHashes[] = {
|
||||
|
||||
AsScene1308JaggyDoor::AsScene1308JaggyDoor(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 0xBA0AE050, 1100, 320, 240), _parentScene(parentScene) {
|
||||
|
||||
|
||||
setVisible(false);
|
||||
stopAnimation();
|
||||
SetMessageHandler(&AsScene1308JaggyDoor::handleMessage);
|
||||
@ -1412,12 +1412,12 @@ void AsScene1308JaggyDoor::stCloseDoorDone() {
|
||||
|
||||
AsScene1308KeyboardDoor::AsScene1308KeyboardDoor(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 0xA08A0851, 1100, 320, 240), _parentScene(parentScene) {
|
||||
|
||||
|
||||
playSound(0, 0x51456049);
|
||||
SetMessageHandler(&AsScene1308KeyboardDoor::handleMessage);
|
||||
NextState(&AsScene1308KeyboardDoor::stFallingKeys);
|
||||
}
|
||||
|
||||
|
||||
uint32 AsScene1308KeyboardDoor::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -1443,7 +1443,7 @@ void AsScene1308KeyboardDoor::stFallingKeysDone() {
|
||||
|
||||
AsScene1308LightWallSymbols::AsScene1308LightWallSymbols(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 0x80180A10, 100, 320, 240), _parentScene(parentScene) {
|
||||
|
||||
|
||||
setVisible(false);
|
||||
stopAnimation();
|
||||
Entity::_priority = 1200;
|
||||
@ -1486,7 +1486,7 @@ void AsScene1308LightWallSymbols::stFadeOutDone() {
|
||||
|
||||
SsScene1308Number::SsScene1308Number(NeverhoodEngine *vm, uint32 fileHash, int index)
|
||||
: StaticSprite(vm, fileHash, 100) {
|
||||
|
||||
|
||||
setVisible(false);
|
||||
_x = _spriteResource.getPosition().x + index * 20;
|
||||
updatePosition();
|
||||
@ -1520,11 +1520,11 @@ uint32 AsScene1308Mouse::handleMessage(int messageNum, const MessageParam ¶m
|
||||
|
||||
Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _isProjecting(false), _asProjector(NULL) {
|
||||
|
||||
|
||||
_vm->gameModule()->initKeySlotsPuzzle();
|
||||
|
||||
SetMessageHandler(&Scene1308::handleMessage);
|
||||
|
||||
|
||||
setBackground(0x41024202);
|
||||
setPalette(0x41024202);
|
||||
insertScreenMouse(0x24206418);
|
||||
@ -1536,7 +1536,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
insertSprite<AsScene1308Mouse>();
|
||||
insertSprite<AnimatedSprite>(0x461A1490, 200, 235, 429);
|
||||
}
|
||||
|
||||
|
||||
_sprite1 = insertStaticSprite(0x0A042060, 1100);
|
||||
_asJaggyDoor = insertSprite<AsScene1308JaggyDoor>(this);
|
||||
_asLightWallSymbols = insertSprite<AsScene1308LightWallSymbols>(this);
|
||||
@ -1546,7 +1546,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_sprite2 = insertStaticSprite(0x40043120, 995);
|
||||
_sprite3 = insertStaticSprite(0x43003100, 995);
|
||||
_sprite4 = NULL;
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
// Restoring game
|
||||
insertKlaymen<KmScene1308>(380, 440);
|
||||
@ -1698,7 +1698,7 @@ uint32 Scene1308::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
Scene1317::Scene1317(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1317::handleMessage);
|
||||
_smackerPlayer = addSmackerPlayer(new SmackerPlayer(_vm, this, 0x08982841, true, false));
|
||||
_vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder());
|
||||
@ -1720,7 +1720,7 @@ void Scene1317::update() {
|
||||
void Scene1317::upChooseKing() {
|
||||
if (!_klaymenBlinks && _klaymenBlinkCountdown != 0 && (--_klaymenBlinkCountdown == 0))
|
||||
_klaymenBlinks = true;
|
||||
|
||||
|
||||
if (!_klaymenBlinks && _smackerPlayer->getFrameNumber() + 1 >= 2) {
|
||||
_smackerPlayer->rewind();
|
||||
} else if (_klaymenBlinks && _smackerPlayer->getFrameNumber() + 1 >= 6) {
|
||||
@ -1731,7 +1731,7 @@ void Scene1317::upChooseKing() {
|
||||
|
||||
if (!_klaymenBlinks && _decisionCountdown != 0 && (--_decisionCountdown == 0))
|
||||
stNoDecisionYet();
|
||||
|
||||
|
||||
if (_smackerFileHash) {
|
||||
_smackerPlayer->open(_smackerFileHash, _keepLastSmackerFrame);
|
||||
_vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder());
|
||||
@ -1739,7 +1739,7 @@ void Scene1317::upChooseKing() {
|
||||
}
|
||||
|
||||
Scene::update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene1317::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -1751,7 +1751,7 @@ uint32 Scene1317::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
uint32 Scene1317::hmChooseKing(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
|
@ -31,7 +31,7 @@ namespace Neverhood {
|
||||
|
||||
Module1400::Module1400(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
_vm->_soundMan->addMusic(0x00AD0012, 0x06333232);
|
||||
_vm->_soundMan->addMusic(0x00AD0012, 0x624A220E);
|
||||
|
||||
@ -139,7 +139,7 @@ void Module1400::updateScene() {
|
||||
|
||||
AsScene1401Pipe::AsScene1401Pipe(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1100), _countdown1(0), _countdown2(0) {
|
||||
|
||||
|
||||
createSurface(900, 152, 147);
|
||||
_x = 454;
|
||||
_y = 217;
|
||||
@ -179,10 +179,10 @@ uint32 AsScene1401Pipe::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
_countdown1 = 70;
|
||||
_countdown2 = 8;
|
||||
stStartSucking();
|
||||
break;
|
||||
break;
|
||||
case 0x483A:
|
||||
stSuckInProjector();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -221,7 +221,7 @@ void AsScene1401Pipe::stSuckInProjector() {
|
||||
|
||||
AsScene1401Mouse::AsScene1401Mouse(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1100) {
|
||||
|
||||
|
||||
createSurface(100, 71, 41);
|
||||
_x = 478;
|
||||
_y = 433;
|
||||
@ -243,7 +243,7 @@ uint32 AsScene1401Mouse::handleMessage(int messageNum, const MessageParam ¶m
|
||||
break;
|
||||
case 0x4839:
|
||||
stSuckedIn();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -280,7 +280,7 @@ uint32 AsScene1401Cheese::handleMessage(int messageNum, const MessageParam ¶
|
||||
switch (messageNum) {
|
||||
case 0x4839:
|
||||
stSuckedIn();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -332,7 +332,7 @@ uint32 AsScene1401BackDoor::handleMessage(int messageNum, const MessageParam &pa
|
||||
case 0x2001:
|
||||
if (_isOpen)
|
||||
_countdown = 168;
|
||||
messageResult = _isOpen ? 1 : 0;
|
||||
messageResult = _isOpen ? 1 : 0;
|
||||
break;
|
||||
case 0x3002:
|
||||
gotoNextState();
|
||||
@ -341,7 +341,7 @@ uint32 AsScene1401BackDoor::handleMessage(int messageNum, const MessageParam &pa
|
||||
_countdown = 168;
|
||||
if (!_isOpen)
|
||||
stOpenDoor();
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -540,7 +540,7 @@ void AsCommonProjector::moveProjector() {
|
||||
playSound(1, 0x5440E474);
|
||||
_lockedInSlot = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AsCommonProjector::stSuckedIn() {
|
||||
@ -627,8 +627,8 @@ void AsCommonProjector::stStartSuckedIn() {
|
||||
}
|
||||
|
||||
Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _projectorBorderFlag(false), _ssFloorButton(NULL), _asProjector(NULL),
|
||||
_asPipe(NULL), _asMouse(NULL), _asCheese(NULL), _asBackDoor(NULL),
|
||||
: Scene(vm, parentModule), _projectorBorderFlag(false), _ssFloorButton(NULL), _asProjector(NULL),
|
||||
_asPipe(NULL), _asMouse(NULL), _asCheese(NULL), _asBackDoor(NULL),
|
||||
_sprite1(NULL), _sprite2(NULL), _sprite3(NULL), _ssButton(NULL) {
|
||||
|
||||
SetMessageHandler(&Scene1401::handleMessage);
|
||||
@ -638,7 +638,7 @@ Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setBackground(0x08221FA5);
|
||||
setPalette(0x08221FA5);
|
||||
insertScreenMouse(0x21FA108A);
|
||||
|
||||
|
||||
_ssFloorButton = insertSprite<SsCommonFloorButton>(this, 0x980F3124, 0x12192892, 100, 0);
|
||||
_asPipe = insertSprite<AsScene1401Pipe>();
|
||||
|
||||
@ -692,7 +692,7 @@ Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
_asProjector->setClipRect(_sprite3->getDrawRect().x, _sprite2->getDrawRect().y, 640, 480);
|
||||
}
|
||||
|
||||
|
||||
_klaymen->setClipRect(_sprite3->getDrawRect().x, 0, 640, 480);
|
||||
|
||||
if (which == 0 && _asProjector)
|
||||
@ -752,7 +752,7 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
setMessageList2(0x004B6658);
|
||||
} else
|
||||
setMessageList2(0x004B65F0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x482A:
|
||||
_sprite1->setVisible(true);
|
||||
@ -772,7 +772,7 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
SsScene1402BridgePart::SsScene1402BridgePart(NeverhoodEngine *vm, uint32 fileHash, int surfacePriority)
|
||||
: StaticSprite(vm, fileHash, surfacePriority) {
|
||||
|
||||
|
||||
SetFilterY(&Sprite::defFilterY);
|
||||
SetUpdateHandler(&StaticSprite::updatePosition);
|
||||
}
|
||||
@ -892,7 +892,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
startShaking();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_asPuzzleBox)
|
||||
_asPuzzleBox->setClipRect(0, 0, 640, _ssBridgePart3->getDrawRect().y2());
|
||||
|
||||
@ -914,7 +914,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
_klaymen->setClipRect(_ssBridgePart1->getDrawRect().x, 0, _ssBridgePart2->getDrawRect().x2(), _ssBridgePart3->getDrawRect().y2());
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene1402::upShaking() {
|
||||
@ -1082,7 +1082,7 @@ static const struct {
|
||||
|
||||
AsScene1407Mouse::AsScene1407Mouse(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _currSectionIndex(0) {
|
||||
|
||||
|
||||
createSurface(100, 117, 45);
|
||||
_x = 108;
|
||||
_y = 106;
|
||||
@ -1096,7 +1096,7 @@ void AsScene1407Mouse::suWalkTo() {
|
||||
xdelta = _deltaX;
|
||||
else if (xdelta < -_deltaX)
|
||||
xdelta = -_deltaX;
|
||||
_deltaX = 0;
|
||||
_deltaX = 0;
|
||||
if (_walkDestX == _x)
|
||||
sendMessage(this, 0x1019, 0);
|
||||
else {
|
||||
@ -1231,7 +1231,7 @@ Scene1407::Scene1407(NeverhoodEngine *vm, Module *parentModule)
|
||||
|
||||
_asMouse = insertSprite<AsScene1407Mouse>(this);
|
||||
_ssResetButton = insertStaticSprite(0x12006600, 100);
|
||||
_ssResetButton->setVisible(false);
|
||||
_ssResetButton->setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
@ -1279,9 +1279,9 @@ uint32 Scene1407::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
Scene1403::Scene1403(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _asProjector(NULL), _isProjecting(false) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1403::handleMessage);
|
||||
|
||||
|
||||
setRectList(0x004B1FF8);
|
||||
setBackground(0x2110A234);
|
||||
setPalette(0x2110A234);
|
||||
@ -1383,10 +1383,10 @@ uint32 Scene1403::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _asProjector(NULL), _asKey(NULL) {
|
||||
|
||||
|
||||
if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0)
|
||||
setGlobalVar(V_KEY3_LOCATION, 5);
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1404::handleMessage);
|
||||
|
||||
setRectList(0x004B8D80);
|
||||
@ -1555,14 +1555,14 @@ Scene1405::Scene1405(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule), _selectFirstTile(true), _tilesLeft(48), _countdown(0) {
|
||||
|
||||
_vm->gameModule()->initMemoryPuzzle();
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene1405::update);
|
||||
SetMessageHandler(&Scene1405::handleMessage);
|
||||
|
||||
setBackground(0x0C0C007D);
|
||||
setPalette(0x0C0C007D);
|
||||
insertPuzzleMouse(0xC00790C8, 20, 620);
|
||||
|
||||
|
||||
for (uint32 tileIndex = 0; tileIndex < 48; tileIndex++) {
|
||||
_tiles[tileIndex] = insertSprite<AsScene1405Tile>(this, tileIndex);
|
||||
addCollisionSprite(_tiles[tileIndex]);
|
||||
|
@ -26,7 +26,7 @@ namespace Neverhood {
|
||||
|
||||
Module1500::Module1500(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else
|
||||
@ -86,7 +86,7 @@ Scene1501::Scene1501(NeverhoodEngine *vm, Module *parentModule, uint32 backgroun
|
||||
|
||||
SetUpdateHandler(&Scene1501::update);
|
||||
SetMessageHandler(&Scene1501::handleMessage);
|
||||
|
||||
|
||||
setBackground(backgroundFileHash);
|
||||
setPalette();
|
||||
addEntity(_palette);
|
||||
@ -118,7 +118,7 @@ void Scene1501::update() {
|
||||
_countdown1 = 12;
|
||||
_palette->startFadeToBlack(11);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene1501::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
|
@ -34,7 +34,7 @@ static const uint32 kModule1600SoundList[] = {
|
||||
|
||||
Module1600::Module1600(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else if (which == 1)
|
||||
@ -109,7 +109,7 @@ void Module1600::createScene(int sceneNum, int which) {
|
||||
if (getGlobalVar(V_TALK_COUNTING_INDEX) >= 2)
|
||||
setGlobalVar(V_TALK_COUNTING_INDEX, 0);
|
||||
else
|
||||
incGlobalVar(V_TALK_COUNTING_INDEX, +1);
|
||||
incGlobalVar(V_TALK_COUNTING_INDEX, +1);
|
||||
break;
|
||||
}
|
||||
SetUpdateHandler(&Module1600::updateScene);
|
||||
@ -185,11 +185,11 @@ void Module1600::updateScene() {
|
||||
|
||||
AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y)
|
||||
: AnimatedSprite(vm, 1000), _parentScene(parentScene) {
|
||||
|
||||
|
||||
createSurface(200, 556, 328);
|
||||
_x = x;
|
||||
_y = y;
|
||||
|
||||
|
||||
_inMainArea = false;
|
||||
_exitDirection = 0;
|
||||
_currPointIndex = 0;
|
||||
@ -207,7 +207,7 @@ AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
|
||||
_soundCounter = 0;
|
||||
_pathPoints = NULL;
|
||||
_currMoveDirection = 0;
|
||||
|
||||
|
||||
startAnimation(0xD4220027, 0, -1);
|
||||
setDoDeltaX(getGlobalVar(V_CAR_DELTA_X));
|
||||
|
||||
@ -517,7 +517,7 @@ void AsCommonCar::moveToNextPoint() {
|
||||
if (ABS(nextPt.y - currPt.y) <= ABS(nextPt.x - currPt.x) &&
|
||||
((_currMoveDirection == 2 && nextPt.x < currPt.x) ||
|
||||
(_currMoveDirection == 4 && nextPt.x >= currPt.x))) {
|
||||
if (_currMoveDirection == 2)
|
||||
if (_currMoveDirection == 2)
|
||||
_currMoveDirection = 4;
|
||||
else if (_currMoveDirection == 4)
|
||||
_currMoveDirection = 2;
|
||||
@ -605,7 +605,7 @@ void AsCommonCar::moveToPrevPoint() {
|
||||
if (ABS(prevPt.y - currPt.y) <= ABS(prevPt.x - currPt.x) &&
|
||||
((_currMoveDirection == 2 && prevPt.x < currPt.x) ||
|
||||
(_currMoveDirection == 4 && prevPt.x >= currPt.x))) {
|
||||
if (_currMoveDirection == 2)
|
||||
if (_currMoveDirection == 2)
|
||||
_currMoveDirection = 4;
|
||||
else if (_currMoveDirection == 4)
|
||||
_currMoveDirection = 2;
|
||||
@ -668,7 +668,7 @@ void AsCommonCar::suMoveToNextPoint() {
|
||||
bool firstTime = true;
|
||||
_ySteps = _steps;
|
||||
int stepsCtr = _steps;
|
||||
|
||||
|
||||
while (stepsCtr > 0) {
|
||||
NPoint pt1;
|
||||
NPoint pt2 = pathPoint(_currPointIndex);
|
||||
@ -739,7 +739,7 @@ void AsCommonCar::suMoveToNextPoint() {
|
||||
stepsCtr = 0;
|
||||
}
|
||||
}
|
||||
firstTime = false;
|
||||
firstTime = false;
|
||||
}
|
||||
|
||||
if (_yMoveTotalSteps != 0) {
|
||||
@ -811,7 +811,7 @@ void AsCommonCar::suMoveToPrevPoint() {
|
||||
bool firstTime = true;
|
||||
_ySteps = _steps;
|
||||
int stepsCtr = _steps;
|
||||
|
||||
|
||||
while (stepsCtr > 0) {
|
||||
if (_stepError == 0)
|
||||
_currPointIndex--;
|
||||
@ -884,7 +884,7 @@ void AsCommonCar::suMoveToPrevPoint() {
|
||||
stepsCtr = 0;
|
||||
}
|
||||
}
|
||||
firstTime = false;
|
||||
firstTime = false;
|
||||
}
|
||||
|
||||
if (_yMoveTotalSteps != 0) {
|
||||
@ -971,7 +971,7 @@ AsCommonIdleCarFull::AsCommonIdleCarFull(NeverhoodEngine *vm, int16 x, int16 y)
|
||||
|
||||
AsCommonCarConnector::AsCommonCarConnector(NeverhoodEngine *vm, AsCommonCar *asCar)
|
||||
: AnimatedSprite(vm, 1100), _asCar(asCar) {
|
||||
|
||||
|
||||
createSurface1(0x60281C10, 150);
|
||||
startAnimation(0x60281C10, -1, -1);
|
||||
_newStickFrameIndex = STICK_LAST_FRAME;
|
||||
@ -1006,9 +1006,9 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _asCar(NULL), _countdown1(0) {
|
||||
|
||||
setGlobalVar(V_CAR_DELTA_X, 1);
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1608::hmLowerFloor);
|
||||
|
||||
|
||||
_asKey = insertSprite<AsCommonKey>(this, 1, 1100, 198, 220);
|
||||
addCollisionSprite(_asKey);
|
||||
|
||||
@ -1092,9 +1092,9 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_carClipFlag = false;
|
||||
_carStatus = 0;
|
||||
setRectList(0x004B4810);
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: Not in the else because 'which' is set to 1 in the true branch
|
||||
// NOTE: Not in the else because 'which' is set to 1 in the true branch
|
||||
if (which == 1) {
|
||||
// Klaymen riding the car
|
||||
_vm->gameState().which = 1;
|
||||
@ -1134,9 +1134,9 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_carClipFlag = true;
|
||||
_carStatus = 0;
|
||||
}
|
||||
|
||||
|
||||
_palette->addPalette("paKlayRed", 0, 64, 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Scene1608::~Scene1608() {
|
||||
@ -1308,7 +1308,7 @@ uint32 Scene1608::hmCarAtHome(int messageNum, const MessageParam ¶m, Entity
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void Scene1608::updateKlaymenCliprect() {
|
||||
if (_kmScene1608->getX() <= 375)
|
||||
_kmScene1608->setClipRect(_clipRect1);
|
||||
@ -1321,17 +1321,17 @@ Scene1609::Scene1609(NeverhoodEngine *vm, Module *parentModule)
|
||||
|
||||
_vm->gameModule()->initCodeSymbolsPuzzle();
|
||||
_noisySymbolIndex = getGlobalVar(V_NOISY_SYMBOL_INDEX);
|
||||
|
||||
|
||||
SetMessageHandler(&Scene1609::handleMessage);
|
||||
SetUpdateHandler(&Scene1609::update);
|
||||
|
||||
|
||||
setBackground(0x92124A14);
|
||||
setPalette(0x92124A14);
|
||||
insertPuzzleMouse(0x24A10929, 20, 620);
|
||||
|
||||
|
||||
for (int symbolPosition = 0; symbolPosition < 12; symbolPosition++)
|
||||
_asSymbols[symbolPosition] = insertSprite<AsScene3011Symbol>(symbolPosition, false);
|
||||
|
||||
|
||||
_ssButton = insertSprite<SsScene3011Button>(this, true);
|
||||
addCollisionSprite(_ssButton);
|
||||
loadSound(0, 0x68E25540);
|
||||
@ -1408,5 +1408,5 @@ bool Scene1609::testVars() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace Neverhood
|
||||
|
@ -36,7 +36,7 @@ static const uint32 kModule1700SoundList[] = {
|
||||
|
||||
Module1700::Module1700(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
_vm->_soundMan->addMusic(0x04212331, 0x31114225);
|
||||
_vm->_soundMan->addSoundList(0x04212331, kModule1700SoundList);
|
||||
_vm->_soundMan->setSoundListParams(kModule1700SoundList, true, 50, 600, 5, 150);
|
||||
@ -125,7 +125,7 @@ void Module1700::updateScene() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Scene1705
|
||||
|
||||
static const uint32 kScene1705FileHashes[] = {
|
||||
@ -137,7 +137,7 @@ static const uint32 kScene1705FileHashes[] = {
|
||||
|
||||
SsScene1705WallSymbol::SsScene1705WallSymbol(NeverhoodEngine *vm, uint32 fileHash, int symbolIndex)
|
||||
: StaticSprite(vm, fileHash, 100) {
|
||||
|
||||
|
||||
_x = _spriteResource.getPosition().x + symbolIndex * 30;
|
||||
_y = _spriteResource.getPosition().y + 160;
|
||||
updatePosition();
|
||||
@ -171,7 +171,7 @@ uint32 SsScene1705Tape::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
setSubVar(VA_HAS_TAPE, _tapeIndex, 1);
|
||||
setVisible(false);
|
||||
SetMessageHandler(NULL);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
@ -180,7 +180,7 @@ Scene1705::Scene1705(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _paletteArea(1) {
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
|
||||
setGlobalVar(V_FELL_DOWN_HOLE, 1);
|
||||
_vm->gameModule()->initCannonSymbolsPuzzle();
|
||||
|
||||
@ -271,7 +271,7 @@ uint32 Scene1705::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
sendEntityMessage(_klaymen, 0x1014, sender);
|
||||
setMessageList(0x004B6AC0);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
class SsScene1705Tape : public StaticSprite {
|
||||
public:
|
||||
SsScene1705Tape(NeverhoodEngine *vm, Scene *parentScene, uint32 tapeIndex, int surfacePriority, int16 x, int16 y, uint32 fileHash);
|
||||
protected:
|
||||
protected:
|
||||
Scene *_parentScene;
|
||||
uint32 _tapeIndex;
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
@ -38,7 +38,7 @@ static const uint32 kModule1800SoundList[] = {
|
||||
|
||||
Module1800::Module1800(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
_vm->_soundMan->addSoundList(0x04A14718, kModule1800SoundList);
|
||||
_vm->_soundMan->setSoundListParams(kModule1800SoundList, true, 50, 600, 10, 150);
|
||||
_vm->_soundMan->playTwoSounds(0x04A14718, 0x8A382B55, 0x0C242F1D, 0);
|
||||
@ -177,5 +177,5 @@ void Module1800::updateScene() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace Neverhood
|
||||
|
@ -35,8 +35,8 @@ static const uint32 kModule1900SoundList[] = {
|
||||
Module1900::Module1900(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
// NOTE: The original has a Scene1908 here as well but it's not used here but in another module...
|
||||
|
||||
// NOTE: The original has a Scene1908 here as well but it's not used here but in another module...
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else
|
||||
@ -88,7 +88,7 @@ void Module1900::updateScene() {
|
||||
|
||||
Scene1901::Scene1901(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
setRectList(0x004B34C8);
|
||||
@ -98,7 +98,7 @@ Scene1901::Scene1901(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
insertScreenMouse(0x0322301B);
|
||||
|
||||
insertStaticSprite(0x42213133, 1100);
|
||||
|
||||
|
||||
if (!getGlobalVar(V_STAIRS_PUZZLE_SOLVED))
|
||||
insertStaticSprite(0x40A40168, 100);
|
||||
else if (getGlobalVar(V_STAIRS_DOWN)) {
|
||||
@ -132,16 +132,16 @@ static const NPoint kAsScene1907SymbolGroundPositions[] = {
|
||||
{400, 375}, {370, 435}, {475, 415}
|
||||
};
|
||||
|
||||
static const NPoint kAsScene1907SymbolPluggedInPositions[] = {
|
||||
static const NPoint kAsScene1907SymbolPluggedInPositions[] = {
|
||||
{275, 125}, {244, 125}, {238, 131},
|
||||
{221, 135}, {199, 136}, {168, 149},
|
||||
{145, 152}, {123, 154}, {103, 157}
|
||||
};
|
||||
|
||||
static const NPoint kAsScene1907SymbolGroundHitPositions[] = {
|
||||
{275, 299}, {244, 299}, {238, 305},
|
||||
{221, 309}, {199, 310}, {168, 323},
|
||||
{145, 326}, {123, 328}, {103, 331}
|
||||
{275, 299}, {244, 299}, {238, 305},
|
||||
{221, 309}, {199, 310}, {168, 323},
|
||||
{145, 326}, {123, 328}, {103, 331}
|
||||
};
|
||||
|
||||
static const NPoint kAsScene1907SymbolPluggedInDownPositions[] = {
|
||||
@ -164,7 +164,7 @@ AsScene1907Symbol::AsScene1907Symbol(NeverhoodEngine *vm, Scene1907 *parentScene
|
||||
|
||||
_plugInFailed = false;
|
||||
_plugInTryCount = 0;
|
||||
|
||||
|
||||
if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) {
|
||||
_isPluggedIn = true;
|
||||
_currPositionIndex = elementIndex;
|
||||
@ -289,7 +289,7 @@ void AsScene1907Symbol::suMoveDown() {
|
||||
_y = kAsScene1907SymbolPluggedInDownPositions[_elementIndex].y;
|
||||
_isMoving = false;
|
||||
SetSpriteUpdate(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AsScene1907Symbol::suMoveUp() {
|
||||
@ -423,7 +423,7 @@ void AsScene1907Symbol::moveDown() {
|
||||
SsScene1907UpDownButton::SsScene1907UpDownButton(NeverhoodEngine *vm, Scene1907 *parentScene, AsScene1907Symbol *asScene1907Symbol)
|
||||
: StaticSprite(vm, 1400), _parentScene(parentScene), _asScene1907Symbol(asScene1907Symbol),
|
||||
_countdown1(0) {
|
||||
|
||||
|
||||
loadSprite(0x64516424, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 1400);
|
||||
setVisible(false);
|
||||
loadSound(0, 0x44061000);
|
||||
@ -474,7 +474,7 @@ void SsScene1907UpDownButton::setToDownPosition() {
|
||||
|
||||
AsScene1907WaterHint::AsScene1907WaterHint(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1400) {
|
||||
|
||||
|
||||
createSurface1(0x110A1061, 1500);
|
||||
_x = 320;
|
||||
_y = 240;
|
||||
@ -515,10 +515,10 @@ void AsScene1907WaterHint::hide() {
|
||||
SetMessageHandler(&Sprite::handleMessage);
|
||||
}
|
||||
|
||||
Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule), _currMovingSymbolIndex(0), _pluggedInCount(0),
|
||||
Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule), _currMovingSymbolIndex(0), _pluggedInCount(0),
|
||||
_moveDownCountdown(0), _moveUpCountdown(0), _countdown3(0), _hasPlugInFailed(false) {
|
||||
|
||||
|
||||
setBackground(0x20628E05);
|
||||
setPalette(0x20628E05);
|
||||
|
||||
@ -529,12 +529,12 @@ Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule)
|
||||
_asSymbols[i] = insertSprite<AsScene1907Symbol>(this, i, getRandomPositionIndex());
|
||||
addCollisionSprite(_asSymbols[i]);
|
||||
}
|
||||
|
||||
|
||||
_ssUpDownButton = insertSprite<SsScene1907UpDownButton>(this, _asSymbols[8]);
|
||||
addCollisionSprite(_ssUpDownButton);
|
||||
|
||||
_asWaterHint = insertSprite<AsScene1907WaterHint>();
|
||||
|
||||
|
||||
insertPuzzleMouse(0x28E0120E, 20, 620);
|
||||
|
||||
SetMessageHandler(&Scene1907::handleMessage);
|
||||
@ -542,7 +542,7 @@ Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule)
|
||||
|
||||
if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED))
|
||||
_pluggedInCount = 9;
|
||||
|
||||
|
||||
loadSound(0, 0x72004A10);
|
||||
loadSound(1, 0x22082A12);
|
||||
loadSound(2, 0x21100A10);
|
||||
@ -552,7 +552,7 @@ Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule)
|
||||
|
||||
void Scene1907::update() {
|
||||
Scene::update();
|
||||
|
||||
|
||||
if (_hasPlugInFailed) {
|
||||
int fallOffDelay = 0;
|
||||
_hasPlugInFailed = false;
|
||||
@ -619,7 +619,7 @@ uint32 Scene1907::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
playSound(3);
|
||||
setGlobalVar(V_STAIRS_PUZZLE_SOLVED, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace Neverhood {
|
||||
|
||||
Module2000::Module2000(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else if (which == 0)
|
||||
@ -137,9 +137,9 @@ Scene2001::Scene2001(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
sendMessage(this, 0x2000, 0);
|
||||
_klaymen->setDoDeltaX(1);
|
||||
}
|
||||
|
||||
|
||||
_klaymen->setClipRect(tempSprite->getDrawRect().x, 0, 640, 480);
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene2001::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -153,7 +153,7 @@ uint32 Scene2001::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
setRectList(0x004B3670);
|
||||
_klaymen->setKlaymenIdleTable1();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ Module2100::Module2100(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
_vm->_soundMan->addMusic(0x10A10C14, 0x11482B95);
|
||||
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else if (which == 1)
|
||||
@ -129,7 +129,7 @@ void AsScene2101Door::stCloseDoorDone() {
|
||||
|
||||
AsScene2101HitByDoorEffect::AsScene2101HitByDoorEffect(NeverhoodEngine *vm, Sprite *klaymen)
|
||||
: AnimatedSprite(vm, 1400), _klaymen(klaymen) {
|
||||
|
||||
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene2101HitByDoorEffect::handleMessage);
|
||||
createSurface(1200, 88, 165);
|
||||
@ -176,8 +176,8 @@ void SsCommonFloorButton::update() {
|
||||
else
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint32 SsCommonFloorButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -195,12 +195,12 @@ uint32 SsCommonFloorButton::handleMessage(int messageNum, const MessageParam &pa
|
||||
|
||||
Scene2101::Scene2101(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2101::handleMessage);
|
||||
SetUpdateHandler(&Scene2101::update);
|
||||
|
||||
|
||||
setBackground(0x44242305);
|
||||
setPalette(0x44242305);
|
||||
insertScreenMouse(0x4230144A);
|
||||
@ -212,7 +212,7 @@ Scene2101::Scene2101(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
addCollisionSprite(_asTape1);
|
||||
_asTape2 = insertSprite<AsScene1201Tape>(this, 11, 1100, 441, 443, 0x9048A093);
|
||||
addCollisionSprite(_asTape2);
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
insertKlaymen<KmScene2101>(380, 438);
|
||||
setMessageList(0x004B8E48);
|
||||
@ -256,10 +256,10 @@ Scene2101::Scene2101(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_doorStatus = 1;
|
||||
_countdown1 = 0;
|
||||
}
|
||||
|
||||
|
||||
_asHitByDoorEffect = insertSprite<AsScene2101HitByDoorEffect>(_klaymen);
|
||||
_klaymen->setClipRect(0, 0, tempSprite->getDrawRect().x2(), 480);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene2101::update() {
|
||||
|
@ -68,7 +68,7 @@ protected:
|
||||
uint32 _soundFileHash;
|
||||
uint32 _fileHash1, _fileHash2;
|
||||
int16 _countdown;
|
||||
void update();
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
|
||||
|
@ -30,8 +30,8 @@ namespace Neverhood {
|
||||
|
||||
Module2200::Module2200(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
_vm->_soundMan->addMusic(0x11391412, 0x601C908C);
|
||||
|
||||
_vm->_soundMan->addMusic(0x11391412, 0x601C908C);
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
@ -440,7 +440,7 @@ void Module2200::updateScene() {
|
||||
}
|
||||
|
||||
#undef HallOfRecordsSceneLink
|
||||
|
||||
|
||||
void Module2200::createHallOfRecordsScene(int which, uint32 hallOfRecordsInfoId) {
|
||||
_childObject = new HallOfRecordsScene(_vm, this, which, hallOfRecordsInfoId);
|
||||
}
|
||||
@ -461,7 +461,7 @@ AsScene2201Door::AsScene2201Door(NeverhoodEngine *vm, Klaymen *klaymen, Sprite *
|
||||
: AnimatedSprite(vm, 1100), _klaymen(klaymen), _ssDoorLight(ssDoorLight), _countdown(0), _isOpen(isOpen) {
|
||||
|
||||
_x = 408;
|
||||
_y = 290;
|
||||
_y = 290;
|
||||
createSurface(900, 63, 266);
|
||||
SetUpdateHandler(&AsScene2201Door::update);
|
||||
SetMessageHandler(&AsScene2201Door::handleMessage);
|
||||
@ -528,7 +528,7 @@ void AsScene2201Door::stCloseDoor() {
|
||||
|
||||
SsScene2201PuzzleCube::SsScene2201PuzzleCube(NeverhoodEngine *vm, uint32 positionIndex, uint32 cubeIndex)
|
||||
: StaticSprite(vm, 900) {
|
||||
|
||||
|
||||
createSurface(100, 16, 16);
|
||||
loadSprite(kSsScene2201PuzzleCubeFileHashes[cubeIndex], kSLFCenteredDrawOffset | kSLFSetPosition, 0,
|
||||
kSsScene2201PuzzleCubePoints[positionIndex].x, kSsScene2201PuzzleCubePoints[positionIndex].y);
|
||||
@ -543,7 +543,7 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
SetMessageHandler(&Scene2201::handleMessage);
|
||||
SetUpdateHandler(&Scene2201::update);
|
||||
|
||||
|
||||
loadDataResource(0x04104242);
|
||||
loadHitRectList();
|
||||
setBackground(0x40008208);
|
||||
@ -551,9 +551,9 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
insertScreenMouse(0x0820C408);
|
||||
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 7, 1100, 459, 432, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
addCollisionSprite(_asTape);
|
||||
_ssDoorButton = insertSprite<SsCommonPressButton>(this, 0xE4A43E29, 0xE4A43E29, 100, 0);
|
||||
|
||||
|
||||
for (uint32 cubeIndex = 0; cubeIndex < 9; cubeIndex++)
|
||||
if ((int16)getSubVar(VA_CUBE_POSITIONS, cubeIndex) >= 0)
|
||||
insertSprite<SsScene2201PuzzleCube>(cubeIndex, (int16)getSubVar(VA_CUBE_POSITIONS, cubeIndex));
|
||||
@ -562,10 +562,10 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_clipRects[0].x2 = 640;
|
||||
_clipRects[1].x2 = 640;
|
||||
_clipRects[1].y2 = 480;
|
||||
|
||||
|
||||
if (!getGlobalVar(V_TILE_PUZZLE_SOLVED))
|
||||
insertStaticSprite(0x00026027, 900);
|
||||
|
||||
|
||||
tempSprite = insertStaticSprite(0x030326A0, 1100);
|
||||
_clipRects[0].x1 = tempSprite->getDrawRect().x;
|
||||
insertStaticSprite(0x811DA061, 1100);
|
||||
@ -602,7 +602,7 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setMessageList(0x004B8120);
|
||||
_asDoor = insertSprite<AsScene2201Door>(_klaymen, _ssDoorLight, true);
|
||||
}
|
||||
|
||||
|
||||
insertSprite<AsScene2201CeilingFan>();
|
||||
|
||||
_vm->_soundMan->addSound(0x04106220, 0x81212040);
|
||||
@ -719,7 +719,7 @@ uint32 SsScene2202PuzzleCube::handleMessage(int messageNum, const MessageParam &
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
void SsScene2202PuzzleCube::suMoveCubeX() {
|
||||
|
||||
bool done = false;
|
||||
@ -746,9 +746,9 @@ void SsScene2202PuzzleCube::suMoveCubeX() {
|
||||
if (_x == _xFlagPos)
|
||||
_counterDirection = true;
|
||||
}
|
||||
|
||||
|
||||
if (done)
|
||||
stopMoving();
|
||||
stopMoving();
|
||||
|
||||
updateBounds();
|
||||
|
||||
@ -780,9 +780,9 @@ void SsScene2202PuzzleCube::suMoveCubeY() {
|
||||
if (_x == _xFlagPos)
|
||||
_counterDirection = true;
|
||||
}
|
||||
|
||||
|
||||
if (done)
|
||||
stopMoving();
|
||||
stopMoving();
|
||||
|
||||
updateBounds();
|
||||
|
||||
@ -794,7 +794,7 @@ void SsScene2202PuzzleCube::moveCube(int16 newCubePosition) {
|
||||
|
||||
setSubVar(VA_CUBE_POSITIONS, _cubePosition, (uint32)-1);
|
||||
setSubVar(VA_CUBE_POSITIONS, newCubePosition, (uint32)_cubeSymbol);
|
||||
|
||||
|
||||
_cubePosition = newCubePosition;
|
||||
_errValue = 0;
|
||||
_counterDirection = false;
|
||||
@ -837,7 +837,7 @@ void SsScene2202PuzzleCube::moveCube(int16 newCubePosition) {
|
||||
if (_newX - _x >= 180)
|
||||
_xFlagPos = _newX - 90;
|
||||
else
|
||||
_xFlagPos = _x + _newX / 2;
|
||||
_xFlagPos = _x + _newX / 2;
|
||||
} else {
|
||||
if (_x - _newX >= 180)
|
||||
_xFlagPos = _x + 90;
|
||||
@ -851,7 +851,7 @@ void SsScene2202PuzzleCube::moveCube(int16 newCubePosition) {
|
||||
if (_newY - _y >= 180)
|
||||
_xFlagPos = _newY - 90;
|
||||
else
|
||||
_xFlagPos = _y + _newY / 2;
|
||||
_xFlagPos = _y + _newY / 2;
|
||||
} else {
|
||||
if (_y - _newY >= 180)
|
||||
_xFlagPos = _y + 90;
|
||||
@ -860,7 +860,7 @@ void SsScene2202PuzzleCube::moveCube(int16 newCubePosition) {
|
||||
}
|
||||
playSound(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SsScene2202PuzzleCube::stopMoving() {
|
||||
@ -939,7 +939,7 @@ void Scene2202::update() {
|
||||
_isSolved = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene2202::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -981,7 +981,7 @@ int16 Scene2202::getFreeCubePosition(int16 cubePosition) {
|
||||
}
|
||||
|
||||
bool Scene2202::testIsSolved() {
|
||||
return
|
||||
return
|
||||
getSubVar(VA_CUBE_POSITIONS, 0) == 0 &&
|
||||
getSubVar(VA_CUBE_POSITIONS, 2) == 2 &&
|
||||
getSubVar(VA_CUBE_POSITIONS, 3) == 3 &&
|
||||
@ -1146,7 +1146,7 @@ Scene2203::Scene2203(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_ssSmallRightDoor->setVisible(false);
|
||||
_klaymen->setClipRect(_leftDoorClipRect);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Scene2203::~Scene2203() {
|
||||
@ -1220,7 +1220,7 @@ Scene2205::Scene2205(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
SetMessageHandler(&Scene2205::handleMessage);
|
||||
SetUpdateHandler(&Scene2205::update);
|
||||
|
||||
|
||||
setHitRects(0x004B0620);
|
||||
if (getGlobalVar(V_LIGHTS_ON)) {
|
||||
_isLightOn = true;
|
||||
@ -1263,11 +1263,11 @@ Scene2205::Scene2205(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
_klaymen->setClipRect(_ssDoorFrame->getDrawRect().x, 0, 640, 480);
|
||||
_klaymen->setSoundFlag(true);
|
||||
|
||||
|
||||
loadDataResource(0x00144822);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Scene2205::update() {
|
||||
Scene::update();
|
||||
if (!_isLightOn && getGlobalVar(V_LIGHTS_ON)) {
|
||||
@ -1343,7 +1343,7 @@ static const int16 kAsScene2206DoorSpikesXDeltasClose[] = {
|
||||
|
||||
AsScene2206DoorSpikes::AsScene2206DoorSpikes(NeverhoodEngine *vm, uint32 fileHash)
|
||||
: StaticSprite(vm, fileHash, 200) {
|
||||
|
||||
|
||||
if (getGlobalVar(V_SPIKES_RETRACTED))
|
||||
_x -= 63;
|
||||
SetUpdateHandler(&AsScene2206DoorSpikes::update);
|
||||
@ -1457,10 +1457,10 @@ Scene2206::Scene2206(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
uint32 fileHash;
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene::update);
|
||||
SetMessageHandler(&Scene2206::handleMessage);
|
||||
|
||||
|
||||
if (getGlobalVar(V_LIGHTS_ON)) {
|
||||
fileHash = 0x41983216;
|
||||
_sprite1 = insertStaticSprite(0x2201266A, 100);
|
||||
@ -1495,7 +1495,7 @@ Scene2206::Scene2206(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
if (!getGlobalVar(V_LIGHTS_ON))
|
||||
_palette->addPalette(0x0263D144, 0, 65, 0);
|
||||
addCollisionSprite(_ssTestTube);
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
// Restoring game
|
||||
insertKlaymen<KmScene2206>(200, 430);
|
||||
@ -1644,7 +1644,7 @@ void AsScene2207Elevator::update() {
|
||||
if (_destPointIndex + _destPointIndexDelta > _pointIndex) {
|
||||
_pointIndex++;
|
||||
startAnimation(getGlobalVar(V_LIGHTS_ON) ? 0xC858CC19 : 0x294B3377, _pointIndex, _pointIndex);
|
||||
_newStickFrameIndex = _pointIndex;
|
||||
_newStickFrameIndex = _pointIndex;
|
||||
if (_destPointIndex + _destPointIndexDelta == _pointIndex) {
|
||||
if (_destPointIndexDelta != 0)
|
||||
_destPointIndexDelta = 0;
|
||||
@ -1660,7 +1660,7 @@ void AsScene2207Elevator::update() {
|
||||
if (_pointIndex == 0)
|
||||
sendMessage(_parentScene, 0x2003, 0);
|
||||
startAnimation(getGlobalVar(V_LIGHTS_ON) ? 0xC858CC19 : 0x294B3377, _pointIndex, _pointIndex);
|
||||
_newStickFrameIndex = _pointIndex;
|
||||
_newStickFrameIndex = _pointIndex;
|
||||
if (_destPointIndex + _destPointIndexDelta == _pointIndex) {
|
||||
if (_destPointIndexDelta != 0)
|
||||
_destPointIndexDelta = 0;
|
||||
@ -1675,14 +1675,14 @@ void AsScene2207Elevator::update() {
|
||||
sendMessage(_parentScene, 0x2002, 900);
|
||||
else if (_pointIndex < 20 && _surface->getPriority() != 1100)
|
||||
sendMessage(_parentScene, 0x2002, 1100);
|
||||
|
||||
|
||||
AnimatedSprite::update();
|
||||
|
||||
|
||||
if (_destPointIndex + _destPointIndexDelta == _pointIndex && _isMoving) {
|
||||
sendMessage(_parentScene, 0x2004, 0);
|
||||
_isMoving = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AsScene2207Elevator::suSetPosition() {
|
||||
@ -1706,14 +1706,14 @@ void AsScene2207Elevator::moveToY(int16 y) {
|
||||
|
||||
if (!_pointArray || _pointArray->size() == 0)
|
||||
return;
|
||||
|
||||
|
||||
for (uint i = 0; i < _pointArray->size(); i++) {
|
||||
int16 distance = ABS(y - (*_pointArray)[i].y);
|
||||
if (distance < minDistance) {
|
||||
minDistance = distance;
|
||||
_destPointIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_destPointIndex != _pointIndex) {
|
||||
if (_destPointIndex == 0 || _destPointIndex == (int)_pointArray->size() - 1)
|
||||
@ -1732,7 +1732,7 @@ void AsScene2207Elevator::moveToY(int16 y) {
|
||||
|
||||
AsScene2207Lever::AsScene2207Lever(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y, int doDeltaX)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene) {
|
||||
|
||||
|
||||
_x = x;
|
||||
_y = y;
|
||||
createSurface(1010, 71, 73);
|
||||
@ -1793,7 +1793,7 @@ void AsScene2207Lever::stLeverUpEvent() {
|
||||
|
||||
AsScene2207WallRobotAnimation::AsScene2207WallRobotAnimation(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 1200), _idle(true) {
|
||||
|
||||
|
||||
_x = 309;
|
||||
_y = 320;
|
||||
createSurface1(0xCCFD6090, 100);
|
||||
@ -1874,7 +1874,7 @@ void AsScene2207WallRobotAnimation::cbStopAnimation() {
|
||||
|
||||
AsScene2207WallCannonAnimation::AsScene2207WallCannonAnimation(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1200), _idle(true) {
|
||||
|
||||
|
||||
_x = 309;
|
||||
_y = 320;
|
||||
createSurface1(0x8CAA0099, 100);
|
||||
@ -1925,7 +1925,7 @@ SsScene2207Symbol::SsScene2207Symbol(NeverhoodEngine *vm, uint32 fileHash, int i
|
||||
|
||||
_x = 330;
|
||||
_y = 246 + index * 50;
|
||||
updatePosition();
|
||||
updatePosition();
|
||||
}
|
||||
|
||||
Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule)
|
||||
@ -1943,7 +1943,7 @@ Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule)
|
||||
_klaymen->setRepl(64, 0);
|
||||
setMessageList(0x004B38E8);
|
||||
_asElevator = insertSprite<AsScene2207Elevator>(this);
|
||||
|
||||
|
||||
if (getGlobalVar(V_LIGHTS_ON)) {
|
||||
setBackground(0x88C00241);
|
||||
setPalette(0x88C00241);
|
||||
@ -1952,7 +1952,7 @@ Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule)
|
||||
_ssMaskPart2 = insertStaticSprite(0x688F62A5, 1100);
|
||||
_ssMaskPart3 = insertStaticSprite(0x0043B038, 1100);
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 4, 1100, 277, 428, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
addCollisionSprite(_asTape);
|
||||
_asLever = insertSprite<AsScene2207Lever>(this, 527, 333, 0);
|
||||
addCollisionSprite(_asLever);
|
||||
_asWallRobotAnimation = insertSprite<AsScene2207WallRobotAnimation>(this);
|
||||
@ -2106,7 +2106,7 @@ static const uint32 kScene2208FileHashes1[] = {
|
||||
0x041023CB, 0x041020CB, 0x041026CB, 0x04102ACB,
|
||||
0x041032CB, 0x041002CB
|
||||
};
|
||||
|
||||
|
||||
static const uint32 kScene2208FileHashes2[] = {
|
||||
0x091206C9, 0x091406C9, 0x091806C9, 0x090006C9,
|
||||
0x093006C9, 0x095006C9
|
||||
@ -2122,13 +2122,13 @@ Scene2208::Scene2208(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setGlobalVar(V_COLUMN_TEXT_NAME, calcHash("stLineagex"));
|
||||
|
||||
_textResource.load(getGlobalVar(V_COLUMN_TEXT_NAME));
|
||||
|
||||
|
||||
textStart = _textResource.getString(getGlobalVar(V_CLICKED_COLUMN_INDEX), textEnd);
|
||||
while (textStart < textEnd) {
|
||||
_strings.push_back(textStart);
|
||||
textStart += strlen(textStart) + 1;
|
||||
}
|
||||
|
||||
|
||||
_maxRowIndex = 8 + 10 * (3 - (getGlobalVar(V_COLUMN_TEXT_NAME) == calcHash("stLineagex") ? 1 : 0));
|
||||
|
||||
_background = new Background(_vm, 0);
|
||||
@ -2154,7 +2154,7 @@ Scene2208::Scene2208(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_bottomBackgroundSurface = new BaseSurface(_vm, 0, 640, 192, "bottom background");
|
||||
spriteResource.load(kScene2208FileHashes2[getGlobalVar(V_CLICKED_COLUMN_INDEX) % 6], true);
|
||||
_bottomBackgroundSurface->drawSpriteResourceEx(spriteResource, false, false, 0, 0);
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene2208::update);
|
||||
SetMessageHandler(&Scene2208::handleMessage);
|
||||
|
||||
@ -2165,7 +2165,7 @@ Scene2208::Scene2208(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
if (_newRowIndex < 6)
|
||||
_newRowIndex = 0;
|
||||
_rowScrollY = 0;
|
||||
_backgroundScrollY = 48 * _newRowIndex;
|
||||
_backgroundScrollY = 48 * _newRowIndex;
|
||||
_currRowIndex = _newRowIndex;
|
||||
|
||||
for (int16 rowIndex = 0; rowIndex < _visibleRowsCount; rowIndex++)
|
||||
@ -2185,7 +2185,7 @@ Scene2208::~Scene2208() {
|
||||
void Scene2208::update() {
|
||||
|
||||
int16 mouseY = _vm->getMouseY();
|
||||
|
||||
|
||||
if (mouseY < 48) {
|
||||
if (_currRowIndex > 0)
|
||||
_newRowIndex = _currRowIndex - 1;
|
||||
@ -2235,7 +2235,7 @@ uint32 Scene2208::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
}
|
||||
|
||||
void Scene2208::drawRow(int16 rowIndex) {
|
||||
NDrawRect sourceRect;
|
||||
NDrawRect sourceRect;
|
||||
int16 y = (rowIndex * 48) % 528;
|
||||
if (rowIndex < 4) {
|
||||
sourceRect.x = 0;
|
||||
@ -2280,7 +2280,7 @@ Scene2242::Scene2242(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
SetMessageHandler(&Scene2242::handleMessage);
|
||||
SetUpdateHandler(&Scene2242::update);
|
||||
|
||||
|
||||
if (getGlobalVar(V_LIGHTS_ON)) {
|
||||
setBackground(0x11840E24);
|
||||
setPalette(0x11840E24);
|
||||
@ -2297,7 +2297,7 @@ Scene2242::Scene2242(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 10, 1100, 464, 435, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
addCollisionSprite(_asTape);
|
||||
|
||||
if (which < 0) {
|
||||
// Restoring game
|
||||
@ -2380,7 +2380,7 @@ void Scene2242::readClickedColumn() {
|
||||
}
|
||||
|
||||
static const int16 kHallOfRecordsKlaymenXPos[] = {
|
||||
68, 157, 246, 335,
|
||||
68, 157, 246, 335,
|
||||
424, 513, 602
|
||||
};
|
||||
|
||||
@ -2396,7 +2396,7 @@ static const uint32 kHallOfRecordsSceneMessageListIds1[] = {
|
||||
|
||||
HallOfRecordsScene::HallOfRecordsScene(NeverhoodEngine *vm, Module *parentModule, int which, uint32 hallOfRecordsInfoId)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
_hallOfRecordsInfo = _vm->_staticData->getHallOfRecordsInfoItem(hallOfRecordsInfoId);
|
||||
|
||||
SetMessageHandler(&HallOfRecordsScene::handleMessage);
|
||||
@ -2487,7 +2487,7 @@ static const uint32 kScene2247MessageListIds1[] = {
|
||||
|
||||
Scene2247::Scene2247(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2247::handleMessage);
|
||||
SetUpdateHandler(&Scene::update);
|
||||
|
||||
@ -2524,7 +2524,7 @@ Scene2247::Scene2247(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
_klaymen->setSoundFlag(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Scene2247::~Scene2247() {
|
||||
|
@ -100,7 +100,7 @@ class SsScene2202PuzzleCube : public StaticSprite {
|
||||
public:
|
||||
SsScene2202PuzzleCube(NeverhoodEngine *vm, Scene *parentScene, int16 cubePosition, int16 cubeSymbol);
|
||||
protected:
|
||||
Scene *_parentScene;
|
||||
Scene *_parentScene;
|
||||
int16 _cubeSymbol;
|
||||
int16 _cubePosition;
|
||||
int16 _newX, _newY;
|
||||
@ -135,7 +135,7 @@ protected:
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
int16 getFreeCubePosition(int16 index);
|
||||
bool testIsSolved();
|
||||
bool testIsSolved();
|
||||
};
|
||||
|
||||
class AsCommonKey : public AnimatedSprite {
|
||||
|
@ -32,12 +32,12 @@ static const uint32 kModule2300SoundList[] = {
|
||||
|
||||
Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule), _soundVolume(0) {
|
||||
|
||||
|
||||
_vm->_soundMan->addSoundList(0x1A214010, kModule2300SoundList);
|
||||
_vm->_soundMan->setSoundListParams(kModule2300SoundList, true, 50, 600, 10, 150);
|
||||
|
||||
_isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0;
|
||||
|
||||
|
||||
if (_isWallBroken) {
|
||||
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 0);
|
||||
_vm->_soundMan->playSoundLooping(0x90F0D1C3);
|
||||
@ -161,12 +161,12 @@ void Module2300::updateScene() {
|
||||
} else {
|
||||
switch (_sceneNum) {
|
||||
case 1:
|
||||
if (_isWallBroken && navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 4 &&
|
||||
if (_isWallBroken && navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 4 &&
|
||||
navigationScene()->getFrameNumber() % 2) {
|
||||
_soundVolume++;
|
||||
_vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
|
||||
}
|
||||
if (navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 0 &&
|
||||
if (navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 0 &&
|
||||
navigationScene()->getFrameNumber() == 50) {
|
||||
_vm->_soundMan->playTwoSounds(0x1A214010, 0x48498E46, 0x50399F64, 0);
|
||||
_vm->_soundMan->setSoundVolume(0x48498E46, 70);
|
||||
@ -182,5 +182,5 @@ void Module2300::updateScene() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace Neverhood
|
||||
|
@ -26,7 +26,7 @@ namespace Neverhood {
|
||||
|
||||
Module2400::Module2400(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
_vm->_soundMan->addMusic(0x202D1010, 0xB110382D);
|
||||
|
||||
if (which < 0)
|
||||
@ -187,7 +187,7 @@ static const uint32 kAsScene2401WaterSpitFileHashes1[] = {
|
||||
|
||||
AsScene2401WaterSpit::AsScene2401WaterSpit(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1200) {
|
||||
|
||||
|
||||
_x = 240;
|
||||
_y = 447;
|
||||
createSurface(100, 146, 74);
|
||||
@ -222,7 +222,7 @@ uint32 AsScene2401WaterSpit::handleMessage(int messageNum, const MessageParam &p
|
||||
|
||||
AsScene2401FlowingWater::AsScene2401FlowingWater(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1200), _isWaterFlowing(false) {
|
||||
|
||||
|
||||
_x = 88;
|
||||
_y = 421;
|
||||
createSurface1(0x10203116, 100);
|
||||
@ -262,10 +262,10 @@ uint32 AsScene2401FlowingWater::handleMessage(int messageNum, const MessageParam
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
AsScene2401WaterFlushing::AsScene2401WaterFlushing(NeverhoodEngine *vm, int16 x, int16 y)
|
||||
: AnimatedSprite(vm, 1200), _countdown(0), _flushLoopCount(0) {
|
||||
|
||||
|
||||
_x = x;
|
||||
_y = y;
|
||||
createSurface1(0xB8596884, 100);
|
||||
@ -308,7 +308,7 @@ uint32 AsScene2401WaterFlushing::handleMessage(int messageNum, const MessagePara
|
||||
|
||||
AsScene2401Door::AsScene2401Door(NeverhoodEngine *vm, bool isOpen)
|
||||
: AnimatedSprite(vm, 1100), _countdown(0), _isOpen(isOpen) {
|
||||
|
||||
|
||||
_x = 320;
|
||||
_y = 240;
|
||||
createSurface1(0x44687810, 100);
|
||||
@ -398,7 +398,7 @@ Scene2401::Scene2401(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_ssWaterPipes[i] = insertStaticSprite(kScene2401FileHashes1[i], 300);
|
||||
_ssWaterPipes[i]->setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
_asWaterSpit[0] = insertSprite<AsScene2401WaterSpit>();
|
||||
_asWaterSpit[1] = insertSprite<AsScene2401WaterSpit>();
|
||||
|
||||
@ -461,7 +461,7 @@ void Scene2401::update() {
|
||||
|
||||
if (_countdown2 != 0 && (--_countdown2) == 0)
|
||||
sendMessage(_asFlowingWater, 0x2003, 0);
|
||||
|
||||
|
||||
Scene::update();
|
||||
|
||||
}
|
||||
@ -559,7 +559,7 @@ AsScene2402Door::AsScene2402Door(NeverhoodEngine *vm, Scene *parentScene, bool i
|
||||
} else {
|
||||
stopAnimation();
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
SetUpdateHandler(&AsScene2402Door::update);
|
||||
SetMessageHandler(&AsScene2402Door::handleMessage);
|
||||
}
|
||||
@ -654,7 +654,7 @@ void AsScene2402TV::upFocusKlaymen() {
|
||||
_newStickFrameIndex = _currFrameIndex;
|
||||
if (_countdown2 == 0) {
|
||||
_vm->_soundMan->addSound(0x01520123, 0xC42D4528);
|
||||
_vm->_soundMan->playSoundLooping(0xC42D4528);
|
||||
_vm->_soundMan->playSoundLooping(0xC42D4528);
|
||||
}
|
||||
_countdown2 = 5;
|
||||
} else if (_countdown2 != 0 && (--_countdown2 == 0))
|
||||
@ -698,7 +698,7 @@ Scene2402::Scene2402(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 9, 1100, 286, 409, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
_ssButton = insertSprite<SsCommonButtonSprite>(this, 0x15288120, 100, 0);
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
// Restoring game
|
||||
insertKlaymen<KmScene2402>(198, 404);
|
||||
@ -779,7 +779,7 @@ uint32 Scene2402::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
void Scene2402::playPipeSound(uint32 fileHash) {
|
||||
playSound(_soundToggle ? 0 : 1, fileHash);
|
||||
_soundToggle = !_soundToggle;
|
||||
@ -787,7 +787,7 @@ void Scene2402::playPipeSound(uint32 fileHash) {
|
||||
|
||||
Scene2403::Scene2403(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
Sprite *tempSprite1, *tempSprite2, *tempSprite3;
|
||||
|
||||
SetMessageHandler(&Scene2403::handleMessage);
|
||||
@ -799,7 +799,7 @@ Scene2403::Scene2403(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
addCollisionSprite(_asTape);
|
||||
_asLightCord = insertSprite<AsScene2803LightCord>(this, 0xA1095A10, 0x836D3813, 368, 200);
|
||||
_asLightCord->setClipRect(0, 25, 640, 480);
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
// Restoring game
|
||||
_isClimbingLadder = false;
|
||||
@ -828,11 +828,11 @@ Scene2403::Scene2403(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
_ssButton = insertSprite<SsCommonButtonSprite>(this, 0x3130B0EB, 100, 0);
|
||||
tempSprite1 = insertStaticSprite(0x20C24220, 1100);
|
||||
tempSprite1 = insertStaticSprite(0x20C24220, 1100);
|
||||
tempSprite2 = insertStaticSprite(0x03080900, 1300);
|
||||
tempSprite3 = insertSprite<AsScene1002KlaymenLadderHands>(_klaymen);
|
||||
tempSprite3->setClipRect(tempSprite1->getDrawRect().x, 0, 640, tempSprite2->getDrawRect().y2());
|
||||
_klaymen->setClipRect(tempSprite1->getDrawRect().x, 0, 640, tempSprite2->getDrawRect().y2());
|
||||
_klaymen->setClipRect(tempSprite1->getDrawRect().x, 0, 640, tempSprite2->getDrawRect().y2());
|
||||
loadSound(1, calcHash("fxFogHornSoft"));
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ Scene2406::Scene2406(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setGlobalVar(V_KEY3_LOCATION, 2);
|
||||
|
||||
SetMessageHandler(&Scene2406::handleMessage);
|
||||
|
||||
|
||||
setRectList(0x004B78C8);
|
||||
insertScreenMouse(0xB03001A8);
|
||||
|
||||
@ -913,7 +913,7 @@ Scene2406::Scene2406(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
setPalette(0x0A038595);
|
||||
tempSprite1 = insertStaticSprite(0x1712112A, 1100);
|
||||
}
|
||||
|
||||
|
||||
tempSprite2 = insertStaticSprite(0x22300924, 1300);
|
||||
_clipRects[1].x1 = tempSprite1->getDrawRect().x;
|
||||
_clipRects[1].y1 = tempSprite2->getDrawRect().y;
|
||||
|
@ -51,7 +51,7 @@ static const NRect kScene2508ClipRect2 = NRect(0, 0, 594, 448);
|
||||
|
||||
Module2500::Module2500(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule), _soundIndex(0) {
|
||||
|
||||
|
||||
_vm->_soundMan->addMusic(0x29220120, 0x05343184);
|
||||
_vm->_soundMan->startMusic(0x05343184, 0, 0);
|
||||
SetMessageHandler(&Module2500::handleMessage);
|
||||
@ -212,14 +212,14 @@ uint32 Module2500::handleMessage(int messageNum, const MessageParam ¶m, Enti
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
void Module2500::createScene2704(int which, uint32 sceneInfoId, int16 value, const uint32 *staticSprites, const NRect *clipRect) {
|
||||
_childObject = new Scene2704(_vm, this, which, sceneInfoId, value, staticSprites, clipRect);
|
||||
}
|
||||
|
||||
Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B2628));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B264C));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B2670));
|
||||
@ -282,7 +282,7 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_asCarTrackShadow = insertSprite<AsCommonCarTrackShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
|
||||
_asCarConnectorShadow = insertSprite<AsCommonCarConnectorShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
|
||||
insertSprite<AsCommonCarConnector>(_asCar);
|
||||
|
||||
|
||||
_newTrackIndex = -1;
|
||||
_dataResource.load(calcHash("Ashooded"));
|
||||
|
||||
@ -300,9 +300,9 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480)
|
||||
sendMessage(_asCar, 0x2008, 150);
|
||||
}
|
||||
|
||||
|
||||
_carStatus = 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Scene2501::~Scene2501() {
|
||||
@ -391,7 +391,7 @@ uint32 Scene2501::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
uint32 Scene2501::hmRidingCar(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -434,7 +434,7 @@ uint32 Scene2501::hmCarAtHome(int messageNum, const MessageParam ¶m, Entity
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
void Scene2501::moveCarToPoint(NPoint &pt) {
|
||||
int minMatchTrackIndex, minMatchDistance;
|
||||
_tracks.findTrackPoint(pt, minMatchTrackIndex, minMatchDistance, _dataResource);
|
||||
@ -472,7 +472,7 @@ void Scene2501::updateKlaymenClipRect() {
|
||||
|
||||
SsScene2504Button::SsScene2504Button(NeverhoodEngine *vm)
|
||||
: StaticSprite(vm, 1400), _countdown(0), _isSoundPlaying(false) {
|
||||
|
||||
|
||||
loadSprite(0x070220D9, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
loadSound(0, 0x4600204C);
|
||||
@ -520,9 +520,9 @@ uint32 SsScene2504Button::handleMessage(int messageNum, const MessageParam ¶
|
||||
|
||||
Scene2504::Scene2504(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
Sprite *ssButton;
|
||||
|
||||
|
||||
setBackground(0x90791B80);
|
||||
setPalette(0x90791B80);
|
||||
ssButton = insertSprite<SsScene2504Button>();
|
||||
|
@ -35,7 +35,7 @@ static const uint32 kModule2600SoundList[] = {
|
||||
|
||||
Module2600::Module2600(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule) {
|
||||
|
||||
|
||||
if (which < 0)
|
||||
createScene(_vm->gameState().sceneNum, -1);
|
||||
else if (which == 1)
|
||||
@ -218,10 +218,10 @@ void Module2600::updateScene() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SsScene2609Button::SsScene2609Button(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: StaticSprite(vm, 1400), _parentScene(parentScene), _countdown(0) {
|
||||
|
||||
|
||||
SetUpdateHandler(&SsScene2609Button::update);
|
||||
SetMessageHandler(&SsScene2609Button::handleMessage);
|
||||
|
||||
@ -273,7 +273,7 @@ uint32 SsScene2609Button::handleMessage(int messageNum, const MessageParam ¶
|
||||
|
||||
AsScene2609Water::AsScene2609Water(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1000) {
|
||||
|
||||
|
||||
_x = 240;
|
||||
_y = 420;
|
||||
setDoDeltaX(1);
|
||||
@ -309,7 +309,7 @@ uint32 AsScene2609Water::handleMessage(int messageNum, const MessageParam ¶m
|
||||
|
||||
Scene2609::Scene2609(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _isBusy(false) {
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene::update);
|
||||
SetMessageHandler(&Scene2609::handleMessage);
|
||||
|
||||
|
@ -84,7 +84,7 @@ static const uint32 kScene2725StaticSprites[] = {
|
||||
|
||||
Module2700::Module2700(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule), _soundIndex(0), _radioMusicInitialized(false) {
|
||||
|
||||
|
||||
_vm->_soundMan->addMusic(0x42212411, 0x04020210);
|
||||
_vm->_soundMan->startMusic(0x04020210, 24, 2);
|
||||
SetMessageHandler(&Module2700::handleMessage);
|
||||
@ -527,7 +527,7 @@ uint32 Module2700::handleMessage(int messageNum, const MessageParam ¶m, Enti
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
void Module2700::createScene2703(int which, uint32 trackInfoId) {
|
||||
_childObject = new Scene2703(_vm, this, which, trackInfoId);
|
||||
}
|
||||
@ -545,7 +545,7 @@ static const NPoint kCarShadowOffsets[] = {
|
||||
|
||||
SsCommonTrackShadowBackground::SsCommonTrackShadowBackground(NeverhoodEngine *vm, uint32 fileHash)
|
||||
: StaticSprite(vm, 0) {
|
||||
|
||||
|
||||
loadSprite(fileHash, kSLFDefDrawOffset | kSLFDefPosition, 0);
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ AsCommonCarShadow::AsCommonCarShadow(NeverhoodEngine *vm, AnimatedSprite *asCar,
|
||||
SetUpdateHandler(&AsCommonCarShadow::update);
|
||||
createShadowSurface(shadowSurface, 211, 147, 100);
|
||||
updateShadow();
|
||||
}
|
||||
}
|
||||
|
||||
void AsCommonCarShadow::update() {
|
||||
updateShadow();
|
||||
@ -589,8 +589,8 @@ AsCommonCarConnectorShadow::AsCommonCarConnectorShadow(NeverhoodEngine *vm, Spri
|
||||
SetUpdateHandler(&AsCommonCarConnectorShadow::update);
|
||||
createShadowSurface1(shadowSurface, 0x60281C10, 150);
|
||||
startAnimation(0x60281C10, -1, -1);
|
||||
_newStickFrameIndex = STICK_LAST_FRAME;
|
||||
}
|
||||
_newStickFrameIndex = STICK_LAST_FRAME;
|
||||
}
|
||||
|
||||
void AsCommonCarConnectorShadow::update() {
|
||||
_x = _asCar->getX() + kCarShadowOffsets[_index].x;
|
||||
@ -605,7 +605,7 @@ AsCommonCarTrackShadow::AsCommonCarTrackShadow(NeverhoodEngine *vm, Sprite *asCa
|
||||
createShadowSurface1(shadowSurface, 0x0759129C, 100);
|
||||
startAnimation(0x0759129C, frameIndex, -1);
|
||||
_newStickFrameIndex = frameIndex;
|
||||
}
|
||||
}
|
||||
|
||||
void AsCommonCarTrackShadow::update() {
|
||||
_x = _asCar->getX();
|
||||
@ -615,19 +615,19 @@ void AsCommonCarTrackShadow::update() {
|
||||
|
||||
Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
|
||||
NRect clipRect;
|
||||
TrackInfo *tracks = _vm->_staticData->getTrackInfo(0x004B2240);
|
||||
setGlobalVar(V_CAR_DELTA_X, 1);
|
||||
|
||||
|
||||
setBackground(tracks->bgFilename);
|
||||
setPalette(tracks->bgFilename);
|
||||
_palette->addPalette(calcHash("paPodFloor"), 65, 31, 65);
|
||||
_palette->addPalette(calcHash("paKlayFloor"), 0, 65, 0);
|
||||
insertScreenMouse(0x08B08180);
|
||||
|
||||
|
||||
tempSprite = insertStaticSprite(0x1E086325, 1200);
|
||||
clipRect.set(0, 0, 640, tempSprite->getDrawRect().y2());
|
||||
|
||||
@ -661,7 +661,7 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480)
|
||||
sendMessage(_asCar, 0x2008, 150);
|
||||
}
|
||||
|
||||
|
||||
_asCar->setClipRect(clipRect);
|
||||
_asCarConnector->setClipRect(clipRect);
|
||||
|
||||
@ -715,10 +715,10 @@ uint32 Scene2701::hmCarAtHome(int messageNum, const MessageParam ¶m, Entity
|
||||
|
||||
Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _isInLight(true), _newTrackIndex(-1) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2702::handleMessage);
|
||||
SetUpdateHandler(&Scene2702::update);
|
||||
|
||||
|
||||
setBackground(0x18808B00);
|
||||
setPalette(0x18808B00);
|
||||
_palette->addPalette(calcHash("paPodFloor"), 65, 31, 65);
|
||||
@ -734,7 +734,7 @@ Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_asCarTrackShadow = insertSprite<AsCommonCarTrackShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
|
||||
_asCarConnectorShadow = insertSprite<AsCommonCarConnectorShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
|
||||
_dataResource.load(0x04310014);
|
||||
|
||||
|
||||
if (which == 1) {
|
||||
_isUpperTrack = false;
|
||||
_currTrackIndex = 1;
|
||||
@ -765,11 +765,11 @@ Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
|
||||
if (_isUpperTrack) {
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5F68));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5F68));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5F8C));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5FB0));
|
||||
} else {
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5FD8));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5FD8));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B5FFC));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B6020));
|
||||
}
|
||||
@ -873,19 +873,19 @@ Scene2703::Scene2703(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
TrackInfo *tracks = _vm->_staticData->getTrackInfo(trackInfoId);
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2703::handleMessage);
|
||||
SetUpdateHandler(&Scene2703::update);
|
||||
|
||||
|
||||
setBackground(tracks->bgFilename);
|
||||
setPalette(tracks->bgFilename);
|
||||
_palette->addPalette(calcHash("paPodShade"), 65, 31, 65);
|
||||
_palette->addPalette(calcHash("paKlayShade"), 0, 65, 0);
|
||||
addEntity(_palette);
|
||||
insertScreenMouse(tracks->mouseCursorFilename);
|
||||
|
||||
|
||||
_palStatus = 2;
|
||||
|
||||
|
||||
if (tracks->bgShadowFilename) {
|
||||
_ssTrackShadowBackground = createSprite<SsCommonTrackShadowBackground>(tracks->bgShadowFilename);
|
||||
addEntity(_ssTrackShadowBackground);
|
||||
@ -905,7 +905,7 @@ Scene2703::Scene2703(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
_dataResource.load(tracks->dataResourceFilename);
|
||||
_trackPoints = _dataResource.getPointArray(tracks->trackPointsName);
|
||||
_asCar->setPathPoints(_trackPoints);
|
||||
|
||||
|
||||
if (which == _which2) {
|
||||
NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1];
|
||||
sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
|
||||
@ -921,7 +921,7 @@ Scene2703::Scene2703(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
else
|
||||
sendMessage(_asCar, 0x2008, 150);
|
||||
}
|
||||
|
||||
|
||||
if (which == 0) {
|
||||
_palette->addPalette(calcHash("paPodShade"), 65, 31, 65);
|
||||
_palette->addPalette(calcHash("paKlayShade"), 0, 65, 0);
|
||||
@ -931,9 +931,9 @@ Scene2703::Scene2703(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
_palette->addPalette(calcHash("paKlayBlack"), 0, 65, 0);
|
||||
_palStatus = 0;
|
||||
}
|
||||
|
||||
|
||||
_palette->copyBasePalette(0, 256, 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene2703::update() {
|
||||
@ -981,16 +981,16 @@ uint32 Scene2703::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint32 trackInfoId, int16 value,
|
||||
const uint32 *staticSprites, const NRect *clipRect)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
TrackInfo *tracks = _vm->_staticData->getTrackInfo(trackInfoId);
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2704::handleMessage);
|
||||
SetUpdateHandler(&Scene2704::update);
|
||||
|
||||
|
||||
setBackground(tracks->bgFilename);
|
||||
setPalette(tracks->bgFilename);
|
||||
|
||||
@ -999,12 +999,12 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
|
||||
if (tracks->exPaletteFilename2)
|
||||
_palette->addPalette(tracks->exPaletteFilename2, 65, 31, 65);
|
||||
|
||||
|
||||
while (staticSprites && *staticSprites)
|
||||
insertStaticSprite(*staticSprites++, 1100);
|
||||
|
||||
insertScreenMouse(tracks->mouseCursorFilename);
|
||||
|
||||
|
||||
if (tracks->bgShadowFilename) {
|
||||
_ssTrackShadowBackground = createSprite<SsCommonTrackShadowBackground>(tracks->bgShadowFilename);
|
||||
addEntity(_ssTrackShadowBackground);
|
||||
@ -1024,7 +1024,7 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
_dataResource.load(tracks->dataResourceFilename);
|
||||
_trackPoints = _dataResource.getPointArray(tracks->trackPointsName);
|
||||
_asCar->setPathPoints(_trackPoints);
|
||||
|
||||
|
||||
if (which == _which2) {
|
||||
NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1];
|
||||
sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
|
||||
@ -1040,21 +1040,21 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3
|
||||
else
|
||||
sendMessage(_asCar, 0x2008, 0);
|
||||
}
|
||||
|
||||
|
||||
if (clipRect) {
|
||||
_asCar->getClipRect() = *clipRect;
|
||||
if (_asCarShadow)
|
||||
_asCarShadow->getClipRect() = *clipRect;
|
||||
_asCarShadow->getClipRect() = *clipRect;
|
||||
if (_asCarTrackShadow)
|
||||
_asCarTrackShadow->getClipRect() = *clipRect;
|
||||
_asCarTrackShadow->getClipRect() = *clipRect;
|
||||
if (_asCarConnectorShadow)
|
||||
_asCarConnectorShadow->getClipRect() = *clipRect;
|
||||
_asCarConnectorShadow->getClipRect() = *clipRect;
|
||||
if (_asCarConnector)
|
||||
_asCarConnector->getClipRect() = *clipRect;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Scene2704::update() {
|
||||
Scene::update();
|
||||
if (_mouseClicked) {
|
||||
@ -1083,24 +1083,24 @@ uint32 Scene2704::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _newTrackIndex(-1) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2706::handleMessage);
|
||||
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B22A0));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B22A0));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B22C4));
|
||||
_tracks.push_back(_vm->_staticData->getTrackInfo(0x004B22E8));
|
||||
|
||||
|
||||
setBackground(0x18808B88);
|
||||
setPalette(0x18808B88);
|
||||
|
||||
|
||||
_palette->addPalette(calcHash("paPodShade"), 65, 31, 65);
|
||||
_palette->addPalette(calcHash("paKlayShade"), 0, 65, 0);
|
||||
|
||||
|
||||
insertScreenMouse(0x08B8C180);
|
||||
|
||||
_ssTrackShadowBackground = createSprite<SsCommonTrackShadowBackground>(0x18808B88);
|
||||
addEntity(_ssTrackShadowBackground);
|
||||
|
||||
|
||||
_asCar = insertSprite<AsCommonCar>(this, 320, 240);
|
||||
_asCarShadow = insertSprite<AsCommonCarShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
|
||||
_asCarConnector = insertSprite<AsCommonCarConnector>(_asCar);
|
||||
@ -1108,10 +1108,10 @@ Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_asCarConnectorShadow = insertSprite<AsCommonCarConnectorShadow>(_asCar, _ssTrackShadowBackground->getSurface(), 4);
|
||||
|
||||
_dataResource.load(0x06000162);
|
||||
|
||||
|
||||
if (which == 5)
|
||||
_currTrackIndex = 2;
|
||||
else if (which == 6)
|
||||
else if (which == 6)
|
||||
_currTrackIndex = 1;
|
||||
else
|
||||
_currTrackIndex = 0;
|
||||
@ -1123,16 +1123,16 @@ Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
|
||||
if (which == 5)
|
||||
sendMessage(_asCar, 0x2007, 50);
|
||||
else
|
||||
else
|
||||
sendMessage(_asCar, 0x2007, 150);
|
||||
} else {
|
||||
sendMessage(_asCar, 0x2002, 0);
|
||||
if (which == 5)
|
||||
sendMessage(_asCar, 0x2008, 50);
|
||||
else
|
||||
else
|
||||
sendMessage(_asCar, 0x2008, 150);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene2706::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -1192,7 +1192,7 @@ void Scene2706::changeTrack() {
|
||||
|
||||
Scene2732::Scene2732(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
setBackground(0x0220C041);
|
||||
|
@ -36,7 +36,7 @@ Module2800::Module2800(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_currentMusicFileHash = 0;
|
||||
_vm->_soundMan->addMusic(0x64210814, 0xD2FA4D14);
|
||||
setGlobalVar(V_RADIO_MOVE_DISH_VIDEO, 1);
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
createScene(_vm->gameState().sceneNum, which);
|
||||
} else if (which == 2) {
|
||||
@ -224,7 +224,7 @@ void Module2800::updateScene() {
|
||||
_musicResource = NULL;
|
||||
}
|
||||
_currentMusicFileHash = 0;
|
||||
}
|
||||
}
|
||||
if (_moduleResult == 1) {
|
||||
createScene(2, 0);
|
||||
} else if (_moduleResult == 2) {
|
||||
@ -251,7 +251,7 @@ void Module2800::updateScene() {
|
||||
createScene(9, 0);
|
||||
else if (_moduleResult == 5)
|
||||
createScene(25, 0);
|
||||
else
|
||||
else
|
||||
createScene(0, 1);
|
||||
break;
|
||||
case 3:
|
||||
@ -318,7 +318,7 @@ void Module2800::updateScene() {
|
||||
createScene(22, 0);
|
||||
else if (_moduleResult == 22)
|
||||
createScene(23, 0);
|
||||
else
|
||||
else
|
||||
createScene(2, 4);
|
||||
break;
|
||||
case 10:
|
||||
@ -331,7 +331,7 @@ void Module2800::updateScene() {
|
||||
createScene(26, 0);
|
||||
else if (_moduleResult == 3)
|
||||
createScene(9, 5);
|
||||
else
|
||||
else
|
||||
createScene(9, 1);
|
||||
break;
|
||||
case 12:
|
||||
@ -401,7 +401,7 @@ void Module2800::updateMusic(bool halfVolume) {
|
||||
|
||||
if (!_musicResource)
|
||||
_musicResource = new MusicResource(_vm);
|
||||
|
||||
|
||||
if (newMusicFileHash != _currentMusicFileHash) {
|
||||
_currentMusicFileHash = newMusicFileHash;
|
||||
if (_currentMusicFileHash != 0) {
|
||||
@ -469,7 +469,7 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_klaymen->setClipRect(_sprite1->getDrawRect().x, 0, _sprite2->getDrawRect().x2(), 480);
|
||||
insertScreenMouse(0x0066201C);
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 8, 1100, 302, 437, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
addCollisionSprite(_asTape);
|
||||
} else if (getGlobalVar(V_RADIO_ROOM_RIGHT_DOOR)) {
|
||||
setRectList(0x004B6CD0);
|
||||
setBackground(0x11E00684);
|
||||
@ -480,7 +480,7 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_klaymen->setClipRect(0, 0, _sprite2->getDrawRect().x2(), 480);
|
||||
insertScreenMouse(0x00680116);
|
||||
_asTape = insertSprite<SsScene1705Tape>(this, 8, 1100, 302, 437, 0x01142428);
|
||||
addCollisionSprite(_asTape);
|
||||
addCollisionSprite(_asTape);
|
||||
} else {
|
||||
setRectList(0x004B6CF0);
|
||||
setBackground(0x030006E6);
|
||||
@ -491,9 +491,9 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_klaymen->setClipRect(0, 0, _sprite2->getDrawRect().x2(), 480);
|
||||
insertScreenMouse(0x006E2038);
|
||||
_asTape = insertSprite<AsScene1201Tape>(this, 8, 1100, 302, 437, 0x9148A011);
|
||||
addCollisionSprite(_asTape);
|
||||
addCollisionSprite(_asTape);
|
||||
}
|
||||
|
||||
|
||||
addEntity(_palette);
|
||||
|
||||
if (which == 1) {
|
||||
@ -503,7 +503,7 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_palette->addPalette(_paletteHash, 0, 65, 0);
|
||||
_palette->addBasePalette(_paletteHash, 0, 65, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Scene2801::~Scene2801() {
|
||||
@ -565,7 +565,7 @@ Scene2802::~Scene2802() {
|
||||
}
|
||||
setGlobalVar(V_CURR_RADIO_MUSIC_INDEX, _currRadioMusicIndex);
|
||||
}
|
||||
|
||||
|
||||
void Scene2802::update() {
|
||||
int prevTuneStatus = _currTuneStatus;
|
||||
uint prevRadioMusicIndex = _currRadioMusicIndex;
|
||||
@ -577,7 +577,7 @@ void Scene2802::update() {
|
||||
_currTuneStatus = 3;
|
||||
else if (_currTuneStatus == 4)
|
||||
_currTuneStatus = 6;
|
||||
|
||||
|
||||
switch (_currTuneStatus) {
|
||||
case 2:
|
||||
if (_currRadioMusicIndex < 90)
|
||||
@ -607,20 +607,20 @@ void Scene2802::update() {
|
||||
} else
|
||||
_currTuneStatus = 0;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (prevRadioMusicIndex != _currRadioMusicIndex)
|
||||
_smackerPlayer->gotoFrame(_currRadioMusicIndex);
|
||||
|
||||
|
||||
if (prevTuneStatus != _currTuneStatus)
|
||||
changeTuneStatus(prevTuneStatus, _currTuneStatus);
|
||||
|
||||
|
||||
if (getGlobalVar(V_RADIO_MOVE_DISH_VIDEO) && prevTuneStatus != _currTuneStatus && _currRadioMusicIndex != 0) {
|
||||
setGlobalVar(V_RADIO_MOVE_DISH_VIDEO, 0);
|
||||
leaveScene(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 Scene2802::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -758,7 +758,7 @@ void AsScene2803LightCord::setFileHashes(uint32 fileHash1, uint32 fileHash2) {
|
||||
|
||||
AsScene2803TestTubeOne::AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileHash1, uint32 fileHash2)
|
||||
: AnimatedSprite(vm, 1200), _fileHash1(fileHash1), _fileHash2(fileHash2) {
|
||||
|
||||
|
||||
createSurface1(fileHash1, 100);
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene2803TestTubeOne::handleMessage);
|
||||
@ -781,7 +781,7 @@ uint32 AsScene2803TestTubeOne::handleMessage(int messageNum, const MessageParam
|
||||
|
||||
AsScene2803Rope::AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene) {
|
||||
|
||||
|
||||
createSurface(990, 68, 476);
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
|
||||
@ -837,7 +837,7 @@ void AsScene2803Rope::stHide() {
|
||||
|
||||
Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _paletteArea(0) {
|
||||
|
||||
|
||||
static const uint32 kScene2803FileHashes1[] = {
|
||||
0,
|
||||
0x081000F1,
|
||||
@ -854,20 +854,20 @@ Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
setGlobalVar(V_BEEN_SHRINKING_ROOM, 1);
|
||||
_vm->gameModule()->initTestTubes1Puzzle();
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2803::handleMessage);
|
||||
|
||||
|
||||
loadDataResource(0x00900849);
|
||||
|
||||
|
||||
_background = new Background(_vm, 0);
|
||||
_background->createSurface(0, 640, 480);
|
||||
addBackground(_background);
|
||||
|
||||
|
||||
setPalette(0x412A423E);
|
||||
addEntity(_palette);
|
||||
|
||||
|
||||
insertScreenMouse(0xA423A41A);
|
||||
|
||||
|
||||
if (getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 0) == 0) {
|
||||
_asTestTubeOne = (StaticSprite*)insertStaticSprite(0x66121222, 100);
|
||||
} else {
|
||||
@ -875,13 +875,13 @@ Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
kScene2803FileHashes1[getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 0)],
|
||||
kScene2803FileHashes2[getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 0)]);
|
||||
}
|
||||
|
||||
|
||||
if (getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 1) == 3)
|
||||
_asTestTubeTwo = (StaticSprite*)insertStaticSprite(0x64330236, 100);
|
||||
|
||||
if (getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 2) == 3)
|
||||
_asTestTubeThree = (StaticSprite*)insertStaticSprite(0x2E4A22A2, 100);
|
||||
|
||||
|
||||
_asLightCord = insertSprite<AsScene2803LightCord>(this, 0x8FAD5932, 0x276E1A3D, 578, 200);
|
||||
_sprite3 = (StaticSprite*)insertStaticSprite(0xA40EF2FB, 1100);
|
||||
_sprite4 = (StaticSprite*)insertStaticSprite(0x0C03AA23, 1100);
|
||||
@ -896,7 +896,7 @@ Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_clipRectsFloor[0].y1 = 0;
|
||||
_clipRectsFloor[0].x2 = 640;
|
||||
_clipRectsFloor[0].y2 = _sprite8->getDrawRect().y2();
|
||||
|
||||
|
||||
_clipRectsFloor[1].x1 = _sprite8->getDrawRect().x2();
|
||||
_clipRectsFloor[1].y1 = _sprite8->getDrawRect().y2();
|
||||
_clipRectsFloor[1].x2 = 640;
|
||||
@ -906,12 +906,12 @@ Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_clipRectsStairs[0].y1 = 0;
|
||||
_clipRectsStairs[0].x2 = _sprite5->getDrawRect().x2();
|
||||
_clipRectsStairs[0].y2 = _sprite5->getDrawRect().y2();
|
||||
|
||||
|
||||
_clipRectsStairs[1].x1 = _sprite6->getDrawRect().x;
|
||||
_clipRectsStairs[1].y1 = 0;
|
||||
_clipRectsStairs[1].x2 = _sprite3->getDrawRect().x;
|
||||
_clipRectsStairs[1].y2 = _sprite6->getDrawRect().y2();
|
||||
|
||||
|
||||
_clipRectsStairs[2].x1 = _sprite3->getDrawRect().x;
|
||||
_clipRectsStairs[2].y1 = 0;
|
||||
_clipRectsStairs[2].x2 = _sprite4->getDrawRect().x2();
|
||||
@ -1112,7 +1112,7 @@ Scene2803Small::Scene2803Small(NeverhoodEngine *vm, Module *parentModule, int wh
|
||||
static const uint32 kScene2803SmallFileHashes2[] = {
|
||||
0, 0x286800D4, 0x286806D4, 0x28680AD4
|
||||
};
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2803Small::handleMessage);
|
||||
|
||||
loadDataResource(0x81120132);
|
||||
@ -1160,7 +1160,7 @@ Scene2803Small::Scene2803Small(NeverhoodEngine *vm, Module *parentModule, int wh
|
||||
if (getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 2) == 3)
|
||||
insertStaticSprite(0x30022689, 100);
|
||||
}
|
||||
|
||||
|
||||
_sprite6->setVisible(false);
|
||||
_sprite7->setVisible(false);
|
||||
|
||||
@ -1352,7 +1352,7 @@ void Scene2803Small::updatePaletteArea(bool instantly) {
|
||||
|
||||
SsScene2804RedButton::SsScene2804RedButton(NeverhoodEngine *vm, Scene2804 *parentScene)
|
||||
: StaticSprite(vm, 900), _countdown(0), _parentScene(parentScene) {
|
||||
|
||||
|
||||
loadSprite(getGlobalVar(V_SHRINK_LIGHTS_ON) ? 0x51A10202 : 0x11814A21, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&SsScene2804RedButton::update);
|
||||
@ -1385,7 +1385,7 @@ uint32 SsScene2804RedButton::handleMessage(int messageNum, const MessageParam &p
|
||||
|
||||
SsScene2804LightCoil::SsScene2804LightCoil(NeverhoodEngine *vm)
|
||||
: StaticSprite(vm, 900) {
|
||||
|
||||
|
||||
loadSprite(0x8889B008, kSLFDefDrawOffset | kSLFDefPosition, 400);
|
||||
setVisible(false);
|
||||
SetMessageHandler(&SsScene2804LightCoil::handleMessage);
|
||||
@ -1410,7 +1410,7 @@ uint32 SsScene2804LightCoil::handleMessage(int messageNum, const MessageParam &p
|
||||
|
||||
SsScene2804LightTarget::SsScene2804LightTarget(NeverhoodEngine *vm)
|
||||
: StaticSprite(vm, 900) {
|
||||
|
||||
|
||||
loadSprite(0x06092132, kSLFDefDrawOffset | kSLFDefPosition, 400);
|
||||
setVisible(false);
|
||||
SetMessageHandler(&SsScene2804LightTarget::handleMessage);
|
||||
@ -1435,7 +1435,7 @@ uint32 SsScene2804LightTarget::handleMessage(int messageNum, const MessageParam
|
||||
|
||||
SsScene2804Flash::SsScene2804Flash(NeverhoodEngine *vm)
|
||||
: StaticSprite(vm, 900) {
|
||||
|
||||
|
||||
loadSprite(0x211003A0, kSLFDefDrawOffset | kSLFDefPosition, 400);
|
||||
setVisible(false);
|
||||
loadSound(0, 0xCB36BA54);
|
||||
@ -1449,7 +1449,7 @@ void SsScene2804Flash::show() {
|
||||
|
||||
SsScene2804BeamCoilBody::SsScene2804BeamCoilBody(NeverhoodEngine *vm)
|
||||
: StaticSprite(vm, 900) {
|
||||
|
||||
|
||||
loadSprite(0x9A816000, kSLFDefDrawOffset | kSLFDefPosition, 400);
|
||||
setVisible(false);
|
||||
}
|
||||
@ -1585,7 +1585,7 @@ SsScene2804CrystalButton::SsScene2804CrystalButton(NeverhoodEngine *vm, Scene280
|
||||
0xA8042525,
|
||||
0x5008292B
|
||||
};
|
||||
|
||||
|
||||
loadSprite(getGlobalVar(V_SHRINK_LIGHTS_ON) ? kSsScene2804CrystalButtonFileHashes1[crystalIndex] : kSsScene2804CrystalButtonFileHashes2[crystalIndex],
|
||||
kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
@ -1619,7 +1619,7 @@ uint32 SsScene2804CrystalButton::handleMessage(int messageNum, const MessagePara
|
||||
|
||||
AsScene2804BeamCoil::AsScene2804BeamCoil(NeverhoodEngine *vm, Scene *parentScene, SsScene2804BeamCoilBody *ssBeamCoilBody)
|
||||
: AnimatedSprite(vm, 1400), _parentScene(parentScene), _ssBeamCoilBody(ssBeamCoilBody), _countdown(0) {
|
||||
|
||||
|
||||
createSurface1(0x00494891, 1000);
|
||||
_x = 125;
|
||||
_y = 184;
|
||||
@ -1659,7 +1659,7 @@ uint32 AsScene2804BeamCoil::handleMessage(int messageNum, const MessageParam &pa
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
void AsScene2804BeamCoil::show() {
|
||||
_ssBeamCoilBody->setVisible(true);
|
||||
setVisible(true);
|
||||
@ -1695,7 +1695,7 @@ uint32 AsScene2804BeamCoil::hmBeaming(int messageNum, const MessageParam ¶m,
|
||||
|
||||
AsScene2804BeamTarget::AsScene2804BeamTarget(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1400) {
|
||||
|
||||
|
||||
createSurface1(0x03842000, 1000);
|
||||
_x = 475;
|
||||
_y = 278;
|
||||
@ -1750,7 +1750,7 @@ Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_asTarget = insertSprite<AsScene2804BeamTarget>();
|
||||
_ssFlash = insertSprite<SsScene2804Flash>();
|
||||
}
|
||||
|
||||
|
||||
_ssRedButton = insertSprite<SsScene2804RedButton>(this);
|
||||
addCollisionSprite(_ssRedButton);
|
||||
|
||||
@ -1797,7 +1797,7 @@ uint32 Scene2804::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
void Scene2804::update() {
|
||||
|
||||
Scene::update();
|
||||
|
||||
|
||||
if (_countdown1 != 0 && (--_countdown1) == 0) {
|
||||
leaveScene(0);
|
||||
}
|
||||
@ -1836,7 +1836,7 @@ void Scene2804::update() {
|
||||
|
||||
Scene2805::Scene2805(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2805::handleMessage);
|
||||
|
||||
setBackground(0x08021E04);
|
||||
@ -1894,7 +1894,7 @@ uint32 Scene2805::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
AsScene2806Spew::AsScene2806Spew(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1200) {
|
||||
|
||||
|
||||
createSurface1(0x04211490, 1200);
|
||||
_x = 378;
|
||||
_y = 423;
|
||||
@ -1919,7 +1919,7 @@ uint32 AsScene2806Spew::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
}
|
||||
return messageResult;
|
||||
}
|
||||
|
||||
|
||||
Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
@ -1927,16 +1927,16 @@ Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
SetMessageHandler(&Scene2806::handleMessage);
|
||||
SetUpdateHandler(&Scene2806::update);
|
||||
|
||||
|
||||
loadDataResource(0x98182003);
|
||||
loadHitRectList();
|
||||
|
||||
|
||||
_pointList = _dataResource.getPointArray(0x3606A422);
|
||||
|
||||
insertScreenMouse(0x22114C13);
|
||||
insertScreenMouse(0x22114C13);
|
||||
setBackground(0xC1B22110);
|
||||
setPalette(0xC1B22110);
|
||||
|
||||
|
||||
_sprite1 = insertStaticSprite(0xA21F82CB, 1100);
|
||||
_clipRects[0].x1 = _sprite1->getDrawRect().x;
|
||||
_clipRects[0].y1 = _sprite1->getDrawRect().y;
|
||||
@ -1951,7 +1951,7 @@ Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_sprite4 = insertStaticSprite(0x72090342, 1100);
|
||||
_clipRects[1].x1 = _sprite4->getDrawRect().x;
|
||||
_clipRects[1].y1 = _sprite4->getDrawRect().y;
|
||||
|
||||
|
||||
tempSprite = insertStaticSprite(0xD2012C02, 1100);
|
||||
_clipRects[2].x1 = tempSprite->getDrawRect().x;
|
||||
_clipRects[2].y2 = tempSprite->getDrawRect().y2();
|
||||
@ -2027,7 +2027,7 @@ void Scene2806::findClosestPoint() {
|
||||
|
||||
int16 x = MIN<int16>(_klaymen->getX(), 639);
|
||||
int index = 1;
|
||||
|
||||
|
||||
while (index < (int)_pointList->size() && (*_pointList)[index].x < x)
|
||||
++index;
|
||||
--index;
|
||||
@ -2036,12 +2036,12 @@ void Scene2806::findClosestPoint() {
|
||||
_pointIndex = index;
|
||||
_palette->addPalette(kScene2806PaletteFileHashes[index], 0, 64, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Scene2807::Scene2807(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2807::handleMessage);
|
||||
|
||||
if (getSubVar(VA_GOOD_TEST_TUBES_LEVEL_1, 0) == 1) {
|
||||
@ -2136,7 +2136,7 @@ static const int16 kClass490FrameIndices2[] = {
|
||||
SsScene2808Dispenser::SsScene2808Dispenser(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum, int testTubeIndex)
|
||||
: StaticSprite(vm, 900), _parentScene(parentScene), _countdown(0), _testTubeSetNum(testTubeSetNum),
|
||||
_testTubeIndex(testTubeIndex) {
|
||||
|
||||
|
||||
loadSprite(kClass428FileHashes[testTubeSetNum * 3 + testTubeIndex], kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 1500);
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&SsScene2808Dispenser::update);
|
||||
@ -2149,7 +2149,7 @@ void SsScene2808Dispenser::update() {
|
||||
setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32 SsScene2808Dispenser::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -2197,16 +2197,16 @@ AsScene2808TestTube::AsScene2808TestTube(NeverhoodEngine *vm, int testTubeSetNum
|
||||
loadSound(7, 0x70A43D2D);
|
||||
loadSound(8, 0xF0601E2D);
|
||||
}
|
||||
|
||||
|
||||
startAnimation(kClass490FileHashes[testTubeIndex], 0, -1);
|
||||
_newStickFrameIndex = 0;
|
||||
|
||||
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene2808TestTube::handleMessage);
|
||||
|
||||
|
||||
if (_fillLevel == 0)
|
||||
setVisible(false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint32 AsScene2808TestTube::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -2253,7 +2253,7 @@ void AsScene2808TestTube::flush() {
|
||||
|
||||
AsScene2808Handle::AsScene2808Handle(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum)
|
||||
: AnimatedSprite(vm, 1300), _parentScene(parentScene), _testTubeSetNum(testTubeSetNum), _isActivated(false) {
|
||||
|
||||
|
||||
loadSound(0, 0xE18D1F30);
|
||||
_x = 320;
|
||||
_y = 240;
|
||||
@ -2325,7 +2325,7 @@ AsScene2808Flow::AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int te
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
AnimatedSprite::updatePosition();
|
||||
}
|
||||
|
||||
|
||||
uint32 AsScene2808Flow::hmFlowing(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -2351,7 +2351,7 @@ void AsScene2808Flow::stKeepFlowing() {
|
||||
|
||||
AsScene2808LightEffect::AsScene2808LightEffect(NeverhoodEngine *vm, int testTubeSetNum)
|
||||
: AnimatedSprite(vm, 800), _countdown(1) {
|
||||
|
||||
|
||||
_x = 320;
|
||||
_y = 240;
|
||||
if (testTubeSetNum == 1)
|
||||
@ -2381,7 +2381,7 @@ Scene2808::Scene2808(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_vm->gameModule()->initTestTubes1Puzzle();
|
||||
else
|
||||
_vm->gameModule()->initTestTubes2Puzzle();
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2808::handleMessage);
|
||||
SetUpdateHandler(&Scene2808::update);
|
||||
|
||||
@ -2400,7 +2400,7 @@ Scene2808::Scene2808(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_asTestTubes[testTubeIndex] = insertSprite<AsScene2808TestTube>(which, testTubeIndex, ssDispenser);
|
||||
addCollisionSprite(_asTestTubes[testTubeIndex]);
|
||||
}
|
||||
|
||||
|
||||
insertScreenMouse(kScene2808FileHashes2[which]);
|
||||
|
||||
}
|
||||
@ -2498,13 +2498,13 @@ Scene2809::Scene2809(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule) {
|
||||
|
||||
Sprite *tempSprite;
|
||||
|
||||
|
||||
SetMessageHandler(&Scene2809::handleMessage);
|
||||
SetUpdateHandler(&Scene2809::update);
|
||||
|
||||
|
||||
loadDataResource(0x1830009A);
|
||||
loadHitRectList();
|
||||
|
||||
|
||||
_pointList = _dataResource.getPointArray(0x064A310E);
|
||||
|
||||
setBackground(0xB22116C5);
|
||||
@ -2535,7 +2535,7 @@ Scene2809::Scene2809(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
tempSprite = insertStaticSprite(0x877F6252, 1100);
|
||||
_clipRects[3].x2 = tempSprite->getDrawRect().x2();
|
||||
|
||||
|
||||
insertStaticSprite(0x01612A22, 1100);
|
||||
insertStaticSprite(0x877F6252, 1100);
|
||||
|
||||
@ -2610,7 +2610,7 @@ void Scene2809::findClosestPoint() {
|
||||
_pointIndex = index;
|
||||
_palette->addPalette(kScene2809PaletteFileHashes[index], 0, 64, 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
AsScene2810Rope::AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16 x)
|
||||
@ -2647,7 +2647,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
Sprite *tempSprite;
|
||||
|
||||
SetMessageHandler(&Scene2810::handleMessage);
|
||||
|
||||
|
||||
setBackground(0x26508804);
|
||||
setPalette(0x26508804);
|
||||
insertScreenMouse(0x0880026D);
|
||||
@ -2683,7 +2683,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
}
|
||||
_sprite4->setClipRect(0, _sprite1->getDrawRect().y, 640, 480);
|
||||
}
|
||||
|
||||
|
||||
if (which < 0) {
|
||||
if (getGlobalVar(V_KLAYMEN_SMALL)) {
|
||||
insertKlaymen<KmScene2810Small>(240, 448);
|
||||
@ -2864,7 +2864,7 @@ uint32 Scene2810::handleMessage(int messageNum, const MessageParam ¶m, Entit
|
||||
|
||||
AsScene2812Winch::AsScene2812Winch(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 1100) {
|
||||
|
||||
|
||||
createSurface1(0x20DA08A0, 1200);
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene2812Winch::handleMessage);
|
||||
@ -2895,7 +2895,7 @@ uint32 AsScene2812Winch::handleMessage(int messageNum, const MessageParam ¶m
|
||||
|
||||
AsScene2812Rope::AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene)
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene) {
|
||||
|
||||
|
||||
createSurface(990, 68, 476);
|
||||
SetUpdateHandler(&AnimatedSprite::update);
|
||||
SetMessageHandler(&AsScene2812Rope::handleMessage);
|
||||
@ -2940,7 +2940,7 @@ void AsScene2812Rope::stRopingDown() {
|
||||
|
||||
AsScene2812TrapDoor::AsScene2812TrapDoor(NeverhoodEngine *vm)
|
||||
: AnimatedSprite(vm, 0x805D0029, 100, 320, 240) {
|
||||
|
||||
|
||||
SetMessageHandler(&AsScene2812TrapDoor::handleMessage);
|
||||
_newStickFrameIndex = 0;
|
||||
}
|
||||
@ -2959,15 +2959,15 @@ uint32 AsScene2812TrapDoor::handleMessage(int messageNum, const MessageParam &pa
|
||||
|
||||
Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _paletteArea(0) {
|
||||
|
||||
|
||||
if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0)
|
||||
setGlobalVar(V_KEY3_LOCATION, 3);
|
||||
|
||||
SetMessageHandler(&Scene2812::handleMessage);
|
||||
SetUpdateHandler(&Scene2812::update);
|
||||
|
||||
|
||||
setRectList(0x004AF700);
|
||||
|
||||
|
||||
setBackground(0x03600606);
|
||||
setPalette(0x03600606);
|
||||
addEntity(_palette);
|
||||
@ -2983,7 +2983,7 @@ Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
_ssTape = insertSprite<SsScene1705Tape>(this, 6, 1100, 513, 437, 0xA1361863);
|
||||
addCollisionSprite(_ssTape);
|
||||
|
||||
|
||||
_asWinch = insertSprite<AsScene2812Winch>();
|
||||
_asTrapDoor = insertSprite<AsScene2812TrapDoor>();
|
||||
_asRope = insertSprite<AsScene2812Rope>(this);
|
||||
@ -3023,9 +3023,9 @@ Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_sprite1->setVisible(false);
|
||||
_klaymen->setClipRect(_sprite4->getDrawRect().x, 0, 640, _sprite3->getDrawRect().y2());
|
||||
}
|
||||
|
||||
|
||||
_asRope->setClipRect(0, _sprite2->getDrawRect().y, 640, _sprite3->getDrawRect().y2());
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene2812::update() {
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
protected:
|
||||
Scene *_parentScene;
|
||||
uint32 _fileHash1, _fileHash2;
|
||||
bool _isPulled, _isBusy;
|
||||
bool _isPulled, _isBusy;
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
uint32 hmPulled(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
@ -323,7 +323,7 @@ protected:
|
||||
Scene *_parentScene;
|
||||
int _countdown;
|
||||
int _testTubeSetNum, _testTubeIndex;
|
||||
void update();
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
|
||||
@ -408,7 +408,7 @@ protected:
|
||||
Sprite *_sprite3;
|
||||
Sprite *_sprite4;
|
||||
Sprite *_asSpew;
|
||||
void update();
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
void findClosestPoint();
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ Module2900::Module2900(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
if (which >= 0)
|
||||
setGlobalVar(V_TELEPORTER_WHICH, which);
|
||||
|
||||
|
||||
createScene(0, 0);
|
||||
|
||||
}
|
||||
@ -255,7 +255,7 @@ SsScene2901LocationButton::SsScene2901LocationButton(NeverhoodEngine *vm, Scene
|
||||
: StaticSprite(vm, 900), _parentScene(parentScene), _index(index), _countdown1(0) {
|
||||
|
||||
const NPoint &pt = kSsScene2901LocationButtonPoints[_index];
|
||||
|
||||
|
||||
loadSprite(kSsScene2901LocationButtonFileHashes[which * 6 + index], kSLFDefDrawOffset | kSLFDefPosition, 800);
|
||||
_collisionBounds.set(pt.x - 25, pt.y - 25, pt.x + 25, pt.y + 25);
|
||||
setVisible(false);
|
||||
@ -263,7 +263,7 @@ SsScene2901LocationButton::SsScene2901LocationButton(NeverhoodEngine *vm, Scene
|
||||
SetUpdateHandler(&SsScene2901LocationButton::update);
|
||||
SetMessageHandler(&SsScene2901LocationButton::handleMessage);
|
||||
}
|
||||
|
||||
|
||||
void SsScene2901LocationButton::update() {
|
||||
updatePosition();
|
||||
if (_countdown1 != 0 && (--_countdown1) == 0) {
|
||||
@ -289,7 +289,7 @@ uint32 SsScene2901LocationButton::handleMessage(int messageNum, const MessagePar
|
||||
|
||||
SsScene2901LocationButtonLight::SsScene2901LocationButtonLight(NeverhoodEngine *vm, int which, uint index)
|
||||
: StaticSprite(vm, 900), _index(index) {
|
||||
|
||||
|
||||
loadSprite(kSsScene2901LocationButtonLightFileHashes1[which * 6 + index], kSLFDefDrawOffset | kSLFDefPosition, 900);
|
||||
setVisible(false);
|
||||
loadSound(0, kSsScene2901LocationButtonLightFileHashes2[_index]);
|
||||
@ -315,7 +315,7 @@ SsScene2901BrokenButton::SsScene2901BrokenButton(NeverhoodEngine *vm, int which)
|
||||
SsScene2901BigButton::SsScene2901BigButton(NeverhoodEngine *vm, Scene *parentScene, int which)
|
||||
: StaticSprite(vm, 900), _parentScene(parentScene), _which(which), _countdown1(0) {
|
||||
|
||||
loadSprite(kSsScene2901BigButtonFileHashes[which], kSLFDefDrawOffset | kSLFDefPosition, 400);
|
||||
loadSprite(kSsScene2901BigButtonFileHashes[which], kSLFDefDrawOffset | kSLFDefPosition, 400);
|
||||
_collisionBounds.set(62, 94, 322, 350);
|
||||
setVisible(false);
|
||||
loadSound(0, 0xF3D420C8);
|
||||
@ -330,7 +330,7 @@ void SsScene2901BigButton::update() {
|
||||
sendMessage(_parentScene, 0x2000, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32 SsScene2901BigButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
|
||||
switch (messageNum) {
|
||||
@ -361,7 +361,7 @@ Scene2901::Scene2901(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
setBackground(kScene2901FileHashes1[_currLocationButtonNum]);
|
||||
setPalette(kScene2901FileHashes1[_currLocationButtonNum]);
|
||||
|
||||
|
||||
for (uint i = 0; i < 6; ++i) {
|
||||
if (i != 2 || !_isButton2Broken) {
|
||||
_ssLocationButtons[i] = insertSprite<SsScene2901LocationButton>(this, _currLocationButtonNum, i);
|
||||
@ -369,7 +369,7 @@ Scene2901::Scene2901(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
_ssLocationButtonLights[i] = insertSprite<SsScene2901LocationButtonLight>(_currLocationButtonNum, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_isButton2Broken)
|
||||
insertSprite<SsScene2901BrokenButton>(_currLocationButtonNum);
|
||||
|
||||
@ -377,10 +377,10 @@ Scene2901::Scene2901(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
addCollisionSprite(_ssBigButton);
|
||||
|
||||
insertPuzzleMouse(kScene2901FileHashes2[_currLocationButtonNum], 20, 620);
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene2901::update);
|
||||
SetMessageHandler(&Scene2901::handleMessage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene2901::update() {
|
||||
|
@ -49,7 +49,7 @@ protected:
|
||||
Scene *_parentScene;
|
||||
uint _index;
|
||||
int _countdown1;
|
||||
void update();
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
|
||||
@ -74,7 +74,7 @@ protected:
|
||||
Scene *_parentScene;
|
||||
int _which;
|
||||
int _countdown1;
|
||||
void update();
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@ static const uint32 kModule3000SoundList[] = {
|
||||
|
||||
Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Module(vm, parentModule), _soundVolume(0) {
|
||||
|
||||
|
||||
_vm->_soundMan->addSoundList(0x81293110, kModule3000SoundList);
|
||||
_vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 50, 600, 5, 150);
|
||||
_vm->_soundMan->setSoundParams(0x90F0D1C3, false, 20000, 30000, 20000, 30000);
|
||||
@ -440,7 +440,7 @@ static const uint32 kAsScene3009SymbolFileHashes[] = {
|
||||
};
|
||||
|
||||
static const uint32 kSsScene3009SymbolArrowFileHashes1[] = {
|
||||
0x24016060,
|
||||
0x24016060,
|
||||
0x21216221,
|
||||
0x486160A0,
|
||||
0x42216422,
|
||||
@ -455,7 +455,7 @@ static const uint32 kSsScene3009SymbolArrowFileHashes1[] = {
|
||||
};
|
||||
|
||||
static const uint32 kSsScene3009SymbolArrowFileHashes2[] = {
|
||||
0x40092024,
|
||||
0x40092024,
|
||||
0x01636002,
|
||||
0x8071E028,
|
||||
0x02A56064,
|
||||
@ -471,7 +471,7 @@ static const uint32 kSsScene3009SymbolArrowFileHashes2[] = {
|
||||
|
||||
SsScene3009FireCannonButton::SsScene3009FireCannonButton(NeverhoodEngine *vm, Scene3009 *parentScene)
|
||||
: StaticSprite(vm, 1400), _parentScene(parentScene), _isClicked(false) {
|
||||
|
||||
|
||||
loadSprite(0x120B24B0, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
SetUpdateHandler(&SsScene3009FireCannonButton::update);
|
||||
@ -637,7 +637,7 @@ uint32 AsScene3009VerticalIndicator::handleMessage(int messageNum, const Message
|
||||
|
||||
AsScene3009HorizontalIndicator::AsScene3009HorizontalIndicator(NeverhoodEngine *vm, Scene3009 *parentScene, uint32 cannonTargetStatus)
|
||||
: AnimatedSprite(vm, 1000), _parentScene(parentScene), _enabled(false) {
|
||||
|
||||
|
||||
_x = getGlobalVar(V_CANNON_TURNED) ? 533 : 92;
|
||||
_y = 150;
|
||||
createSurface1(0xC0C12954, 1200);
|
||||
@ -702,7 +702,7 @@ AsScene3009Symbol::AsScene3009Symbol(NeverhoodEngine *vm, Scene3009 *parentScene
|
||||
: AnimatedSprite(vm, 1100), _parentScene(parentScene), _symbolPosition(symbolPosition) {
|
||||
|
||||
_symbolIndex = getSubVar(VA_CURR_CANNON_SYMBOLS, _symbolPosition);
|
||||
|
||||
|
||||
_x = kAsScene3009SymbolPoints[_symbolPosition].x;
|
||||
_y = kAsScene3009SymbolPoints[_symbolPosition].y;
|
||||
createSurface1(kAsScene3009SymbolFileHashes[_symbolPosition / 3], 1200);
|
||||
@ -753,17 +753,17 @@ void AsScene3009Symbol::hide() {
|
||||
}
|
||||
|
||||
Scene3009::Scene3009(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _keepVideo(false), _moveCannonLeftFirst(false),
|
||||
: Scene(vm, parentModule), _keepVideo(false), _moveCannonLeftFirst(false),
|
||||
_isTurning(false), _lockSymbolsPart1Countdown(1), _lockSymbolsPart2Countdown(1) {
|
||||
|
||||
_cannonTargetStatus = getGlobalVar(V_CANNON_TARGET_STATUS);
|
||||
|
||||
|
||||
_vm->gameModule()->initCannonSymbolsPuzzle();
|
||||
|
||||
|
||||
setGlobalVar(V_CANNON_SMACKER_NAME, 0);
|
||||
|
||||
|
||||
_vm->_screen->clear();
|
||||
|
||||
|
||||
setBackground(0xD000420C);
|
||||
setPalette(0xD000420C);
|
||||
insertPuzzleMouse(0x04208D08, 20, 620);
|
||||
@ -821,7 +821,7 @@ void Scene3009::openSmacker(uint32 fileHash, bool keepLastFrame) {
|
||||
|
||||
void Scene3009::update() {
|
||||
Scene::update();
|
||||
|
||||
|
||||
if (!_keepVideo && _cannonSmackerPlayer->isDone() && _cannonTargetStatus <= kCTSCount) {
|
||||
switch (_cannonTargetStatus) {
|
||||
case kCTSNull:
|
||||
@ -850,9 +850,9 @@ void Scene3009::update() {
|
||||
if (_moveCannonLeftFirst) {
|
||||
if (_cannonTargetStatus == kCTSLeftRobotNoTarget)
|
||||
openSmacker(0x110A000F, false);
|
||||
else if (_cannonTargetStatus == kCTSLeftRobotIsTarget)
|
||||
else if (_cannonTargetStatus == kCTSLeftRobotIsTarget)
|
||||
openSmacker(0x500B004F, false);
|
||||
else if (_cannonTargetStatus == kCTSLeftNoRobot)
|
||||
else if (_cannonTargetStatus == kCTSLeftNoRobot)
|
||||
openSmacker(0x100B010E, false);
|
||||
_moveCannonLeftFirst = false;
|
||||
_asHorizontalIndicator->stMoveLeft();
|
||||
@ -1119,7 +1119,7 @@ AsScene3010DeadBolt::AsScene3010DeadBolt(NeverhoodEngine *vm, Scene *parentScene
|
||||
loadSound(0, 0x420073DC);
|
||||
loadSound(1, 0x420073DC);
|
||||
}
|
||||
|
||||
|
||||
setVisible(false);
|
||||
stIdle();
|
||||
if (initUnlocked)
|
||||
@ -1127,7 +1127,7 @@ AsScene3010DeadBolt::AsScene3010DeadBolt(NeverhoodEngine *vm, Scene *parentScene
|
||||
|
||||
_needRefresh = true;
|
||||
AnimatedSprite::updatePosition();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AsScene3010DeadBolt::update() {
|
||||
@ -1217,7 +1217,7 @@ void AsScene3010DeadBolt::stDisabledMessage() {
|
||||
|
||||
Scene3010::Scene3010(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
: Scene(vm, parentModule), _countdown(0), _doorUnlocked(false), _checkUnlocked(false) {
|
||||
|
||||
|
||||
int initCountdown = 0;
|
||||
|
||||
setBackground(0x80802626);
|
||||
@ -1348,7 +1348,7 @@ static const uint32 kAsScene3011SymbolFileHashes[] = {
|
||||
|
||||
SsScene3011Button::SsScene3011Button(NeverhoodEngine *vm, Scene *parentScene, bool flag)
|
||||
: StaticSprite(vm, 1400), _parentScene(parentScene), _countdown(0) {
|
||||
|
||||
|
||||
loadSprite(flag ? 0x11282020 : 0x994D0433, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400);
|
||||
setVisible(false);
|
||||
loadSound(0, 0x44061000);
|
||||
@ -1446,7 +1446,7 @@ Scene3011::Scene3011(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
SetMessageHandler(&Scene3011::handleMessage);
|
||||
SetUpdateHandler(&Scene3011::update);
|
||||
|
||||
|
||||
setBackground(0x92124A04);
|
||||
setPalette(0xA4070114);
|
||||
addEntity(_palette);
|
||||
@ -1458,12 +1458,12 @@ Scene3011::Scene3011(NeverhoodEngine *vm, Module *parentModule, int which)
|
||||
|
||||
_ssButton = insertSprite<SsScene3011Button>(this, true);
|
||||
addCollisionSprite(_ssButton);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene3011::update() {
|
||||
Scene::update();
|
||||
|
||||
|
||||
if (_countdown != 0 && (--_countdown == 0)) {
|
||||
switch (_updateStatus) {
|
||||
case 0:
|
||||
|
@ -244,7 +244,7 @@ protected:
|
||||
bool _buttonClicked;
|
||||
int _countdown;
|
||||
int _noisySymbolIndex;
|
||||
int _currentSymbolIndex;
|
||||
int _currentSymbolIndex;
|
||||
int _noisyRandomSymbolIndex;
|
||||
void update();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
@ -26,9 +26,9 @@
|
||||
namespace Neverhood {
|
||||
|
||||
Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, const NRect &mouseRect)
|
||||
: StaticSprite(vm, 2000), _mouseType(kMouseType433),
|
||||
: StaticSprite(vm, 2000), _mouseType(kMouseType433),
|
||||
_mouseCursorResource(vm), _frameNum(0) {
|
||||
|
||||
|
||||
_mouseRect = mouseRect;
|
||||
init(fileHash);
|
||||
if (_x >= _mouseRect.x1 && _x <= _mouseRect.x2 &&
|
||||
@ -43,7 +43,7 @@ Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, const NRect &mouseRect)
|
||||
Mouse::Mouse(NeverhoodEngine *vm, uint32 fileHash, int16 x1, int16 x2)
|
||||
: StaticSprite(vm, 2000), _mouseType(kMouseType435),
|
||||
_mouseCursorResource(vm), _frameNum(0), _x1(x1), _x2(x2) {
|
||||
|
||||
|
||||
init(fileHash);
|
||||
if (_x <= _x1) {
|
||||
_mouseCursorResource.setCursorNum(6);
|
||||
@ -69,8 +69,8 @@ Mouse::~Mouse() {
|
||||
|
||||
void Mouse::init(uint32 fileHash) {
|
||||
_mouseCursorResource.load(fileHash);
|
||||
_x = _vm->getMouseX();
|
||||
_y = _vm->getMouseY();
|
||||
_x = _vm->getMouseX();
|
||||
_y = _vm->getMouseY();
|
||||
createSurface(2000, 32, 32);
|
||||
SetUpdateHandler(&Mouse::update);
|
||||
SetMessageHandler(&Mouse::handleMessage);
|
||||
@ -99,7 +99,7 @@ void Mouse::update() {
|
||||
_frameNum++;
|
||||
if (_frameNum >= 6)
|
||||
_frameNum = 0;
|
||||
_needRefresh = _frameNum % 2 == 0;
|
||||
_needRefresh = _frameNum % 2 == 0;
|
||||
}
|
||||
|
||||
uint32 Mouse::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -113,40 +113,40 @@ uint32 Mouse::handleMessage(int messageNum, const MessageParam ¶m, Entity *s
|
||||
case 1:
|
||||
if (_x >= 320)
|
||||
messageResult = 1;
|
||||
else
|
||||
else
|
||||
messageResult = 0;
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
if (_x < 100)
|
||||
messageResult = 0;
|
||||
else if (_x > 540)
|
||||
else if (_x > 540)
|
||||
messageResult = 1;
|
||||
else
|
||||
else
|
||||
messageResult = 2;
|
||||
break;
|
||||
case 3:
|
||||
if (_x < 100)
|
||||
messageResult = 0;
|
||||
else if (_x > 540)
|
||||
else if (_x > 540)
|
||||
messageResult = 1;
|
||||
else
|
||||
else
|
||||
messageResult = 4;
|
||||
break;
|
||||
case 4:
|
||||
if (_x < 100)
|
||||
messageResult = 0;
|
||||
else if (_x > 540)
|
||||
else if (_x > 540)
|
||||
messageResult = 1;
|
||||
else if (_y >= 150)
|
||||
else if (_y >= 150)
|
||||
messageResult = 2;
|
||||
else
|
||||
else
|
||||
messageResult = 3;
|
||||
break;
|
||||
case 5:
|
||||
if (_y >= 240)
|
||||
messageResult = 4;
|
||||
else
|
||||
else
|
||||
messageResult = 3;
|
||||
break;
|
||||
}
|
||||
@ -162,7 +162,7 @@ uint32 Mouse::handleMessage(int messageNum, const MessageParam ¶m, Entity *s
|
||||
}
|
||||
|
||||
void Mouse::updateCursor() {
|
||||
|
||||
|
||||
if (!_surface)
|
||||
return;
|
||||
|
||||
@ -213,44 +213,44 @@ void Mouse::updateCursorNum() {
|
||||
case 1:
|
||||
if (_x >= 320)
|
||||
_mouseCursorResource.setCursorNum(5);
|
||||
else
|
||||
else
|
||||
_mouseCursorResource.setCursorNum(6);
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
if (_x < 100)
|
||||
_mouseCursorResource.setCursorNum(6);
|
||||
else if (_x > 540)
|
||||
else if (_x > 540)
|
||||
_mouseCursorResource.setCursorNum(5);
|
||||
else
|
||||
else
|
||||
_mouseCursorResource.setCursorNum(0);
|
||||
break;
|
||||
case 3:
|
||||
if (_x < 100)
|
||||
_mouseCursorResource.setCursorNum(1);
|
||||
else if (_x > 540)
|
||||
else if (_x > 540)
|
||||
_mouseCursorResource.setCursorNum(1);
|
||||
break;
|
||||
case 4:
|
||||
if (_x < 100)
|
||||
_mouseCursorResource.setCursorNum(6);
|
||||
else if (_x > 540)
|
||||
else if (_x > 540)
|
||||
_mouseCursorResource.setCursorNum(5);
|
||||
else if (_y >= 150)
|
||||
else if (_y >= 150)
|
||||
_mouseCursorResource.setCursorNum(0);
|
||||
else
|
||||
else
|
||||
_mouseCursorResource.setCursorNum(3);
|
||||
break;
|
||||
case 5:
|
||||
if (_y >= 240)
|
||||
_mouseCursorResource.setCursorNum(2);
|
||||
else
|
||||
else
|
||||
_mouseCursorResource.setCursorNum(3);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} // End of namespace Neverhood
|
||||
|
@ -52,7 +52,7 @@ protected:
|
||||
int16 _x1;
|
||||
int16 _x2;
|
||||
int _type;
|
||||
void init(uint32 fileHash);
|
||||
void init(uint32 fileHash);
|
||||
void update();
|
||||
void updateCursorNum();
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
|
@ -35,19 +35,19 @@ NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint
|
||||
_isWalkingForward(false), _isTurning(false), _smackerFileHash(0), _interactive(true), _leaveSceneAfter(false) {
|
||||
|
||||
_navigationList = _vm->_staticData->getNavigationList(navigationListId);
|
||||
|
||||
|
||||
if (_navigationIndex < 0) {
|
||||
_navigationIndex = (int)getGlobalVar(V_NAVIGATION_INDEX);
|
||||
if (_navigationIndex >= (int)_navigationList->size())
|
||||
_navigationIndex = 0;
|
||||
_navigationIndex = 0;
|
||||
}
|
||||
setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex);
|
||||
|
||||
|
||||
SetUpdateHandler(&NavigationScene::update);
|
||||
SetMessageHandler(&NavigationScene::handleMessage);
|
||||
|
||||
_smackerPlayer = addSmackerPlayer(new SmackerPlayer(_vm, this, (*_navigationList)[_navigationIndex].fileHash, true, true));
|
||||
|
||||
|
||||
_smackerPlayer = addSmackerPlayer(new SmackerPlayer(_vm, this, (*_navigationList)[_navigationIndex].fileHash, true, true));
|
||||
|
||||
createMouseCursor();
|
||||
|
||||
_vm->_screen->clear();
|
||||
@ -99,7 +99,7 @@ void NavigationScene::update() {
|
||||
_vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder());
|
||||
sendMessage(_parentModule, 0x100A, _navigationIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
Scene::update();
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ void NavigationScene::createMouseCursor() {
|
||||
mouseCursorFileHash = navigationItem.mouseCursorFileHash;
|
||||
if (mouseCursorFileHash == 0)
|
||||
mouseCursorFileHash = 0x63A40028;
|
||||
|
||||
|
||||
if (_itemsTypes)
|
||||
areaType = _itemsTypes[_navigationIndex];
|
||||
else if (navigationItem.middleSmackerFileHash != 0 || navigationItem.middleFlag)
|
||||
@ -152,7 +152,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) {
|
||||
bool oldIsWalkingForward = _isWalkingForward;
|
||||
bool oldIsTurning = _isTurning;
|
||||
uint32 direction = sendPointMessage(_mouseCursor, 0x2064, mousePos);
|
||||
|
||||
|
||||
switch (direction) {
|
||||
case 0:
|
||||
if (navigationItem.leftSmackerFileHash != 0) {
|
||||
@ -203,7 +203,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (oldIsTurning != _isTurning)
|
||||
_vm->_soundMan->setSoundThreePlayFlag(_isTurning);
|
||||
|
||||
|
@ -104,9 +104,9 @@ Common::Error NeverhoodEngine::run() {
|
||||
|
||||
_soundMan = new SoundMan(this);
|
||||
_audioResourceMan = new AudioResourceMan(this);
|
||||
|
||||
|
||||
_gameModule = new GameModule(this);
|
||||
|
||||
|
||||
_isSaveAllowed = true;
|
||||
_updateSound = true;
|
||||
|
||||
@ -122,15 +122,15 @@ Common::Error NeverhoodEngine::run() {
|
||||
(*navigationList)[5].middleSmackerFileHash = 0;
|
||||
(*navigationList)[5].middleFlag = 1;
|
||||
}
|
||||
|
||||
|
||||
if (ConfMan.hasKey("save_slot")) {
|
||||
if (loadGameState(ConfMan.getInt("save_slot")).getCode() != Common::kNoError)
|
||||
_gameModule->startup();
|
||||
} else
|
||||
_gameModule->startup();
|
||||
|
||||
|
||||
mainLoop();
|
||||
|
||||
|
||||
delete _gameModule;
|
||||
delete _soundMan;
|
||||
delete _audioResourceMan;
|
||||
@ -141,7 +141,7 @@ Common::Error NeverhoodEngine::run() {
|
||||
|
||||
delete _gameVars;
|
||||
delete _staticData;
|
||||
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
AudioResourceMan *_audioResourceMan;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
/* Save/load */
|
||||
|
||||
enum kReadSaveHeaderError {
|
||||
@ -118,7 +118,7 @@ public:
|
||||
|
||||
bool canLoadGameStateCurrently() { return _isSaveAllowed; }
|
||||
bool canSaveGameStateCurrently() { return _isSaveAllowed; }
|
||||
|
||||
|
||||
Common::Error loadGameState(int slot);
|
||||
Common::Error saveGameState(int slot, const Common::String &description);
|
||||
Common::Error removeGameState(int slot);
|
||||
|
@ -81,7 +81,7 @@ void Palette::addPalette(uint32 fileHash, int toIndex, int count, int fromIndex)
|
||||
if (toIndex + count > 256)
|
||||
count = 256 - toIndex;
|
||||
paletteResource.load(fileHash);
|
||||
memcpy(_palette + toIndex * 4, paletteResource.palette() + fromIndex * 4, count * 4);
|
||||
memcpy(_palette + toIndex * 4, paletteResource.palette() + fromIndex * 4, count * 4);
|
||||
_vm->_screen->testPalette(_palette);
|
||||
}
|
||||
|
||||
@ -90,20 +90,20 @@ void Palette::addBasePalette(uint32 fileHash, int toIndex, int count, int fromIn
|
||||
if (toIndex + count > 256)
|
||||
count = 256 - toIndex;
|
||||
paletteResource.load(fileHash);
|
||||
memcpy(_basePalette + toIndex * 4, paletteResource.palette() + fromIndex * 4, count * 4);
|
||||
memcpy(_basePalette + toIndex * 4, paletteResource.palette() + fromIndex * 4, count * 4);
|
||||
}
|
||||
|
||||
void Palette::copyPalette(const byte *palette, int toIndex, int count, int fromIndex) {
|
||||
if (toIndex + count > 256)
|
||||
count = 256 - toIndex;
|
||||
memcpy(_palette + toIndex * 4, palette + fromIndex * 4, count * 4);
|
||||
memcpy(_palette + toIndex * 4, palette + fromIndex * 4, count * 4);
|
||||
_vm->_screen->testPalette(_palette);
|
||||
}
|
||||
|
||||
void Palette::copyBasePalette(int toIndex, int count, int fromIndex) {
|
||||
if (toIndex + count > 256)
|
||||
count = 256 - toIndex;
|
||||
memcpy(_basePalette + toIndex * 4, _palette + fromIndex * 4, count * 4);
|
||||
memcpy(_basePalette + toIndex * 4, _palette + fromIndex * 4, count * 4);
|
||||
}
|
||||
|
||||
void Palette::startFadeToBlack(int counter) {
|
||||
@ -115,7 +115,7 @@ void Palette::startFadeToBlack(int counter) {
|
||||
_fadeToB = 0;
|
||||
_palCounter = counter;
|
||||
_fadeStep = 255 / counter;
|
||||
_status = 1;
|
||||
_status = 1;
|
||||
}
|
||||
|
||||
void Palette::startFadeToWhite(int counter) {
|
||||
@ -127,7 +127,7 @@ void Palette::startFadeToWhite(int counter) {
|
||||
_fadeToB = 255;
|
||||
_palCounter = counter;
|
||||
_fadeStep = 255 / counter;
|
||||
_status = 1;
|
||||
_status = 1;
|
||||
}
|
||||
|
||||
void Palette::startFadeToPalette(int counter) {
|
||||
@ -136,7 +136,7 @@ void Palette::startFadeToPalette(int counter) {
|
||||
counter = 1;
|
||||
_palCounter = counter;
|
||||
_fadeStep = 255 / counter;
|
||||
_status = 2;
|
||||
_status = 2;
|
||||
}
|
||||
|
||||
void Palette::fillBaseWhite(int index, int count) {
|
||||
|
@ -57,7 +57,7 @@ bool SpriteResource::load(uint32 fileHash, bool doLoadPosition) {
|
||||
const byte *spriteData = _resourceHandle.data();
|
||||
NPoint *position = doLoadPosition ? &_position : NULL;
|
||||
parseBitmapResource(spriteData, &_rle, &_dimensions, position, NULL, &_pixels);
|
||||
}
|
||||
}
|
||||
return _pixels != NULL;
|
||||
}
|
||||
|
||||
@ -134,11 +134,11 @@ bool AnimResource::load(uint32 fileHash) {
|
||||
return true;
|
||||
|
||||
unload();
|
||||
|
||||
|
||||
_vm->_res->queryResource(fileHash, _resourceHandle);
|
||||
if (!_resourceHandle.isValid() || _resourceHandle.type() != kResTypeAnimation)
|
||||
return false;
|
||||
|
||||
|
||||
const byte *resourceData, *animList, *frameList;
|
||||
uint16 animInfoStartOfs, animListIndex, animListCount;
|
||||
uint16 frameListStartOfs, frameCount;
|
||||
@ -146,20 +146,20 @@ bool AnimResource::load(uint32 fileHash) {
|
||||
|
||||
_vm->_res->loadResource(_resourceHandle);
|
||||
resourceData = _resourceHandle.data();
|
||||
|
||||
|
||||
animListCount = READ_LE_UINT16(resourceData);
|
||||
animInfoStartOfs = READ_LE_UINT16(resourceData + 2);
|
||||
spriteDataOfs = READ_LE_UINT32(resourceData + 4);
|
||||
paletteDataOfs = READ_LE_UINT32(resourceData + 8);
|
||||
|
||||
|
||||
animList = resourceData + 12;
|
||||
for (animListIndex = 0; animListIndex < animListCount; animListIndex++) {
|
||||
debug(8, "hash: %08X", READ_LE_UINT32(animList));
|
||||
if (READ_LE_UINT32(animList) == fileHash)
|
||||
break;
|
||||
animList += 8;
|
||||
animList += 8;
|
||||
}
|
||||
|
||||
|
||||
if (animListIndex >= animListCount) {
|
||||
_vm->_res->unloadResource(_resourceHandle);
|
||||
return false;
|
||||
@ -168,12 +168,12 @@ bool AnimResource::load(uint32 fileHash) {
|
||||
_spriteData = resourceData + spriteDataOfs;
|
||||
if (paletteDataOfs > 0)
|
||||
_paletteData = resourceData + paletteDataOfs;
|
||||
|
||||
|
||||
frameCount = READ_LE_UINT16(animList + 4);
|
||||
frameListStartOfs = READ_LE_UINT16(animList + 6);
|
||||
|
||||
|
||||
debug(8, "frameCount = %d; frameListStartOfs = %04X; animInfoStartOfs = %04X", frameCount, frameListStartOfs, animInfoStartOfs);
|
||||
|
||||
|
||||
frameList = resourceData + animInfoStartOfs + frameListStartOfs;
|
||||
|
||||
_frames.clear();
|
||||
@ -189,13 +189,13 @@ bool AnimResource::load(uint32 fileHash) {
|
||||
frameInfo.drawOffset.height = READ_LE_UINT16(frameList + 12);
|
||||
frameInfo.deltaX = READ_LE_UINT16(frameList + 14);
|
||||
frameInfo.deltaY = READ_LE_UINT16(frameList + 16);
|
||||
frameInfo.collisionBoundsOffset.x = READ_LE_UINT16(frameList + 18);
|
||||
frameInfo.collisionBoundsOffset.y = READ_LE_UINT16(frameList + 20);
|
||||
frameInfo.collisionBoundsOffset.width = READ_LE_UINT16(frameList + 22);
|
||||
frameInfo.collisionBoundsOffset.x = READ_LE_UINT16(frameList + 18);
|
||||
frameInfo.collisionBoundsOffset.y = READ_LE_UINT16(frameList + 20);
|
||||
frameInfo.collisionBoundsOffset.width = READ_LE_UINT16(frameList + 22);
|
||||
frameInfo.collisionBoundsOffset.height = READ_LE_UINT16(frameList + 24);
|
||||
frameInfo.spriteDataOffs = READ_LE_UINT32(frameList + 28);
|
||||
debug(8, "frameHash = %08X; counter = %d; rect = (%d,%d,%d,%d); deltaX = %d; deltaY = %d; collisionBoundsOffset = (%d,%d,%d,%d); spriteDataOffs = %08X",
|
||||
frameInfo.frameHash, frameInfo.counter,
|
||||
debug(8, "frameHash = %08X; counter = %d; rect = (%d,%d,%d,%d); deltaX = %d; deltaY = %d; collisionBoundsOffset = (%d,%d,%d,%d); spriteDataOffs = %08X",
|
||||
frameInfo.frameHash, frameInfo.counter,
|
||||
frameInfo.drawOffset.x, frameInfo.drawOffset.y, frameInfo.drawOffset.width, frameInfo.drawOffset.height,
|
||||
frameInfo.deltaX, frameInfo.deltaY,
|
||||
frameInfo.collisionBoundsOffset.x, frameInfo.collisionBoundsOffset.y, frameInfo.collisionBoundsOffset.width, frameInfo.collisionBoundsOffset.height,
|
||||
@ -203,11 +203,11 @@ bool AnimResource::load(uint32 fileHash) {
|
||||
frameList += 32;
|
||||
_frames.push_back(frameInfo);
|
||||
}
|
||||
|
||||
|
||||
_fileHash = fileHash;
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AnimResource::unload() {
|
||||
@ -229,7 +229,7 @@ int16 AnimResource::getFrameIndex(uint32 frameHash) {
|
||||
break;
|
||||
}
|
||||
debug(2, "AnimResource::getFrameIndex(%08X) -> %d", frameHash, frameIndex);
|
||||
return frameIndex;
|
||||
return frameIndex;
|
||||
}
|
||||
|
||||
void AnimResource::setRepl(byte oldColor, byte newColor) {
|
||||
@ -254,7 +254,7 @@ NDimensions AnimResource::loadSpriteDimensions(uint32 fileHash) {
|
||||
|
||||
// MouseCursorResource
|
||||
|
||||
MouseCursorResource::MouseCursorResource(NeverhoodEngine *vm)
|
||||
MouseCursorResource::MouseCursorResource(NeverhoodEngine *vm)
|
||||
: _cursorSprite(vm), _cursorNum(4), _currFileHash(0) {
|
||||
|
||||
_rect.width = 32;
|
||||
@ -265,7 +265,7 @@ void MouseCursorResource::load(uint32 fileHash) {
|
||||
if (_currFileHash != fileHash) {
|
||||
if (_cursorSprite.load(fileHash) && !_cursorSprite.isRle() &&
|
||||
_cursorSprite.getDimensions().width == 96 && _cursorSprite.getDimensions().height == 224) {
|
||||
_currFileHash = fileHash;
|
||||
_currFileHash = fileHash;
|
||||
} else {
|
||||
unload();
|
||||
}
|
||||
@ -296,14 +296,14 @@ NDrawRect& MouseCursorResource::getRect() {
|
||||
void MouseCursorResource::draw(int frameNum, Graphics::Surface *destSurface) {
|
||||
if (_cursorSprite.getPixels()) {
|
||||
const int sourcePitch = (_cursorSprite.getDimensions().width + 3) & 0xFFFC; // 4 byte alignment
|
||||
const int destPitch = destSurface->pitch;
|
||||
const int destPitch = destSurface->pitch;
|
||||
const byte *source = _cursorSprite.getPixels() + _cursorNum * (sourcePitch * 32) + frameNum * 32;
|
||||
byte *dest = (byte*)destSurface->pixels;
|
||||
for (int16 yc = 0; yc < 32; yc++) {
|
||||
memcpy(dest, source, 32);
|
||||
source += sourcePitch;
|
||||
dest += destPitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ void MouseCursorResource::draw(int frameNum, Graphics::Surface *destSurface) {
|
||||
|
||||
TextResource::TextResource(NeverhoodEngine *vm)
|
||||
: _vm(vm), _textData(NULL), _count(0) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
TextResource::~TextResource() {
|
||||
@ -372,7 +372,7 @@ void DataResource::load(uint32 fileHash) {
|
||||
dataS.seek(2 + i * 8);
|
||||
DRDirectoryItem drDirectoryItem;
|
||||
drDirectoryItem.nameHash = dataS.readUint32LE();
|
||||
drDirectoryItem.offset = dataS.readUint16LE();
|
||||
drDirectoryItem.offset = dataS.readUint16LE();
|
||||
drDirectoryItem.type = dataS.readUint16LE();
|
||||
debug(2, "%03d nameHash = %08X; offset = %04X; type = %d", i, drDirectoryItem.nameHash, drDirectoryItem.offset, drDirectoryItem.type);
|
||||
dataS.seek(itemStartOffs + drDirectoryItem.offset);
|
||||
@ -415,7 +415,7 @@ void DataResource::load(uint32 fileHash) {
|
||||
hitRect.rect.y1 = dataS.readUint16LE();
|
||||
hitRect.rect.x2 = dataS.readUint16LE();
|
||||
hitRect.rect.y2 = dataS.readUint16LE();
|
||||
hitRect.type = dataS.readUint16LE() + 0x5001;
|
||||
hitRect.type = dataS.readUint16LE() + 0x5001;
|
||||
debug(3, "(%d, %d, %d, %d) -> %04d", hitRect.rect.x1, hitRect.rect.y1, hitRect.rect.x2, hitRect.rect.y2, hitRect.type);
|
||||
hitRectList->push_back(hitRect);
|
||||
}
|
||||
@ -491,7 +491,7 @@ void DataResource::load(uint32 fileHash) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
_directory.push_back(drDirectoryItem);
|
||||
_directory.push_back(drDirectoryItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -540,12 +540,12 @@ HitRectList *DataResource::getHitRectList() {
|
||||
|
||||
MessageList *DataResource::getMessageListAtPos(int16 klaymenX, int16 klaymenY, int16 mouseX, int16 mouseY) {
|
||||
for (uint i = 0; i < _drRects.size(); i++) {
|
||||
if (klaymenX >= _drRects[i].rect.x1 && klaymenX <= _drRects[i].rect.x2 &&
|
||||
if (klaymenX >= _drRects[i].rect.x1 && klaymenX <= _drRects[i].rect.x2 &&
|
||||
klaymenY >= _drRects[i].rect.y1 && klaymenY <= _drRects[i].rect.y2) {
|
||||
DRSubRectList *drSubRectList = _drSubRectLists[_drRects[i].subRectIndex];
|
||||
DRSubRectList *drSubRectList = _drSubRectLists[_drRects[i].subRectIndex];
|
||||
for (uint j = 0; j < drSubRectList->size(); j++) {
|
||||
DRSubRect &subRect = (*drSubRectList)[j];
|
||||
if (mouseX >= subRect.rect.x1 && mouseX <= subRect.rect.x2 &&
|
||||
if (mouseX >= subRect.rect.x1 && mouseX <= subRect.rect.x2 &&
|
||||
mouseY >= subRect.rect.y1 && mouseY <= subRect.rect.y2) {
|
||||
return _messageLists[subRect.messageListItemIndex];
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ protected:
|
||||
|
||||
struct DRDirectoryItem {
|
||||
uint32 nameHash;
|
||||
uint16 offset;
|
||||
uint16 offset;
|
||||
uint16 type;
|
||||
};
|
||||
|
||||
@ -195,7 +195,7 @@ protected:
|
||||
Common::Array<MessageList*> _messageLists;
|
||||
Common::Array<DRRect> _drRects;
|
||||
Common::Array<DRSubRectList*> _drSubRectLists;
|
||||
DataResource::DRDirectoryItem *findDRDirectoryItem(uint32 nameHash, uint16 type);
|
||||
DataResource::DRDirectoryItem *findDRDirectoryItem(uint32 nameHash, uint16 type);
|
||||
};
|
||||
|
||||
uint32 calcHash(const char *value);
|
||||
|
@ -49,7 +49,7 @@ void ResourceMan::addArchive(const Common::String &filename) {
|
||||
if (archiveEntry->timeStamp > entry->archiveEntry->timeStamp) {
|
||||
entry->archive = archive;
|
||||
entry->archiveEntry = archiveEntry;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ResourceFileEntry newEntry;
|
||||
newEntry.resourceHandle = -1;
|
||||
|
@ -78,7 +78,7 @@ bool NeverhoodEngine::savegame(const char *filename, const char *description) {
|
||||
byte descriptionLen = strlen(description);
|
||||
out->writeByte(descriptionLen);
|
||||
out->write(description, descriptionLen);
|
||||
|
||||
|
||||
Graphics::saveThumbnail(*out);
|
||||
|
||||
// Not used yet, reserved for future usage
|
||||
@ -96,7 +96,7 @@ bool NeverhoodEngine::savegame(const char *filename, const char *description) {
|
||||
_gameVars->setGlobalVar(V_CURRENT_SCENE_WHICH, _gameState.which);
|
||||
|
||||
_gameVars->saveState(out);
|
||||
|
||||
|
||||
out->finalize();
|
||||
delete out;
|
||||
return true;
|
||||
@ -112,17 +112,17 @@ bool NeverhoodEngine::loadgame(const char *filename) {
|
||||
SaveHeader header;
|
||||
|
||||
kReadSaveHeaderError errorCode = readSaveHeader(in, false, header);
|
||||
|
||||
|
||||
if (errorCode != kRSHENoError) {
|
||||
warning("Error loading savegame '%s'", filename);
|
||||
delete in;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
g_engine->setTotalPlayTime(header.playTime * 1000);
|
||||
|
||||
_gameVars->loadState(in);
|
||||
|
||||
|
||||
_gameState.sceneNum = _gameVars->getGlobalVar(V_CURRENT_SCENE);
|
||||
_gameState.which = _gameVars->getGlobalVar(V_CURRENT_SCENE_WHICH);
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace Neverhood {
|
||||
Scene::Scene(NeverhoodEngine *vm, Module *parentModule)
|
||||
: Entity(vm, 0), _parentModule(parentModule), _dataResource(vm), _hitRects(NULL),
|
||||
_mouseCursorWasVisible(true) {
|
||||
|
||||
|
||||
_isKlaymenBusy = false;
|
||||
_doConvertMessages = false;
|
||||
_messageList = NULL;
|
||||
@ -50,10 +50,10 @@ Scene::Scene(NeverhoodEngine *vm, Module *parentModule)
|
||||
_smackerPlayer = NULL;
|
||||
_isMessageListBusy = false;
|
||||
_messageValue = -1;
|
||||
|
||||
|
||||
SetUpdateHandler(&Scene::update);
|
||||
SetMessageHandler(&Scene::handleMessage);
|
||||
|
||||
|
||||
_vm->_screen->clearRenderQueue();
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ Scene::~Scene() {
|
||||
delete *iter;
|
||||
|
||||
// Don't delete surfaces since they always belong to an entity
|
||||
|
||||
|
||||
// Purge the resources after each scene
|
||||
_vm->_res->purgeResources();
|
||||
|
||||
@ -84,7 +84,7 @@ void Scene::draw() {
|
||||
} else {
|
||||
for (Common::Array<BaseSurface*>::iterator iter = _surfaces.begin(); iter != _surfaces.end(); iter++)
|
||||
(*iter)->draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::addEntity(Entity *entity) {
|
||||
@ -99,7 +99,7 @@ void Scene::addEntity(Entity *entity) {
|
||||
if (insertIndex >= 0)
|
||||
_entities.insert_at(insertIndex, entity);
|
||||
else
|
||||
_entities.push_back(entity);
|
||||
_entities.push_back(entity);
|
||||
}
|
||||
|
||||
bool Scene::removeEntity(Entity *entity) {
|
||||
@ -108,7 +108,7 @@ bool Scene::removeEntity(Entity *entity) {
|
||||
_entities.remove_at(index);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Scene::addSurface(BaseSurface *surface) {
|
||||
@ -124,7 +124,7 @@ void Scene::addSurface(BaseSurface *surface) {
|
||||
if (insertIndex >= 0)
|
||||
_surfaces.insert_at(insertIndex, surface);
|
||||
else
|
||||
_surfaces.push_back(surface);
|
||||
_surfaces.push_back(surface);
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ bool Scene::removeSurface(BaseSurface *surface) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Scene::printSurfaces(Console *con) {
|
||||
@ -246,12 +246,12 @@ void Scene::update() {
|
||||
if (_mouseClicked) {
|
||||
if (_klaymen) {
|
||||
if (_canAcceptInput &&
|
||||
_klaymen->hasMessageHandler() &&
|
||||
_klaymen->hasMessageHandler() &&
|
||||
sendMessage(_klaymen, 0x1008, 0) != 0 &&
|
||||
queryPositionSprite(_mouseClickPos.x, _mouseClickPos.y)) {
|
||||
_mouseClicked = false;
|
||||
} else if (_canAcceptInput &&
|
||||
_klaymen->hasMessageHandler() &&
|
||||
_klaymen->hasMessageHandler() &&
|
||||
sendMessage(_klaymen, 0x1008, 0) != 0) {
|
||||
_mouseClicked = !queryPositionRectList(_mouseClickPos.x, _mouseClickPos.y);
|
||||
}
|
||||
@ -262,7 +262,7 @@ void Scene::update() {
|
||||
|
||||
processMessageList();
|
||||
|
||||
// Update all entities
|
||||
// Update all entities
|
||||
for (Common::Array<Entity*>::iterator iter = _entities.begin(); iter != _entities.end(); iter++)
|
||||
(*iter)->handleUpdate();
|
||||
|
||||
@ -283,7 +283,7 @@ uint32 Scene::handleMessage(int messageNum, const MessageParam ¶m, Entity *s
|
||||
_mouseClickPos = param.asPoint();
|
||||
break;
|
||||
case 0x0006:
|
||||
sendMessage(_parentModule, 0x1009, param);
|
||||
sendMessage(_parentModule, 0x1009, param);
|
||||
break;
|
||||
case 0x1006:
|
||||
// Sent by Klaymen when its animation sequence has finished
|
||||
@ -332,7 +332,7 @@ uint32 Scene::handleMessage(int messageNum, const MessageParam ¶m, Entity *s
|
||||
bool Scene::queryPositionSprite(int16 mouseX, int16 mouseY) {
|
||||
for (uint i = 0; i < _collisionSprites.size(); i++) {
|
||||
Sprite *sprite = _collisionSprites[i];
|
||||
if (sprite->hasMessageHandler() && sprite->isPointInside(mouseX, mouseY) &&
|
||||
if (sprite->hasMessageHandler() && sprite->isPointInside(mouseX, mouseY) &&
|
||||
sendPointMessage(sprite, 0x1011, _mouseClickPos) != 0) {
|
||||
return true;
|
||||
}
|
||||
@ -412,8 +412,8 @@ void Scene::processMessageList() {
|
||||
_messageList2 = NULL;
|
||||
_messageListStatus = 0;
|
||||
}
|
||||
|
||||
if (_messageList && _klaymen) {
|
||||
|
||||
if (_messageList && _klaymen) {
|
||||
|
||||
#if 0
|
||||
debug("MessageList: %p, %d", (void*)_messageList, _messageList->size());
|
||||
@ -423,11 +423,11 @@ void Scene::processMessageList() {
|
||||
}
|
||||
debug("--------------------------------");
|
||||
#endif
|
||||
|
||||
|
||||
while (_messageList && _messageListIndex < _messageListCount && !_isKlaymenBusy) {
|
||||
uint32 messageNum = (*_messageList)[_messageListIndex].messageNum;
|
||||
uint32 messageParam = (*_messageList)[_messageListIndex].messageValue;
|
||||
|
||||
|
||||
++_messageListIndex;
|
||||
if (_messageListIndex == _messageListCount)
|
||||
sendMessage(_klaymen, 0x1021, 0);
|
||||
@ -460,7 +460,7 @@ void Scene::processMessageList() {
|
||||
if (_klaymen->hasMessageHandler() && sendMessage(_klaymen, messageNum, messageParam) != 0) {
|
||||
_isKlaymenBusy = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_messageListIndex == _messageListCount) {
|
||||
_canAcceptInput = true;
|
||||
_messageList = NULL;
|
||||
@ -469,7 +469,7 @@ void Scene::processMessageList() {
|
||||
}
|
||||
|
||||
_isMessageListBusy = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scene::cancelMessageList() {
|
||||
@ -531,7 +531,7 @@ uint16 Scene::convertMessageNum(uint32 messageNum) {
|
||||
case 0x42002200:
|
||||
return 0x4004;
|
||||
case 0x428D4894:
|
||||
return 0x101A;
|
||||
return 0x101A;
|
||||
}
|
||||
return 0x1000;
|
||||
}
|
||||
@ -546,7 +546,7 @@ HitRect *Scene::findHitRectAtPos(int16 x, int16 y) {
|
||||
for (HitRectList::iterator it = _hitRects->begin(); it != _hitRects->end(); it++)
|
||||
if ((*it).rect.contains(x, y))
|
||||
return &(*it);
|
||||
return &kDefaultHitRect;
|
||||
return &kDefaultHitRect;
|
||||
}
|
||||
|
||||
void Scene::addCollisionSprite(Sprite *sprite) {
|
||||
@ -561,7 +561,7 @@ void Scene::addCollisionSprite(Sprite *sprite) {
|
||||
if (insertIndex >= 0)
|
||||
_collisionSprites.insert_at(insertIndex, sprite);
|
||||
else
|
||||
_collisionSprites.push_back(sprite);
|
||||
_collisionSprites.push_back(sprite);
|
||||
}
|
||||
|
||||
void Scene::removeCollisionSprite(Sprite *sprite) {
|
||||
@ -583,7 +583,7 @@ void Scene::checkCollision(Sprite *sprite, uint16 flags, int messageNum, uint32
|
||||
if ((sprite->getFlags() & flags) && collSprite->checkCollision(sprite->getCollisionBounds())) {
|
||||
sprite->sendMessage(collSprite, messageNum, messageParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::insertMouse(Mouse *mouseCursor) {
|
||||
|
@ -76,89 +76,89 @@ public:
|
||||
void checkCollision(Sprite *sprite, uint16 flags, int messageNum, uint32 messageParam);
|
||||
// Some crazy templated functions to make the logic code smaller/simpler (imo!)
|
||||
// insertKlaymen
|
||||
template<class T>
|
||||
template<class T>
|
||||
void insertKlaymen() {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this));
|
||||
}
|
||||
template<class T, class Arg1>
|
||||
template<class T, class Arg1>
|
||||
void insertKlaymen(Arg1 arg1) {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this, arg1));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2>
|
||||
template<class T, class Arg1, class Arg2>
|
||||
void insertKlaymen(Arg1 arg1, Arg2 arg2) {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this, arg1, arg2));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3>
|
||||
template<class T, class Arg1, class Arg2, class Arg3>
|
||||
void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this, arg1, arg2, arg3));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this, arg1, arg2, arg3, arg4));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this, arg1, arg2, arg3, arg4, arg5));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
void insertKlaymen(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
|
||||
_klaymen = (T*)addSprite(new T(_vm, this, arg1, arg2, arg3, arg4, arg5, arg6));
|
||||
}
|
||||
// insertSprite
|
||||
template<class T>
|
||||
template<class T>
|
||||
T* insertSprite() {
|
||||
return (T*)addSprite(new T(_vm));
|
||||
}
|
||||
template<class T, class Arg1>
|
||||
template<class T, class Arg1>
|
||||
T* insertSprite(Arg1 arg1) {
|
||||
return (T*)addSprite(new T(_vm, arg1));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2>
|
||||
template<class T, class Arg1, class Arg2>
|
||||
T* insertSprite(Arg1 arg1, Arg2 arg2) {
|
||||
return (T*)addSprite(new T(_vm, arg1, arg2));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3>
|
||||
template<class T, class Arg1, class Arg2, class Arg3>
|
||||
T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
|
||||
return (T*)addSprite(new T(_vm, arg1, arg2, arg3));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) {
|
||||
return (T*)addSprite(new T(_vm, arg1, arg2, arg3, arg4));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) {
|
||||
return (T*)addSprite(new T(_vm, arg1, arg2, arg3, arg4, arg5));
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
T* insertSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
|
||||
return (T*)addSprite(new T(_vm, arg1, arg2, arg3, arg4, arg5, arg6));
|
||||
}
|
||||
// createSprite
|
||||
template<class T>
|
||||
template<class T>
|
||||
T* createSprite() {
|
||||
return new T(_vm);
|
||||
}
|
||||
template<class T, class Arg1>
|
||||
template<class T, class Arg1>
|
||||
T* createSprite(Arg1 arg1) {
|
||||
return new T(_vm, arg1);
|
||||
}
|
||||
template<class T, class Arg1, class Arg2>
|
||||
template<class T, class Arg1, class Arg2>
|
||||
T* createSprite(Arg1 arg1, Arg2 arg2) {
|
||||
return new T(_vm, arg1, arg2);
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3>
|
||||
template<class T, class Arg1, class Arg2, class Arg3>
|
||||
T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
|
||||
return new T(_vm, arg1, arg2, arg3);
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4>
|
||||
T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4) {
|
||||
return new T(_vm, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
|
||||
T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5) {
|
||||
return new T(_vm, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
template<class T, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
|
||||
T* createSprite(Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6) {
|
||||
return new T(_vm, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
|
@ -28,16 +28,16 @@ namespace Neverhood {
|
||||
Screen::Screen(NeverhoodEngine *vm)
|
||||
: _vm(vm), _paletteData(NULL), _paletteChanged(false), _smackerDecoder(NULL),
|
||||
_yOffset(0), _fullRefresh(false) {
|
||||
|
||||
|
||||
_ticks = _vm->_system->getMillis();
|
||||
|
||||
|
||||
_backScreen = new Graphics::Surface();
|
||||
_backScreen->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
|
||||
|
||||
|
||||
_renderQueue = new RenderQueue();
|
||||
_prevRenderQueue = new RenderQueue();
|
||||
_microTiles = new MicroTileArray(640, 480);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Screen::~Screen() {
|
||||
@ -72,13 +72,13 @@ void Screen::update() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (RenderQueue::iterator jt = _prevRenderQueue->begin(); jt != _prevRenderQueue->end(); ++jt) {
|
||||
RenderItem &prevRenderItem = (*jt);
|
||||
if (prevRenderItem._refresh)
|
||||
_microTiles->addRect(Common::Rect(prevRenderItem._destX, prevRenderItem._destY, prevRenderItem._destX + prevRenderItem._width, prevRenderItem._destY + prevRenderItem._height));
|
||||
}
|
||||
|
||||
|
||||
for (RenderQueue::iterator it = _renderQueue->begin(); it != _renderQueue->end(); ++it) {
|
||||
RenderItem &renderItem = (*it);
|
||||
if (renderItem._refresh)
|
||||
@ -93,7 +93,7 @@ void Screen::update() {
|
||||
for (RectangleList::iterator ri = updateRects->begin(); ri != updateRects->end(); ++ri)
|
||||
blitRenderItem(renderItem, *ri);
|
||||
}
|
||||
|
||||
|
||||
SWAP(_renderQueue, _prevRenderQueue);
|
||||
_renderQueue->clear();
|
||||
|
||||
@ -202,12 +202,12 @@ void Screen::drawSurface2(const Graphics::Surface *surface, NDrawRect &drawRect,
|
||||
destX = drawRect.x;
|
||||
ddRect.x1 = 0;
|
||||
}
|
||||
|
||||
|
||||
if (drawRect.y + drawRect.height >= clipRect.y2)
|
||||
ddRect.y2 = clipRect.y2 - drawRect.y;
|
||||
else
|
||||
ddRect.y2 = drawRect.height;
|
||||
|
||||
|
||||
if (drawRect.y < clipRect.y1) {
|
||||
destY = clipRect.y1;
|
||||
ddRect.y1 = clipRect.y1 - drawRect.y;
|
||||
@ -215,7 +215,7 @@ void Screen::drawSurface2(const Graphics::Surface *surface, NDrawRect &drawRect,
|
||||
destY = drawRect.y;
|
||||
ddRect.y1 = 0;
|
||||
}
|
||||
|
||||
|
||||
queueBlit(surface, destX, destY, ddRect, transparent, version, shadowSurface);
|
||||
|
||||
}
|
||||
@ -224,12 +224,12 @@ void Screen::drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, ND
|
||||
|
||||
int16 destX, destY;
|
||||
NRect ddRect;
|
||||
|
||||
|
||||
if (x + drawRect.width >= clipRect.x2)
|
||||
ddRect.x2 = clipRect.x2 - drawRect.x - x;
|
||||
else
|
||||
ddRect.x2 = drawRect.x + drawRect.width;
|
||||
|
||||
|
||||
if (x < clipRect.x1) {
|
||||
destX = clipRect.x1;
|
||||
ddRect.x1 = clipRect.x1 + drawRect.x - x;
|
||||
@ -242,7 +242,7 @@ void Screen::drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, ND
|
||||
ddRect.y2 = clipRect.y2 + drawRect.y - y;
|
||||
else
|
||||
ddRect.y2 = drawRect.y + drawRect.height;
|
||||
|
||||
|
||||
if (y < clipRect.y1) {
|
||||
destY = clipRect.y1;
|
||||
ddRect.y1 = clipRect.y1 + drawRect.y - y;
|
||||
@ -250,7 +250,7 @@ void Screen::drawSurface3(const Graphics::Surface *surface, int16 x, int16 y, ND
|
||||
destY = y;
|
||||
ddRect.y1 = drawRect.y;
|
||||
}
|
||||
|
||||
|
||||
queueBlit(surface, destX, destY, ddRect, transparent, version);
|
||||
|
||||
}
|
||||
@ -270,13 +270,13 @@ void Screen::drawDoubleSurface2(const Graphics::Surface *surface, NDrawRect &dra
|
||||
dest += _backScreen->pitch;
|
||||
dest += _backScreen->pitch;
|
||||
}
|
||||
|
||||
|
||||
_fullRefresh = true; // See Screen::update
|
||||
|
||||
}
|
||||
|
||||
void Screen::drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDrawRect &sysRect, NRect &clipRect, bool transparent, byte version) {
|
||||
|
||||
|
||||
int16 x, y;
|
||||
bool xflag, yflag;
|
||||
NDrawRect newDrawRect;
|
||||
@ -292,26 +292,26 @@ void Screen::drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDra
|
||||
y = y % sysRect.height;
|
||||
if (y < 0)
|
||||
y += sysRect.height;
|
||||
|
||||
|
||||
xflag = x <= 0;
|
||||
yflag = y <= 0;
|
||||
|
||||
|
||||
newDrawRect.x = x;
|
||||
newDrawRect.width = sysRect.width - x;
|
||||
if (drawRect.width < newDrawRect.width) {
|
||||
xflag = true;
|
||||
newDrawRect.width = drawRect.width;
|
||||
}
|
||||
|
||||
|
||||
newDrawRect.y = y;
|
||||
newDrawRect.height = sysRect.height - y;
|
||||
if (drawRect.height < newDrawRect.height) {
|
||||
yflag = true;
|
||||
newDrawRect.height = drawRect.height;
|
||||
}
|
||||
|
||||
|
||||
drawSurface3(surface, drawRect.x, drawRect.y, newDrawRect, clipRect, transparent, version);
|
||||
|
||||
|
||||
if (!xflag) {
|
||||
newDrawRect.x = 0;
|
||||
newDrawRect.y = y;
|
||||
@ -321,7 +321,7 @@ void Screen::drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDra
|
||||
newDrawRect.height = drawRect.height;
|
||||
drawSurface3(surface, sysRect.width + drawRect.x - x, drawRect.y, newDrawRect, clipRect, transparent, version);
|
||||
}
|
||||
|
||||
|
||||
if (!yflag) {
|
||||
newDrawRect.x = x;
|
||||
newDrawRect.y = 0;
|
||||
@ -331,7 +331,7 @@ void Screen::drawUnk(const Graphics::Surface *surface, NDrawRect &drawRect, NDra
|
||||
newDrawRect.width = drawRect.width;
|
||||
drawSurface3(surface, drawRect.x, sysRect.height + drawRect.y - y, newDrawRect, clipRect, transparent, version);
|
||||
}
|
||||
|
||||
|
||||
if (!xflag && !yflag) {
|
||||
newDrawRect.x = 0;
|
||||
newDrawRect.y = 0;
|
||||
@ -350,13 +350,13 @@ void Screen::drawSurfaceClipRects(const Graphics::Surface *surface, NDrawRect &d
|
||||
|
||||
void Screen::queueBlit(const Graphics::Surface *surface, int16 destX, int16 destY, NRect &ddRect, bool transparent, byte version,
|
||||
const Graphics::Surface *shadowSurface) {
|
||||
|
||||
|
||||
const int width = ddRect.x2 - ddRect.x1;
|
||||
const int height = ddRect.y2 - ddRect.y1;
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
|
||||
RenderItem renderItem;
|
||||
renderItem._surface = surface;
|
||||
renderItem._shadowSurface = shadowSurface;
|
||||
@ -369,7 +369,7 @@ void Screen::queueBlit(const Graphics::Surface *surface, int16 destX, int16 dest
|
||||
renderItem._transparent = transparent;
|
||||
renderItem._version = version;
|
||||
_renderQueue->push_back(renderItem);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Screen::blitRenderItem(const RenderItem &renderItem, const Common::Rect &clipRect) {
|
||||
|
@ -79,22 +79,22 @@ void SmackerDoubleSurface::draw() {
|
||||
void NeverhoodSmackerDecoder::forceSeekToFrame(uint frame) {
|
||||
if (!isVideoLoaded())
|
||||
return;
|
||||
|
||||
|
||||
if (frame >= getFrameCount())
|
||||
error("Can't force Smacker seek to invalid frame %d", frame);
|
||||
|
||||
|
||||
if (_header.audioInfo[0].hasAudio)
|
||||
error("Can't force Smacker frame seek with audio");
|
||||
if (!rewind())
|
||||
error("Failed to rewind");
|
||||
|
||||
|
||||
SmackerVideoTrack *videoTrack = (SmackerVideoTrack *)getTrack(0);
|
||||
uint32 offset = 0;
|
||||
for (uint32 i = 0; i < frame; i++) {
|
||||
videoTrack->increaseCurFrame();
|
||||
offset += _frameSizes[i] & ~3;
|
||||
}
|
||||
|
||||
|
||||
_fileStream->seek(offset, SEEK_CUR);
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ SmackerPlayer::~SmackerPlayer() {
|
||||
|
||||
void SmackerPlayer::open(uint32 fileHash, bool keepLastFrame) {
|
||||
debug(0, "SmackerPlayer::open(%08X)", fileHash);
|
||||
|
||||
|
||||
_fileHash = fileHash;
|
||||
_keepLastFrame = keepLastFrame;
|
||||
|
||||
@ -136,13 +136,13 @@ void SmackerPlayer::open(uint32 fileHash, bool keepLastFrame) {
|
||||
|
||||
_smackerDecoder = new NeverhoodSmackerDecoder();
|
||||
_smackerDecoder->loadStream(_stream);
|
||||
|
||||
|
||||
_palette = new Palette(_vm);
|
||||
_palette->usePalette();
|
||||
|
||||
if (!_paused)
|
||||
_smackerDecoder->start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SmackerPlayer::close() {
|
||||
@ -212,7 +212,7 @@ void SmackerPlayer::update() {
|
||||
_videoDone = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SmackerPlayer::updateFrame() {
|
||||
@ -240,7 +240,7 @@ void SmackerPlayer::updateFrame() {
|
||||
|
||||
if (_smackerDecoder->hasDirtyPalette())
|
||||
updatePalette();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SmackerPlayer::updatePalette() {
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
void close();
|
||||
void gotoFrame(int frameNumber);
|
||||
uint32 getFrameCount();
|
||||
uint32 getFrameNumber();
|
||||
uint32 getFrameNumber();
|
||||
uint getStatus();
|
||||
void setDrawPos(int16 x, int16 y);
|
||||
void rewind();
|
||||
|
@ -31,16 +31,16 @@ SmackerScene::SmackerScene(NeverhoodEngine *vm, Module *parentModule, bool doubl
|
||||
debug(0, "SmackerScene::SmackerScene(%d, %d, %d)", doubleSurface, canSkip, canAbort);
|
||||
|
||||
// NOTE: Merged from SmackerScene::init, maybe split again if needed (incl. parameter flags)
|
||||
|
||||
|
||||
if (getGlobalVar(V_SMACKER_CAN_ABORT)) {
|
||||
_canSkip = true;
|
||||
_canAbort = true;
|
||||
}
|
||||
|
||||
|
||||
if (!_doubleSurface)
|
||||
_vm->_screen->clear();
|
||||
|
||||
_fileHash[0] = 0;
|
||||
_fileHash[0] = 0;
|
||||
_fileHash[1] = 0;
|
||||
|
||||
SetUpdateHandler(&SmackerScene::update);
|
||||
@ -67,7 +67,7 @@ void SmackerScene::nextVideo() {
|
||||
debug(0, "SmackerScene::nextVideo()");
|
||||
|
||||
_fileHashListIndex++;
|
||||
|
||||
|
||||
if (_fileHashList && _fileHashList[_fileHashListIndex] != 0) {
|
||||
uint32 smackerFileHash = _fileHashList[_fileHashListIndex];
|
||||
ResourceHandle resourceHandle;
|
||||
|
@ -35,7 +35,7 @@ SoundResource::~SoundResource() {
|
||||
unload();
|
||||
}
|
||||
|
||||
bool SoundResource::isPlaying() {
|
||||
bool SoundResource::isPlaying() {
|
||||
AudioResourceManSoundItem *soundItem = getSoundItem();
|
||||
return soundItem ? soundItem->isPlaying() : false;
|
||||
}
|
||||
@ -94,7 +94,7 @@ MusicResource::MusicResource(NeverhoodEngine *vm)
|
||||
|
||||
bool MusicResource::isPlaying() {
|
||||
AudioResourceManMusicItem *musicItem = getMusicItem();
|
||||
return musicItem && musicItem->isPlaying();
|
||||
return musicItem && musicItem->isPlaying();
|
||||
}
|
||||
|
||||
void MusicResource::load(uint32 fileHash) {
|
||||
@ -134,7 +134,7 @@ AudioResourceManMusicItem *MusicResource::getMusicItem() {
|
||||
|
||||
MusicItem::MusicItem(NeverhoodEngine *vm, uint32 groupNameHash, uint32 musicFileHash)
|
||||
: _vm(vm), _musicResource(NULL) {
|
||||
|
||||
|
||||
_groupNameHash = groupNameHash;
|
||||
_fileHash = musicFileHash;
|
||||
_play = false;
|
||||
@ -187,7 +187,7 @@ SoundItem::SoundItem(NeverhoodEngine *vm, uint32 groupNameHash, uint32 soundFile
|
||||
_playOnceAfterRandomCountdown(false), _minCountdown(0), _maxCountdown(0),
|
||||
_playOnceAfterCountdown(playOnceAfterCountdown), _initialCountdown(initialCountdown),
|
||||
_playLooping(false), _currCountdown(currCountdown) {
|
||||
|
||||
|
||||
_soundResource = new SoundResource(vm);
|
||||
_soundResource->load(soundFileHash);
|
||||
}
|
||||
@ -200,7 +200,7 @@ SoundItem::~SoundItem() {
|
||||
|
||||
void SoundItem::setSoundParams(bool playOnceAfterRandomCountdown, int16 minCountdown, int16 maxCountdown,
|
||||
int16 firstMinCountdown, int16 firstMaxCountdown) {
|
||||
|
||||
|
||||
_playOnceAfterCountdown = false;
|
||||
_playLooping = false;
|
||||
_playOnceAfterRandomCountdown = playOnceAfterRandomCountdown;
|
||||
@ -361,7 +361,7 @@ void SoundMan::setSoundVolume(uint32 soundFileHash, int volume) {
|
||||
}
|
||||
|
||||
void SoundMan::update() {
|
||||
|
||||
|
||||
for (uint i = 0; i < _soundItems.size(); ++i) {
|
||||
SoundItem *soundItem = _soundItems[i];
|
||||
if (soundItem)
|
||||
@ -456,7 +456,7 @@ void SoundMan::playSoundThree(uint32 groupNameHash, uint32 soundFileHash) {
|
||||
SoundItem *soundItem = new SoundItem(_vm, groupNameHash, soundFileHash, false, 0, 0, false, _initialCountdown3, false, 0);
|
||||
_soundIndex3 = addSoundItem(soundItem);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SoundMan::setTwoSoundsPlayFlag(bool playOnceAfterCountdown) {
|
||||
@ -530,16 +530,16 @@ NeverhoodAudioStream::~NeverhoodAudioStream() {
|
||||
|
||||
int NeverhoodAudioStream::readBuffer(int16 *buffer, const int numSamples) {
|
||||
int samplesLeft = numSamples;
|
||||
|
||||
|
||||
while (samplesLeft > 0 && !_endOfData) {
|
||||
|
||||
const int maxSamples = MIN<int>(kSampleBufferLength, samplesLeft);
|
||||
const int bytesToRead = maxSamples * (_isCompressed ? 1 : 2);
|
||||
int bytesRead = _stream->read(_buffer, bytesToRead);
|
||||
int samplesRead = bytesRead / (_isCompressed ? 1 : 2);
|
||||
|
||||
|
||||
samplesLeft -= samplesRead;
|
||||
|
||||
|
||||
const byte *src = _buffer;
|
||||
if (_isCompressed) {
|
||||
while (samplesRead--) {
|
||||
@ -694,7 +694,7 @@ void AudioResourceManMusicItem::update() {
|
||||
_start = false;
|
||||
_isPlaying = true;
|
||||
}
|
||||
|
||||
|
||||
if (_vm->_mixer->isSoundHandleActive(_soundHandle)) {
|
||||
if (_isFadingIn) {
|
||||
_fadeVolume += _fadeVolumeStep;
|
||||
@ -787,11 +787,11 @@ int16 AudioResourceMan::loadMusic(uint32 fileHash) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int16 musicIndex = _musicItems.size();
|
||||
_musicItems.push_back(musicItem);
|
||||
return musicIndex;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AudioResourceMan::updateMusic() {
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
void setVolume(int16 volume);
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
int16 _musicIndex;
|
||||
int16 _musicIndex;
|
||||
AudioResourceManMusicItem *getMusicItem();
|
||||
};
|
||||
|
||||
@ -83,7 +83,7 @@ public:
|
||||
void update();
|
||||
uint32 getGroupNameHash() const { return _groupNameHash; }
|
||||
uint32 getFileHash() const { return _fileHash; }
|
||||
protected:
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
uint32 _groupNameHash;
|
||||
uint32 _fileHash;
|
||||
@ -110,7 +110,7 @@ public:
|
||||
uint32 getGroupNameHash() const { return _groupNameHash; }
|
||||
uint32 getFileHash() const { return _fileHash; }
|
||||
int16 getCurrCountdown() const { return _currCountdown; }
|
||||
protected:
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
uint32 _groupNameHash;
|
||||
uint32 _fileHash;
|
||||
@ -136,7 +136,7 @@ public:
|
||||
void deleteMusic(uint32 musicFileHash);
|
||||
void startMusic(uint32 musicFileHash, int16 countdown, int16 fadeVolumeStep);
|
||||
void stopMusic(uint32 musicFileHash, int16 countdown, int16 fadeVolumeStep);
|
||||
|
||||
|
||||
// Sound
|
||||
void addSound(uint32 groupNameHash, uint32 soundFileHash);
|
||||
void addSoundList(uint32 groupNameHash, const uint32 *soundFileHashList);
|
||||
@ -148,7 +148,7 @@ public:
|
||||
void playSoundLooping(uint32 soundFileHash);
|
||||
void stopSound(uint32 soundFileHash);
|
||||
void setSoundVolume(uint32 soundFileHash, int volume);
|
||||
|
||||
|
||||
// Misc
|
||||
void update();
|
||||
void deleteGroup(uint32 groupNameHash);
|
||||
@ -161,25 +161,25 @@ public:
|
||||
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
|
||||
|
||||
// TODO Find out what these special sounds are used for (door sounds?)
|
||||
int _soundIndex1, _soundIndex2;
|
||||
int16 _initialCountdown;
|
||||
bool _playOnceAfterCountdown;
|
||||
|
||||
|
||||
int _soundIndex3;
|
||||
int16 _initialCountdown3;
|
||||
bool _playOnceAfterCountdown3;
|
||||
|
||||
Common::Array<MusicItem*> _musicItems;
|
||||
Common::Array<SoundItem*> _soundItems;
|
||||
|
||||
|
||||
MusicItem *getMusicItemByHash(uint32 musicFileHash);
|
||||
SoundItem *getSoundItemByHash(uint32 soundFileHash);
|
||||
int16 addMusicItem(MusicItem *musicItem);
|
||||
int16 addSoundItem(SoundItem *soundItem);
|
||||
void deleteSoundByIndex(int index);
|
||||
|
||||
|
||||
};
|
||||
|
||||
class NeverhoodAudioStream : public Audio::AudioStream {
|
||||
@ -209,7 +209,7 @@ private:
|
||||
// TODO Rename these
|
||||
|
||||
class AudioResourceManSoundItem {
|
||||
public:
|
||||
public:
|
||||
AudioResourceManSoundItem(NeverhoodEngine *vm, uint32 fileHash);
|
||||
void loadSound();
|
||||
void unloadSound();
|
||||
@ -218,7 +218,7 @@ public:
|
||||
void playSound(bool looping);
|
||||
void stopSound();
|
||||
bool isPlaying();
|
||||
protected:
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
uint32 _fileHash;
|
||||
ResourceHandle _resourceHandle;
|
||||
@ -243,7 +243,7 @@ public:
|
||||
bool canRestart() const { return _canRestart; }
|
||||
bool isTerminated() const { return _terminate; }
|
||||
uint32 getFileHash() const { return _fileHash; }
|
||||
protected:
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
uint32 _fileHash;
|
||||
bool _isPlaying;
|
||||
@ -263,7 +263,7 @@ class AudioResourceMan {
|
||||
public:
|
||||
AudioResourceMan(NeverhoodEngine *vm);
|
||||
~AudioResourceMan();
|
||||
|
||||
|
||||
void stopAllSounds();
|
||||
|
||||
int16 addSound(uint32 fileHash);
|
||||
@ -271,10 +271,10 @@ public:
|
||||
|
||||
int16 loadMusic(uint32 fileHash);
|
||||
void updateMusic();
|
||||
|
||||
|
||||
AudioResourceManSoundItem *getSoundItem(int16 index);
|
||||
AudioResourceManMusicItem *getMusicItem(int16 index);
|
||||
|
||||
|
||||
protected:
|
||||
NeverhoodEngine *_vm;
|
||||
|
||||
|
@ -28,11 +28,11 @@ namespace Neverhood {
|
||||
// Sprite
|
||||
|
||||
Sprite::Sprite(NeverhoodEngine *vm, int objectPriority)
|
||||
: Entity(vm, objectPriority), _x(0), _y(0), _spriteUpdateCb(NULL), _filterXCb(NULL), _filterYCb(NULL),
|
||||
: Entity(vm, objectPriority), _x(0), _y(0), _spriteUpdateCb(NULL), _filterXCb(NULL), _filterYCb(NULL),
|
||||
_dataResource(vm), _doDeltaX(false), _doDeltaY(false), _needRefresh(false), _flags(0), _surface(NULL) {
|
||||
|
||||
SetMessageHandler(&Sprite::handleMessage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Sprite::~Sprite() {
|
||||
@ -71,7 +71,7 @@ bool Sprite::isPointInside(int16 x, int16 y) {
|
||||
}
|
||||
|
||||
bool Sprite::checkCollision(NRect &rect) {
|
||||
return (_collisionBounds.x1 < rect.x2) && (rect.x1 < _collisionBounds.x2) && (_collisionBounds.y1 < rect.y2) && (rect.y1 < _collisionBounds.y2);
|
||||
return (_collisionBounds.x1 < rect.x2) && (rect.x1 < _collisionBounds.x2) && (_collisionBounds.y1 < rect.y2) && (rect.y1 < _collisionBounds.y2);
|
||||
}
|
||||
|
||||
uint32 Sprite::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
|
||||
@ -153,13 +153,13 @@ void StaticSprite::updatePosition() {
|
||||
|
||||
if (!_surface)
|
||||
return;
|
||||
|
||||
|
||||
if (_doDeltaX) {
|
||||
_surface->getDrawRect().x = filterX(_x - _drawOffset.x - _drawOffset.width + 1);
|
||||
} else {
|
||||
_surface->getDrawRect().x = filterX(_x + _drawOffset.x);
|
||||
}
|
||||
|
||||
|
||||
if (_doDeltaY) {
|
||||
_surface->getDrawRect().y = filterY(_y - _drawOffset.y - _drawOffset.height + 1);
|
||||
} else {
|
||||
@ -261,7 +261,7 @@ void AnimatedSprite::updateAnim() {
|
||||
}
|
||||
if (_newAnimFileHash == 0 && _currFrameIndex != _currStickFrameIndex) {
|
||||
if (_currFrameTicks != 0 && (--_currFrameTicks == 0) && _animResource.getFrameCount() != 0) {
|
||||
|
||||
|
||||
if (_nextAnimFileHash != 0) {
|
||||
if (_animResource.load(_nextAnimFileHash)) {
|
||||
_currAnimFileHash = _nextAnimFileHash;
|
||||
@ -270,7 +270,7 @@ void AnimatedSprite::updateAnim() {
|
||||
_currAnimFileHash = 0;
|
||||
}
|
||||
if (_replOldColor != _replNewColor) {
|
||||
_animResource.setRepl(_replOldColor, _replNewColor);
|
||||
_animResource.setRepl(_replOldColor, _replNewColor);
|
||||
}
|
||||
_nextAnimFileHash = 0;
|
||||
if (_animStatus != 0) {
|
||||
@ -278,17 +278,17 @@ void AnimatedSprite::updateAnim() {
|
||||
_lastFrameIndex = _plLastFrameHash != 0 ? MAX<int16>(0, _animResource.getFrameIndex(_plLastFrameHash)) : _animResource.getFrameCount() - 1;
|
||||
} else {
|
||||
_currFrameIndex = _plFirstFrameIndex != -1 ? _plFirstFrameIndex : _animResource.getFrameCount() - 1;
|
||||
_lastFrameIndex = _plLastFrameIndex != -1 ? _plLastFrameIndex : _animResource.getFrameCount() - 1;
|
||||
_lastFrameIndex = _plLastFrameIndex != -1 ? _plLastFrameIndex : _animResource.getFrameCount() - 1;
|
||||
}
|
||||
} else {
|
||||
updateFrameIndex();
|
||||
}
|
||||
if (_newAnimFileHash == 0)
|
||||
updateFrameInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_newAnimFileHash != 0) {
|
||||
if (_animStatus == 2) {
|
||||
_currStickFrameIndex = _currFrameIndex;
|
||||
@ -301,7 +301,7 @@ void AnimatedSprite::updateAnim() {
|
||||
_currAnimFileHash = 0;
|
||||
}
|
||||
if (_replOldColor != _replNewColor) {
|
||||
_animResource.setRepl(_replOldColor, _replNewColor);
|
||||
_animResource.setRepl(_replOldColor, _replNewColor);
|
||||
}
|
||||
_newAnimFileHash = 0;
|
||||
_currFrameIndex = _plFirstFrameHash != 0 ? MAX<int16>(0, _animResource.getFrameIndex(_plFirstFrameHash)) : 0;
|
||||
@ -314,7 +314,7 @@ void AnimatedSprite::updateAnim() {
|
||||
_currAnimFileHash = 0;
|
||||
}
|
||||
if (_replOldColor != _replNewColor) {
|
||||
_animResource.setRepl(_replOldColor, _replNewColor);
|
||||
_animResource.setRepl(_replOldColor, _replNewColor);
|
||||
}
|
||||
_newAnimFileHash = 0;
|
||||
_currFrameIndex = _plFirstFrameIndex != -1 ? _plFirstFrameIndex : _animResource.getFrameCount() - 1;
|
||||
|
@ -33,13 +33,13 @@ StaticData::~StaticData() {
|
||||
void StaticData::load(const char *filename) {
|
||||
|
||||
Common::File fd;
|
||||
|
||||
|
||||
if (!fd.open(filename))
|
||||
error("StaticData::load() Could not open %s", filename);
|
||||
|
||||
fd.readUint32LE(); // magic
|
||||
|
||||
fd.readUint32LE(); // magic
|
||||
fd.readUint32LE(); // version
|
||||
|
||||
|
||||
// Load message lists
|
||||
uint32 messageListsCount = fd.readUint32LE();
|
||||
debug(3, "messageListsCount: %d", messageListsCount);
|
||||
@ -84,7 +84,7 @@ void StaticData::load(const char *filename) {
|
||||
}
|
||||
_rectLists[id] = rectList;
|
||||
}
|
||||
|
||||
|
||||
// Load hit rects
|
||||
uint32 hitRectListsCount = fd.readUint32LE();
|
||||
debug(3, "hitRectListsCount: %d", hitRectListsCount);
|
||||
|
@ -364,7 +364,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
|
||||
|
||||
// Load MIDI/XMI resource data
|
||||
if (_vm->getGameId() == GID_IHNM && _vm->isMacResources()) {
|
||||
// Load the external music file for Mac IHNM
|
||||
// Load the external music file for Mac IHNM
|
||||
_player->playQuickTime(Common::String::format("Music/Music%02x", resourceId), flags & MUSIC_LOOP);
|
||||
} else {
|
||||
if (_currentMusicBuffer == &_musicBuffer[1]) {
|
||||
|
@ -1966,7 +1966,7 @@ static bool isVertexCovered(const Patch &p, unsigned int wi) {
|
||||
// ---w1--1----p----w2--2----
|
||||
// ^ \ (inside)
|
||||
if (wi > p.indexw1 && wi <= p.indexw2)
|
||||
return true;
|
||||
return true;
|
||||
|
||||
// v / (outside)
|
||||
// ---w2--2----p----w1--1----
|
||||
|
@ -551,7 +551,7 @@ reg_t kMessage(EngineState *s, int argc, reg_t *argv) {
|
||||
// NOTE: To fix a corrupted jar object, type "send Glass_Jar message 52"
|
||||
// in the debugger.
|
||||
if (g_sci->getGameId() == GID_PEPPER && func == 0 && argc >= 6 && module == 894 &&
|
||||
tuple.noun == 26 && tuple.cond == 0 && tuple.seq == 1 &&
|
||||
tuple.noun == 26 && tuple.cond == 0 && tuple.seq == 1 &&
|
||||
!s->_msgState->getMessage(module, tuple, NULL_REG))
|
||||
tuple.verb = 0;
|
||||
|
||||
|
@ -745,7 +745,7 @@ void GfxFrameout::kernelFrameout() {
|
||||
// Process global scaling, if needed.
|
||||
// TODO: Seems like SCI32 always processes global scaling for scaled objects
|
||||
// TODO: We can only process symmetrical scaling for now (i.e. same value for scaleX/scaleY)
|
||||
if ((itemEntry->scaleSignal & kScaleSignalDoScaling32) &&
|
||||
if ((itemEntry->scaleSignal & kScaleSignalDoScaling32) &&
|
||||
!(itemEntry->scaleSignal & kScaleSignalDisableGlobalScaling32) &&
|
||||
(itemEntry->scaleX == itemEntry->scaleY) &&
|
||||
itemEntry->scaleX != 128)
|
||||
|
@ -1509,7 +1509,7 @@ void IMuseInternal::initGM(MidiDriver *midi) {
|
||||
midi->sysEx(buffer, 9);
|
||||
debug(2, "GS SysEx: GS Reset");
|
||||
_system->delayMillis(200);
|
||||
|
||||
|
||||
// Set global Master Tune to 442.0kHz, as on the MT-32
|
||||
memcpy(&buffer[4], "\x40\x00\x00\x00\x04\x04\x0F\x29", 8);
|
||||
midi->sysEx(buffer, 12);
|
||||
|
@ -124,7 +124,7 @@ bool Player_V3M::checkMusicAvailable() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GUI::MessageDialog dialog(_(
|
||||
"Could not find the 'Loom' Macintosh executable to read the\n"
|
||||
"instruments from. Music will be disabled."), _("OK"));
|
||||
|
@ -53,7 +53,7 @@ DynamicBitmap::DynamicBitmap(InputPersistenceBlock &reader, RenderObjectPtr<Rend
|
||||
bool DynamicBitmap::createRenderedImage(uint width, uint height) {
|
||||
bool result = false;
|
||||
_image.reset(new RenderedImage(width, height, result));
|
||||
|
||||
|
||||
_originalWidth = _width = width;
|
||||
_originalHeight = _height = height;
|
||||
|
||||
@ -77,7 +77,7 @@ bool DynamicBitmap::doRender(RectangleList *updateRects) {
|
||||
// Get the frame buffer object
|
||||
GraphicEngine *pGfx = Kernel::getInstance()->getGfx();
|
||||
assert(pGfx);
|
||||
|
||||
|
||||
// Draw the bitmap
|
||||
bool result;
|
||||
if (_scaleFactorX == 1.0f && _scaleFactorY == 1.0f) {
|
||||
|
@ -205,7 +205,7 @@ public:
|
||||
@brief Returns true, if the content of the BS_Image is allowed to be replaced by call of SetContent().
|
||||
*/
|
||||
virtual bool isSetContentAllowed() const = 0;
|
||||
|
||||
|
||||
virtual bool isSolid() const { return false; }
|
||||
|
||||
//@}
|
||||
|
@ -294,7 +294,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
|
||||
for (RectangleList::iterator it = updateRects->begin(); it != updateRects->end(); ++it) {
|
||||
const Common::Rect &clipRect = *it;
|
||||
|
||||
|
||||
int skipLeft = 0, skipTop = 0;
|
||||
int drawX = posX, drawY = posY;
|
||||
int drawWidth = img->w;
|
||||
@ -306,7 +306,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
drawWidth -= skipLeft;
|
||||
drawX = clipRect.left;
|
||||
}
|
||||
|
||||
|
||||
if (drawY < clipRect.top) {
|
||||
skipTop = clipRect.top - drawY;
|
||||
drawHeight -= skipTop;
|
||||
@ -315,13 +315,13 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
|
||||
if (drawX + drawWidth >= clipRect.right)
|
||||
drawWidth = clipRect.right - drawX;
|
||||
|
||||
|
||||
if (drawY + drawHeight >= clipRect.bottom)
|
||||
drawHeight = clipRect.bottom - drawY;
|
||||
|
||||
|
||||
if ((drawWidth > 0) && (drawHeight > 0)) {
|
||||
int xp = 0, yp = 0;
|
||||
|
||||
|
||||
int inStep = 4;
|
||||
int inoStep = img->pitch;
|
||||
if (flipping & Image::FLIP_V) {
|
||||
@ -330,14 +330,14 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
} else {
|
||||
xp = skipLeft;
|
||||
}
|
||||
|
||||
|
||||
if (flipping & Image::FLIP_H) {
|
||||
inoStep = -inoStep;
|
||||
yp = img->h - 1 - skipTop;
|
||||
} else {
|
||||
yp = skipTop;
|
||||
}
|
||||
|
||||
|
||||
byte *ino = (byte *)img->getBasePtr(xp, yp);
|
||||
byte *outo = (byte *)_backSurface->getBasePtr(drawX, drawY);
|
||||
|
||||
@ -351,7 +351,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
ino += inoStep;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
byte *in, *out;
|
||||
for (int i = 0; i < drawHeight; i++) {
|
||||
@ -361,7 +361,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
uint32 pix = *(uint32 *)in;
|
||||
int a = (pix >> 24) & 0xff;
|
||||
in += inStep;
|
||||
|
||||
|
||||
if (ca != 255) {
|
||||
a = a * ca >> 8;
|
||||
}
|
||||
@ -371,11 +371,11 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
out += 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
int b = (pix >> 0) & 0xff;
|
||||
int g = (pix >> 8) & 0xff;
|
||||
int r = (pix >> 16) & 0xff;
|
||||
|
||||
|
||||
if (a == 255) {
|
||||
#if defined(SCUMM_LITTLE_ENDIAN)
|
||||
if (cb != 255)
|
||||
@ -460,7 +460,7 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (imgScaled) {
|
||||
|
@ -84,7 +84,7 @@ bool Panel::doRender(RectangleList *updateRects) {
|
||||
gfxPtr->fill(&intersectionRect, _color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ bool RenderObject::updateObjectState() {
|
||||
|
||||
// Die Bounding-Box neu berechnen und Update-Regions registrieren.
|
||||
updateBoxes();
|
||||
|
||||
|
||||
++_version;
|
||||
|
||||
// Änderungen Validieren
|
||||
|
@ -236,7 +236,7 @@ public:
|
||||
@brief Löscht alle Kinderobjekte.
|
||||
*/
|
||||
void deleteAllChildren();
|
||||
|
||||
|
||||
// Accessor-Methoden
|
||||
// -----------------
|
||||
/**
|
||||
@ -305,11 +305,11 @@ public:
|
||||
int getZ() const {
|
||||
return _z;
|
||||
}
|
||||
|
||||
|
||||
int getAbsoluteZ() const {
|
||||
return _absoluteZ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@brief Gibt die Breite des Objektes zurück.
|
||||
*/
|
||||
@ -363,11 +363,11 @@ public:
|
||||
return _handle;
|
||||
}
|
||||
|
||||
// Get the RenderObjects current version
|
||||
// Get the RenderObjects current version
|
||||
int getVersion() const {
|
||||
return _version;
|
||||
}
|
||||
|
||||
|
||||
bool isSolid() const {
|
||||
return _isSolid;
|
||||
}
|
||||
@ -410,7 +410,7 @@ protected:
|
||||
bool _oldVisible;
|
||||
|
||||
static int _nextGlobalVersion;
|
||||
|
||||
|
||||
int _version;
|
||||
|
||||
// This should be set to true if the RenderObject is NOT alpha-blended to optimize drawing
|
||||
@ -509,9 +509,9 @@ private:
|
||||
@brief Berechnet die absolute Position des Objektes.
|
||||
*/
|
||||
int calcAbsoluteY() const;
|
||||
|
||||
|
||||
int calcAbsoluteZ() const;
|
||||
|
||||
|
||||
/**
|
||||
@brief Sortiert alle Kinderobjekte nach ihrem Renderang.
|
||||
*/
|
||||
|
@ -113,7 +113,7 @@ bool RenderObjectManager::render() {
|
||||
|
||||
RectangleList *updateRects = _uta->getRectangles();
|
||||
Common::Array<int> updateRectsMinZ;
|
||||
|
||||
|
||||
updateRectsMinZ.reserve(updateRects->size());
|
||||
|
||||
// Calculate the minimum drawing Z value of each update rectangle
|
||||
@ -144,9 +144,9 @@ bool RenderObjectManager::render() {
|
||||
}
|
||||
|
||||
delete updateRects;
|
||||
|
||||
|
||||
SWAP(_currQueue, _prevQueue);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ bool StaticBitmap::initBitmapResource(const Common::String &filename) {
|
||||
// RenderObject Eigenschaften aktualisieren
|
||||
_originalWidth = _width = bitmapPtr->getWidth();
|
||||
_originalHeight = _height = bitmapPtr->getHeight();
|
||||
|
||||
|
||||
_isSolid = bitmapPtr->isSolid();
|
||||
|
||||
// Bild-Resource freigeben
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user