glext_funcs: Added gDEBugger-specific extension.
Interact: Answered comment. Fixed calculation of map edge. Renderer: Fixed unloading of water textures. Removed some redundant state-setting in water renderer. Avoided potential problems with floating point accuracy. This was SVN commit r3182.
This commit is contained in:
parent
e0aa4feb99
commit
8f976e4b8a
@ -165,4 +165,7 @@ FUNC(int, wglQueryPbufferARB, (HPBUFFERARB, int, int*))
|
|||||||
FUNC(int, wglGetPixelFormatAttribivARB, (HDC, int, int, unsigned int, const int*, int*))
|
FUNC(int, wglGetPixelFormatAttribivARB, (HDC, int, int, unsigned int, const int*, int*))
|
||||||
FUNC(int, wglGetPixelFormatAttribfvARB, (HDC, int, int, unsigned int, const int*, float*))
|
FUNC(int, wglGetPixelFormatAttribfvARB, (HDC, int, int, unsigned int, const int*, float*))
|
||||||
FUNC(int, wglChoosePixelFormatARB, (HDC, const int *, const float*, unsigned int, int*, unsigned int*))
|
FUNC(int, wglChoosePixelFormatARB, (HDC, const int *, const float*, unsigned int, int*, unsigned int*))
|
||||||
|
|
||||||
|
// GL_GREMEDY_string_marker (from gDEBugger)
|
||||||
|
FUNC(int, glStringMarkerGREMEDY, (GLsizei len, const GLvoid *string))
|
||||||
#endif // OS_WIN
|
#endif // OS_WIN
|
||||||
|
@ -1134,8 +1134,8 @@ void CBuildingPlacer::update( float timeStep )
|
|||||||
}
|
}
|
||||||
|
|
||||||
CTerrain *pTerrain=g_Game->GetWorld()->GetTerrain();
|
CTerrain *pTerrain=g_Game->GetWorld()->GetTerrain();
|
||||||
int mapSize = pTerrain->GetVerticesPerSide() * 4; // is this a constant somewhere?
|
int mapSize = (pTerrain->GetVerticesPerSide() - 1) * CELL_SIZE; // use vertices-1 to get number of tiles
|
||||||
m_valid = pos.X>=0 && pos.Z>=0 && pos.X<=mapSize && pos.Z<=mapSize && getCollisionObject(m_bounds)==0;
|
m_valid = pos.X>=0 && pos.Z>=0 && pos.X<mapSize && pos.Z<mapSize && getCollisionObject(m_bounds)==0;
|
||||||
|
|
||||||
CColor col;
|
CColor col;
|
||||||
if(m_valid)
|
if(m_valid)
|
||||||
|
@ -1093,26 +1093,20 @@ void CRenderer::RenderWater()
|
|||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||||
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
|
glDepthMask(GL_FALSE);
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
glEnable(GL_CULL_FACE);
|
|
||||||
glDepthMask(false);
|
|
||||||
|
|
||||||
float time = (float) get_time();
|
double time = get_time();
|
||||||
|
|
||||||
float period = 1.6f;
|
double period = 1.6;
|
||||||
int curTex = (int)(fmod(time, period)*(60/period));
|
int curTex = (int)(time*60/period) % 60;
|
||||||
ogl_tex_bind(m_WaterTexture[curTex], 0);
|
ogl_tex_bind(m_WaterTexture[curTex], 0);
|
||||||
|
|
||||||
glMatrixMode(GL_TEXTURE);
|
glMatrixMode(GL_TEXTURE);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
float tx = -fmod(time, 20.0f)/20.0f;
|
float tx = -fmod(time, 20.0)/20.0;
|
||||||
float ty = fmod(time, 35.0f)/35.0f;
|
float ty = fmod(time, 35.0)/35.0;
|
||||||
glTranslatef(tx, ty, 0);
|
glTranslatef(tx, ty, 0);
|
||||||
|
|
||||||
pglActiveTextureARB(GL_TEXTURE0);
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
|
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
|
||||||
@ -1197,7 +1191,7 @@ void CRenderer::RenderWater()
|
|||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
glDepthMask(true);
|
glDepthMask(GL_TRUE);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
@ -1713,6 +1707,7 @@ ogl_tex_transform_to(textures[i], flags & ~TEX_DXT);
|
|||||||
void CRenderer::UnloadAlphaMaps()
|
void CRenderer::UnloadAlphaMaps()
|
||||||
{
|
{
|
||||||
ogl_tex_free(m_hCompositeAlphaMap);
|
ogl_tex_free(m_hCompositeAlphaMap);
|
||||||
|
m_hCompositeAlphaMap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1761,7 +1756,11 @@ int CRenderer::LoadWaterTextures()
|
|||||||
void CRenderer::UnloadWaterTextures()
|
void CRenderer::UnloadWaterTextures()
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < ARRAY_SIZE(m_WaterTexture); i++)
|
for (uint i = 0; i < ARRAY_SIZE(m_WaterTexture); i++)
|
||||||
|
{
|
||||||
ogl_tex_free(m_WaterTexture[i]);
|
ogl_tex_free(m_WaterTexture[i]);
|
||||||
|
m_WaterTexture[i] = 0;
|
||||||
|
}
|
||||||
|
cur_loading_water_tex = 0; // so they will be reloaded if LoadWaterTextures is called again
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user