diff options
author | Marisa-Chan | 2014-11-12 14:30:13 +0600 |
---|---|---|
committer | Marisa-Chan | 2014-11-12 14:30:13 +0600 |
commit | 51a9ec80df468757902cd85a5ab2a32856148d29 (patch) | |
tree | 079daf318ca3fd77efe4385e27043e3d84f4ee6b /engines/zvision | |
parent | d0f2e20b62392dc040a61036237cef37e13e6d19 (diff) | |
download | scummvm-rg350-51a9ec80df468757902cd85a5ab2a32856148d29.tar.gz scummvm-rg350-51a9ec80df468757902cd85a5ab2a32856148d29.tar.bz2 scummvm-rg350-51a9ec80df468757902cd85a5ab2a32856148d29.zip |
ZVISION: Implement ZeroPoint for panorama renderer
Diffstat (limited to 'engines/zvision')
-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) |