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

reformat: set variables to constexpr where possible

This commit is contained in:
jerrrrycho
2026-07-04 06:16:13 +02:00
parent aeb800283c
commit 6fd1d6715b
64 changed files with 541 additions and 541 deletions

View File

@@ -20,8 +20,8 @@ http://mozilla.org/MPL/2.0/.
#include "vehicle/DynObj.h"
#include "scene/scenenode.h"
const int iMaxNumLights = 8;
float const DefaultDarkThresholdLevel { 0.325f };
constexpr int iMaxNumLights = 8;
constexpr float DefaultDarkThresholdLevel { 0.325f };
// typy stanu świateł
enum TLightState

View File

@@ -18,10 +18,10 @@ http://mozilla.org/MPL/2.0/.
#define EU07_USE_GEOMETRYINDEXING
// Ra: specjalne typy submodeli, poza tym GL_TRIANGLES itp.
const int TP_ROTATOR = 256;
const int TP_FREESPOTLIGHT = 257;
const int TP_STARS = 258;
const int TP_TEXT = 259;
constexpr int TP_ROTATOR = 256;
constexpr int TP_FREESPOTLIGHT = 257;
constexpr int TP_STARS = 258;
constexpr int TP_TEXT = 259;
enum class TAnimType // rodzaj animacji
{

View File

@@ -43,7 +43,7 @@ public:
std::min(
m_resourcesweepindex + m_unusedresourcesweepsize,
m_container.size() );
auto const blanktimestamp { std::chrono::steady_clock::time_point() };
constexpr auto blanktimestamp { std::chrono::steady_clock::time_point() };
int releasecount{ 0 };
for( auto resourceindex = m_resourcesweepindex; resourceindex < sweeplastindex; ++resourceindex ) {
if( m_container[resourceindex].second != blanktimestamp

View File

@@ -963,7 +963,7 @@ opengl_texture::create( bool const Static ) {
glTexParameteri(target, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
wrap_mode_s = GL_CLAMP_TO_BORDER;
wrap_mode_t = GL_CLAMP_TO_BORDER;
const float borderColor[] = { 0.0f, 0.0f, 0.0f, 0.0f };
constexpr float borderColor[] = { 0.0f, 0.0f, 0.0f, 0.0f };
glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, borderColor);
}
glTexParameteri( target, GL_TEXTURE_MAG_FILTER, GL_LINEAR );