23 #ifndef M4_WSCRIPT_WS_LOAD_H 24 #define M4_WSCRIPT_WS_LOAD_H 26 #include "m4/m4_types.h" 27 #include "m4/fileio/sys_file.h" 28 #include "m4/mem/reloc.h" 29 #include "m4/wscript/ws_machine.h" 30 #include "m4/wscript/ws_univ.h" 34 #define _WS_ASSET_MACH 0 35 #define _WS_ASSET_SEQU 1 36 #define _WS_ASSET_CELS 2 37 #define _WS_ASSET_DATA 3 39 #define CHUNK_MACH 0x4D414348 //'MACH' 40 #define CHUNK_SEQU 0x53455155 //'SEQU' 41 #define CHUNK_DATA 0x44415441 //'DATA' 42 #define CHUNK_CELS 0x43454C53 //'CELS' 44 #define CHUNK_NECS 0x4E454353 //INTEL 'SCEN' 45 #define CHUNK_HCAM 0x4843414D //INTEL 'MACH' 46 #define CHUNK_UQES 0x55514553 //INTEL 'SEQU' 47 #define CHUNK_SLEC 0x534C4543 //INTEL 'CELS' 48 #define CHUNK_ATAD 0x41544144 //INTEL 'DATA' 50 #define MACH_NUM_STATES 0 51 #define MACH_OFFSETS 1 53 #define SEQU_NUM_VARS 0 54 #define SEQU_SEQU_START 1 56 #define DATA_REC_COUNT 0 57 #define DATA_REC_SIZE 1 58 #define DATA_REC_START 2 60 #define MAX_ASSET_HASH 255 63 bool _wsloaderInitialized =
false;
64 char **_globalMACHnames =
nullptr;
65 char **_globalSEQUnames =
nullptr;
66 char **_globalDATAnames =
nullptr;
67 char **_globalCELSnames =
nullptr;
69 MemHandle *_globalMACHHandles =
nullptr;
70 int32 *_globalMACHoffsets =
nullptr;
71 MemHandle *_globalSEQUHandles =
nullptr;
72 int32 *_globalSEQUoffsets =
nullptr;
73 MemHandle *_globalDATAHandles =
nullptr;
74 int32 *_globalDATAoffsets =
nullptr;
75 MemHandle *_globalCELSHandles =
nullptr;
76 int32 *_globalCELSoffsets =
nullptr;
77 int32 *_globalCELSPaloffsets =
nullptr;
81 bool ClearWSAssets(uint32 assetType, int32 minHash, int32 maxHash);
82 void ShutdownWSAssets();
84 bool LoadWSAssets(
const char *wsAssetName);
85 bool LoadWSAssets(
const char *wsAssetName,
RGB8 *myPalette);
86 int32 AddWSAssetCELS(
const char *wsAssetName, int32 hash,
RGB8 *myPalette);
87 M4sprite *GetWSAssetSprite(
char *spriteName, uint32 hash, uint32 index,
M4sprite *mySprite,
bool *streamSeries);
89 CCB *GetWSAssetCEL(uint32 hash, uint32 index,
CCB *myCCB);
90 int32 GetWSAssetCELCount(uint32 hash);
91 int32 GetWSAssetCELFrameRate(uint32 hash);
92 int32 GetWSAssetCELPixSpeed(uint32 hash);
93 int32 ws_get_sprite_width(uint32 hash, int32 index);
94 int32 ws_get_sprite_height(uint32 hash, int32 index);
95 MemHandle ws_GetSEQU(uint32 hash, int32 *numLocalVars, int32 *offset);
96 MemHandle ws_GetMACH(uint32 hash, int32 *numStates, int32 *stateTableOffset, int32 *machInstrOffset);
97 MemHandle ws_GetDATA(uint32 hash, uint32 index, int32 *rowOffset);
98 int32 ws_GetDATACount(uint32 hash);
100 bool ws_GetSSMaxWH(MemHandle ssHandle, int32 ssOffset, int32 *maxW, int32 *maxH);
103 int32 LoadSpriteSeries(
const char *assetName, MemHandle *seriesHandle, int32 *celsOffset, int32 *palOffset,
RGB8 *myPalette);
104 int32 LoadSpriteSeriesDirect(
const char *assetName, MemHandle *seriesHandle, int32 *celsOffset, int32 *palOffset,
RGB8 *myPalette);
105 M4sprite *CreateSprite(MemHandle resourceHandle, int32 handleOffset, int32 index,
M4sprite *mySprite,
bool *streamSeries);
108 bool ws_OpenSSstream(
SysFile *streamFile,
Anim8 *anim8);
109 bool ws_GetNextSSstreamCel(
Anim8 *anim8);
110 void ws_CloseSSstream(
CCB *myCCB);
Definition: ws_machine.h:115
Definition: m4_types.h:88
Definition: database.h:28
Definition: sys_file.h:47
Definition: ws_machine.h:99