2008-07-31 10:47:15 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2009-03-04 11:53:25 +00:00
|
|
|
#ifdef ENABLE_LOL
|
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
#ifndef KYRA_LOL_H
|
|
|
|
#define KYRA_LOL_H
|
|
|
|
|
|
|
|
#include "kyra/kyra_v1.h"
|
|
|
|
#include "kyra/script_tim.h"
|
2009-01-18 17:04:24 +00:00
|
|
|
#include "kyra/script.h"
|
2009-02-01 19:27:01 +00:00
|
|
|
#include "kyra/sound.h"
|
|
|
|
#include "kyra/gui_lol.h"
|
|
|
|
#include "kyra/text_lol.h"
|
2008-07-31 10:47:15 +00:00
|
|
|
|
|
|
|
#include "common/list.h"
|
|
|
|
|
|
|
|
namespace Kyra {
|
|
|
|
|
|
|
|
class Screen_LoL;
|
|
|
|
class WSAMovie_v2;
|
|
|
|
struct Button;
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
struct LoLCharacter {
|
|
|
|
uint16 flags;
|
|
|
|
char name[11];
|
|
|
|
uint8 raceClassSex;
|
|
|
|
int16 id;
|
|
|
|
uint8 curFaceFrame;
|
|
|
|
uint8 nextFaceFrame;
|
2009-02-21 17:24:50 +00:00
|
|
|
uint8 field_12;
|
|
|
|
const uint16 *defaultModifiers;
|
|
|
|
uint16 itemsMight[8];
|
2009-01-18 17:04:24 +00:00
|
|
|
uint16 field_27[2];
|
|
|
|
uint8 field_2B;
|
|
|
|
uint16 field_2C;
|
|
|
|
uint16 field_2E;
|
|
|
|
uint16 field_30;
|
|
|
|
uint16 field_32;
|
|
|
|
uint16 field_34;
|
|
|
|
uint8 field_36;
|
2009-02-21 17:24:50 +00:00
|
|
|
uint16 itemsProtection;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint16 hitPointsCur;
|
|
|
|
uint16 hitPointsMax;
|
|
|
|
uint16 magicPointsCur;
|
|
|
|
uint16 magicPointsMax;
|
|
|
|
uint8 field_41;
|
|
|
|
uint16 damageSuffered;
|
|
|
|
uint16 weaponHit;
|
2009-02-23 20:17:53 +00:00
|
|
|
uint16 totalMightModifier;
|
|
|
|
uint16 totalProtectionModifier;
|
|
|
|
uint16 might;
|
|
|
|
uint16 protection;
|
|
|
|
int16 nextAnimUpdateCountdown;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint16 items[11];
|
2009-02-21 17:24:50 +00:00
|
|
|
uint8 skillLevels[3];
|
|
|
|
uint8 skillModifiers[3];
|
|
|
|
int32 experiencePts[3];
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 arrayUnk2[5];
|
|
|
|
uint8 arrayUnk1[5];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SpellProperty {
|
|
|
|
uint16 field_0;
|
|
|
|
uint16 unkArr[4];
|
|
|
|
uint16 field_A;
|
|
|
|
uint16 field_C;
|
|
|
|
uint16 field_E;
|
|
|
|
uint16 spellNameCode;
|
|
|
|
uint16 mpRequired[4];
|
|
|
|
uint16 field_1A;
|
|
|
|
};
|
|
|
|
|
2009-01-19 07:31:34 +00:00
|
|
|
struct LevelBlockProperty {
|
|
|
|
uint8 walls[4];
|
2009-03-01 14:45:30 +00:00
|
|
|
uint16 itemMonsterIndex;
|
2009-02-23 20:17:53 +00:00
|
|
|
uint16 field_6;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 direction;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 flags;
|
|
|
|
};
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
struct MonsterProperty {
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 shapeIndex;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint8 maxWidth;
|
2009-02-21 17:24:50 +00:00
|
|
|
uint16 field2[2];
|
|
|
|
uint16 protection;
|
|
|
|
uint16 unk[6];
|
2009-02-01 19:27:01 +00:00
|
|
|
uint16 *pos;
|
|
|
|
uint16 unk2[8];
|
|
|
|
uint16 unk3[8];
|
2009-02-21 17:24:50 +00:00
|
|
|
uint16 itemProtection;
|
|
|
|
uint16 might;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint8 b;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint16 flags;
|
|
|
|
uint16 unk5;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint16 unk6[5];
|
|
|
|
uint8 unk7[4];
|
2009-03-03 22:32:39 +00:00
|
|
|
uint8 sounds[3];
|
2009-02-01 19:27:01 +00:00
|
|
|
};
|
|
|
|
|
2009-02-23 20:17:53 +00:00
|
|
|
struct MonsterInPlay {
|
2009-03-01 14:45:30 +00:00
|
|
|
uint16 next;
|
2009-02-23 20:17:53 +00:00
|
|
|
uint16 unk2;
|
|
|
|
uint8 unk4;
|
2009-01-19 07:31:34 +00:00
|
|
|
uint16 blockPropertyIndex;
|
2009-02-21 23:20:14 +00:00
|
|
|
uint16 x;
|
|
|
|
uint16 y;
|
2009-03-06 22:53:08 +00:00
|
|
|
int8 shiftStep;
|
2009-03-03 22:32:39 +00:00
|
|
|
uint16 destX;
|
|
|
|
uint16 destY;
|
|
|
|
uint8 destDirection;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 anon8;
|
|
|
|
uint8 anonh;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint8 anon9;
|
|
|
|
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 mode;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 field_15;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 id;
|
2009-03-03 22:32:39 +00:00
|
|
|
uint8 direction;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 facing;
|
|
|
|
uint16 flags;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 field_1B;
|
|
|
|
uint8 field_1C;
|
2009-03-01 14:45:30 +00:00
|
|
|
int16 might;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 field_1F;
|
2009-02-23 20:17:53 +00:00
|
|
|
uint8 type;
|
|
|
|
MonsterProperty *properties;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 field_25;
|
|
|
|
uint8 field_26;
|
|
|
|
uint8 field_27;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint16 assignedItems;
|
|
|
|
uint8 field_2A[4];
|
2009-01-18 17:04:24 +00:00
|
|
|
};
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
struct ItemInPlay {
|
2009-03-01 14:45:30 +00:00
|
|
|
uint16 next;
|
2009-02-23 20:17:53 +00:00
|
|
|
uint16 unk2;
|
|
|
|
uint8 unk4;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint16 blockPropertyIndex;
|
2009-02-21 23:20:14 +00:00
|
|
|
uint16 x;
|
|
|
|
uint16 y;
|
2009-02-01 19:27:01 +00:00
|
|
|
int8 level;
|
|
|
|
uint16 itemPropertyIndex;
|
|
|
|
uint16 shpCurFrame_flg;
|
2009-03-03 22:32:39 +00:00
|
|
|
uint8 destDirection;
|
2009-03-01 14:45:30 +00:00
|
|
|
uint8 anon8;
|
|
|
|
uint8 anonh;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint8 anon9;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ItemProperty {
|
|
|
|
uint16 nameStringId;
|
|
|
|
uint8 shpIndex;
|
|
|
|
uint16 flags;
|
2009-02-21 17:24:50 +00:00
|
|
|
uint16 type;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint8 itemScriptFunc;
|
2009-02-21 17:24:50 +00:00
|
|
|
int8 might;
|
|
|
|
uint8 skill;
|
|
|
|
uint8 protection;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint16 unkB;
|
|
|
|
uint8 unkD;
|
|
|
|
};
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
struct LevelShapeProperty {
|
|
|
|
uint16 shapeIndex[10];
|
|
|
|
uint8 scaleFlag[10];
|
|
|
|
uint16 shapeX[10];
|
|
|
|
uint16 shapeY[10];
|
|
|
|
int8 next;
|
|
|
|
uint8 flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CompassDef {
|
|
|
|
uint8 shapeIndex;
|
|
|
|
int8 x;
|
|
|
|
int8 y;
|
|
|
|
uint8 flags;
|
|
|
|
};
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
struct ButtonDef {
|
|
|
|
uint16 buttonflags;
|
2009-02-15 03:36:30 +00:00
|
|
|
uint16 keyCode;
|
|
|
|
uint16 keyCode2;
|
2009-02-01 19:27:01 +00:00
|
|
|
int16 x;
|
|
|
|
int16 y;
|
|
|
|
uint16 w;
|
|
|
|
uint16 h;
|
|
|
|
uint16 index;
|
2009-02-14 00:51:07 +00:00
|
|
|
uint16 screenDim;
|
2009-01-18 17:04:24 +00:00
|
|
|
};
|
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
class LoLEngine : public KyraEngine_v1 {
|
2009-02-01 19:27:01 +00:00
|
|
|
friend class GUI_LoL;
|
|
|
|
friend class TextDisplayer_LoL;
|
2009-02-02 23:20:55 +00:00
|
|
|
friend class TIMInterpreter_LoL;
|
2008-07-31 10:47:15 +00:00
|
|
|
public:
|
|
|
|
LoLEngine(OSystem *system, const GameFlags &flags);
|
|
|
|
~LoLEngine();
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
Screen *screen();
|
2009-02-01 19:27:01 +00:00
|
|
|
GUI *gui() const;
|
2008-07-31 10:47:15 +00:00
|
|
|
private:
|
|
|
|
Screen_LoL *_screen;
|
2009-02-01 19:27:01 +00:00
|
|
|
GUI_LoL *_gui;
|
2009-02-02 23:20:55 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
TIMInterpreter *_tim;
|
|
|
|
|
2008-11-06 17:05:54 +00:00
|
|
|
Common::Error init();
|
|
|
|
Common::Error go();
|
2008-07-31 10:47:15 +00:00
|
|
|
|
2008-12-26 11:04:45 +00:00
|
|
|
// initialization
|
2009-01-18 17:04:24 +00:00
|
|
|
void initStaticResource();
|
2008-12-26 11:04:45 +00:00
|
|
|
void preInit();
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
void loadItemIconShapes();
|
2008-12-26 11:04:45 +00:00
|
|
|
int mainMenu();
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
void startup();
|
|
|
|
void startupNew();
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// main loop
|
2009-01-18 17:04:24 +00:00
|
|
|
void runLoop();
|
2009-02-01 19:27:01 +00:00
|
|
|
void update();
|
2009-03-03 22:32:39 +00:00
|
|
|
void updateEnvironmentalSfx(int soundId);
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
// mouse
|
|
|
|
void setMouseCursorToIcon(int icon);
|
|
|
|
void setMouseCursorToItemInHand();
|
|
|
|
uint8 *getItemIconShapePtr(int index);
|
2009-02-01 19:27:01 +00:00
|
|
|
bool posWithinRect(int mouseX, int mouseY, int x1, int y1, int x2, int y2);
|
|
|
|
|
|
|
|
int _floatingMouseArrowControl;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
// intro
|
|
|
|
void setupPrologueData(bool load);
|
|
|
|
|
|
|
|
void showIntro();
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
struct CharacterPrev {
|
|
|
|
const char *name;
|
|
|
|
int x, y;
|
|
|
|
int attrib[3];
|
|
|
|
};
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
static const CharacterPrev _charPreviews[];
|
|
|
|
|
|
|
|
WSAMovie_v2 *_chargenWSA;
|
|
|
|
static const uint8 _chargenFrameTable[];
|
|
|
|
int chooseCharacter();
|
|
|
|
|
|
|
|
void kingSelectionIntro();
|
|
|
|
void kingSelectionReminder();
|
|
|
|
void kingSelectionOutro();
|
|
|
|
void processCharacterSelection();
|
|
|
|
void updateSelectionAnims();
|
|
|
|
int selectionCharInfo(int character);
|
|
|
|
void selectionCharInfoIntro(char *file);
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
int getCharSelection();
|
|
|
|
int selectionCharAccept();
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
int _charSelection;
|
|
|
|
int _charSelectionInfoResult;
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
uint32 _selectionAnimTimers[4];
|
|
|
|
uint8 _selectionAnimFrames[4];
|
|
|
|
static const uint8 _selectionAnimIndexTable[];
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
static const uint16 _selectionPosTable[];
|
|
|
|
|
|
|
|
static const uint8 _selectionChar1IdxTable[];
|
|
|
|
static const uint8 _selectionChar2IdxTable[];
|
|
|
|
static const uint8 _selectionChar3IdxTable[];
|
|
|
|
static const uint8 _selectionChar4IdxTable[];
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
static const uint8 _reminderChar1IdxTable[];
|
|
|
|
static const uint8 _reminderChar2IdxTable[];
|
|
|
|
static const uint8 _reminderChar3IdxTable[];
|
|
|
|
static const uint8 _reminderChar4IdxTable[];
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
static const uint8 _charInfoFrameTable[];
|
|
|
|
|
2009-02-21 23:20:14 +00:00
|
|
|
// timers
|
|
|
|
void setupTimers();
|
|
|
|
void enableTimer(int id);
|
|
|
|
|
2009-03-06 22:53:08 +00:00
|
|
|
void timerProcessDoors(int timerNum);
|
2009-03-01 14:45:30 +00:00
|
|
|
void timerProcessMonsters(int timerNum);
|
2009-02-21 23:20:14 +00:00
|
|
|
void timerSub3(int timerNum);
|
|
|
|
void timerSub4(int timerNum);
|
|
|
|
void timerSub5(int timerNum);
|
|
|
|
void timerSub6(int timerNum);
|
2009-02-23 20:17:53 +00:00
|
|
|
void timerUpdatePortraitAnimations(int skipUpdate);
|
2009-02-21 23:20:14 +00:00
|
|
|
void timerUpdateLampState(int timerNum);
|
|
|
|
void timerFadeMessageText(int timerNum);
|
2008-07-31 10:47:15 +00:00
|
|
|
|
2009-03-06 22:53:08 +00:00
|
|
|
static const uint8 _clock2Timers[];
|
|
|
|
static const uint8 _numClock2Timers;
|
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
// sound
|
2009-01-19 23:35:27 +00:00
|
|
|
void loadTalkFile(int index);
|
2009-02-01 19:27:01 +00:00
|
|
|
void snd_playVoiceFile(int track) {}
|
|
|
|
bool snd_playCharacterSpeech(int id, int8 speaker, int);
|
|
|
|
int snd_characterSpeaking();
|
2009-02-16 17:17:15 +00:00
|
|
|
void snd_stopSpeech(bool setFlag);
|
2009-01-18 17:04:24 +00:00
|
|
|
void snd_playSoundEffect(int track, int volume);
|
2009-03-03 22:32:39 +00:00
|
|
|
void snd_processEnvironmentalSoundEffect(int soundId, int block);
|
2009-01-19 23:35:27 +00:00
|
|
|
void snd_loadSoundFile(int track);
|
|
|
|
int snd_playTrack(int track);
|
|
|
|
int snd_stopMusic();
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
int _lastSpeechId;
|
|
|
|
int _lastSpeaker;
|
|
|
|
char _activeVoiceFile[13];
|
2009-01-18 17:04:24 +00:00
|
|
|
int _lastSfxTrack;
|
2009-01-19 23:35:27 +00:00
|
|
|
int _lastMusicTrack;
|
|
|
|
int _curMusicFileIndex;
|
2009-01-18 23:50:31 +00:00
|
|
|
char _curMusicFileExt;
|
2009-03-03 22:32:39 +00:00
|
|
|
int _environmentSfx;
|
|
|
|
int _environmentSfxVol;
|
|
|
|
int _environmentSfxDistThreshold;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
int _curTlkFile;
|
|
|
|
int _speechFlag;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
char **_ingameSoundList;
|
|
|
|
int _ingameSoundListSize;
|
|
|
|
|
2009-01-18 23:50:31 +00:00
|
|
|
const uint8 *_musicTrackMap;
|
|
|
|
int _musicTrackMapSize;
|
2009-01-18 17:04:24 +00:00
|
|
|
const uint16 *_ingameSoundIndex;
|
|
|
|
int _ingameSoundIndexSize;
|
|
|
|
const uint8 *_ingameGMSoundIndex;
|
|
|
|
int _ingameGMSoundIndexSize;
|
|
|
|
const uint8 *_ingameMT32SoundIndex;
|
|
|
|
int _ingameMT32SoundIndexSize;
|
2009-02-14 00:51:07 +00:00
|
|
|
/*const uint8 *_ingameADLSoundIndex;
|
|
|
|
int _ingameADLSoundIndexSize;*/
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
// gui
|
|
|
|
void gui_drawPlayField();
|
|
|
|
void gui_drawScene(int pageNum);
|
|
|
|
void gui_drawAllCharPortraitsWithStats();
|
|
|
|
void gui_drawCharPortraitWithStats(int charNum);
|
2009-02-01 19:27:01 +00:00
|
|
|
void gui_drawBox(int x, int y, int w, int h, int frameColor1, int frameColor2, int fillColor);
|
2009-01-18 17:04:24 +00:00
|
|
|
void gui_drawCharFaceShape(int charNum, int x, int y, int pageNum);
|
2009-02-14 14:33:26 +00:00
|
|
|
void gui_highlightPortraitFrame(int charNum);
|
2009-01-18 17:04:24 +00:00
|
|
|
void gui_drawLiveMagicBar(int x, int y, int curPoints, int unk, int maxPoints, int w, int h, int col1, int col2, int flag);
|
|
|
|
void gui_drawMoneyBox(int pageNum);
|
|
|
|
void gui_drawInventory();
|
|
|
|
void gui_drawInventoryItem(int index);
|
|
|
|
void gui_drawCompass();
|
|
|
|
void gui_drawScroll();
|
2009-02-14 00:51:07 +00:00
|
|
|
void gui_highlightSelectedSpell(int unk);
|
2009-02-21 17:24:50 +00:00
|
|
|
void gui_displayCharInventory(int charNum);
|
|
|
|
void gui_printCharInventoryStats(int charNum);
|
|
|
|
void gui_printCharacterStats(int index, int redraw, int value);
|
|
|
|
void gui_changeCharacterStats(int charNum);
|
|
|
|
void gui_drawCharInventoryItem(int itemIndex);
|
|
|
|
void gui_drawBarGraph(int x, int y, int w, int h, int32 curVal, int32 maxVal, int col1, int col2);
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
int gui_enableControls();
|
|
|
|
int gui_disableControls(int controlMode);
|
2009-02-14 00:51:07 +00:00
|
|
|
void gui_toggleButtonDisplayMode(int shapeIndex, int mode);
|
2009-02-01 19:27:01 +00:00
|
|
|
void gui_toggleFightButtons(bool disable);
|
2009-02-14 00:51:07 +00:00
|
|
|
void gui_prepareForSequence(int x, int y, int w, int h, int buttonFlags);
|
2009-02-01 19:27:01 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
bool _weaponsDisabled;
|
2009-02-14 00:51:07 +00:00
|
|
|
int _lastButtonShape;
|
|
|
|
uint32 _buttonPressTimer;
|
2009-02-01 19:27:01 +00:00
|
|
|
int _selectedCharacter;
|
|
|
|
int _compassDirection;
|
|
|
|
int _compassUnk;
|
2009-01-18 17:04:24 +00:00
|
|
|
int _compassDirectionIndex;
|
2009-02-21 17:24:50 +00:00
|
|
|
int _charInventoryUnk;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
const CompassDef *_compassDefs;
|
|
|
|
int _compassDefsSize;
|
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
void gui_updateInput();
|
2009-02-16 17:17:15 +00:00
|
|
|
void gui_triggerEvent(int eventType);
|
2009-02-14 00:51:07 +00:00
|
|
|
void gui_enableDefaultPlayfieldButtons();
|
|
|
|
void gui_enableSequenceButtons(int x, int y, int w, int h, int enableFlags);
|
2009-02-21 17:24:50 +00:00
|
|
|
void gui_enableCharInventoryButtons(int charNum);
|
2009-02-14 00:51:07 +00:00
|
|
|
|
|
|
|
void gui_resetButtonList();
|
|
|
|
void gui_initButtonsFromList(const int16 *list);
|
|
|
|
void gui_initCharacterControlButtons(int index, int xOffs);
|
2009-02-21 17:24:50 +00:00
|
|
|
void gui_initCharInventorySpecialButtons(int charNum);
|
2009-02-14 00:51:07 +00:00
|
|
|
void gui_initMagicScrollButtons();
|
2009-02-16 17:17:15 +00:00
|
|
|
void gui_initMagicSubmenu(int charNum);
|
2009-02-21 17:24:50 +00:00
|
|
|
void gui_initButton(int index, int x = -1, int y = -1, int val = -1);
|
2009-02-16 21:46:02 +00:00
|
|
|
void gui_notifyButtonListChanged() { if (_gui) _gui->_buttonListChanged = true; }
|
2009-02-14 00:51:07 +00:00
|
|
|
void assignButtonCallback(Button *button, int index);
|
|
|
|
|
|
|
|
Button *_activeButtons;
|
|
|
|
ButtonDef _sceneWindowButton;
|
2009-02-16 17:17:15 +00:00
|
|
|
bool _preserveEvents;
|
2009-02-01 19:27:01 +00:00
|
|
|
|
|
|
|
int clickedUpArrow(Button *button);
|
|
|
|
int clickedDownArrow(Button *button);
|
|
|
|
int clickedLeftArrow(Button *button);
|
|
|
|
int clickedRightArrow(Button *button);
|
|
|
|
int clickedTurnLeftArrow(Button *button);
|
|
|
|
int clickedTurnRightArrow(Button *button);
|
|
|
|
int clickedAttackButton(Button *button);
|
|
|
|
int clickedMagicButton(Button *button);
|
2009-02-16 17:17:15 +00:00
|
|
|
int clickedMagicSubmenu(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int clickedScreen(Button *button);
|
|
|
|
int clickedPortraitLeft(Button *button);
|
|
|
|
int clickedLiveMagicBarsLeft(Button *button);
|
|
|
|
int clickedPortraitEtcRight(Button *button);
|
2009-02-21 17:24:50 +00:00
|
|
|
int clickedCharInventorySlot(Button *button);
|
|
|
|
int clickedExitCharInventory(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int clickedUnk16(Button *button);
|
2009-02-23 20:17:53 +00:00
|
|
|
int clickedScenePickupItem(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int clickedInventorySlot(Button *button);
|
|
|
|
int clickedInventoryScroll(Button *button);
|
2009-03-01 14:45:30 +00:00
|
|
|
int clickedWall(Button *button);
|
2009-03-01 20:37:57 +00:00
|
|
|
int clickedSequenceWindow(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int clickedScroll(Button *button);
|
|
|
|
int clickedUnk23(Button *button);
|
|
|
|
int clickedUnk24(Button *button);
|
2009-02-23 20:17:53 +00:00
|
|
|
int clickedSceneDropItem(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int clickedOptions(Button *button);
|
|
|
|
int clickedRestParty(Button *button);
|
2009-02-14 00:51:07 +00:00
|
|
|
int clickedMoneyBox(Button *button);
|
|
|
|
int clickedCompass(Button *button);
|
|
|
|
int clickedAutomap(Button *button);
|
|
|
|
int clickedLamp(Button *button);
|
2009-02-01 19:27:01 +00:00
|
|
|
int clickedUnk32(Button *button);
|
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
const ButtonDef *_buttonData;
|
|
|
|
int _buttonDataSize;
|
|
|
|
const int16 *_buttonList1;
|
|
|
|
int _buttonList1Size;
|
|
|
|
const int16 *_buttonList2;
|
|
|
|
int _buttonList2Size;
|
|
|
|
const int16 *_buttonList3;
|
|
|
|
int _buttonList3Size;
|
|
|
|
const int16 *_buttonList4;
|
|
|
|
int _buttonList4Size;
|
|
|
|
const int16 *_buttonList5;
|
|
|
|
int _buttonList5Size;
|
|
|
|
const int16 *_buttonList6;
|
|
|
|
int _buttonList6Size;
|
|
|
|
const int16 *_buttonList7;
|
|
|
|
int _buttonList7Size;
|
|
|
|
const int16 *_buttonList8;
|
|
|
|
int _buttonList8Size;
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// text
|
2009-02-23 20:17:53 +00:00
|
|
|
bool characterSays(int track, int charId, bool redraw);
|
2009-03-01 20:37:57 +00:00
|
|
|
int playCharacterScriptChat(int charId, int y, int unk1, char *str, EMCState *script, const uint16 *paramList, int16 paramIndex);
|
2009-02-23 20:17:53 +00:00
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
TextDisplayer_LoL *_txt;
|
2009-02-01 19:27:01 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
// emc scripts
|
2009-03-01 14:45:30 +00:00
|
|
|
void runInitScript(const char *filename, int optionalFunc);
|
2009-01-18 17:04:24 +00:00
|
|
|
void runInfScript(const char *filename);
|
2009-02-21 23:20:14 +00:00
|
|
|
void runLevelScript(int block, int sub);
|
|
|
|
void runLevelScriptCustom(int block, int sub, int charNum, int item, int reg3, int reg4);
|
2009-03-01 14:45:30 +00:00
|
|
|
bool checkSceneUpdateNeed(int func);
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
EMCData _scriptData;
|
2009-03-01 14:45:30 +00:00
|
|
|
bool _suspendScript;
|
2009-02-14 00:51:07 +00:00
|
|
|
uint16 _scriptDirection;
|
2009-01-18 23:50:31 +00:00
|
|
|
uint16 _currentDirection;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint16 _currentBlock;
|
2009-02-01 19:27:01 +00:00
|
|
|
bool _sceneUpdateRequired;
|
2009-02-14 00:51:07 +00:00
|
|
|
int16 _currentBlockPropertyIndex[18];
|
2009-01-18 17:04:24 +00:00
|
|
|
uint16 _gameFlags[15];
|
2009-01-19 23:35:27 +00:00
|
|
|
uint16 _unkEMC46[16];
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
// emc opcode
|
2009-03-01 20:37:57 +00:00
|
|
|
int olol_drawScene(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_setGameFlag(EMCState *script);
|
|
|
|
int olol_testGameFlag(EMCState *script);
|
|
|
|
int olol_loadLevelGraphics(EMCState *script);
|
|
|
|
int olol_loadCmzFile(EMCState *script);
|
|
|
|
int olol_loadMonsterShapes(EMCState *script);
|
2009-03-06 23:59:12 +00:00
|
|
|
int olol_deleteHandItem(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_allocItemPropertiesBuffer(EMCState *script);
|
|
|
|
int olol_setItemProperty(EMCState *script);
|
2009-02-14 13:55:00 +00:00
|
|
|
int olol_makeItem(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_getItemPara(EMCState *script);
|
|
|
|
int olol_getCharacterStat(EMCState *script);
|
|
|
|
int olol_setCharacterStat(EMCState *script);
|
|
|
|
int olol_loadLevelShapes(EMCState *script);
|
|
|
|
int olol_closeLevelShapeFile(EMCState *script);
|
|
|
|
int olol_loadDoorShapes(EMCState *script);
|
2009-02-01 19:27:01 +00:00
|
|
|
int olol_initAnimStruct(EMCState *script);
|
|
|
|
int olol_freeAnimStruct(EMCState *script);
|
2009-02-23 20:17:53 +00:00
|
|
|
int olol_getDirection(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_setMusicTrack(EMCState *script);
|
2009-02-23 20:17:53 +00:00
|
|
|
int olol_clearDialogueField(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_getUnkArrayVal(EMCState *script);
|
|
|
|
int olol_setUnkArrayVal(EMCState *script);
|
|
|
|
int olol_setGlobalVar(EMCState *script);
|
|
|
|
int olol_mapShapeToBlock(EMCState *script);
|
|
|
|
int olol_resetBlockShapeAssignment(EMCState *script);
|
2009-03-01 14:45:30 +00:00
|
|
|
int olol_initMonster(EMCState *script);
|
2009-02-01 19:27:01 +00:00
|
|
|
int olol_loadMonsterProperties(EMCState *script);
|
2009-03-03 22:32:39 +00:00
|
|
|
int olol_moveMonster(EMCState *script);
|
2009-02-21 23:20:14 +00:00
|
|
|
int olol_setScriptTimer(EMCState *script);
|
2009-02-01 19:27:01 +00:00
|
|
|
int olol_loadTimScript(EMCState *script);
|
|
|
|
int olol_runTimScript(EMCState *script);
|
|
|
|
int olol_releaseTimScript(EMCState *script);
|
|
|
|
int olol_initDialogueSequence(EMCState *script);
|
|
|
|
int olol_restoreSceneAfterDialogueSequence(EMCState *script);
|
2009-03-01 14:45:30 +00:00
|
|
|
int olol_giveItemToMonster(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_loadLangFile(EMCState *script);
|
2009-03-01 14:45:30 +00:00
|
|
|
int olol_playSoundEffect(EMCState *script);
|
2009-02-01 19:27:01 +00:00
|
|
|
int olol_stopTimScript(EMCState *script);
|
2009-03-06 22:53:08 +00:00
|
|
|
int olol_playCharacterScriptChat(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_loadSoundFile(EMCState *script);
|
|
|
|
int olol_setPaletteBrightness(EMCState *script);
|
2009-03-01 14:45:30 +00:00
|
|
|
int olol_printMessage(EMCState *script);
|
2009-02-01 19:27:01 +00:00
|
|
|
int olol_playDialogueTalkText(EMCState *script);
|
2009-03-06 22:53:08 +00:00
|
|
|
int olol_checkForMonsterMode1(EMCState *script);
|
2009-02-01 19:27:01 +00:00
|
|
|
int olol_setNextFunc(EMCState *script);
|
2009-02-23 20:17:53 +00:00
|
|
|
int olol_setDoorState(EMCState *script);
|
2009-01-20 09:22:16 +00:00
|
|
|
int olol_assignCustomSfx(EMCState *script);
|
2009-02-23 20:17:53 +00:00
|
|
|
int olol_resetPortraitsArea(EMCState *script);
|
2009-03-03 22:32:39 +00:00
|
|
|
int olol_enableSysTimer(EMCState *script);
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// tim scripts
|
|
|
|
TIM *_activeTim[10];
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
// tim opcode
|
2008-07-31 10:47:15 +00:00
|
|
|
void setupOpcodeTable();
|
|
|
|
|
|
|
|
Common::Array<const TIMOpcode*> _timIntroOpcodes;
|
|
|
|
int tlol_setupPaletteFade(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_loadPalette(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_setupPaletteFadeEx(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_processWsaFrame(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_displayText(const TIM *tim, const uint16 *param);
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2009-03-01 20:37:57 +00:00
|
|
|
int tlol_initDialogueSequence(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_restoreSceneAfterDialogueSequence(const TIM *tim, const uint16 *param);
|
2009-03-06 23:59:12 +00:00
|
|
|
int tlol_giveItem(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_setPartyPosition(const TIM *tim, const uint16 *param);
|
2009-03-01 20:37:57 +00:00
|
|
|
int tlol_fadeClearWindow(const TIM *tim, const uint16 *param);
|
2009-03-06 22:53:08 +00:00
|
|
|
int tlol_update(const TIM *tim, const uint16 *param);
|
2009-03-06 23:59:12 +00:00
|
|
|
int tlol_loadSoundFile(const TIM *tim, const uint16 *param);
|
|
|
|
int tlol_playMusicTrack(const TIM *tim, const uint16 *param);
|
2009-03-01 20:37:57 +00:00
|
|
|
int tlol_playDialogueTalkText(const TIM *tim, const uint16 *param);
|
2009-03-06 23:59:12 +00:00
|
|
|
int tlol_playSoundEffect(const TIM *tim, const uint16 *param);
|
2009-03-01 20:37:57 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
Common::Array<const TIMOpcode*> _timIngameOpcodes;
|
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
// translation
|
|
|
|
int _lang;
|
|
|
|
|
2008-12-26 11:04:45 +00:00
|
|
|
uint8 *_landsFile;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 *_levelLangFile;
|
2008-12-26 11:04:45 +00:00
|
|
|
|
|
|
|
int _lastUsedStringBuffer;
|
|
|
|
char _stringBuffer[5][512]; // TODO: The original used a size of 512, it looks a bit large.
|
|
|
|
// Maybe we can someday reduce the size.
|
2009-02-01 19:27:01 +00:00
|
|
|
char *getLangString(uint16 id);
|
2008-12-26 11:04:45 +00:00
|
|
|
uint8 *getTableEntry(uint8 *buffer, uint16 id);
|
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
static const char * const _languageExt[];
|
2008-12-26 11:04:45 +00:00
|
|
|
|
|
|
|
// graphics
|
2009-01-18 17:04:24 +00:00
|
|
|
void setupScreenDims();
|
2009-02-01 19:27:01 +00:00
|
|
|
void initDialogueSequence(int controlMode);
|
|
|
|
void restoreSceneAfterDialogueSequence(int redraw);
|
2009-02-23 20:17:53 +00:00
|
|
|
void resetPortraitsArea();
|
2009-02-01 19:27:01 +00:00
|
|
|
void toggleSelectedCharacterFrame(bool mode);
|
2009-02-14 00:51:07 +00:00
|
|
|
void fadeText();
|
2009-02-01 19:27:01 +00:00
|
|
|
void updateWsaAnimations();
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
uint8 **_itemIconShapes;
|
|
|
|
int _numItemIconShapes;
|
|
|
|
uint8 **_itemShapes;
|
|
|
|
int _numItemShapes;
|
|
|
|
uint8 **_gameShapes;
|
|
|
|
int _numGameShapes;
|
|
|
|
uint8 **_thrownShapes;
|
|
|
|
int _numThrownShapes;
|
|
|
|
uint8 **_iceShapes;
|
|
|
|
int _numIceShapes;
|
|
|
|
uint8 **_fireballShapes;
|
|
|
|
int _numFireballShapes;
|
|
|
|
|
|
|
|
const int8 *_gameShapeMap;
|
|
|
|
int _gameShapeMapSize;
|
|
|
|
|
|
|
|
uint8 *_characterFaceShapes[40][3];
|
|
|
|
|
|
|
|
// characters
|
|
|
|
bool addCharacter(int id);
|
|
|
|
void initCharacter(int charNum, int firstFaceFrame, int unk2, int redraw);
|
|
|
|
void initCharacterUnkSub(int charNum, int unk1, int unk2, int unk3);
|
|
|
|
int countActiveCharacters();
|
|
|
|
void loadCharFaceShapes(int charNum, int id);
|
|
|
|
void calcCharPortraitXpos();
|
|
|
|
|
2009-02-16 17:17:15 +00:00
|
|
|
void updatePortraitSpeechAnim();
|
2009-01-18 17:04:24 +00:00
|
|
|
void updatePortraits();
|
2009-02-14 13:55:00 +00:00
|
|
|
void initTextFading(int textType, int clearField);
|
2009-01-18 17:04:24 +00:00
|
|
|
void setCharFaceFrame(int charNum, int frameNum);
|
|
|
|
void faceFrameRefresh(int charNum);
|
|
|
|
|
2009-02-21 17:24:50 +00:00
|
|
|
void recalcCharacterStats(int charNum);
|
|
|
|
int calculateCharacterStats(int charNum, int index);
|
|
|
|
int calculateProtection(int index);
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
LoLCharacter *_characters;
|
|
|
|
uint16 _activeCharsXpos[3];
|
2009-02-01 19:27:01 +00:00
|
|
|
int _updateFlags;
|
2009-01-18 17:04:24 +00:00
|
|
|
int _updateCharNum;
|
2009-02-23 20:17:53 +00:00
|
|
|
int _updatePortraitSpeechAnimDuration;
|
|
|
|
int _portraitSpeechAnimMode;
|
2009-01-18 17:04:24 +00:00
|
|
|
int _updateCharV3;
|
2009-02-14 00:51:07 +00:00
|
|
|
int _textColourFlag;
|
|
|
|
bool _fadeText;
|
2009-02-01 19:27:01 +00:00
|
|
|
int _hideInventory;
|
|
|
|
uint32 _palUpdateTimer;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint32 _updatePortraitNext;
|
|
|
|
|
|
|
|
int _loadLevelFlag;
|
|
|
|
int _levelFlagUnk;
|
2009-02-14 00:51:07 +00:00
|
|
|
int _unkCharNum;
|
2009-02-21 17:24:50 +00:00
|
|
|
int _charStatsTemp[5];
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
const LoLCharacter *_charDefaults;
|
|
|
|
int _charDefaultsSize;
|
|
|
|
|
2009-02-21 17:24:50 +00:00
|
|
|
const uint16 *_charDefsMan;
|
|
|
|
int _charDefsManSize;
|
|
|
|
const uint16 *_charDefsWoman;
|
|
|
|
int _charDefsWomanSize;
|
|
|
|
const uint16 *_charDefsKieran;
|
|
|
|
int _charDefsKieranSize;
|
|
|
|
const uint16 *_charDefsAkshel;
|
|
|
|
int _charDefsAkshelSize;
|
|
|
|
const int32 *_expRequirements;
|
|
|
|
int _expRequirementsSize;
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// lamp
|
|
|
|
void resetLampStatus();
|
|
|
|
void setLampMode(bool lampOn);
|
|
|
|
void updateLampStatus();
|
|
|
|
|
|
|
|
int _lampOilStatus;
|
|
|
|
int _brightness;
|
|
|
|
int _lampStatusUnk;
|
|
|
|
uint32 _lampStatusTimer;
|
|
|
|
bool _lampStatusSuspended;
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
// level
|
|
|
|
void loadLevel(int index);
|
|
|
|
void addLevelItems();
|
|
|
|
void loadLevelWLL(int index, bool mapShapes);
|
2009-01-19 07:31:34 +00:00
|
|
|
void moveItemToBlock(uint16 *cmzItemIndex, uint16 item);
|
2009-01-18 17:04:24 +00:00
|
|
|
int assignLevelShapes(int index);
|
|
|
|
uint8 *getLevelShapes(int index);
|
2009-01-19 07:31:34 +00:00
|
|
|
void loadLevelCmzFile(int index);
|
2009-01-18 17:04:24 +00:00
|
|
|
void loadCMZ_Sub(int index1, int index2);
|
|
|
|
void loadCmzFile(const char *file);
|
|
|
|
void loadLevelShpDat(const char *shpFile, const char *datFile, bool flag);
|
2009-01-18 23:50:31 +00:00
|
|
|
void loadLevelGraphics(const char *file, int specialColor, int weight, int vcnLen, int vmpLen, const char *palFile);
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-01-19 23:35:27 +00:00
|
|
|
void resetItems(int flag);
|
|
|
|
void resetLvlBuffer();
|
|
|
|
void resetBlockProperties();
|
2009-02-14 00:51:07 +00:00
|
|
|
bool testWallFlag(int block, int direction, int flag);
|
2009-01-19 23:35:27 +00:00
|
|
|
bool testWallInvisibility(int block, int direction);
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
void drawScene(int pageNum);
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-19 07:31:34 +00:00
|
|
|
void generateBlockDrawingBuffer(int block, int direction);
|
2009-01-18 17:04:24 +00:00
|
|
|
void generateBlockDrawingBufferF0(int16 wllOffset, uint8 wllIndex, uint8 wllVmpIndex, int16 vmpOffset, uint8 len, uint8 numEntries);
|
|
|
|
void generateBlockDrawingBufferF1(int16 wllOffset, uint8 wllIndex, uint8 wllVmpIndex, int16 vmpOffset, uint8 len, uint8 numEntries);
|
2009-01-19 07:31:34 +00:00
|
|
|
bool hasWall(int index);
|
|
|
|
void assignBlockCaps(int block, int direction);
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
void drawVcnBlocks(uint8 *vcnBlocks, uint16 *blockDrawingBuffer, uint8 *vcnShift, int pageNum);
|
|
|
|
void drawSceneShapes();
|
|
|
|
void setLevelShapesDim(int index, int16 &x1, int16 &x2, int dim);
|
|
|
|
void scaleLevelShapesDim(int index, int16 &y1, int16 &y2, int dim);
|
|
|
|
void drawLevelModifyScreenDim(int dim, int16 x1, int16 y1, int16 x2, int16 y2);
|
|
|
|
void drawDecorations(int index);
|
|
|
|
void drawIceShapes(int index, int iceShapeIndex);
|
|
|
|
void drawScriptShapes(int pageNum);
|
|
|
|
void updateSceneWindow();
|
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
void setSequenceGui(int x, int y, int w, int h, int enableFlags);
|
|
|
|
void restoreDefaultGui();
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
void updateCompass();
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
void moveParty(uint16 direction, int unk1, int unk2, int buttonShape);
|
|
|
|
bool checkBlockPassability(uint16 block, uint16 direction);
|
2009-02-14 13:55:00 +00:00
|
|
|
void notifyBlockNotPassable(int scrollFlag);
|
2009-02-14 00:51:07 +00:00
|
|
|
|
2009-03-01 14:45:30 +00:00
|
|
|
uint16 calcNewBlockPosition(uint16 curBlock, uint16 direction);
|
|
|
|
uint16 calcBlockIndex(uint16 x, uint16 y);
|
|
|
|
void calcCoordinates(uint16 & x, uint16 & y, int block, uint16 xOffs, uint16 yOffs);
|
|
|
|
|
|
|
|
int clickedWallShape(uint16 block, uint16 direction);
|
|
|
|
int clicked2(uint16 block, uint16 direction);
|
|
|
|
int clicked3(uint16 block, uint16 direction);
|
|
|
|
int clickedWallOnlyScript(uint16 block);
|
|
|
|
int clickedDoorSwitch(uint16 block, uint16 direction);
|
|
|
|
int clicked6(uint16 block, uint16 direction);
|
2009-03-06 22:53:08 +00:00
|
|
|
|
2009-02-23 20:17:53 +00:00
|
|
|
bool clickedShape(int shapeIndex);
|
2009-03-06 22:53:08 +00:00
|
|
|
void processDoorSwitch(uint16 block, int unk);
|
|
|
|
void openCloseDoor(uint16 block, int openClose);
|
2009-02-23 20:17:53 +00:00
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
void movePartySmoothScrollBlocked(int speed);
|
|
|
|
void movePartySmoothScrollUp(int speed);
|
|
|
|
void movePartySmoothScrollDown(int speed);
|
|
|
|
void movePartySmoothScrollLeft(int speed);
|
|
|
|
void movePartySmoothScrollRight(int speed);
|
|
|
|
void movePartySmoothScrollTurnLeft(int speed);
|
|
|
|
void movePartySmoothScrollTurnRight(int speed);
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
int smoothScrollDrawSpecialShape(int pageNum);
|
2009-01-18 17:04:24 +00:00
|
|
|
void setLF2(int block);
|
2009-02-14 00:51:07 +00:00
|
|
|
|
2009-03-06 22:53:08 +00:00
|
|
|
struct OpenDoorState {
|
|
|
|
uint16 block;
|
|
|
|
int8 field_2;
|
|
|
|
int8 state;
|
|
|
|
};
|
|
|
|
|
|
|
|
OpenDoorState _openDoorState[3];
|
|
|
|
int _emcDoorState;
|
|
|
|
|
2009-02-14 00:51:07 +00:00
|
|
|
uint8 *_scrollSceneBuffer;
|
|
|
|
uint32 _smoothScrollTimer;
|
|
|
|
int _smoothScrollModeNormal;
|
|
|
|
|
|
|
|
const uint8 *_scrollXTop;
|
|
|
|
int _scrollXTopSize;
|
|
|
|
const uint8 *_scrollYTop;
|
|
|
|
int _scrollYTopSize;
|
|
|
|
const uint8 *_scrollXBottom;
|
|
|
|
int _scrollXBottomSize;
|
|
|
|
const uint8 *_scrollYBottom;
|
|
|
|
int _scrollYBottomSize;
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
int _unkFlag;
|
2009-02-01 19:27:01 +00:00
|
|
|
int _nextScriptFunc;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 _currentLevel;
|
2009-02-14 00:51:07 +00:00
|
|
|
int _sceneDefaultUpdate;
|
2009-01-18 17:04:24 +00:00
|
|
|
int _lvlBlockIndex;
|
|
|
|
int _lvlShapeIndex;
|
|
|
|
bool _unkDrawLevelBool;
|
|
|
|
uint8 *_vcnBlocks;
|
|
|
|
uint8 *_vcnShift;
|
|
|
|
uint8 *_vcnExpTable;
|
|
|
|
uint16 *_vmpPtr;
|
|
|
|
uint16 *_blockDrawingBuffer;
|
|
|
|
uint8 *_sceneWindowBuffer;
|
|
|
|
LevelShapeProperty *_levelShapeProperties;
|
|
|
|
uint8 **_levelShapes;
|
2009-02-14 00:51:07 +00:00
|
|
|
uint8 *_scriptAssignedLevelShape;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
char _lastSuppFile[12];
|
2009-01-18 23:50:31 +00:00
|
|
|
char _lastOverridePalFile[12];
|
|
|
|
char *_lastOverridePalFilePtr;
|
2009-01-18 17:04:24 +00:00
|
|
|
int _lastSpecialColor;
|
|
|
|
int _lastSpecialColorWeight;
|
|
|
|
|
|
|
|
int _sceneDrawVar1;
|
|
|
|
int _sceneDrawVar2;
|
|
|
|
int _sceneDrawVar3;
|
|
|
|
int _wllProcessFlag;
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
uint8 *_trueLightTable2;
|
|
|
|
uint8 *_trueLightTable1;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
int _loadSuppFilesFlag;
|
|
|
|
|
|
|
|
uint8 *_wllVmpMap;
|
|
|
|
int8 *_wllShapeMap;
|
|
|
|
uint8 *_wllBuffer3;
|
|
|
|
uint8 *_wllBuffer4;
|
2009-01-19 07:31:34 +00:00
|
|
|
uint8 *_wllWallFlags;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
int16 *_lvlShapeTop;
|
|
|
|
int16 *_lvlShapeBottom;
|
|
|
|
int16 *_lvlShapeLeftRight;
|
|
|
|
|
2009-01-19 07:31:34 +00:00
|
|
|
LevelBlockProperty *_levelBlockProperties;
|
|
|
|
LevelBlockProperty *_curBlockCaps[18];
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
uint16 _partyPosX;
|
|
|
|
uint16 _partyPosY;
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
Common::SeekableReadStream *_lvlShpFileHandle;
|
|
|
|
uint16 _lvlShpNum;
|
|
|
|
uint16 _levelFileDataSize;
|
|
|
|
LevelShapeProperty *_levelFileData;
|
|
|
|
|
|
|
|
uint8 *_doorShapes[2];
|
2009-01-18 23:50:31 +00:00
|
|
|
int16 _shpDmX;
|
|
|
|
int16 _shpDmY;
|
|
|
|
int16 _dmScaleW;
|
|
|
|
int16 _dmScaleH;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
int _lastMouseRegion;
|
2009-02-14 00:51:07 +00:00
|
|
|
//int _preSeq_X1, _preSeq_Y1, _preSeq_X2, _preSeq_Y2;
|
2009-01-18 17:04:24 +00:00
|
|
|
uint8 _unkGameFlag;
|
|
|
|
|
|
|
|
uint8 *_tempBuffer5120;
|
2009-01-19 23:35:27 +00:00
|
|
|
uint8 *_tmpData136;
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
const char *const * _levelDatList;
|
|
|
|
int _levelDatListSize;
|
|
|
|
const char *const * _levelShpList;
|
|
|
|
int _levelShpListSize;
|
|
|
|
|
|
|
|
const int8 *_dscUnk1;
|
|
|
|
int _dscUnk1Size;
|
|
|
|
const int8 *_dscShapeIndex;
|
|
|
|
int _dscShapeIndexSize;
|
|
|
|
const uint8 *_dscOvlMap;
|
|
|
|
int _dscOvlMapSize;
|
|
|
|
const uint16 *_dscShapeScaleW;
|
|
|
|
int _dscShapeScaleWSize;
|
|
|
|
const uint16 *_dscShapeScaleH;
|
|
|
|
int _dscShapeScaleHSize;
|
|
|
|
const int16 *_dscShapeX;
|
|
|
|
int _dscShapeXSize;
|
|
|
|
const int8 *_dscShapeY;
|
|
|
|
int _dscShapeYSize;
|
|
|
|
const uint8 *_dscTileIndex;
|
|
|
|
int _dscTileIndexSize;
|
|
|
|
const uint8 *_dscUnk2;
|
|
|
|
int _dscUnk2Size;
|
|
|
|
const uint8 *_dscDoorShpIndex;
|
|
|
|
int _dscDoorShpIndexSize;
|
|
|
|
const int8 *_dscDim1;
|
|
|
|
int _dscDim1Size;
|
|
|
|
const int8 *_dscDim2;
|
|
|
|
int _dscDim2Size;
|
|
|
|
const uint8 *_dscBlockMap;
|
|
|
|
int _dscBlockMapSize;
|
|
|
|
const uint8 *_dscDimMap;
|
|
|
|
int _dscDimMapSize;
|
2009-01-18 23:50:31 +00:00
|
|
|
const uint16 *_dscDoorMonsterScaleTable;
|
|
|
|
int _dscDoorMonsterScaleTableSize;
|
2009-01-18 17:04:24 +00:00
|
|
|
const uint16 *_dscDoor4;
|
|
|
|
int _dscDoor4Size;
|
|
|
|
const uint8 *_dscShapeOvlIndex;
|
|
|
|
int _dscShapeOvlIndexSize;
|
|
|
|
const int8 *_dscBlockIndex;
|
|
|
|
int _dscBlockIndexSize;
|
|
|
|
const uint8 *_dscDoor1;
|
|
|
|
int _dscDoor1Size;
|
2009-01-18 23:50:31 +00:00
|
|
|
const int16 *_dscDoorMonsterX;
|
|
|
|
int _dscDoorMonsterXSize;
|
|
|
|
const int16 *_dscDoorMonsterY;
|
|
|
|
int _dscDoorMonsterYSize;
|
2009-02-14 13:55:00 +00:00
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
int _sceneDrawPage1;
|
|
|
|
int _sceneDrawPage2;
|
|
|
|
|
|
|
|
// items
|
|
|
|
void giveCredits(int credits, int redraw);
|
|
|
|
int makeItem(int itemIndex, int curFrame, int flags);
|
2009-03-06 23:59:12 +00:00
|
|
|
bool addItemToInventory(int itemIndex);
|
2009-01-18 17:04:24 +00:00
|
|
|
bool testUnkItemFlags(int itemIndex);
|
2009-02-21 17:24:50 +00:00
|
|
|
void deleteItem(int itemIndex);
|
2009-03-01 14:45:30 +00:00
|
|
|
ItemInPlay *findItem(uint16 index);
|
2009-02-21 17:24:50 +00:00
|
|
|
void runItemScript(int charNum, int item, int reg0, int reg3, int reg4);
|
2009-02-21 23:20:14 +00:00
|
|
|
void setHandItem(uint16 itemIndex);
|
|
|
|
void clickSceneSub1();
|
2009-03-01 14:45:30 +00:00
|
|
|
int checkMonsterSpace(int itemX, int itemY, int partyX, int partyY);
|
2009-02-23 20:17:53 +00:00
|
|
|
int checkSceneForItems(LevelBlockProperty *block, int pos);
|
|
|
|
void foundItemSub(int item, int block);
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
uint8 _moneyColumnHeight[5];
|
|
|
|
uint16 _credits;
|
|
|
|
|
|
|
|
ItemInPlay *_itemsInPlay;
|
|
|
|
ItemProperty *_itemProperties;
|
|
|
|
|
|
|
|
int _itemInHand;
|
2009-02-01 19:27:01 +00:00
|
|
|
uint16 _inventory[48];
|
2009-01-18 17:04:24 +00:00
|
|
|
int _inventoryCurItem;
|
2009-02-01 19:27:01 +00:00
|
|
|
int _hideControls;
|
2009-02-21 17:24:50 +00:00
|
|
|
int _lastCharInventory;
|
|
|
|
|
|
|
|
const uint8 *_charInvIndex;
|
|
|
|
int _charInvIndexSize;
|
|
|
|
const int8 *_charInvDefs;
|
|
|
|
int _charInvDefsSize;
|
2009-01-18 17:04:24 +00:00
|
|
|
|
|
|
|
EMCData _itemScript;
|
|
|
|
|
2009-02-21 17:24:50 +00:00
|
|
|
const uint16 *_inventorySlotDesc;
|
|
|
|
int _inventorySlotDescSize;
|
|
|
|
|
2009-03-01 14:45:30 +00:00
|
|
|
// monsters
|
|
|
|
void loadMonsterShapes(const char *file, int monsterIndex, int b);
|
|
|
|
void releaseMonsterShapes(int monsterIndex);
|
|
|
|
int placeMonstersUnk(int block);
|
|
|
|
void setMonsterMode(MonsterInPlay *monster, int a);
|
|
|
|
void placeMonster(MonsterInPlay *monster, uint16 x, uint16 y);
|
2009-03-03 22:32:39 +00:00
|
|
|
int calcMonsterDirection(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
|
|
|
|
void setMonsterDirection(MonsterInPlay *monster, int dir);
|
2009-03-01 14:45:30 +00:00
|
|
|
void cmzS3(MonsterInPlay *monster);
|
|
|
|
void removeItemOrMonsterFromBlock(uint16 *blockItemIndex, int id);
|
|
|
|
void assignItemOrMonsterToBlock(uint16 *blockItemIndex, int id);
|
2009-03-03 22:32:39 +00:00
|
|
|
void giveItemToMonster(MonsterInPlay *monster, uint16 item);
|
|
|
|
int checkBlockBeforeMonsterPlacement(int x, int y, int monsterWidth, int testFlag, int wallFlag);
|
2009-03-01 14:45:30 +00:00
|
|
|
int calcMonsterSkillLevel(int id, int a);
|
2009-03-03 22:32:39 +00:00
|
|
|
int checkBlockForWallsAndSufficientSpace(int block, int x, int y, int monsterWidth, int testFlag, int wallFlag);
|
|
|
|
bool checkBlockOccupiedByParty(int x, int y, int testFlag);
|
2009-03-01 14:45:30 +00:00
|
|
|
const uint16 *getCharacterOrMonsterStats(int id);
|
2009-03-06 22:53:08 +00:00
|
|
|
void drawMonstersAndItems(int block);
|
2009-03-01 14:45:30 +00:00
|
|
|
void drawMonster(uint16 id);
|
|
|
|
int getMonsterCurFrame(MonsterInPlay *m, uint16 dirFlags);
|
|
|
|
void recalcItemMonsterPositions(uint16 direction, uint16 itemIndex, LevelBlockProperty *l, bool flag);
|
|
|
|
int calcItemMonsterPosition(ItemInPlay *i, uint16 direction);
|
|
|
|
void recalcSpritePosition(uint16 partyX, uint16 partyY, int &itemX, int &itemY, uint16 direction);
|
|
|
|
void drawDoor(uint8 *shape, uint8 *table, int index, int unk2, int w, int h, int flags);
|
|
|
|
void drawDoorOrMonsterShape(uint8 *shape, uint8 *table, int x, int y, int flags, const uint8 *ovl);
|
|
|
|
uint8 *drawItemOrMonster(uint8 *shape, uint8 *ovl, int x, int y, int w, int h, int flags, int tblValue, bool flip);
|
|
|
|
int calcDrawingLayerParameters(int srcX, int srcY, int16 &x2, int16 &y2, int16 &w, int16 &h, uint8 *shape, int flip);
|
2009-03-06 22:53:08 +00:00
|
|
|
|
2009-03-01 14:45:30 +00:00
|
|
|
void updateMonster(MonsterInPlay *monster);
|
|
|
|
void moveMonster(MonsterInPlay *monster);
|
2009-03-03 22:32:39 +00:00
|
|
|
void walkMonster(MonsterInPlay *monster);
|
|
|
|
int walkMonsterCalcNextStep(MonsterInPlay *monster);
|
|
|
|
int getMonsterDistance(uint16 block1, uint16 block2);
|
2009-03-06 22:53:08 +00:00
|
|
|
int walkMonster_s3(uint16 monsterBlock, int direction, int distance, uint16 curBlock);
|
2009-03-03 22:32:39 +00:00
|
|
|
int walkMonsterCheckDest(int x, int y, MonsterInPlay *monster, int unk);
|
|
|
|
void walkMonsterGetNextStepCoords(int16 monsterX, int16 monsterY, int &newX, int &newY, uint16 unk);
|
2009-03-01 14:45:30 +00:00
|
|
|
|
|
|
|
MonsterInPlay *_monsters;
|
|
|
|
MonsterProperty *_monsterProperties;
|
|
|
|
uint8 **_monsterShapes;
|
|
|
|
uint8 **_monsterPalettes;
|
|
|
|
uint8 **_monsterShapesEx;
|
|
|
|
uint8 _monsterUnk[3];
|
2009-03-03 22:32:39 +00:00
|
|
|
uint16 _monsterCurBlock;
|
|
|
|
int _monsterUnkDir;
|
|
|
|
int _monsterCountUnk;
|
|
|
|
int _monsterShiftAlt;
|
2009-03-01 14:45:30 +00:00
|
|
|
|
|
|
|
const uint16 *_monsterModifiers;
|
|
|
|
int _monsterModifiersSize;
|
2009-03-06 22:53:08 +00:00
|
|
|
const int8 *_monsterShiftOffs;
|
|
|
|
int _monsterShiftOffsSize;
|
2009-03-01 14:45:30 +00:00
|
|
|
const uint8 *_monsterDirFlags;
|
|
|
|
int _monsterDirFlagsSize;
|
|
|
|
const int8 *_monsterScaleX;
|
|
|
|
int _monsterScaleXSize;
|
|
|
|
const int8 *_monsterScaleY;
|
|
|
|
int _monsterScaleYSize;
|
|
|
|
const uint16 *_monsterScaleWH;
|
|
|
|
int _monsterScaleWHSize;
|
|
|
|
|
2009-02-01 19:27:01 +00:00
|
|
|
// misc
|
2009-02-21 17:24:50 +00:00
|
|
|
void delay(uint32 millis, bool cUpdate = false, bool isMainLoop = false);
|
2009-03-03 22:32:39 +00:00
|
|
|
void enableSysTimer(int sysTimer);
|
|
|
|
void disableSysTimer(int sysTimer);
|
2009-02-01 19:27:01 +00:00
|
|
|
|
2009-02-21 17:24:50 +00:00
|
|
|
uint8 *_pageBuffer1;
|
|
|
|
uint8 *_pageBuffer2;
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
// spells
|
2009-02-15 03:36:30 +00:00
|
|
|
bool notEnoughMagic(int charNum, int spellNum, int spellLevel);
|
|
|
|
|
2009-01-18 17:04:24 +00:00
|
|
|
int8 _availableSpells[7];
|
|
|
|
int _selectedSpell;
|
|
|
|
const SpellProperty *_spellProperties;
|
|
|
|
int _spellPropertiesSize;
|
2009-02-16 17:17:15 +00:00
|
|
|
int _subMenuIndex;
|
2009-01-01 15:06:43 +00:00
|
|
|
|
2008-07-31 10:47:15 +00:00
|
|
|
// unneeded
|
|
|
|
void setWalkspeed(uint8) {}
|
|
|
|
void removeHandItem() {}
|
|
|
|
bool lineIsPassable(int, int) { return false; }
|
2008-09-14 19:48:40 +00:00
|
|
|
|
|
|
|
// save
|
2008-11-09 13:00:40 +00:00
|
|
|
Common::Error loadGameState(int slot) { return Common::kNoError; }
|
|
|
|
Common::Error saveGameState(int slot, const char *saveName, const Graphics::Surface *thumbnail) { return Common::kNoError; }
|
2008-07-31 10:47:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace Kyra
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2009-03-04 11:53:25 +00:00
|
|
|
#endif // ENABLE_LOL
|
|
|
|
|