mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 22:59:19 +02:00
additional timetable data for python scripts, light level application fix
This commit is contained in:
@@ -532,6 +532,8 @@ void TTrainParameters::serialize( dictionary_source *Output ) const {
|
|||||||
Output->insert( "train_enginetype", LocSeries );
|
Output->insert( "train_enginetype", LocSeries );
|
||||||
Output->insert( "train_engineload", LocLoad );
|
Output->insert( "train_engineload", LocLoad );
|
||||||
|
|
||||||
|
Output->insert( "train_stationfrom", Relation1 );
|
||||||
|
Output->insert( "train_stationto", Relation2 );
|
||||||
Output->insert( "train_stationindex", StationIndex );
|
Output->insert( "train_stationindex", StationIndex );
|
||||||
Output->insert( "train_stationcount", StationCount );
|
Output->insert( "train_stationcount", StationCount );
|
||||||
if( StationCount > 0 ) {
|
if( StationCount > 0 ) {
|
||||||
|
|||||||
@@ -32,17 +32,18 @@ int const EU07_ENVIRONMENTBUFFERSIZE { 256 }; // size of (square) environmental
|
|||||||
void
|
void
|
||||||
opengl_light::apply_intensity( float const Factor ) {
|
opengl_light::apply_intensity( float const Factor ) {
|
||||||
|
|
||||||
if( Factor == 1.0 ) {
|
if( Factor == 1.f ) {
|
||||||
|
|
||||||
::glLightfv( id, GL_AMBIENT, glm::value_ptr( ambient ) );
|
::glLightfv( id, GL_AMBIENT, glm::value_ptr( ambient ) );
|
||||||
::glLightfv( id, GL_DIFFUSE, glm::value_ptr( diffuse ) );
|
::glLightfv( id, GL_DIFFUSE, glm::value_ptr( diffuse ) );
|
||||||
::glLightfv( id, GL_SPECULAR, glm::value_ptr( specular ) );
|
::glLightfv( id, GL_SPECULAR, glm::value_ptr( specular ) );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
auto const factor{ clamp( Factor, 0.05f, 1.f ) };
|
||||||
// temporary light scaling mechanics (ultimately this work will be left to the shaders
|
// temporary light scaling mechanics (ultimately this work will be left to the shaders
|
||||||
glm::vec4 scaledambient( ambient.r * Factor, ambient.g * Factor, ambient.b * Factor, ambient.a );
|
glm::vec4 scaledambient( ambient.r * factor, ambient.g * factor, ambient.b * factor, ambient.a );
|
||||||
glm::vec4 scaleddiffuse( diffuse.r * Factor, diffuse.g * Factor, diffuse.b * Factor, diffuse.a );
|
glm::vec4 scaleddiffuse( diffuse.r * factor, diffuse.g * factor, diffuse.b * factor, diffuse.a );
|
||||||
glm::vec4 scaledspecular( specular.r * Factor, specular.g * Factor, specular.b * Factor, specular.a );
|
glm::vec4 scaledspecular( specular.r * factor, specular.g * factor, specular.b * factor, specular.a );
|
||||||
glLightfv( id, GL_AMBIENT, glm::value_ptr( scaledambient ) );
|
glLightfv( id, GL_AMBIENT, glm::value_ptr( scaledambient ) );
|
||||||
glLightfv( id, GL_DIFFUSE, glm::value_ptr( scaleddiffuse ) );
|
glLightfv( id, GL_DIFFUSE, glm::value_ptr( scaleddiffuse ) );
|
||||||
glLightfv( id, GL_SPECULAR, glm::value_ptr( scaledspecular ) );
|
glLightfv( id, GL_SPECULAR, glm::value_ptr( scaledspecular ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user