ScummVM
Kyra::StaticResource Class Reference

#include <resource.h>

Collaboration diagram for Kyra::StaticResource:

Classes

struct  DataDescriptor
 
struct  FileType
 
struct  ResData
 

Public Member Functions

 StaticResource (KyraEngine_v1 *vm)
 
 ~StaticResource ()
 
bool loadStaticResourceFile ()
 
bool init ()
 
void deinit ()
 
const char *const * loadStrings (int id, int &strings)
 
const uint8loadRawData (int id, int &size)
 
const ShapeloadShapeTable (int id, int &entries)
 
const AmigaSfxTableloadAmigaSfxTable (int id, int &entries)
 
const RoomloadRoomTable (int id, int &entries)
 
const HoFSeqDataloadHoFSequenceData (int id, int &entries)
 
const HoFSeqItemAnimDataloadHoFSeqItemAnimData (int id, int &entries)
 
const ItemAnimDefinitionloadItemAnimDefinition (int id, int &entries)
 
const uint16loadRawDataBe16 (int id, int &entries)
 
const uint32loadRawDataBe32 (int id, int &entries)
 
const LoLCharacterloadCharData (int id, int &entries)
 
const SpellPropertyloadSpellData (int id, int &entries)
 
const CompassDefloadCompassData (int id, int &entries)
 
const FlyingObjectShapeloadFlyingObjectData (int id, int &entries)
 
const LoLButtonDefloadButtonDefs (int id, int &entries)
 
const DarkMoonAnimCommandloadEoB2SeqData (int id, int &entries)
 
const DarkMoonShapeDefloadEoB2ShapeData (int id, int &entries)
 
const EoBCharacterloadEoBNpcData (int id, int &entries)
 
bool prefetchId (int id)
 
void unloadId (int id)
 

Static Public Member Functions

static const Common::String staticDataFilename ()
 

Private Types

enum  ResTypes {
  kStringList = 0, kRawData = 1, kRoomList = 2, kShapeList = 3,
  kAmigaSfxTable = 4, k2SeqData = 5, k2SeqItemAnimData = 6, k2ItemAnimDefinition = 7,
  kLoLCharData = 8, kLoLSpellData = 9, kLoLCompassData = 10, kLoLFlightShpData = 11,
  kLoLButtonData = 12, kRawDataBe16 = 13, kRawDataBe32 = 14, kEoB2SequenceData = 15,
  kEoB2ShapeData = 16, kEoBNpcData = 17
}
 
typedef Common::HashMap< uint16, DataDescriptorDataMap
 

Private Member Functions

bool tryKyraDatLoad ()
 
bool checkResList (int id, int &type, const void *&ptr, int &size)
 
const FileTypegetFiletype (int type)
 
const voidgetData (int id, int requesttype, int &size)
 
bool loadDummy (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadStringTable (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadRawData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadShapeTable (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadAmigaSfxTable (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadRoomTable (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadHoFSequenceData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadHoFSeqItemAnimData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadItemAnimDefinition (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadRawDataBe16 (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadRawDataBe32 (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadCharData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadSpellData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadCompassData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadFlyingObjectData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadButtonDefs (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadEoB2SeqData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadEoB2ShapeData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
bool loadEoBNpcData (Common::SeekableReadStream &stream, void *&ptr, int &size)
 
void freeDummy (void *&ptr, int &size)
 
void freeRawData (void *&ptr, int &size)
 
void freeStringTable (void *&ptr, int &size)
 
void freeShapeTable (void *&ptr, int &size)
 
void freeAmigaSfxTable (void *&ptr, int &size)
 
void freeRoomTable (void *&ptr, int &size)
 
void freeHoFSequenceData (void *&ptr, int &size)
 
void freeHoFSeqItemAnimData (void *&ptr, int &size)
 
void freeItemAnimDefinition (void *&ptr, int &size)
 
void freeRawDataBe16 (void *&ptr, int &size)
 
void freeRawDataBe32 (void *&ptr, int &size)
 
void freeCharData (void *&ptr, int &size)
 
void freeSpellData (void *&ptr, int &size)
 
void freeCompassData (void *&ptr, int &size)
 
void freeFlyingObjectData (void *&ptr, int &size)
 
void freeButtonDefs (void *&ptr, int &size)
 
void freeEoB2SeqData (void *&ptr, int &size)
 
void freeEoB2ShapeData (void *&ptr, int &size)
 
void freeEoBNpcData (void *&ptr, int &size)
 

Private Attributes

KyraEngine_v1_vm
 
Common::List< ResData_resList
 
const FileType_fileLoader
 
DataMap _dataTable
 

Detailed Description

Definition at line 1029 of file resource.h.

Member Typedef Documentation

◆ DataMap

Definition at line 1186 of file resource.h.

Member Enumeration Documentation

◆ ResTypes

Enumerator
kStringList 
kRawData 
kRoomList 
kShapeList 
kAmigaSfxTable 
k2SeqData 
k2SeqItemAnimData 
k2ItemAnimDefinition 
kLoLCharData 
kLoLSpellData 
kLoLCompassData 
kLoLFlightShpData 
kLoLButtonData 
kRawDataBe16 
kRawDataBe32 
kEoB2SequenceData 
kEoB2ShapeData 
kEoBNpcData 

Definition at line 1135 of file resource.h.

Constructor & Destructor Documentation

◆ StaticResource()

Kyra::StaticResource::StaticResource ( KyraEngine_v1 vm)
inline

Definition at line 1033 of file resource.h.

◆ ~StaticResource()

Kyra::StaticResource::~StaticResource ( )
inline

Definition at line 1034 of file resource.h.

Member Function Documentation

◆ checkResList()

bool Kyra::StaticResource::checkResList ( int  id,
int type,
const void *&  ptr,
int size 
)
private

Definition at line 379 of file staticres.cpp.

◆ deinit()

void Kyra::StaticResource::deinit ( )

Definition at line 288 of file staticres.cpp.

◆ freeAmigaSfxTable()

void Kyra::StaticResource::freeAmigaSfxTable ( void *&  ptr,
int size 
)
private

Definition at line 660 of file staticres.cpp.

◆ freeButtonDefs()

void Kyra::StaticResource::freeButtonDefs ( void *&  ptr,
int size 
)
private

Definition at line 209 of file staticres_lol.cpp.

◆ freeCharData()

void Kyra::StaticResource::freeCharData ( void *&  ptr,
int size 
)
private

Definition at line 181 of file staticres_lol.cpp.

◆ freeCompassData()

void Kyra::StaticResource::freeCompassData ( void *&  ptr,
int size 
)
private

Definition at line 195 of file staticres_lol.cpp.

◆ freeDummy()

void Kyra::StaticResource::freeDummy ( void *&  ptr,
int size 
)
private

Definition at line 634 of file staticres.cpp.

◆ freeEoB2SeqData()

void Kyra::StaticResource::freeEoB2SeqData ( void *&  ptr,
int size 
)
private

Definition at line 131 of file staticres_eob.cpp.

◆ freeEoB2ShapeData()

void Kyra::StaticResource::freeEoB2ShapeData ( void *&  ptr,
int size 
)
private

Definition at line 138 of file staticres_eob.cpp.

◆ freeEoBNpcData()

void Kyra::StaticResource::freeEoBNpcData ( void *&  ptr,
int size 
)
private

Definition at line 145 of file staticres_eob.cpp.

◆ freeFlyingObjectData()

void Kyra::StaticResource::freeFlyingObjectData ( void *&  ptr,
int size 
)
private

Definition at line 202 of file staticres_lol.cpp.

◆ freeHoFSeqItemAnimData()

void Kyra::StaticResource::freeHoFSeqItemAnimData ( void *&  ptr,
int size 
)
private

Definition at line 694 of file staticres.cpp.

◆ freeHoFSequenceData()

void Kyra::StaticResource::freeHoFSequenceData ( void *&  ptr,
int size 
)
private

Definition at line 674 of file staticres.cpp.

◆ freeItemAnimDefinition()

void Kyra::StaticResource::freeItemAnimDefinition ( void *&  ptr,
int size 
)
private

Definition at line 703 of file staticres.cpp.

◆ freeRawData()

void Kyra::StaticResource::freeRawData ( void *&  ptr,
int size 
)
private

Definition at line 637 of file staticres.cpp.

◆ freeRawDataBe16()

void Kyra::StaticResource::freeRawDataBe16 ( void *&  ptr,
int size 
)
private

Definition at line 61 of file staticres_rpg.cpp.

◆ freeRawDataBe32()

void Kyra::StaticResource::freeRawDataBe32 ( void *&  ptr,
int size 
)
private

Definition at line 68 of file staticres_rpg.cpp.

◆ freeRoomTable()

void Kyra::StaticResource::freeRoomTable ( void *&  ptr,
int size 
)
private

Definition at line 667 of file staticres.cpp.

◆ freeShapeTable()

void Kyra::StaticResource::freeShapeTable ( void *&  ptr,
int size 
)
private

Definition at line 653 of file staticres.cpp.

◆ freeSpellData()

void Kyra::StaticResource::freeSpellData ( void *&  ptr,
int size 
)
private

Definition at line 188 of file staticres_lol.cpp.

◆ freeStringTable()

void Kyra::StaticResource::freeStringTable ( void *&  ptr,
int size 
)
private

Definition at line 644 of file staticres.cpp.

◆ getData()

const void * Kyra::StaticResource::getData ( int  id,
int  requesttype,
int size 
)
private

Definition at line 404 of file staticres.cpp.

◆ getFiletype()

const StaticResource::FileType * Kyra::StaticResource::getFiletype ( int  type)
private

Definition at line 392 of file staticres.cpp.

◆ init()

bool Kyra::StaticResource::init ( void  )

Definition at line 240 of file staticres.cpp.

◆ loadAmigaSfxTable() [1/2]

const AmigaSfxTable * Kyra::StaticResource::loadAmigaSfxTable ( int  id,
int entries 
)

Definition at line 304 of file staticres.cpp.

◆ loadAmigaSfxTable() [2/2]

bool Kyra::StaticResource::loadAmigaSfxTable ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 477 of file staticres.cpp.

◆ loadButtonDefs() [1/2]

const LoLButtonDef * Kyra::StaticResource::loadButtonDefs ( int  id,
int entries 
)

Definition at line 49 of file staticres_lol.cpp.

◆ loadButtonDefs() [2/2]

bool Kyra::StaticResource::loadButtonDefs ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 160 of file staticres_lol.cpp.

◆ loadCharData() [1/2]

const LoLCharacter * Kyra::StaticResource::loadCharData ( int  id,
int entries 
)

Definition at line 33 of file staticres_lol.cpp.

◆ loadCharData() [2/2]

bool Kyra::StaticResource::loadCharData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 53 of file staticres_lol.cpp.

◆ loadCompassData() [1/2]

const CompassDef * Kyra::StaticResource::loadCompassData ( int  id,
int entries 
)

Definition at line 41 of file staticres_lol.cpp.

◆ loadCompassData() [2/2]

bool Kyra::StaticResource::loadCompassData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 126 of file staticres_lol.cpp.

◆ loadDummy()

bool Kyra::StaticResource::loadDummy ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 426 of file staticres.cpp.

◆ loadEoB2SeqData() [1/2]

const DarkMoonAnimCommand * Kyra::StaticResource::loadEoB2SeqData ( int  id,
int entries 
)

Definition at line 33 of file staticres_eob.cpp.

◆ loadEoB2SeqData() [2/2]

bool Kyra::StaticResource::loadEoB2SeqData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 45 of file staticres_eob.cpp.

◆ loadEoB2ShapeData() [1/2]

const DarkMoonShapeDef * Kyra::StaticResource::loadEoB2ShapeData ( int  id,
int entries 
)

Definition at line 37 of file staticres_eob.cpp.

◆ loadEoB2ShapeData() [2/2]

bool Kyra::StaticResource::loadEoB2ShapeData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 67 of file staticres_eob.cpp.

◆ loadEoBNpcData() [1/2]

const EoBCharacter * Kyra::StaticResource::loadEoBNpcData ( int  id,
int entries 
)

Definition at line 41 of file staticres_eob.cpp.

◆ loadEoBNpcData() [2/2]

bool Kyra::StaticResource::loadEoBNpcData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 84 of file staticres_eob.cpp.

◆ loadFlyingObjectData() [1/2]

const FlyingObjectShape * Kyra::StaticResource::loadFlyingObjectData ( int  id,
int entries 
)

Definition at line 45 of file staticres_lol.cpp.

◆ loadFlyingObjectData() [2/2]

bool Kyra::StaticResource::loadFlyingObjectData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 143 of file staticres_lol.cpp.

◆ loadHoFSeqItemAnimData() [1/2]

const HoFSeqItemAnimData * Kyra::StaticResource::loadHoFSeqItemAnimData ( int  id,
int entries 
)

Definition at line 316 of file staticres.cpp.

◆ loadHoFSeqItemAnimData() [2/2]

bool Kyra::StaticResource::loadHoFSeqItemAnimData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 596 of file staticres.cpp.

◆ loadHoFSequenceData() [1/2]

const HoFSeqData * Kyra::StaticResource::loadHoFSequenceData ( int  id,
int entries 
)

Definition at line 312 of file staticres.cpp.

◆ loadHoFSequenceData() [2/2]

bool Kyra::StaticResource::loadHoFSequenceData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 517 of file staticres.cpp.

◆ loadItemAnimDefinition() [1/2]

const ItemAnimDefinition * Kyra::StaticResource::loadItemAnimDefinition ( int  id,
int entries 
)

Definition at line 320 of file staticres.cpp.

◆ loadItemAnimDefinition() [2/2]

bool Kyra::StaticResource::loadItemAnimDefinition ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 614 of file staticres.cpp.

◆ loadRawData() [1/2]

const uint8 * Kyra::StaticResource::loadRawData ( int  id,
int size 
)

Definition at line 296 of file staticres.cpp.

◆ loadRawData() [2/2]

bool Kyra::StaticResource::loadRawData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 450 of file staticres.cpp.

◆ loadRawDataBe16() [1/2]

const uint16 * Kyra::StaticResource::loadRawDataBe16 ( int  id,
int entries 
)

Definition at line 29 of file staticres_rpg.cpp.

◆ loadRawDataBe16() [2/2]

bool Kyra::StaticResource::loadRawDataBe16 ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 37 of file staticres_rpg.cpp.

◆ loadRawDataBe32() [1/2]

const uint32 * Kyra::StaticResource::loadRawDataBe32 ( int  id,
int entries 
)

Definition at line 33 of file staticres_rpg.cpp.

◆ loadRawDataBe32() [2/2]

bool Kyra::StaticResource::loadRawDataBe32 ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 49 of file staticres_rpg.cpp.

◆ loadRoomTable() [1/2]

const Room * Kyra::StaticResource::loadRoomTable ( int  id,
int entries 
)

Definition at line 308 of file staticres.cpp.

◆ loadRoomTable() [2/2]

bool Kyra::StaticResource::loadRoomTable ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 494 of file staticres.cpp.

◆ loadShapeTable() [1/2]

const Shape * Kyra::StaticResource::loadShapeTable ( int  id,
int entries 
)

Definition at line 300 of file staticres.cpp.

◆ loadShapeTable() [2/2]

bool Kyra::StaticResource::loadShapeTable ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 457 of file staticres.cpp.

◆ loadSpellData() [1/2]

const SpellProperty * Kyra::StaticResource::loadSpellData ( int  id,
int entries 
)

Definition at line 37 of file staticres_lol.cpp.

◆ loadSpellData() [2/2]

bool Kyra::StaticResource::loadSpellData ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 103 of file staticres_lol.cpp.

◆ loadStaticResourceFile()

bool Kyra::StaticResource::loadStaticResourceFile ( )

Definition at line 132 of file staticres.cpp.

◆ loadStrings()

const char *const * Kyra::StaticResource::loadStrings ( int  id,
int strings 
)

Definition at line 292 of file staticres.cpp.

◆ loadStringTable()

bool Kyra::StaticResource::loadStringTable ( Common::SeekableReadStream stream,
void *&  ptr,
int size 
)
private

Definition at line 430 of file staticres.cpp.

◆ prefetchId()

bool Kyra::StaticResource::prefetchId ( int  id)

Definition at line 324 of file staticres.cpp.

◆ staticDataFilename()

static const Common::String Kyra::StaticResource::staticDataFilename ( )
inlinestatic

Definition at line 1031 of file resource.h.

◆ tryKyraDatLoad()

bool Kyra::StaticResource::tryKyraDatLoad ( )
private

Definition at line 172 of file staticres.cpp.

◆ unloadId()

void Kyra::StaticResource::unloadId ( int  id)

Definition at line 364 of file staticres.cpp.

Member Data Documentation

◆ _dataTable

DataMap Kyra::StaticResource::_dataTable
private

Definition at line 1187 of file resource.h.

◆ _fileLoader

const FileType* Kyra::StaticResource::_fileLoader
private

Definition at line 1177 of file resource.h.

◆ _resList

Common::List<ResData> Kyra::StaticResource::_resList
private

Definition at line 1175 of file resource.h.

◆ _vm

KyraEngine_v1* Kyra::StaticResource::_vm
private

Definition at line 1075 of file resource.h.


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