general tweaks

This commit is contained in:
milek7
2019-09-28 22:52:01 +02:00
parent fc13d6c2a9
commit 106f64f0ba
7 changed files with 11 additions and 21 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -296,8 +296,7 @@ opengl_texture::make_request() {
auto const components { Split( name, '?' ) };
auto *dictionary { new dictionary_source( components.back() ) };
if( dictionary == nullptr ) { return; }
auto *dictionary { new dictionary_source( components.back() ) };
auto rt = std::make_shared<python_rt>();
rt->shared_tex = id;

View File

@@ -466,8 +466,7 @@ dictionary_source *TTrain::GetTrainState() {
auto const *mover = DynamicObject->MoverParameters;
if( mover == nullptr ) { return nullptr; }
auto *dict { new dictionary_source };
if( dict == nullptr ) { return nullptr; }
auto *dict { new dictionary_source };
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 );
}

View File

@@ -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

View File

@@ -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();

View File

@@ -21,6 +21,7 @@ class ui_panel {
public:
// constructor
ui_panel( std::string const &Identifier, bool const Isopen );
virtual ~ui_panel() = default;
// methods
virtual void update() {};
virtual void render();