diff options
-rw-r--r-- | engines/zvision/graphics/render_table.cpp | 9 | ||||
-rw-r--r-- | engines/zvision/graphics/render_table.h | 3 | ||||
-rw-r--r-- | engines/zvision/scripting/control.cpp | 4 | ||||
-rw-r--r-- | engines/zvision/zvision.cpp | 2 |
4 files changed, 16 insertions, 2 deletions
diff --git a/engines/zvision/graphics/render_table.cpp b/engines/zvision/graphics/render_table.cpp index aeba729196..bb095f0c9a 100644 --- a/engines/zvision/graphics/render_table.cpp +++ b/engines/zvision/graphics/render_table.cpp @@ -52,6 +52,7 @@ void RenderTable::setRenderState(RenderState newState) { _panoramaOptions.fieldOfView = 27.0f; _panoramaOptions.linearScale = 0.55f; _panoramaOptions.reverse = false; + _panoramaOptions.zeroPoint = 0; break; case TILT: _tiltOptions.fieldOfView = 27.0f; @@ -244,6 +245,14 @@ void RenderTable::setPanoramaReverse(bool reverse) { _panoramaOptions.reverse = reverse; } +void RenderTable::setPanoramaZeroPoint(uint16 point) { + _panoramaOptions.zeroPoint = point; +} + +uint16 RenderTable::getPanoramaZeroPoint() { + return _panoramaOptions.zeroPoint; +} + void RenderTable::setTiltFoV(float fov) { assert(fov > 0.0f); diff --git a/engines/zvision/graphics/render_table.h b/engines/zvision/graphics/render_table.h index 7153738c6f..2e3fd8ec33 100644 --- a/engines/zvision/graphics/render_table.h +++ b/engines/zvision/graphics/render_table.h @@ -50,6 +50,7 @@ private: float fieldOfView; float linearScale; bool reverse; + uint16 zeroPoint; } _panoramaOptions; // TODO: See if tilt and panorama need to have separate options @@ -75,6 +76,8 @@ public: void setPanoramaFoV(float fov); void setPanoramaScale(float scale); void setPanoramaReverse(bool reverse); + void setPanoramaZeroPoint(uint16 point); + uint16 getPanoramaZeroPoint(); void setTiltFoV(float fov); void setTiltScale(float scale); diff --git a/engines/zvision/scripting/control.cpp b/engines/zvision/scripting/control.cpp index ae717d6f8d..4567495725 100644 --- a/engines/zvision/scripting/control.cpp +++ b/engines/zvision/scripting/control.cpp @@ -61,7 +61,9 @@ void Control::parsePanoramaControl(ZVision *engine, Common::SeekableReadStream & renderTable->setPanoramaReverse(true); } } else if (line.matchString("zeropoint*", true)) { - // TODO: Implement + uint point; + sscanf(line.c_str(), "zeropoint(%u)", &point); + renderTable->setPanoramaZeroPoint(point); } line = stream.readLine(); diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index 4f05edaefd..606e712cd0 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -370,7 +370,7 @@ void ZVision::updateRotation() { int16 new_pos = st_pos + _velocity * (1 - 2 * 0); - int16 zero_point = 0; + int16 zero_point = _renderManager->getRenderTable()->getPanoramaZeroPoint(); if (st_pos >= zero_point && new_pos < zero_point) _scriptManager->setStateValue(StateKey_Rounds, _scriptManager->getStateValue(StateKey_Rounds) - 1); if (st_pos <= zero_point && new_pos > zero_point) |