From 4d0ebfaa2285e2741a134db36fb4f5bd0317784d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 04:03:20 +0200 Subject: ZVISION: Move the save manager together with the other file classes --- engines/zvision/scripting/script_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 4c1e69072d..2a4aa5fed0 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -27,7 +27,7 @@ #include "zvision/zvision.h" #include "zvision/graphics/render_manager.h" #include "zvision/graphics/cursors/cursor_manager.h" -#include "zvision/core/save_manager.h" +#include "zvision/file/save_manager.h" #include "zvision/scripting/actions.h" #include "zvision/scripting/sidefx/timer_node.h" -- cgit v1.2.3 From eea1ee445fcac7ecc53e31d258aac697d6b242f1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 13:14:24 +0200 Subject: ZVISION: Move more graphics code out of the main engine code --- engines/zvision/scripting/script_manager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 2a4aa5fed0..1a2b8362f5 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -29,6 +29,7 @@ #include "zvision/graphics/cursors/cursor_manager.h" #include "zvision/file/save_manager.h" #include "zvision/scripting/actions.h" +#include "zvision/scripting/menu.h" #include "zvision/scripting/sidefx/timer_node.h" #include "common/algorithm.h" @@ -583,7 +584,7 @@ void ScriptManager::ChangeLocationReal() { _referenceTable.clear(); addPuzzlesToReferenceTable(universe); - _engine->menuBarEnable(0xFFFF); + _engine->getMenuHandler()->setEnable(0xFFFF); if (_nextLocation.world != _currentLocation.world) { cleanScriptScope(nodeview); @@ -652,7 +653,7 @@ void ScriptManager::ChangeLocationReal() { execScope(nodeview); } - _engine->checkBorders(); + _engine->getRenderManager()->checkBorders(); } void ScriptManager::serialize(Common::WriteStream *stream) { -- cgit v1.2.3 From e5f0ee2271f4a43ff05b82380ab22eade9763702 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 26 Dec 2014 18:22:18 +0200 Subject: ZVISION: Implement auto-saving --- engines/zvision/scripting/script_manager.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 1a2b8362f5..d0ebb18944 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -569,10 +569,6 @@ void ScriptManager::ChangeLocationReal() { } else { if (_currentLocation.world == 'g' && _currentLocation.room == 'j') _engine->getSaveManager()->flushSaveBuffer(); - else { - // Auto save - //_engine->getSaveManager()->autoSave(); - } } setStateValue(StateKey_World, _nextLocation.world); -- cgit v1.2.3 From 68d3ebd57b0313e517032681a119b47956803e71 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Tue, 30 Dec 2014 01:10:36 -0600 Subject: ZVISION: Rename some scripting classes to better represent what the classes are Also, rename the graphics 'Effect' class in order to avoid naming clashes (and/or coder confusion) with the newly named ScriptingEffect class. Lastly, add some documentation for the classes for further clarity. --- engines/zvision/scripting/script_manager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index d0ebb18944..464e8bfe4d 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -30,7 +30,7 @@ #include "zvision/file/save_manager.h" #include "zvision/scripting/actions.h" #include "zvision/scripting/menu.h" -#include "zvision/scripting/sidefx/timer_node.h" +#include "zvision/scripting/effects/timer_effect.h" #include "common/algorithm.h" #include "common/hashmap.h" @@ -382,11 +382,11 @@ void ScriptManager::setFocusControlKey(uint32 key) { _currentlyFocusedControl = key; } -void ScriptManager::addSideFX(SideFX *fx) { +void ScriptManager::addSideFX(ScriptingEffect *fx) { _activeSideFx.push_back(fx); } -SideFX *ScriptManager::getSideFX(uint32 key) { +ScriptingEffect *ScriptManager::getSideFX(uint32 key) { for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); ++iter) { if ((*iter)->getKey() == key) { return (*iter); @@ -430,7 +430,7 @@ void ScriptManager::killSideFx(uint32 key) { } } -void ScriptManager::killSideFxType(SideFX::SideFXType type) { +void ScriptManager::killSideFxType(ScriptingEffect::ScriptingEffectType type) { for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end();) { if ((*iter)->getType() & type) { (*iter)->kill(); -- cgit v1.2.3 From 9f642074ba8e17aa23b01bcee82b2293fe84f8f1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 2 Jan 2015 04:52:53 +0200 Subject: ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot) This is handled internally now, so r.svr isn't needed anymore --- engines/zvision/scripting/script_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 464e8bfe4d..ba38d3a0e4 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -686,7 +686,7 @@ void ScriptManager::serialize(Common::WriteStream *stream) { stream->writeSint16LE(getStateValue(i)); } -void ScriptManager::deserialize(Common::SeekableReadStream *stream) { +void ScriptManager::reset() { // Clear out the current table values _globalState.clear(); _globalStateFlags.clear(); @@ -706,6 +706,10 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { _activeSideFx.clear(); _referenceTable.clear(); +} + +void ScriptManager::deserialize(Common::SeekableReadStream *stream) { + reset(); if (stream->readUint32BE() != MKTAG('Z', 'N', 'S', 'G') || stream->readUint32LE() != 4) { changeLocation('g', 'a', 'r', 'y', 0); -- cgit v1.2.3 From 616b34e629686d7bfc3e5a74658c6a76b4a45c94 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 10 Jan 2015 17:30:11 +0200 Subject: ZVISION: Change wording --- engines/zvision/scripting/script_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index ba38d3a0e4..8220d5c37c 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -500,7 +500,7 @@ void ScriptManager::changeLocation(char _world, char _room, char _node, char _vi _nextLocation.node = _node; _nextLocation.view = _view; _nextLocation.offset = offset; - // If next location 0000 - it's indicate to go to previous location. + // If next location is 0000, return to the previous location. if (_nextLocation.world == '0' && _nextLocation.room == '0' && _nextLocation.node == '0' && _nextLocation.view == '0') { if (getStateValue(StateKey_World) != 'g' || getStateValue(StateKey_Room) != 'j') { _nextLocation.world = getStateValue(StateKey_LastWorld); -- cgit v1.2.3 From 21e9007d80ee60e519896c330324e5e3a95f772f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 10 Jan 2015 22:03:15 +0200 Subject: Revert "ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot)" This reverts commit 9f642074ba8e17aa23b01bcee82b2293fe84f8f1, as it broke the credits screen in ZGI. This has been rewritten to use the common save code --- engines/zvision/scripting/script_manager.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 8220d5c37c..ad049434c3 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -686,7 +686,7 @@ void ScriptManager::serialize(Common::WriteStream *stream) { stream->writeSint16LE(getStateValue(i)); } -void ScriptManager::reset() { +void ScriptManager::deserialize(Common::SeekableReadStream *stream) { // Clear out the current table values _globalState.clear(); _globalStateFlags.clear(); @@ -706,10 +706,6 @@ void ScriptManager::reset() { _activeSideFx.clear(); _referenceTable.clear(); -} - -void ScriptManager::deserialize(Common::SeekableReadStream *stream) { - reset(); if (stream->readUint32BE() != MKTAG('Z', 'N', 'S', 'G') || stream->readUint32LE() != 4) { changeLocation('g', 'a', 'r', 'y', 0); -- cgit v1.2.3 From a26a9c7268d27cb1f7407f5cf48038303f443197 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 18 Jan 2015 17:06:24 -0600 Subject: ZVISION: Fix formatting and add curlies --- engines/zvision/scripting/script_manager.cpp | 196 +++++++++++++++++---------- 1 file changed, 126 insertions(+), 70 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index ad049434c3..4792a02045 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -72,21 +72,24 @@ void ScriptManager::initialize() { } void ScriptManager::update(uint deltaTimeMillis) { - if (_currentLocation.node != _nextLocation.node || - _currentLocation.room != _nextLocation.room || - _currentLocation.view != _nextLocation.view || - _currentLocation.world != _nextLocation.world) + if (_currentLocation.node != _nextLocation.node || _currentLocation.room != _nextLocation.room || + _currentLocation.view != _nextLocation.view || _currentLocation.world != _nextLocation.world) { ChangeLocationReal(); + } updateNodes(deltaTimeMillis); - if (! execScope(nodeview)) + if (! execScope(nodeview)) { return; - if (! execScope(room)) + } + if (! execScope(room)) { return; - if (! execScope(world)) + } + if (! execScope(world)) { return; - if (! execScope(universe)) + } + if (! execScope(universe)) { return; + } updateControls(deltaTimeMillis); } @@ -97,17 +100,22 @@ bool ScriptManager::execScope(ScriptScope &scope) { scope.scopeQueue = tmp; scope.scopeQueue->clear(); - for (PuzzleList::iterator PuzzleIter = scope.puzzles.begin(); PuzzleIter != scope.puzzles.end(); ++PuzzleIter) + for (PuzzleList::iterator PuzzleIter = scope.puzzles.begin(); PuzzleIter != scope.puzzles.end(); ++PuzzleIter) { (*PuzzleIter)->addedBySetState = false; + } if (scope.procCount < 2 || getStateValue(StateKey_ExecScopeStyle)) { - for (PuzzleList::iterator PuzzleIter = scope.puzzles.begin(); PuzzleIter != scope.puzzles.end(); ++PuzzleIter) - if (!checkPuzzleCriteria(*PuzzleIter, scope.procCount)) + for (PuzzleList::iterator PuzzleIter = scope.puzzles.begin(); PuzzleIter != scope.puzzles.end(); ++PuzzleIter) { + if (!checkPuzzleCriteria(*PuzzleIter, scope.procCount)) { return false; + } + } } else { - for (PuzzleList::iterator PuzzleIter = scope.execQueue->begin(); PuzzleIter != scope.execQueue->end(); ++PuzzleIter) - if (!checkPuzzleCriteria(*PuzzleIter, scope.procCount)) + for (PuzzleList::iterator PuzzleIter = scope.execQueue->begin(); PuzzleIter != scope.execQueue->end(); ++PuzzleIter) { + if (!checkPuzzleCriteria(*PuzzleIter, scope.procCount)) { return false; + } + } } if (scope.procCount < 2) { @@ -119,9 +127,11 @@ bool ScriptManager::execScope(ScriptScope &scope) { void ScriptManager::referenceTableAddPuzzle(uint32 key, PuzzleRef ref) { if (_referenceTable.contains(key)) { Common::Array *arr = &_referenceTable[key]; - for (uint32 i = 0; i < arr->size(); i++) - if ((*arr)[i].puz == ref.puz) + for (uint32 i = 0; i < arr->size(); i++) { + if ((*arr)[i].puz == ref.puz) { return; + } + } } _referenceTable[key].push_back(ref); @@ -139,9 +149,11 @@ void ScriptManager::addPuzzlesToReferenceTable(ScriptScope &scope) { referenceTableAddPuzzle(puzzlePtr->key, ref); // Iterate through each CriteriaEntry and add a reference from the criteria key to the Puzzle - for (Common::List >::iterator criteriaIter = (*PuzzleIter)->criteriaList.begin(); criteriaIter != (*PuzzleIter)->criteriaList.end(); ++criteriaIter) - for (Common::List::iterator entryIter = criteriaIter->begin(); entryIter != criteriaIter->end(); ++entryIter) + for (Common::List >::iterator criteriaIter = (*PuzzleIter)->criteriaList.begin(); criteriaIter != (*PuzzleIter)->criteriaList.end(); ++criteriaIter) { + for (Common::List::iterator entryIter = criteriaIter->begin(); entryIter != criteriaIter->end(); ++entryIter) { referenceTableAddPuzzle(entryIter->key, ref); + } + } } } @@ -159,8 +171,9 @@ void ScriptManager::updateNodes(uint deltaTimeMillis) { } void ScriptManager::updateControls(uint deltaTimeMillis) { - if (!_activeControls) + if (!_activeControls) { return; + } // Process only one event if (!_controlEvents.empty()) { @@ -187,9 +200,11 @@ void ScriptManager::updateControls(uint deltaTimeMillis) { _controlEvents.pop_front(); } - for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); iter++) - if ((*iter)->process(deltaTimeMillis)) + for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); iter++) { + if ((*iter)->process(deltaTimeMillis)) { break; + } + } } bool ScriptManager::checkPuzzleCriteria(Puzzle *puzzle, uint counter) { @@ -200,8 +215,9 @@ bool ScriptManager::checkPuzzleCriteria(Puzzle *puzzle, uint counter) { } // Check each Criteria - if (counter == 0 && (getStateFlag(puzzle->key) & Puzzle::DO_ME_NOW) == 0) + if (counter == 0 && (getStateFlag(puzzle->key) & Puzzle::DO_ME_NOW) == 0) { return true; + } bool criteriaMet = false; for (Common::List >::iterator criteriaIter = puzzle->criteriaList.begin(); criteriaIter != puzzle->criteriaList.end(); ++criteriaIter) { @@ -210,10 +226,11 @@ bool ScriptManager::checkPuzzleCriteria(Puzzle *puzzle, uint counter) { for (Common::List::iterator entryIter = criteriaIter->begin(); entryIter != criteriaIter->end(); ++entryIter) { // Get the value to compare against int argumentValue; - if (entryIter->argumentIsAKey) + if (entryIter->argumentIsAKey) { argumentValue = getStateValue(entryIter->argument); - else + } else { argumentValue = entryIter->argument; + } // Do the comparison switch (entryIter->criteriaOperator) { @@ -251,8 +268,9 @@ bool ScriptManager::checkPuzzleCriteria(Puzzle *puzzle, uint counter) { setStateValue(puzzle->key, 1); for (Common::List::iterator resultIter = puzzle->resultActions.begin(); resultIter != puzzle->resultActions.end(); ++resultIter) { - if (!(*resultIter)->execute()) + if (!(*resultIter)->execute()) { return false; + } } } @@ -275,13 +293,15 @@ void ScriptManager::cleanScriptScope(ScriptScope &scope) { scope.privQueueTwo.clear(); scope.scopeQueue = &scope.privQueueOne; scope.execQueue = &scope.privQueueTwo; - for (PuzzleList::iterator iter = scope.puzzles.begin(); iter != scope.puzzles.end(); ++iter) + for (PuzzleList::iterator iter = scope.puzzles.begin(); iter != scope.puzzles.end(); ++iter) { delete(*iter); + } scope.puzzles.clear(); - for (ControlList::iterator iter = scope.controls.begin(); iter != scope.controls.end(); ++iter) + for (ControlList::iterator iter = scope.controls.begin(); iter != scope.controls.end(); ++iter) { delete(*iter); + } scope.controls.clear(); @@ -289,44 +309,49 @@ void ScriptManager::cleanScriptScope(ScriptScope &scope) { } int ScriptManager::getStateValue(uint32 key) { - if (_globalState.contains(key)) + if (_globalState.contains(key)) { return _globalState[key]; - else + } else { return 0; + } } void ScriptManager::queuePuzzles(uint32 key) { if (_referenceTable.contains(key)) { Common::Array *arr = &_referenceTable[key]; - for (int32 i = arr->size() - 1; i >= 0; i--) + for (int32 i = arr->size() - 1; i >= 0; i--) { if (!(*arr)[i].puz->addedBySetState) { (*arr)[i].scope->scopeQueue->push_back((*arr)[i].puz); (*arr)[i].puz->addedBySetState = true; } + } } } void ScriptManager::setStateValue(uint32 key, int value) { - if (value == 0) + if (value == 0) { _globalState.erase(key); - else + } else { _globalState[key] = value; + } queuePuzzles(key); } void ScriptManager::setStateValueSilent(uint32 key, int value) { - if (value == 0) + if (value == 0) { _globalState.erase(key); - else + } else { _globalState[key] = value; + } } uint ScriptManager::getStateFlag(uint32 key) { - if (_globalStateFlags.contains(key)) + if (_globalStateFlags.contains(key)) { return _globalStateFlags[key]; - else + } else { return 0; + } } void ScriptManager::setStateFlag(uint32 key, uint value) { @@ -336,10 +361,11 @@ void ScriptManager::setStateFlag(uint32 key, uint value) { } void ScriptManager::setStateFlagSilent(uint32 key, uint value) { - if (value == 0) + if (value == 0) { _globalStateFlags.erase(key); - else + } else { _globalStateFlags[key] = value; + } } void ScriptManager::unsetStateFlag(uint32 key, uint value) { @@ -348,23 +374,29 @@ void ScriptManager::unsetStateFlag(uint32 key, uint value) { if (_globalStateFlags.contains(key)) { _globalStateFlags[key] &= ~value; - if (_globalStateFlags[key] == 0) + if (_globalStateFlags[key] == 0) { _globalStateFlags.erase(key); + } } } Control *ScriptManager::getControl(uint32 key) { - for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); ++iter) - if ((*iter)->getKey() == key) + for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); ++iter) { + if ((*iter)->getKey() == key) { return *iter; + } + } + return nullptr; } void ScriptManager::focusControl(uint32 key) { - if (!_activeControls) + if (!_activeControls) { return; - if (_currentlyFocusedControl == key) + } + if (_currentlyFocusedControl == key) { return; + } for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); ++iter) { uint32 controlKey = (*iter)->getKey(); @@ -443,50 +475,60 @@ void ScriptManager::killSideFxType(ScriptingEffect::ScriptingEffectType type) { } void ScriptManager::onMouseDown(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { - if (!_activeControls) + if (!_activeControls) { return; + } for (ControlList::iterator iter = _activeControls->reverse_begin(); iter != _activeControls->end(); iter--) { - if ((*iter)->onMouseDown(screenSpacePos, backgroundImageSpacePos)) + if ((*iter)->onMouseDown(screenSpacePos, backgroundImageSpacePos)) { return; + } } } void ScriptManager::onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { - if (!_activeControls) + if (!_activeControls) { return; + } for (ControlList::iterator iter = _activeControls->reverse_begin(); iter != _activeControls->end(); iter--) { - if ((*iter)->onMouseUp(screenSpacePos, backgroundImageSpacePos)) + if ((*iter)->onMouseUp(screenSpacePos, backgroundImageSpacePos)) { return; + } } } bool ScriptManager::onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { - if (!_activeControls) + if (!_activeControls) { return false; + } for (ControlList::iterator iter = _activeControls->reverse_begin(); iter != _activeControls->end(); iter--) { - if ((*iter)->onMouseMove(screenSpacePos, backgroundImageSpacePos)) + if ((*iter)->onMouseMove(screenSpacePos, backgroundImageSpacePos)) { return true; + } } return false; } void ScriptManager::onKeyDown(Common::KeyState keyState) { - if (!_activeControls) + if (!_activeControls) { return; + } for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); ++iter) { - if ((*iter)->onKeyDown(keyState)) + if ((*iter)->onKeyDown(keyState)) { return; + } } } void ScriptManager::onKeyUp(Common::KeyState keyState) { - if (!_activeControls) + if (!_activeControls) { return; + } for (ControlList::iterator iter = _activeControls->begin(); iter != _activeControls->end(); ++iter) { - if ((*iter)->onKeyUp(keyState)) + if ((*iter)->onKeyUp(keyState)) { return; + } } } @@ -539,8 +581,9 @@ void ScriptManager::ChangeLocationReal() { _currentLocation.node = '0'; _currentLocation.view = '0'; _currentLocation.offset = 0; - } else + } else { return; + } } } @@ -563,12 +606,13 @@ void ScriptManager::ChangeLocationReal() { } if (_nextLocation.world == 'g' && _nextLocation.room == 'j') { - if (_nextLocation.node == 's' && _nextLocation.view == 'e' && - _currentLocation.world != 'g' && _currentLocation.room != 'j') + if (_nextLocation.node == 's' && _nextLocation.view == 'e' && _currentLocation.world != 'g' && _currentLocation.room != 'j') { _engine->getSaveManager()->prepareSaveBuffer(); + } } else { - if (_currentLocation.world == 'g' && _currentLocation.room == 'j') + if (_currentLocation.world == 'g' && _currentLocation.room == 'j') { _engine->getSaveManager()->flushSaveBuffer(); + } } setStateValue(StateKey_World, _nextLocation.world); @@ -664,26 +708,30 @@ void ScriptManager::serialize(Common::WriteStream *stream) { stream->writeByte(getStateValue(StateKey_View)); stream->writeUint32LE(getStateValue(StateKey_ViewPos)); - for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); ++iter) + for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); ++iter) { (*iter)->serialize(stream); + } stream->writeUint32BE(MKTAG('F', 'L', 'A', 'G')); int32 slots = 20000; - if (_engine->getGameId() == GID_NEMESIS) + if (_engine->getGameId() == GID_NEMESIS) { slots = 30000; + } stream->writeUint32LE(slots * 2); - for (int32 i = 0; i < slots; i++) + for (int32 i = 0; i < slots; i++) { stream->writeUint16LE(getStateFlag(i)); + } stream->writeUint32BE(MKTAG('P', 'U', 'Z', 'Z')); stream->writeUint32LE(slots * 2); - for (int32 i = 0; i < slots; i++) + for (int32 i = 0; i < slots; i++) { stream->writeSint16LE(getStateValue(i)); + } } void ScriptManager::deserialize(Common::SeekableReadStream *stream) { @@ -700,8 +748,9 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { _currentLocation.room = 0; _currentLocation.view = 0; - for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); iter++) + for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); iter++) { delete(*iter); + } _activeSideFx.clear(); @@ -734,20 +783,23 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { case MKTAG('T', 'I', 'M', 'R'): { uint32 key = stream->readUint32LE(); uint32 time = stream->readUint32LE(); - if (_engine->getGameId() == GID_GRANDINQUISITOR) + if (_engine->getGameId() == GID_GRANDINQUISITOR) { time /= 100; - else if (_engine->getGameId() == GID_NEMESIS) + } else if (_engine->getGameId() == GID_NEMESIS) { time /= 1000; + } addSideFX(new TimerNode(_engine, key, time)); } break; case MKTAG('F', 'L', 'A', 'G'): - for (uint32 i = 0; i < tagSize / 2; i++) + for (uint32 i = 0; i < tagSize / 2; i++) { setStateFlagSilent(i, stream->readUint16LE()); + } break; case MKTAG('P', 'U', 'Z', 'Z'): - for (uint32 i = 0; i < tagSize / 2; i++) + for (uint32 i = 0; i < tagSize / 2; i++) { setStateValueSilent(i, stream->readUint16LE()); + } break; default: stream->seek(tagSize, SEEK_CUR); @@ -801,10 +853,11 @@ void ScriptManager::flushEvent(Common::EventType type) { EventList::iterator it = _controlEvents.begin(); while (it != _controlEvents.end()) { - if ((*it).type == type) + if ((*it).type == type) { it = _controlEvents.erase(it); - else + } else { it++; + } } } @@ -833,12 +886,15 @@ ValueSlot::ValueSlot(ScriptManager *scriptManager, const char *slotValue): } int16 ValueSlot::getValue() { if (slot) { - if (value >= 0) + if (value >= 0) { return _scriptManager->getStateValue(value); - else + } + else { return 0; - } else + } + } else { return value; + } } } // End of namespace ZVision -- cgit v1.2.3 From b835eacc0cd401bb0d15a33e60d2ac47ebb4d718 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 18 Jan 2015 19:26:49 -0600 Subject: ZVISION: Don't change location when coming back from ScummVM save dialog Fixes bug # 6771 We don't need to change locations, since we use the ScummVM save dialog instead of the original one (which is actually a location). Instead we just need to reset _nextLocation to _currentLocation so the engine can stop trying to save. If we change locations, the StateKey_LastWorld/Room/etc. end up being overwritten with the current room. So if a script refers to location 0, 0, 0, 0 (aka, the last room), the engine will try to change location to the same room. --- engines/zvision/scripting/script_manager.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 4792a02045..a4ab4579b5 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -576,11 +576,8 @@ void ScriptManager::ChangeLocationReal() { _nextLocation.node = _currentLocation.node; _nextLocation.view = _currentLocation.view; _nextLocation.offset = _currentLocation.offset; - _currentLocation.world = '0'; - _currentLocation.room = '0'; - _currentLocation.node = '0'; - _currentLocation.view = '0'; - _currentLocation.offset = 0; + + return; } else { return; } @@ -743,11 +740,6 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { cleanScriptScope(room); cleanScriptScope(world); - _currentLocation.node = 0; - _currentLocation.world = 0; - _currentLocation.room = 0; - _currentLocation.view = 0; - for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); iter++) { delete(*iter); } -- cgit v1.2.3 From 0fafb6a62c13f6f5a4ef6215a4be592ed84f248c Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 18 Jan 2015 20:11:10 -0600 Subject: Revert "ZVISION: Don't change location when coming back from ScummVM save dialog" This reverts commit b835eacc0cd401bb0d15a33e60d2ac47ebb4d718. --- engines/zvision/scripting/script_manager.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index a4ab4579b5..4792a02045 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -576,8 +576,11 @@ void ScriptManager::ChangeLocationReal() { _nextLocation.node = _currentLocation.node; _nextLocation.view = _currentLocation.view; _nextLocation.offset = _currentLocation.offset; - - return; + _currentLocation.world = '0'; + _currentLocation.room = '0'; + _currentLocation.node = '0'; + _currentLocation.view = '0'; + _currentLocation.offset = 0; } else { return; } @@ -740,6 +743,11 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { cleanScriptScope(room); cleanScriptScope(world); + _currentLocation.node = 0; + _currentLocation.world = 0; + _currentLocation.room = 0; + _currentLocation.view = 0; + for (SideFXList::iterator iter = _activeSideFx.begin(); iter != _activeSideFx.end(); iter++) { delete(*iter); } -- cgit v1.2.3 From 3a31e1de96a860b9f971cef939cb8a4aed8bcd5d Mon Sep 17 00:00:00 2001 From: RichieSams Date: Sun, 18 Jan 2015 20:22:02 -0600 Subject: ZVISION: Don't change location when coming back from ScummVM save dialog and do change location when coming back from restore dialog Fixes bug # 6771 We don't need to change locations, since we use the ScummVM save dialog instead of the original one (which is actually a location). Instead we just need to reset _nextLocation to _currentLocation so the engine can stop trying to save. If we change locations, the StateKey_LastWorld/Room/etc. end up being overwritten with the current room. So if a script refers to location 0, 0, 0, 0 (aka, the last room), the engine will try to change location to the same room. On restore, we have to force a location change, just in case we restore to the same room. (Since the logic will only do a location change if _nextLocation != _currentLocation) --- engines/zvision/scripting/script_manager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 4792a02045..b45f17a6f1 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -576,13 +576,14 @@ void ScriptManager::ChangeLocationReal() { _nextLocation.node = _currentLocation.node; _nextLocation.view = _currentLocation.view; _nextLocation.offset = _currentLocation.offset; - _currentLocation.world = '0'; + + return; + } else { + _currentLocation.world = 'g'; _currentLocation.room = '0'; _currentLocation.node = '0'; _currentLocation.view = '0'; _currentLocation.offset = 0; - } else { - return; } } } -- cgit v1.2.3 From 68b7839d994d536c7e65b3bfe5045ba164bbedd5 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 19 Jan 2015 05:09:03 +0200 Subject: ZVISION: Fix bug #6768 (unable to save in the prison area) The save buffer preparation code had a bug, which triggered in the jail area because its room is 'j' --- engines/zvision/scripting/script_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index b45f17a6f1..df74fd69dc 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -607,7 +607,7 @@ void ScriptManager::ChangeLocationReal() { } if (_nextLocation.world == 'g' && _nextLocation.room == 'j') { - if (_nextLocation.node == 's' && _nextLocation.view == 'e' && _currentLocation.world != 'g' && _currentLocation.room != 'j') { + if (_nextLocation.node == 's' && _nextLocation.view == 'e' && _currentLocation.world != 'g') { _engine->getSaveManager()->prepareSaveBuffer(); } } else { -- cgit v1.2.3 From dcac5be493a98764239619d5da60d6bc0f608383 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 19 Jan 2015 23:52:08 +0200 Subject: ZVISION: Simplify the checks in the location changing code --- engines/zvision/scripting/script_manager.cpp | 42 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index df74fd69dc..bcc1f0a5ff 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -564,12 +564,16 @@ void ScriptManager::ChangeLocationReal() { assert(_nextLocation.world != 0); debug(1, "Changing location to: %c %c %c %c %u", _nextLocation.world, _nextLocation.room, _nextLocation.node, _nextLocation.view, _nextLocation.offset); - if (_nextLocation.world == 'g' && _nextLocation.room == 'j' && !ConfMan.getBool("originalsaveload")) { - if ((_nextLocation.node == 's' || _nextLocation.node == 'r') && _nextLocation.view == 'e') { + const bool enteringMenu = (_nextLocation.world == 'g' && _nextLocation.room == 'j'); + const bool leavingMenu = (_currentLocation.world == 'g' && _currentLocation.room == 'j'); + const bool isSaveScreen = (enteringMenu && _nextLocation.node == 's' && _nextLocation.view == 'e'); + const bool isRestoreScreen = (enteringMenu && _nextLocation.node == 'r' && _nextLocation.view == 'e'); + + if (enteringMenu && !ConfMan.getBool("originalsaveload")) { + if (isSaveScreen || isRestoreScreen) { // Hook up the ScummVM save/restore dialog - bool isSave = (_nextLocation.node == 's'); - bool gameSavedOrLoaded = _engine->getSaveManager()->scummVMSaveLoadDialog(isSave); - if (!gameSavedOrLoaded || isSave) { + bool gameSavedOrLoaded = _engine->getSaveManager()->scummVMSaveLoadDialog(isSaveScreen); + if (!gameSavedOrLoaded || isSaveScreen) { // Reload the current room _nextLocation.world = _currentLocation.world; _nextLocation.room = _currentLocation.room; @@ -590,30 +594,26 @@ void ScriptManager::ChangeLocationReal() { _engine->setRenderDelay(2); - if (getStateValue(StateKey_World) != 'g' || getStateValue(StateKey_Room) != 'j') { - if (_nextLocation.world != 'g' || _nextLocation.room != 'j') { + if (!enteringMenu) { + if (!leavingMenu) { setStateValue(StateKey_LastWorld, getStateValue(StateKey_World)); setStateValue(StateKey_LastRoom, getStateValue(StateKey_Room)); setStateValue(StateKey_LastNode, getStateValue(StateKey_Node)); setStateValue(StateKey_LastView, getStateValue(StateKey_View)); setStateValue(StateKey_LastViewPos, getStateValue(StateKey_ViewPos)); - } else { - setStateValue(StateKey_Menu_LastWorld, getStateValue(StateKey_World)); - setStateValue(StateKey_Menu_LastRoom, getStateValue(StateKey_Room)); - setStateValue(StateKey_Menu_LastNode, getStateValue(StateKey_Node)); - setStateValue(StateKey_Menu_LastView, getStateValue(StateKey_View)); - setStateValue(StateKey_Menu_LastViewPos, getStateValue(StateKey_ViewPos)); } + } else { + setStateValue(StateKey_Menu_LastWorld, getStateValue(StateKey_World)); + setStateValue(StateKey_Menu_LastRoom, getStateValue(StateKey_Room)); + setStateValue(StateKey_Menu_LastNode, getStateValue(StateKey_Node)); + setStateValue(StateKey_Menu_LastView, getStateValue(StateKey_View)); + setStateValue(StateKey_Menu_LastViewPos, getStateValue(StateKey_ViewPos)); } - if (_nextLocation.world == 'g' && _nextLocation.room == 'j') { - if (_nextLocation.node == 's' && _nextLocation.view == 'e' && _currentLocation.world != 'g') { - _engine->getSaveManager()->prepareSaveBuffer(); - } - } else { - if (_currentLocation.world == 'g' && _currentLocation.room == 'j') { - _engine->getSaveManager()->flushSaveBuffer(); - } + if (isSaveScreen && !leavingMenu) { + _engine->getSaveManager()->prepareSaveBuffer(); + } else if (leavingMenu) { + _engine->getSaveManager()->flushSaveBuffer(); } setStateValue(StateKey_World, _nextLocation.world); -- cgit v1.2.3 From 5df2e08c1668c6649f7817688ce1ce198e563083 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 19 Jan 2015 23:54:07 +0200 Subject: ZVISION: Fix bug #6771 (unable to leave room when loading a game) Avoid overwriting the previous location when loading a saved game --- engines/zvision/scripting/script_manager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index bcc1f0a5ff..34376cee5b 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -74,7 +74,7 @@ void ScriptManager::initialize() { void ScriptManager::update(uint deltaTimeMillis) { if (_currentLocation.node != _nextLocation.node || _currentLocation.room != _nextLocation.room || _currentLocation.view != _nextLocation.view || _currentLocation.world != _nextLocation.world) { - ChangeLocationReal(); + ChangeLocationReal(false); } updateNodes(deltaTimeMillis); @@ -560,7 +560,7 @@ void ScriptManager::changeLocation(char _world, char _room, char _node, char _vi } } -void ScriptManager::ChangeLocationReal() { +void ScriptManager::ChangeLocationReal(bool isLoading) { assert(_nextLocation.world != 0); debug(1, "Changing location to: %c %c %c %c %u", _nextLocation.world, _nextLocation.room, _nextLocation.node, _nextLocation.view, _nextLocation.offset); @@ -595,7 +595,7 @@ void ScriptManager::ChangeLocationReal() { _engine->setRenderDelay(2); if (!enteringMenu) { - if (!leavingMenu) { + if (!isLoading && !leavingMenu) { setStateValue(StateKey_LastWorld, getStateValue(StateKey_World)); setStateValue(StateKey_LastRoom, getStateValue(StateKey_Room)); setStateValue(StateKey_LastNode, getStateValue(StateKey_Node)); @@ -809,7 +809,7 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) { _nextLocation = nextLocation; - ChangeLocationReal(); + ChangeLocationReal(true); _engine->setRenderDelay(10); setStateValue(StateKey_RestoreFlag, 1); -- cgit v1.2.3 From 5f9858844a24b00e75ef2c504b2d68c189261dd2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 20 Jan 2015 01:21:16 +0200 Subject: ZVISION: Fix saving when using the original save dialog A regression from commit dcac5be493 --- engines/zvision/scripting/script_manager.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 34376cee5b..a4491103e6 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -594,26 +594,30 @@ void ScriptManager::ChangeLocationReal(bool isLoading) { _engine->setRenderDelay(2); - if (!enteringMenu) { - if (!isLoading && !leavingMenu) { + if (!leavingMenu) { + if (!isLoading && !enteringMenu) { setStateValue(StateKey_LastWorld, getStateValue(StateKey_World)); setStateValue(StateKey_LastRoom, getStateValue(StateKey_Room)); setStateValue(StateKey_LastNode, getStateValue(StateKey_Node)); setStateValue(StateKey_LastView, getStateValue(StateKey_View)); setStateValue(StateKey_LastViewPos, getStateValue(StateKey_ViewPos)); + } else { + setStateValue(StateKey_Menu_LastWorld, getStateValue(StateKey_World)); + setStateValue(StateKey_Menu_LastRoom, getStateValue(StateKey_Room)); + setStateValue(StateKey_Menu_LastNode, getStateValue(StateKey_Node)); + setStateValue(StateKey_Menu_LastView, getStateValue(StateKey_View)); + setStateValue(StateKey_Menu_LastViewPos, getStateValue(StateKey_ViewPos)); } - } else { - setStateValue(StateKey_Menu_LastWorld, getStateValue(StateKey_World)); - setStateValue(StateKey_Menu_LastRoom, getStateValue(StateKey_Room)); - setStateValue(StateKey_Menu_LastNode, getStateValue(StateKey_Node)); - setStateValue(StateKey_Menu_LastView, getStateValue(StateKey_View)); - setStateValue(StateKey_Menu_LastViewPos, getStateValue(StateKey_ViewPos)); } - if (isSaveScreen && !leavingMenu) { - _engine->getSaveManager()->prepareSaveBuffer(); - } else if (leavingMenu) { - _engine->getSaveManager()->flushSaveBuffer(); + if (enteringMenu) { + if (isSaveScreen && !leavingMenu) { + _engine->getSaveManager()->prepareSaveBuffer(); + } + } else { + if (leavingMenu) { + _engine->getSaveManager()->flushSaveBuffer(); + } } setStateValue(StateKey_World, _nextLocation.world); -- cgit v1.2.3 From 1330cb7c99478c67a722ff3bd35567dcd59f8fdf Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 21 Jan 2015 01:41:35 +0200 Subject: ZVISION: Remove superfluous check --- engines/zvision/scripting/script_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index a4491103e6..d10cd81438 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -210,7 +210,7 @@ void ScriptManager::updateControls(uint deltaTimeMillis) { bool ScriptManager::checkPuzzleCriteria(Puzzle *puzzle, uint counter) { // Check if the puzzle is already finished // Also check that the puzzle isn't disabled - if (getStateValue(puzzle->key) == 1 || (getStateFlag(puzzle->key) & Puzzle::DISABLED) == Puzzle::DISABLED) { + if (getStateValue(puzzle->key) == 1 || (getStateFlag(puzzle->key) & Puzzle::DISABLED)) { return true; } -- cgit v1.2.3 From 796fb134f1af6b3617b7687d2a89ab51dd1aa63d Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 21 Jan 2015 01:24:59 +0100 Subject: ZVISION: Remove unnecessary spaces --- engines/zvision/scripting/script_manager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index d10cd81438..71966b3125 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -78,16 +78,16 @@ void ScriptManager::update(uint deltaTimeMillis) { } updateNodes(deltaTimeMillis); - if (! execScope(nodeview)) { + if (!execScope(nodeview)) { return; } - if (! execScope(room)) { + if (!execScope(room)) { return; } - if (! execScope(world)) { + if (!execScope(world)) { return; } - if (! execScope(universe)) { + if (!execScope(universe)) { return; } updateControls(deltaTimeMillis); -- cgit v1.2.3 From 14914b2a31399ceb6b2e4d7616535e346ee3acd6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 14 Feb 2015 14:45:08 +0200 Subject: ZVISION: Add custom equality operators for game location This makes the location checks more readable --- engines/zvision/scripting/script_manager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'engines/zvision/scripting/script_manager.cpp') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 71966b3125..70eaab2a0a 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -72,8 +72,7 @@ void ScriptManager::initialize() { } void ScriptManager::update(uint deltaTimeMillis) { - if (_currentLocation.node != _nextLocation.node || _currentLocation.room != _nextLocation.room || - _currentLocation.view != _nextLocation.view || _currentLocation.world != _nextLocation.world) { + if (_currentLocation != _nextLocation) { ChangeLocationReal(false); } @@ -543,7 +542,7 @@ void ScriptManager::changeLocation(char _world, char _room, char _node, char _vi _nextLocation.view = _view; _nextLocation.offset = offset; // If next location is 0000, return to the previous location. - if (_nextLocation.world == '0' && _nextLocation.room == '0' && _nextLocation.node == '0' && _nextLocation.view == '0') { + if (_nextLocation == "0000") { if (getStateValue(StateKey_World) != 'g' || getStateValue(StateKey_Room) != 'j') { _nextLocation.world = getStateValue(StateKey_LastWorld); _nextLocation.room = getStateValue(StateKey_LastRoom); @@ -680,7 +679,7 @@ void ScriptManager::ChangeLocationReal(bool isLoading) { // Change the background position _engine->getRenderManager()->setBackgroundPosition(_nextLocation.offset); - if (_currentLocation.world == 0 && _currentLocation.room == 0 && _currentLocation.node == 0 && _currentLocation.view == 0) { + if (_currentLocation == "0000") { _currentLocation = _nextLocation; execScope(world); execScope(room); -- cgit v1.2.3