mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
tint ability for the clouds object
This commit is contained in:
18
sky.cpp
18
sky.cpp
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user