aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/render_table.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/zvision/render_table.cpp')
-rw-r--r--engines/zvision/render_table.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp
index b6a6a3d2bb..5a0bae7c22 100644
--- a/engines/zvision/render_table.cpp
+++ b/engines/zvision/render_table.cpp
@@ -32,9 +32,9 @@
namespace ZVision {
RenderTable::RenderTable(uint numColumns, uint numRows)
- : _numRows(numRows),
- _numColumns(numColumns),
- _renderState(FLAT) {
+ : _numRows(numRows),
+ _numColumns(numColumns),
+ _renderState(FLAT) {
assert(numRows != 0 && numColumns != 0);
_internalBuffer = new Common::Point[numRows * numColumns];
@@ -97,12 +97,12 @@ uint16 mixTwoRGB(uint16 colorOne, uint16 colorTwo, float percentColorOne) {
uint16 returnColor = (byte(rFinal + 0.5f) << Graphics::ColorMasks<555>::kRedShift) |
(byte(gFinal + 0.5f) << Graphics::ColorMasks<555>::kGreenShift) |
- (byte(bFinal + 0.5f) << Graphics::ColorMasks<555>::kBlueShift);
+ (byte(bFinal + 0.5f) << Graphics::ColorMasks<555>::kBlueShift);
return returnColor;
}
-void RenderTable::mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint32 destWidth, const Common::Rect &subRect) {
+void RenderTable::mutateImage(uint16 *sourceBuffer, uint16 *destBuffer, uint32 destWidth, const Common::Rect &subRect) {
uint32 destOffset = 0;
for (int16 y = subRect.top; y < subRect.bottom; ++y) {
@@ -115,7 +115,7 @@ void RenderTable::mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint32 d
// RenderTable only stores offsets from the original coordinates
uint32 sourceYIndex = y + _internalBuffer[index].y;
uint32 sourceXIndex = x + _internalBuffer[index].x;
-
+
destBuffer[destOffset + normalizedX] = sourceBuffer[sourceYIndex * _numColumns + sourceXIndex];
}
@@ -154,11 +154,11 @@ void RenderTable::generatePanoramaLookupTable() {
// To get x in cylinder coordinates, we just need to calculate the arc length
// We also scale it by _panoramaOptions.linearScale
int32 xInCylinderCoords = int32(floor((cylinderRadius * _panoramaOptions.linearScale * alpha) + halfWidth));
-
+
float cosAlpha = cos(alpha);
for (uint y = 0; y < _numRows; ++y) {
- // To calculate y in cylinder coordinates, we can do similar triangles comparison,
+ // To calculate y in cylinder coordinates, we can do similar triangles comparison,
// comparing the triangle from the center to the screen and from the center to the edge of the cylinder
int32 yInCylinderCoords = int32(floor(halfHeight + ((float)y - halfHeight) * cosAlpha));
@@ -179,7 +179,7 @@ void RenderTable::generateTiltLookupTable() {
float cylinderRadius = halfWidth / tan(fovInRadians);
for (uint y = 0; y < _numRows; ++y) {
-
+
// Add an offset of 0.01 to overcome zero tan/atan issue (horizontal line on half of screen)
// Alpha represents the vertical angle between the viewer at the center of a cylinder and y
float alpha = atan(((float)y - halfHeight + 0.01f) / cylinderRadius);
@@ -192,7 +192,7 @@ void RenderTable::generateTiltLookupTable() {
uint32 columnIndex = y * _numColumns;
for (uint x = 0; x < _numColumns; ++x) {
- // To calculate x in cylinder coordinates, we can do similar triangles comparison,
+ // To calculate x in cylinder coordinates, we can do similar triangles comparison,
// comparing the triangle from the center to the screen and from the center to the edge of the cylinder
int32 xInCylinderCoords = int32(floor(halfWidth + ((float)x - halfWidth) * cosAlpha));