diff options
Diffstat (limited to 'engines/tinsel/scene.cpp')
-rw-r--r-- | engines/tinsel/scene.cpp | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index c5444517f1..986d54f59f 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -86,8 +86,8 @@ struct SCENE_STRUC { SCNHANDLE hTaggedActor; // handle to table of tagged actors int32 numProcess; // number of processes in this scene SCNHANDLE hProcess; // handle to table of processes - SCNHANDLE hMusicScript; // handle to music script data - SCNHANDLE hMusicSegment;// handle to music segments + SCNHANDLE hMusicScript; // handle to music script data - Tinsel 2 only + SCNHANDLE hMusicSegment;// handle to music segments - Tinsel 2 only } PACKED_STRUCT; /** entrance structure - one per entrance */ @@ -130,15 +130,15 @@ const SCENE_STRUC *GetSceneStruc(const byte *pStruc) { const byte *p = pStruc; memset(&g_tempStruc, 0, sizeof(SCENE_STRUC)); - g_tempStruc.numEntrance = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.numPoly = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.numTaggedActor = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.defRefer = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.hSceneScript = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.hEntrance = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.hPoly = READ_UINT32(p); p += sizeof(uint32); - g_tempStruc.hTaggedActor = READ_UINT32(p); p += sizeof(uint32); - + g_tempStruc.numEntrance = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.numPoly = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.numTaggedActor = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.defRefer = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.hSceneScript = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.hEntrance = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.hPoly = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + g_tempStruc.hTaggedActor = FROM_LE_32(READ_32(p)); p += sizeof(uint32); + return &g_tempStruc; } @@ -167,7 +167,7 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) { assert(_ctx->pInit->hTinselCode); // Must have some code to run _ctx->pic = InitInterpretContext(GS_SCENE, - READ_LE_UINT32(&_ctx->pInit->hTinselCode), + _ctx->pInit->hTinselCode, TinselV2 ? _ctx->pInit->event : NOEVENT, NOPOLY, // No polygon 0, // No actor @@ -209,7 +209,7 @@ void SendSceneTinselProcess(TINSEL_EVENT event) { */ static void LoadScene(SCNHANDLE scene, int entry) { - uint i; + int32 i; TP_INIT init; const SCENE_STRUC *ss; const ENTRANCE_STRUC *es; @@ -223,7 +223,7 @@ static void LoadScene(SCNHANDLE scene, int entry) { // CdPlay() stuff byte *cptr = FindChunk(scene, CHUNK_CDPLAY_FILENUM); assert(cptr); - i = READ_LE_UINT32(cptr); + i = READ_32(cptr); assert(i < 512); cptr = FindChunk(scene, CHUNK_CDPLAY_FILENAME); assert(cptr); @@ -238,18 +238,17 @@ static void LoadScene(SCNHANDLE scene, int entry) { // Music stuff char *cptr = (char *)FindChunk(scene, CHUNK_MUSIC_FILENAME); assert(cptr); - _vm->_pcmMusic->setMusicSceneDetails(FROM_LE_32(ss->hMusicScript), - FROM_LE_32(ss->hMusicSegment), cptr); + _vm->_pcmMusic->setMusicSceneDetails(ss->hMusicScript, ss->hMusicSegment, cptr); } if (entry == NO_ENTRY_NUM) { // Restoring scene // Initialize all the polygons for this scene - InitPolygons(FROM_LE_32(ss->hPoly), FROM_LE_32(ss->numPoly), true); + InitPolygons(ss->hPoly, ss->numPoly, true); // Initialize the actors for this scene - StartTaggedActors(FROM_LE_32(ss->hTaggedActor), FROM_LE_32(ss->numTaggedActor), false); + StartTaggedActors(ss->hTaggedActor, ss->numTaggedActor, false); if (TinselV2) // Returning from cutscene @@ -259,18 +258,18 @@ static void LoadScene(SCNHANDLE scene, int entry) { // Genuine new scene // Initialize all the polygons for this scene - InitPolygons(FROM_LE_32(ss->hPoly), FROM_LE_32(ss->numPoly), false); + InitPolygons(ss->hPoly, ss->numPoly, false); // Initialize the actors for this scene - StartTaggedActors(FROM_LE_32(ss->hTaggedActor), FROM_LE_32(ss->numTaggedActor), true); + StartTaggedActors(ss->hTaggedActor, ss->numTaggedActor, true); // Run the appropriate entrance code (if any) - es = (const ENTRANCE_STRUC *)LockMem(FROM_LE_32(ss->hEntrance)); - for (i = 0; i < FROM_LE_32(ss->numEntrance); i++) { - if (FROM_LE_32(es->eNumber) == (uint)entry) { + es = (const ENTRANCE_STRUC *)LockMem(ss->hEntrance); + for (i = 0; i < ss->numEntrance; i++) { + if (FROM_32(es->eNumber) == (uint)entry) { if (es->hScript) { init.event = STARTUP; - init.hTinselCode = es->hScript; + init.hTinselCode = FROM_32(es->hScript); CoroScheduler.createProcess(PID_TCODE, SceneTinselProcess, &init, sizeof(init)); } @@ -285,7 +284,7 @@ static void LoadScene(SCNHANDLE scene, int entry) { } - if (i == FROM_LE_32(ss->numEntrance)) + if (i == ss->numEntrance) error("Non-existant scene entry number"); if (ss->hSceneScript) { @@ -297,10 +296,10 @@ static void LoadScene(SCNHANDLE scene, int entry) { } // Default refer type - SetDefaultRefer(FROM_LE_32(ss->defRefer)); + SetDefaultRefer(ss->defRefer); // Scene's processes - SceneProcesses(FROM_LE_32(ss->numProcess), FROM_LE_32(ss->hProcess)); + SceneProcesses(ss->numProcess, ss->hProcess); } |