TWINE: fixed missing holomap surface mappings

This commit is contained in:
Martin Gerhardy 2021-10-09 10:46:39 +02:00
parent c37c46921d
commit fa09c80830

View File

@ -155,7 +155,8 @@ void Holomap::prepareHolomapSurface(Common::SeekableReadStream *holomapSurfaceSt
int holomapSurfaceArrayIdx = 0;
_engine->_renderer->setBaseRotation(0, 0, 0);
for (int alpha = -ANGLE_90; alpha <= ANGLE_90; alpha += ANGLE_11_25) {
const int64 pos = holomapSurfaceStream->pos();
const int32 rot = holomapSurfaceStream->readByte();
holomapSurfaceStream->seek(-1, SEEK_CUR);
for (int beta = 0; beta < ANGLE_360; beta += ANGLE_11_25) {
const int32 rotX = holomapSurfaceStream->readByte();
const IVec3 &rotVec = _engine->_renderer->getHolomapRotation(rotX, alpha, beta);
@ -164,14 +165,13 @@ void Holomap::prepareHolomapSurface(Common::SeekableReadStream *holomapSurfaceSt
_holomapSurface[holomapSurfaceArrayIdx].z = rotVec.z;
++holomapSurfaceArrayIdx;
}
holomapSurfaceStream->seek(pos);
const int32 rotX = holomapSurfaceStream->readByte();
const IVec3 &rotVec = _engine->_renderer->getHolomapRotation(rotX, alpha, 0);
const IVec3 &rotVec = _engine->_renderer->getHolomapRotation(rot, alpha, 0);
_holomapSurface[holomapSurfaceArrayIdx].x = rotVec.x;
_holomapSurface[holomapSurfaceArrayIdx].y = rotVec.y;
_holomapSurface[holomapSurfaceArrayIdx].z = rotVec.z;
++holomapSurfaceArrayIdx;
}
assert(holomapSurfaceStream->eos());
}
void Holomap::prepareHolomapProjectedPositions() {