From aeac51d7263bf5233f3fb1f24d8a0789a9f8ca18 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 13 Jun 2012 11:00:58 +0300 Subject: SCI: Implement the file operations needed for the save dialog in Phantasmagoria Phantasmagoria's scripts keep polling for the existence of the savegame index file and request to read and write it using the same parameters when opening it. The index file is closed and reopened for every save slot, which is slow and can be much slower on non-desktop devices. Also, the game scripts request seeking in writable streams and request to expand the existing index file. To provide this functionality and to reduce constant slow file opening and closing, this virtual class has been introduced --- engines/sci/engine/state.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine/state.cpp') diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 28818cddef..237c6b54a6 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -26,6 +26,7 @@ #include "sci/debug.h" // for g_debug_sleeptime_factor #include "sci/event.h" +#include "sci/engine/file.h" #include "sci/engine/kernel.h" #include "sci/engine/state.h" #include "sci/engine/selector.h" @@ -68,21 +69,26 @@ static const uint16 s_halfWidthSJISMap[256] = { }; EngineState::EngineState(SegManager *segMan) -: _segMan(segMan), _dirseeker() { +: _segMan(segMan), +#ifdef ENABLE_SCI32 + _virtualIndexFile(0), +#endif + _dirseeker() { reset(false); } EngineState::~EngineState() { delete _msgState; +#ifdef ENABLE_SCI32 + delete _virtualIndexFile; +#endif } void EngineState::reset(bool isRestoring) { if (!isRestoring) { _memorySegmentSize = 0; - _fileHandles.resize(5); - abortScriptProcessing = kAbortNone; } -- cgit v1.2.3 From f06eb05e8c554a3462a98d18c04d5f5695074b26 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 23 Jun 2012 21:00:25 +0300 Subject: SCI: Implement kPlayVMD subop 23 (set palette range) Fixes the wrong palette during video sequences in GK2 and the demo of RAMA --- engines/sci/engine/state.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/sci/engine/state.cpp') diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 237c6b54a6..94a3fe3ae5 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -122,6 +122,8 @@ void EngineState::reset(bool isRestoring) { _videoState.reset(); _syncedAudioOptions = false; + _vmdPalStart = 0; + _vmdPalEnd = 256; } void EngineState::speedThrottler(uint32 neededSleep) { -- cgit v1.2.3 From fb215929efaefdf0b75521caab8a86e93181c5b2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 5 Jul 2012 13:42:00 +0300 Subject: SCI: Some updates to SCI32 kernel graphics functions - Added a stub for kSetScroll, which sets the target picture immediately for now - Added an initial stub of kPalCycle (doesn't work correctly yet) - Adjusted the signatures of kUpdateLine and kDeleteLine for LSL6 - Unmapped kSetHotRectangles again, with updated information on how it is used in Phantasmagoria --- engines/sci/engine/state.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/sci/engine/state.cpp') diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 94a3fe3ae5..0f0c8dcd66 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -122,8 +122,11 @@ void EngineState::reset(bool isRestoring) { _videoState.reset(); _syncedAudioOptions = false; + _vmdPalStart = 0; _vmdPalEnd = 256; + + _palCycleToColor = 255; } void EngineState::speedThrottler(uint32 neededSleep) { -- cgit v1.2.3