tint ability for the clouds object

This commit is contained in:
tmj-fstate
2017-02-26 00:20:18 +01:00
parent 493340e602
commit bd588b87b3
3 changed files with 29 additions and 17 deletions

18
sky.cpp
View File

@@ -22,21 +22,22 @@ TSky::TSky(){};
void TSky::Init()
{
WriteLog(Global::asSky.c_str());
WriteLog("init");
WriteLog( "Clouds init" );
if ((Global::asSky != "1") && (Global::asSky != "0"))
// {
mdCloud = TModelsManager::GetModel(Global::asSky.c_str());
// }
mdCloud = TModelsManager::GetModel( Global::asSky );
};
void TSky::Render()
void TSky::Render( float3 const &Tint )
{
if (mdCloud)
{ // jeśli jest model nieba
#ifdef EU07_USE_OLD_LIGHTING_MODEL
// TODO: re-implement this
glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
#else
::glEnable( GL_LIGHTING );
::glDisable( GL_LIGHT0 );
::glLightModelfv( GL_LIGHT_MODEL_AMBIENT, &Tint.x );
#endif
if (Global::bUseVBO)
{ // renderowanie z VBO
@@ -52,6 +53,11 @@ void TSky::Render()
glPopMatrix();
// TODO: re-implement this
glLightfv(GL_LIGHT0, GL_POSITION, Global::lightPos);
#else
GLfloat noambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
::glLightModelfv( GL_LIGHT_MODEL_AMBIENT, noambient );
::glEnable( GL_LIGHT0 );
::glDisable( GL_LIGHTING );
#endif
}
};