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 spotColor[3]; // color
float fogParams[7]; // fog parameters (...) float fogParams[7]; // fog parameters (...)
float scrollFog; // a transparency value that determines if fog is blended over the bottom 2D layer 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 x, y; // viewport coordinates (scaled and in OpenGL format)
int width, height; // viewport dimensions (scaled for display surface size) int width, height; // viewport dimensions (scaled for display surface size)
int priority; // priority int priority; // priority

View file

@ -828,6 +828,10 @@ void CNew3D::RenderViewport(UINT32 addr)
vp->spotEllipse[2] *= m_xRatio; vp->spotEllipse[2] *= m_xRatio;
vp->spotEllipse[3] *= m_yRatio; 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 // Fog
vp->fogParams[0] = (float)((vpnode[0x22] >> 16) & 0xFF) * (1.0f / 255.0f); // fog color R 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 vp->fogParams[1] = (float)((vpnode[0x22] >> 8) & 0xFF) * (1.0f / 255.0f); // fog color G

View file

@ -149,22 +149,22 @@ public:
* Parameters: * Parameters:
* enable Set clamp mode * enable Set clamp mode
*/ */
void SetSunClamp(bool enable); void SetSunClamp(bool enable);
/* /*
* SetSignedShade(bool enable); * SetSignedShade(bool enable);
* *
* Sets the sign-ness of fixed shading value * Sets the sign-ness of fixed shading value
* *
* Parameters: * Parameters:
* enable Fixed shading is expressed as signed value * enable Fixed shading is expressed as signed value
*/ */
void SetSignedShade(bool enable); void SetSignedShade(bool enable);
/* /*
* CRender3D(config): * CRender3D(config):
* ~CRender3D(void): * ~CRender3D(void):
* *
* Constructor and destructor. * Constructor and destructor.
* *
* Parameters: * Parameters:
@ -210,16 +210,16 @@ private:
/* /*
* Data * Data
*/ */
// Misc // Misc
std::string m_gameName; std::string m_gameName;
// GPU configuration // GPU configuration
bool m_sunClamp; bool m_sunClamp;
bool m_shadeIsSigned; bool m_shadeIsSigned;
// Stepping // Stepping
int m_step; int m_step;
int m_offset; // offset to subtract for words 3 and higher of culling nodes int m_offset; // offset to subtract for words 3 and higher of culling nodes
float m_vertexFactor; // fixed-point conversion factor for vertices float m_vertexFactor; // fixed-point conversion factor for vertices