svn-id: r11579
This commit is contained in:
Gregory Montoir 2003-12-11 10:24:27 +00:00
parent 507a7057c1
commit 577ea51c10
4 changed files with 30 additions and 22 deletions

View File

@ -61,7 +61,7 @@ enum Direction {
enum { enum {
INK_BG_PANEL = 226, INK_BG_PANEL = 226,
INK_JOURNAL = 248, INK_JOURNAL = 248,
INK_MAP7 = 243, INK_PINNACLE_ROOM = 243,
INK_CMD_SELECT = 255, INK_CMD_SELECT = 255,
INK_CMD_NORMAL = 225, INK_CMD_NORMAL = 225,
INK_CMD_LOCK = 234, INK_CMD_LOCK = 234,
@ -71,11 +71,6 @@ enum {
}; };
enum {
ZONE_ROOM = 0,
ZONE_PANEL = 1
};
enum { enum {
ITEM_NONE = 0, ITEM_NONE = 0,
ITEM_BAT = 1, ITEM_BAT = 1,
@ -280,14 +275,6 @@ enum Language {
}; };
enum JoeWalkMode {
JWM_NORMAL = 0,
JWM_MOVE = 1,
JWM_EXECUTE = 2,
JWM_SPEAK = 3
};
} // End of namespace Queen } // End of namespace Queen
#endif #endif

View File

@ -65,7 +65,6 @@ Common::RandomSource Logic::randomizer;
Logic::Logic(Resource *theResource, Graphics *graphics, Display *theDisplay, Input *input, Sound *sound) Logic::Logic(Resource *theResource, Graphics *graphics, Display *theDisplay, Input *input, Sound *sound)
: _resource(theResource), _graphics(graphics), _display(theDisplay), : _resource(theResource), _graphics(graphics), _display(theDisplay),
_input(input), _sound(sound) { _input(input), _sound(sound) {
_jas = _resource->loadFile("QUEEN.JAS", 20);
_joe.x = _joe.y = 0; _joe.x = _joe.y = 0;
_joe.scale = 100; _joe.scale = 100;
_walk = new Walk(this, _graphics); _walk = new Walk(this, _graphics);
@ -77,15 +76,20 @@ Logic::Logic(Resource *theResource, Graphics *graphics, Display *theDisplay, Inp
} }
Logic::~Logic() { Logic::~Logic() {
delete[] _jas;
delete _walk; delete _walk;
delete _cmd; delete _cmd;
delete _dbg; delete _dbg;
} }
void Logic::initialise() { void Logic::initialise() {
int16 i, j; int16 i, j;
uint8 *ptr = _jas;
// Step 1 : read queen.jas file and 'unserialize' some arrays
uint8 *jas = _resource->loadFile("QUEEN.JAS", 20);
uint8 *ptr = jas;
_numRooms = READ_BE_UINT16(ptr); ptr += 2; _numRooms = READ_BE_UINT16(ptr); ptr += 2;
_numNames = READ_BE_UINT16(ptr); ptr += 2; _numNames = READ_BE_UINT16(ptr); ptr += 2;
@ -219,6 +223,11 @@ void Logic::initialise() {
warning("Unexpected queen.jas file format"); warning("Unexpected queen.jas file format");
} }
delete[] jas;
// Step 2 : read queen2.jas and grab all description texts
_objDescription = new char*[_numDescriptions + 1]; _objDescription = new char*[_numDescriptions + 1];
_objDescription[0] = 0; _objDescription[0] = 0;
for (i = 1; i <= _numDescriptions; i++) for (i = 1; i <= _numDescriptions; i++)
@ -264,6 +273,9 @@ void Logic::initialise() {
for (i = 1; i <= _numAFile; i++) for (i = 1; i <= _numAFile; i++)
_aFile[i] = _resource->getJAS2Line(); _aFile[i] = _resource->getJAS2Line();
// Step 3 : initialise game state / variables
_cmd->clear(false); _cmd->clear(false);
_scene = 0; _scene = 0;
memset(_gameState, 0, sizeof(_gameState)); memset(_gameState, 0, sizeof(_gameState));
@ -2210,7 +2222,7 @@ void Logic::handlePinnacleRoom() {
_entryObj = objData->entryObj; _entryObj = objData->entryObj;
char textCmd[CmdText::MAX_COMMAND_LEN]; char textCmd[CmdText::MAX_COMMAND_LEN];
sprintf(textCmd, "%s %s", Verb(VERB_WALK_TO).name(), _objName[objData->name]); sprintf(textCmd, "%s %s", Verb(VERB_WALK_TO).name(), _objName[objData->name]);
_graphics->textCurrentColor(INK_MAP7); _graphics->textCurrentColor(INK_PINNACLE_ROOM);
_graphics->textSetCentered(5, textCmd); _graphics->textSetCentered(5, textCmd);
} }
prevObj = curObj; prevObj = curObj;

View File

@ -37,6 +37,18 @@ enum RoomDisplayMode {
RDM_FADE_JOE_XY = 3 // display Joe at the current X, Y coords RDM_FADE_JOE_XY = 3 // display Joe at the current X, Y coords
}; };
enum {
ZONE_ROOM = 0,
ZONE_PANEL = 1
};
enum JoeWalkMode {
JWM_NORMAL = 0,
JWM_MOVE = 1,
JWM_EXECUTE = 2,
JWM_SPEAK = 3
};
struct ZoneSlot { struct ZoneSlot {
bool valid; bool valid;
Box box; Box box;
@ -306,9 +318,6 @@ protected:
void initialise(); void initialise();
//! Contents of queen.jas file
uint8 *_jas;
uint16 _currentRoom; uint16 _currentRoom;
uint16 _oldRoom; uint16 _oldRoom;
uint16 _newRoom; uint16 _newRoom;