Skip to content

Commit

Permalink
KYRA: (EOB) - start implementing camp menu
Browse files Browse the repository at this point in the history
  • Loading branch information
athrxx authored and Johannes Schickel committed Dec 26, 2011
1 parent 69ad70a commit 045d089
Show file tree
Hide file tree
Showing 10 changed files with 487 additions and 57 deletions.
2 changes: 1 addition & 1 deletion engines/kyra/chargen.cpp
Expand Up @@ -319,7 +319,7 @@ void CharacterGenerator::initButton(int index, int x, int y, int w, int h, int k
b->width = w;
b->height = h;
b->keyCode = keyCode;
b->keyCode2 = keyCode + 0x100;
b->keyCode2 = keyCode | 0x100;
}

void CharacterGenerator::checkForCompleteParty() {
Expand Down
17 changes: 6 additions & 11 deletions engines/kyra/eobcommon.cpp
Expand Up @@ -55,8 +55,6 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa
_weaponSlotGrid = _blackBoxWideGrid = _lightningColumnShape = 0;
_tempIconShape = 0;

_menuStringsPrefsTemp = 0;

_monsterDustStrings = 0;
_monsterDistAttType10 = 0;
_monsterDistAttSfx10 = 0;
Expand Down Expand Up @@ -106,6 +104,8 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa
_color10 = 23;
_color11 = 20;

_menuDefs = 0;

_exchangeCharacterId = -1;
_charExchangeSwap = 0;
_configHpBarGraphs = true;
Expand Down Expand Up @@ -143,12 +143,6 @@ EobCoreEngine::~EobCoreEngine() {
releaseItemsAndDecorationsShapes();
releaseTempData();

if (_menuStringsPrefsTemp) {
for (int i = 0; i < 4; i++)
delete _menuStringsPrefsTemp[i];
delete[] _menuStringsPrefsTemp;
}

if (_faceShapes) {
for (int i = 0; i < 44; i++) {
if (_characters) {
Expand Down Expand Up @@ -207,6 +201,9 @@ EobCoreEngine::~EobCoreEngine() {

delete _gui;
_gui = 0;
delete[] _menuDefs;
_menuDefs = 0;

delete _inf;
delete _timer;
_timer = 0;
Expand Down Expand Up @@ -265,12 +262,10 @@ Common::Error EobCoreEngine::init() {
return err;

initButtonData();
initMenus();
initStaticResource();
initSpells();

_menuStringsPrefsTemp = new char*[4];
memset(_menuStringsPrefsTemp, 0, 4 * sizeof(char*));

_timer = new TimerManager(this, _system);
assert(_timer);
setupTimers();
Expand Down
24 changes: 22 additions & 2 deletions engines/kyra/eobcommon.h
Expand Up @@ -228,6 +228,23 @@ struct ScriptTimer {
uint32 next;
};

struct EobMenuDef {
int8 titleStrId;
uint8 dim;
uint8 firstButtonStrId;
int8 numButtons;
int8 titleCol;
};
struct EobMenuButtonDef {
int8 labelId;
int16 x;
int8 y;
uint8 width;
uint8 height;
int16 keyCode;
int16 flags;
};

class EobInfProcessor;

class EobCoreEngine : public LolEobBaseEngine {
Expand Down Expand Up @@ -258,8 +275,9 @@ friend class CharacterGenerator;
void releaseItemsAndDecorationsShapes();

void initButtonData();
void initMenus();
void initStaticResource();
virtual void initSpells();
virtual void initSpells();

const uint8 **_largeItemShapes;
const uint8 **_smallItemShapes;
Expand Down Expand Up @@ -825,6 +843,7 @@ friend class CharacterGenerator;
void sparkEffectDefensive(int charIndex);
void sparkEffectOffensive();
void setSpellEventTimer(int spell, int timerBaseFactor, int timerLength, int timerLevelFactor, int updateExistingTimer);
void cleanupCharacterSpellList(int charIndex);

bool magicObjectHit(EobFlyingObject *fo, int dcTimes, int dcPips, int dcOffs, int level);

Expand Down Expand Up @@ -957,7 +976,8 @@ friend class CharacterGenerator;
const uint8 *_magicFlightObjectProperties;

// Menu
char **_menuStringsPrefsTemp;
EobMenuDef *_menuDefs;
const EobMenuButtonDef *_menuButtonDefs;

bool _configMouse;

Expand Down
2 changes: 2 additions & 0 deletions engines/kyra/gui.h
Expand Up @@ -88,6 +88,8 @@ struct Button {

Callback buttonCallback;

const void *extButtonDef;

uint16 arg;
};

Expand Down

0 comments on commit 045d089

Please sign in to comment.