aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMarisa-Chan2014-10-10 16:48:28 +0700
committerMarisa-Chan2014-10-10 16:48:28 +0700
commit7c9d8f22de461528ac5e3fbe9c1c69dcdaa1a908 (patch)
tree9723757de220276173169bc950c4ace22ce90b40 /engines
parent002b8e692a9488ac91e043df2fe7dce34d52a771 (diff)
downloadscummvm-rg350-7c9d8f22de461528ac5e3fbe9c1c69dcdaa1a908.tar.gz
scummvm-rg350-7c9d8f22de461528ac5e3fbe9c1c69dcdaa1a908.tar.bz2
scummvm-rg350-7c9d8f22de461528ac5e3fbe9c1c69dcdaa1a908.zip
ZVISION: Implement dynamic tilt up/down border
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/graphics/render_table.cpp5
-rw-r--r--engines/zvision/graphics/render_table.h3
-rw-r--r--engines/zvision/zvision.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/engines/zvision/graphics/render_table.cpp b/engines/zvision/graphics/render_table.cpp
index 2fc21b7566..9bf40d3745 100644
--- a/engines/zvision/graphics/render_table.cpp
+++ b/engines/zvision/graphics/render_table.cpp
@@ -199,6 +199,7 @@ void RenderTable::generateTiltLookupTable() {
float fovInRadians = (_tiltOptions.fieldOfView * M_PI / 180.0f);
float cylinderRadius = halfWidth / tan(fovInRadians);
+ _tiltOptions.gap = cylinderRadius * atan2(halfHeight / cylinderRadius, 1.0) * _tiltOptions.linearScale;
for (uint y = 0; y < _numRows; ++y) {
@@ -259,4 +260,8 @@ void RenderTable::setTiltReverse(bool reverse) {
_tiltOptions.reverse = reverse;
}
+float RenderTable::getTiltGap() {
+ return _tiltOptions.gap;
+}
+
} // End of namespace ZVision
diff --git a/engines/zvision/graphics/render_table.h b/engines/zvision/graphics/render_table.h
index 0b4d6e3919..a268ee615f 100644
--- a/engines/zvision/graphics/render_table.h
+++ b/engines/zvision/graphics/render_table.h
@@ -57,6 +57,7 @@ private:
float fieldOfView;
float linearScale;
bool reverse;
+ float gap;
} _tiltOptions;
public:
@@ -79,6 +80,8 @@ public:
void setTiltScale(float scale);
void setTiltReverse(bool reverse);
+ float getTiltGap();
+
private:
void generatePanoramaLookupTable();
void generateTiltLookupTable();
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 24e15e0c86..a534e49c25 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -332,7 +332,7 @@ void ZVision::updateRotation() {
int16 new_pos = st_pos + _velocity * (1 - 2 * 0);
int16 scr_height = _renderManager->getBkgSize().y;
- int16 tilt_gap = _workingWindow.height() / 2;
+ int16 tilt_gap = _renderManager->getRenderTable()->getTiltGap();
if (new_pos >= (scr_height - tilt_gap))
new_pos = scr_height - tilt_gap;