Parse out line of sight position. Only known to be used by scud.

This commit is contained in:
Ian Curtis 2018-01-15 21:27:21 +00:00
parent 99b5b9ba1b
commit 8266eecabb
3 changed files with 31 additions and 26 deletions

View file

@ -186,6 +186,7 @@ struct Viewport
float spotColor[3]; // color
float fogParams[7]; // fog parameters (...)
float scrollFog; // a transparency value that determines if fog is blended over the bottom 2D layer
int losPosX, losPosY; // line of sight position
int x, y; // viewport coordinates (scaled and in OpenGL format)
int width, height; // viewport dimensions (scaled for display surface size)
int priority; // priority

View file

@ -828,6 +828,10 @@ void CNew3D::RenderViewport(UINT32 addr)
vp->spotEllipse[2] *= m_xRatio;
vp->spotEllipse[3] *= m_yRatio;
// Line of sight position
vp->losPosX = (int)(((vpnode[0x1c] & 0xFFFF) / 16.0f) + 0.5f); // x position
vp->losPosY = (int)(((vpnode[0x1c] >> 16) / 16.0f) + 0.5f); // y position 0 starts from the top
// Fog
vp->fogParams[0] = (float)((vpnode[0x22] >> 16) & 0xFF) * (1.0f / 255.0f); // fog color R
vp->fogParams[1] = (float)((vpnode[0x22] >> 8) & 0xFF) * (1.0f / 255.0f); // fog color G