mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
general tweaks
This commit is contained in:
@@ -50,8 +50,6 @@ bool TAnimContainer::Init(TSubModel *pNewSubModel)
|
||||
|
||||
void TAnimContainer::SetRotateAnim( Math3D::vector3 vNewRotateAngles, double fNewRotateSpeed)
|
||||
{
|
||||
if (!this)
|
||||
return; // wywoływane z eventu, gdy brak modelu
|
||||
vDesiredAngles = vNewRotateAngles;
|
||||
fRotateSpeed = fNewRotateSpeed;
|
||||
iAnim |= 1;
|
||||
@@ -72,8 +70,6 @@ void TAnimContainer::SetRotateAnim( Math3D::vector3 vNewRotateAngles, double fNe
|
||||
|
||||
void TAnimContainer::SetTranslateAnim( Math3D::vector3 vNewTranslate, double fNewSpeed)
|
||||
{
|
||||
if (!this)
|
||||
return; // wywoływane z eventu, gdy brak modelu
|
||||
vTranslateTo = vNewTranslate;
|
||||
fTranslateSpeed = fNewSpeed;
|
||||
iAnim |= 2;
|
||||
|
||||
@@ -328,7 +328,7 @@ global_settings::ConfigParse(cParser &Parser) {
|
||||
std::string token;
|
||||
Parser >> token;
|
||||
std::istringstream stream(token);
|
||||
if (token.find(':')) {
|
||||
if (token.find(':') != -1) {
|
||||
float a, b;
|
||||
char s;
|
||||
stream >> a >> s >> b;
|
||||
|
||||
@@ -297,7 +297,6 @@ opengl_texture::make_request() {
|
||||
auto const components { Split( name, '?' ) };
|
||||
|
||||
auto *dictionary { new dictionary_source( components.back() ) };
|
||||
if( dictionary == nullptr ) { return; }
|
||||
|
||||
auto rt = std::make_shared<python_rt>();
|
||||
rt->shared_tex = id;
|
||||
|
||||
@@ -467,7 +467,6 @@ dictionary_source *TTrain::GetTrainState() {
|
||||
if( mover == nullptr ) { return nullptr; }
|
||||
|
||||
auto *dict { new dictionary_source };
|
||||
if( dict == nullptr ) { return nullptr; }
|
||||
|
||||
dict->insert( "name", DynamicObject->asName );
|
||||
dict->insert( "cab", mover->ActiveCab );
|
||||
@@ -7418,11 +7417,6 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
|
||||
tex->make_stub();
|
||||
}
|
||||
|
||||
if (!tex) {
|
||||
WriteLog( "Python Screen: missing texture in screen " + submodelname + " - Ignoring screen" );
|
||||
continue;
|
||||
}
|
||||
|
||||
tex->create();
|
||||
|
||||
const std::string rendererpath {
|
||||
@@ -8271,7 +8265,7 @@ void TTrain::set_cab_controls( int const Cab ) {
|
||||
if( ggMotorBlowersAllOffButton.type() != TGaugeType::push ) {
|
||||
ggMotorBlowersAllOffButton.PutValue(
|
||||
( mvControlled->MotorBlowers[end::front].is_disabled
|
||||
|| mvControlled->MotorBlowers[ end::front ].is_disabled ) ?
|
||||
|| mvControlled->MotorBlowers[end::rear].is_disabled ) ?
|
||||
1.f :
|
||||
0.f );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "Float3d.h"
|
||||
#include "dumb3d.h"
|
||||
|
||||
std::vector<glm::vec4> const ndcfrustumshapepoints //
|
||||
inline std::vector<glm::vec4> const ndcfrustumshapepoints //
|
||||
{
|
||||
{-1, -1, -1, 1}, //
|
||||
{ 1, -1, -1, 1}, //
|
||||
@@ -25,7 +25,7 @@ std::vector<glm::vec4> const ndcfrustumshapepoints //
|
||||
{-1, 1, 1, 1}, // z-far
|
||||
};
|
||||
|
||||
std::vector<std::size_t> const frustumshapepoinstorder { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 };
|
||||
inline std::vector<std::size_t> const frustumshapepoinstorder { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 };
|
||||
|
||||
// generic frustum class. used to determine if objects are inside current view area
|
||||
|
||||
|
||||
@@ -290,11 +290,11 @@ void opengl_vbogeometrybank::setup_buffer()
|
||||
{
|
||||
m_vao.emplace();
|
||||
|
||||
m_vao->setup_attrib(*m_buffer, 0, 3, GL_FLOAT, sizeof(basic_vertex), 0 * sizeof(GL_FLOAT));
|
||||
m_vao->setup_attrib(*m_buffer, 0, 3, GL_FLOAT, sizeof(basic_vertex), 0 * sizeof(float));
|
||||
// NOTE: normal and color streams share the data
|
||||
m_vao->setup_attrib(*m_buffer, 1, 3, GL_FLOAT, sizeof(basic_vertex), 3 * sizeof(GL_FLOAT));
|
||||
m_vao->setup_attrib(*m_buffer, 2, 2, GL_FLOAT, sizeof(basic_vertex), 6 * sizeof(GL_FLOAT));
|
||||
m_vao->setup_attrib(*m_buffer, 3, 4, GL_FLOAT, sizeof(basic_vertex), 8 * sizeof(GL_FLOAT));
|
||||
m_vao->setup_attrib(*m_buffer, 1, 3, GL_FLOAT, sizeof(basic_vertex), 3 * sizeof(float));
|
||||
m_vao->setup_attrib(*m_buffer, 2, 2, GL_FLOAT, sizeof(basic_vertex), 6 * sizeof(float));
|
||||
m_vao->setup_attrib(*m_buffer, 3, 4, GL_FLOAT, sizeof(basic_vertex), 8 * sizeof(float));
|
||||
|
||||
m_buffer->unbind(gl::buffer::ARRAY_BUFFER);
|
||||
m_vao->unbind();
|
||||
|
||||
Reference in New Issue
Block a user