mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 09:11:35 +00:00
WaterManager: don't try rendering if the textures haven't been loaded (e.g. when using the Actor Viewer).
GameView: pushed near clipping plane out a bit (to get more precision), rounded far plane to power of two for no real reason. This was SVN commit r4896.
This commit is contained in:
@@ -50,8 +50,8 @@ static bool bookmarkInUse[10] = { false, false, false, false, false, false, fals
|
||||
static i8 currentBookmark = -1;
|
||||
|
||||
const float CGameView::defaultFOV = DEGTORAD(20.f);
|
||||
const float CGameView::defaultNear = 1.f;
|
||||
const float CGameView::defaultFar = 5000.f;
|
||||
const float CGameView::defaultNear = 4.f;
|
||||
const float CGameView::defaultFar = 4096.f;
|
||||
|
||||
class CGameViewImpl : public CJSObject<CGameViewImpl>, boost::noncopyable
|
||||
{
|
||||
@@ -327,6 +327,8 @@ void CGameView::EnumerateObjects(const CFrustum& frustum, SceneCollector* c)
|
||||
const std::vector<CUnit*>& units = unitMan.GetUnits();
|
||||
for (uint i=0;i<units.size();++i)
|
||||
{
|
||||
oglCheck();
|
||||
|
||||
CEntity* ent = units[i]->GetEntity();
|
||||
if( ent && !ent->m_visible )
|
||||
continue;
|
||||
|
||||
@@ -288,6 +288,8 @@ void BatchModelRenderer::Submit(CModel* model)
|
||||
{
|
||||
debug_assert(m->phase == BMRSubmit);
|
||||
|
||||
oglCheck();
|
||||
|
||||
CModelDefPtr mdef = model->GetModelDef();
|
||||
BMRModelDefTracker* mdeftracker = (BMRModelDefTracker*)mdef->GetRenderData(m);
|
||||
CModelRData* rdata = (CModelRData*)model->GetRenderData();
|
||||
@@ -346,6 +348,8 @@ void BatchModelRenderer::Submit(CModel* model)
|
||||
|
||||
bmrdata->m_Next = mdeftracker->m_ModelSlots[idx];
|
||||
mdeftracker->m_ModelSlots[idx] = bmrdata;
|
||||
|
||||
oglCheck();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
WaterManager::WaterManager()
|
||||
{
|
||||
// water
|
||||
m_RenderWater = true;
|
||||
m_RenderWater = false; // disabled until textures are successfully loaded
|
||||
m_WaterHeight = 5.0f;
|
||||
m_WaterColor = CColor(0.3f, 0.35f, 0.7f, 1.0f);
|
||||
m_WaterFullDepth = 4.0f;
|
||||
@@ -50,6 +50,8 @@ WaterManager::WaterManager()
|
||||
m_WaterCurrentTex = 0;
|
||||
m_ReflectionTexture = 0;
|
||||
m_RefractionTexture = 0;
|
||||
m_ReflectionTextureSize = 0;
|
||||
m_RefractionTextureSize = 0;
|
||||
m_WaterTexTimer = 0.0;
|
||||
m_Shininess = 150.0f;
|
||||
m_SpecularStrength = 0.4f;
|
||||
@@ -159,6 +161,9 @@ int WaterManager::LoadWaterTextures()
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
// Enable rendering, now that we've succeeded this far
|
||||
m_RenderWater = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user