mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 20:59:19 +02:00
reformat: set variables to constexpr where possible
This commit is contained in:
@@ -19,7 +19,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
namespace audio {
|
||||
|
||||
ALuint const null_resource{ ~ALuint{0} };
|
||||
constexpr ALuint null_resource{ ~ALuint{0} };
|
||||
|
||||
// wrapper for audio sample
|
||||
struct openal_buffer {
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace audio {
|
||||
openal_renderer renderer;
|
||||
bool event_volume_change { false };
|
||||
|
||||
float const EU07_SOUND_CUTOFFRANGE { 3000.f }; // 2750 m = max expected emitter spawn range, plus safety margin
|
||||
float const EU07_SOUND_VELOCITYLIMIT { 250 / 3.6f }; // 343 m/sec ~= speed of sound; arbitrary limit of 250 km/h
|
||||
constexpr float EU07_SOUND_CUTOFFRANGE { 3000.f }; // 2750 m = max expected emitter spawn range, plus safety margin
|
||||
constexpr float EU07_SOUND_VELOCITYLIMIT { 250 / 3.6f }; // 343 m/sec ~= speed of sound; arbitrary limit of 250 km/h
|
||||
|
||||
// potentially clamps length of provided vector to 343 meters
|
||||
// TBD: make a generic method for utilities out of this
|
||||
|
||||
@@ -13,12 +13,12 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "utilities/Classes.h"
|
||||
#include "utilities/Names.h"
|
||||
|
||||
float const EU07_SOUND_GLOBALRANGE { -1.f };
|
||||
float const EU07_SOUND_CABCONTROLSCUTOFFRANGE { 7.5f };
|
||||
float const EU07_SOUND_CABANNOUNCEMENTCUTOFFRANGE{ -10.f };
|
||||
float const EU07_SOUND_BRAKINGCUTOFFRANGE { 100.f };
|
||||
float const EU07_SOUND_RUNNINGNOISECUTOFFRANGE { 200.f };
|
||||
float const EU07_SOUND_HANDHELDRADIORANGE { 3500.f };
|
||||
constexpr float EU07_SOUND_GLOBALRANGE { -1.f };
|
||||
constexpr float EU07_SOUND_CABCONTROLSCUTOFFRANGE { 7.5f };
|
||||
constexpr float EU07_SOUND_CABANNOUNCEMENTCUTOFFRANGE{ -10.f };
|
||||
constexpr float EU07_SOUND_BRAKINGCUTOFFRANGE { 100.f };
|
||||
constexpr float EU07_SOUND_RUNNINGNOISECUTOFFRANGE { 200.f };
|
||||
constexpr float EU07_SOUND_HANDHELDRADIORANGE { 3500.f };
|
||||
|
||||
enum class sound_type {
|
||||
single,
|
||||
@@ -46,7 +46,7 @@ enum class sound_placement {
|
||||
custom, // source doesn't fit in any standard location or requires custom soundproofing
|
||||
};
|
||||
|
||||
auto const EU07_SOUNDPROOFING_NONE{ 1.f };
|
||||
constexpr auto EU07_SOUNDPROOFING_NONE{ 1.f };
|
||||
auto const EU07_SOUNDPROOFING_SOME{ std::sqrt( 0.65f ) };
|
||||
auto const EU07_SOUNDPROOFING_STRONG{ std::sqrt( 0.20f ) };
|
||||
auto const EU07_SOUNDPROOFING_VERYSTRONG{ std::sqrt( 0.01f ) };
|
||||
|
||||
Reference in New Issue
Block a user