mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Do not use temp variable when it is not needed
This commit is contained in:
@@ -4313,7 +4313,7 @@ void opengl_renderer::MakeScreenshot()
|
|||||||
void
|
void
|
||||||
opengl_renderer::Update_Lights( light_array &Lights ) {
|
opengl_renderer::Update_Lights( light_array &Lights ) {
|
||||||
// arrange the light array from closest to farthest from current position of the camera
|
// arrange the light array from closest to farthest from current position of the camera
|
||||||
auto const camera = m_renderpass.camera.position();
|
auto const &camera = m_renderpass.camera.position();
|
||||||
std::sort(
|
std::sort(
|
||||||
std::begin( Lights.data ),
|
std::begin( Lights.data ),
|
||||||
std::end( Lights.data ),
|
std::end( Lights.data ),
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ void
|
|||||||
basic_editor::translate( scene::basic_node *Node, float const Offset ) {
|
basic_editor::translate( scene::basic_node *Node, float const Offset ) {
|
||||||
|
|
||||||
// NOTE: offset scaling is calculated early so the same multiplier can be applied to potential whole group
|
// NOTE: offset scaling is calculated early so the same multiplier can be applied to potential whole group
|
||||||
auto location { Node->location() };
|
auto const distance { glm::length( Node->location() - Global.pCamera.Pos ) };
|
||||||
auto const distance { glm::length( location - glm::dvec3{ Global.pCamera.Pos } ) };
|
|
||||||
auto const offset { static_cast<float>( Offset * std::max( 1.0, distance * 0.01 ) ) };
|
auto const offset { static_cast<float>( Offset * std::max( 1.0, distance * 0.01 ) ) };
|
||||||
|
|
||||||
if( Node->group() <= 1 ) {
|
if( Node->group() <= 1 ) {
|
||||||
|
|||||||
@@ -537,13 +537,12 @@ updatevalues_event::run_() {
|
|||||||
// targetcell->LogValues();
|
// targetcell->LogValues();
|
||||||
if( targetcell->Track == nullptr ) { continue; }
|
if( targetcell->Track == nullptr ) { continue; }
|
||||||
// McZapkie-100302 - updatevalues oprocz zmiany wartosci robi putcommand dla wszystkich 'dynamic' na danym torze
|
// McZapkie-100302 - updatevalues oprocz zmiany wartosci robi putcommand dla wszystkich 'dynamic' na danym torze
|
||||||
auto const location { targetcell->location() };
|
|
||||||
for( auto vehicle : targetcell->Track->Dynamics ) {
|
for( auto vehicle : targetcell->Track->Dynamics ) {
|
||||||
if( vehicle->Mechanik ) {
|
if( vehicle->Mechanik ) {
|
||||||
WriteLog( " Vehicle: [" + vehicle->name() + "]" );
|
WriteLog( " Vehicle: [" + vehicle->name() + "]" );
|
||||||
targetcell->PutCommand(
|
targetcell->PutCommand(
|
||||||
vehicle->Mechanik,
|
vehicle->Mechanik,
|
||||||
&location );
|
&targetcell->location() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user