ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <database.h>

Collaboration diagram for Myst3::Database:

List of all members.

Classes

struct  RoomKeyHash

Public Member Functions

 Database (const Common::Platform platform, const Common::Language language, const uint32 localizationType)
 ~Database ()
void cacheRoom (uint32 roomID, uint32 ageID)
 Loads a room's nodes into the database cache.
bool isCommonRoom (uint32 roomID, uint32 ageID) const
 Tells if a room is a common room.
NodePtr getNodeData (uint16 nodeID, uint32 roomID, uint32 ageID)
 Returns a node's hotspots and scripts from the currently loaded room.
int32 getNodeZipBitIndex (uint16 nodeID, uint32 roomID, uint32 ageID)
 Returns a node's zip id, as used by savestates.
const Common::Array< Opcode > & getNodeInitScript ()
 Returns the generic node init script.
Common::String getRoomName (uint32 roomID, uint32 ageID) const
 Returns the name of the currently loaded room.
RoomKey getRoomKey (const char *name)
 Returns the id of a room from its name.
Common::Array< uint16listRoomNodes (uint32 roomID, uint32 ageID)
 Returns the list of the nodes of a room.
uint32 getAgeLabelId (uint32 ageID)
 Returns an age's label id, to be used with AGES 1000 metadata.
Common::String getSoundName (uint32 id)
 Retrieve the file name of a sound from its id.
const AmbientCuegetAmbientCue (uint16 id)
 Retrieve an ambient cue from its id.
int16 getGameLanguageCode () const
bool areRoomsScriptsEqual (uint32 roomID1, uint32 ageID1, uint32 roomID2, uint32 ageID2, ScriptType scriptType)
 Check if the scripts for two rooms are identical.

Private Types

typedef Common::HashMap
< RoomKey, Common::Array
< NodePtr >, RoomKeyHash
NodesCache

Private Member Functions

const RoomDatafindRoomData (uint32 roomID, uint32 ageID) const
Common::Array< NodePtrgetRoomNodes (uint32 roomID, uint32 ageID) const
Common::Array< NodePtrreadRoomScripts (const RoomData *room) const
void preloadCommonRooms ()
void initializeZipBitIndexTable ()
void patchLanguageMenu ()
void patchNodeScripts (const RoomData *room, Common::Array< NodePtr > &nodes) const
void readScriptIndex (Common::SeekableReadStream *stream, bool load)
void readSoundNames (Common::SeekableReadStream *stream, bool load)
void loadAmbientCues (Common::ReadStream *s)
Common::SeekableReadStreamgetRoomScriptStream (const char *room, ScriptType scriptType) const

Private Attributes

const Common::Platform _platform
const Common::Language _language
const uint32 _localizationType
NodesCache _roomNodesCache
Common::Array< Opcode_nodeInitScript
Common::HashMap< uint32,
Common::String
_soundNames
Common::HashMap< uint16,
AmbientCue
_ambientCues
Common::HashMap< uint32, int16_roomZipBitIndex
Common::SeekableReadStream_datFile
Common::Array< RoomScripts_roomScriptsIndex
int32 _roomScriptsStartOffset

Static Private Attributes

static const AgeData _ages []
static const uint kDatVersion = 3

Detailed Description

Definition at line 168 of file database.h.


Member Typedef Documentation


Constructor & Destructor Documentation

Myst3::Database::Database ( const Common::Platform  platform,
const Common::Language  language,
const uint32  localizationType 
)

Definition at line 455 of file database.cpp.

Myst3::Database::~Database (  ) 

Definition at line 506 of file database.cpp.


Member Function Documentation

bool Myst3::Database::areRoomsScriptsEqual ( uint32  roomID1,
uint32  ageID1,
uint32  roomID2,
uint32  ageID2,
ScriptType  scriptType 
)

Check if the scripts for two rooms are identical.

Definition at line 830 of file database.cpp.

void Myst3::Database::cacheRoom ( uint32  roomID,
uint32  ageID 
)

Loads a room's nodes into the database cache.

Definition at line 693 of file database.cpp.

const RoomData * Myst3::Database::findRoomData ( uint32  roomID,
uint32  ageID 
) const [private]

Definition at line 597 of file database.cpp.

uint32 Myst3::Database::getAgeLabelId ( uint32  ageID  ) 

Returns an age's label id, to be used with AGES 1000 metadata.

Definition at line 729 of file database.cpp.

const AmbientCue & Myst3::Database::getAmbientCue ( uint16  id  ) 

Retrieve an ambient cue from its id.

Definition at line 772 of file database.cpp.

int16 Myst3::Database::getGameLanguageCode (  )  const

Definition at line 851 of file database.cpp.

NodePtr Myst3::Database::getNodeData ( uint16  nodeID,
uint32  roomID,
uint32  ageID 
)

Returns a node's hotspots and scripts from the currently loaded room.

Definition at line 551 of file database.cpp.

const Common::Array<Opcode>& Myst3::Database::getNodeInitScript (  )  [inline]

Returns the generic node init script.

Definition at line 198 of file database.h.

int32 Myst3::Database::getNodeZipBitIndex ( uint16  nodeID,
uint32  roomID,
uint32  ageID 
)

Returns a node's zip id, as used by savestates.

Definition at line 581 of file database.cpp.

RoomKey Myst3::Database::getRoomKey ( const char *  name  ) 

Returns the id of a room from its name.

Definition at line 718 of file database.cpp.

Common::String Myst3::Database::getRoomName ( uint32  roomID,
uint32  ageID 
) const

Returns the name of the currently loaded room.

Definition at line 713 of file database.cpp.

Common::Array< NodePtr > Myst3::Database::getRoomNodes ( uint32  roomID,
uint32  ageID 
) const [private]

Definition at line 525 of file database.cpp.

Common::SeekableReadStream * Myst3::Database::getRoomScriptStream ( const char *  room,
ScriptType  scriptType 
) const [private]

Definition at line 816 of file database.cpp.

Common::String Myst3::Database::getSoundName ( uint32  id  ) 

Retrieve the file name of a sound from its id.

Definition at line 737 of file database.cpp.

void Myst3::Database::initializeZipBitIndexTable (  )  [private]

Definition at line 562 of file database.cpp.

bool Myst3::Database::isCommonRoom ( uint32  roomID,
uint32  ageID 
) const

Tells if a room is a common room.

Common rooms are always in the cache

Definition at line 689 of file database.cpp.

Common::Array< uint16 > Myst3::Database::listRoomNodes ( uint32  roomID,
uint32  ageID 
)

Returns the list of the nodes of a room.

Definition at line 538 of file database.cpp.

void Myst3::Database::loadAmbientCues ( Common::ReadStream s  )  [private]

Definition at line 745 of file database.cpp.

void Myst3::Database::patchLanguageMenu (  )  [private]

Definition at line 873 of file database.cpp.

void Myst3::Database::patchNodeScripts ( const RoomData room,
Common::Array< NodePtr > &  nodes 
) const [private]

Definition at line 645 of file database.cpp.

void Myst3::Database::preloadCommonRooms (  )  [private]

Definition at line 510 of file database.cpp.

Common::Array< NodePtr > Myst3::Database::readRoomScripts ( const RoomData room  )  const [private]

Definition at line 611 of file database.cpp.

void Myst3::Database::readScriptIndex ( Common::SeekableReadStream stream,
bool  load 
) [private]

Definition at line 779 of file database.cpp.

void Myst3::Database::readSoundNames ( Common::SeekableReadStream stream,
bool  load 
) [private]

Definition at line 800 of file database.cpp.


Member Data Documentation

const AgeData Myst3::Database::_ages [static, private]
Initial value:
 {
    { 1, 0, 1, roomsXXXX, 0 },
    { 2, 1, 1, roomsINTR, 0 },
    { 3, 2, 1, roomsTOHO, 0 },
    { 4, 4, 1, roomsTOHB, 0 },
    { 5, 2, 6, roomsLE, 1 },
    { 6, 4, 5, roomsLI, 2 },
    { 7, 3, 7, roomsEN, 3 },
    { 8, 3, 1, roomsNA, 4 },
    { 9, 0, 4, roomsMENU, 0 },
    { 10, 1, 6, roomsMA, 5 },
    { 11, 0, 1, roomsLOGO, 0 }
}

Definition at line 248 of file database.h.

Definition at line 260 of file database.h.

Definition at line 245 of file database.h.

Definition at line 246 of file database.h.

Definition at line 252 of file database.h.

Definition at line 244 of file database.h.

Definition at line 250 of file database.h.

Definition at line 262 of file database.h.

const uint Myst3::Database::kDatVersion = 3 [static, private]

Definition at line 259 of file database.h.


The documentation for this class was generated from the following files:


Generated on Sat Jan 12 2019 05:04:51 for ResidualVM by doxygen 1.7.1
curved edge   curved edge