16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 05:29:17 +02:00

stars object, interrior lighting level as accessible parameter for dynamic object

This commit is contained in:
tmj-fstate
2017-02-24 01:22:06 +01:00
parent 3e68e4921b
commit 4dcb87906f
14 changed files with 268 additions and 97 deletions

View File

@@ -3807,9 +3807,26 @@ void TDynamicObject::Render()
}
else
{ // wersja Display Lists
if (mdLowPolyInt)
if (FreeFlyModeFlag ? true : !mdKabina || !bDisplayCab)
mdLowPolyInt->Render(ObjSqrDist, ReplacableSkinID, iAlpha);
if( mdLowPolyInt ) {
// low poly interior
if( FreeFlyModeFlag ? true : !mdKabina || !bDisplayCab ) {
// enable cab light if needed
if( InteriorLightLevel > 0.0f ) {
// crude way to light the cabin, until we have something more complete in place
auto const cablight = InteriorLight * InteriorLightLevel;
::glLightModelfv( GL_LIGHT_MODEL_AMBIENT, &cablight.x );
}
mdLowPolyInt->Render( ObjSqrDist, ReplacableSkinID, iAlpha );
if( InteriorLightLevel > 0.0f ) {
// reset the overall ambient
GLfloat ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
::glLightModelfv( GL_LIGHT_MODEL_AMBIENT, ambient );
}
}
}
mdModel->Render(ObjSqrDist, ReplacableSkinID, iAlpha);
if (mdLoad) // renderowanie nieprzezroczystego ładunku
mdLoad->Render(ObjSqrDist, ReplacableSkinID, iAlpha);