mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
chore(sound): cvars in SI2::Init are local statics
This commit is contained in:
parent
0ff6dc3112
commit
10f350ad1f
@ -4,14 +4,6 @@
|
|||||||
#include "sound/SESound.hpp"
|
#include "sound/SESound.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
|
|
||||||
CVar* SI2::s_pCVar_Sound_EnableReverb;
|
|
||||||
CVar* SI2::s_pCVar_Sound_EnableSoftwareHRTF;
|
|
||||||
CVar* SI2::s_pCVar_Sound_NumChannels;
|
|
||||||
CVar* SI2::s_pCVar_Sound_OutputDriverIndex;
|
|
||||||
CVar* SI2::s_pCVar_Sound_OutputDriverName;
|
|
||||||
|
|
||||||
static int32_t s_initFlags;
|
|
||||||
|
|
||||||
int32_t SI2::Init(int32_t a1) {
|
int32_t SI2::Init(int32_t a1) {
|
||||||
// TODO
|
// TODO
|
||||||
// if (CmdLineGetBool(26)) {
|
// if (CmdLineGetBool(26)) {
|
||||||
@ -38,12 +30,7 @@ int32_t SI2::Init(int32_t a1) {
|
|||||||
|
|
||||||
int32_t enableReverb = 0;
|
int32_t enableReverb = 0;
|
||||||
|
|
||||||
if (!(s_initFlags & 0x1)) {
|
static auto enableReverbVar = CVar::Lookup("Sound_EnableReverb");
|
||||||
SI2::s_pCVar_Sound_EnableReverb = CVar::Lookup("Sound_EnableReverb");
|
|
||||||
s_initFlags |= 0x1;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto enableReverbVar = SI2::s_pCVar_Sound_EnableReverb;
|
|
||||||
|
|
||||||
if (enableReverbVar) {
|
if (enableReverbVar) {
|
||||||
enableReverb = enableReverbVar->GetInt();
|
enableReverb = enableReverbVar->GetInt();
|
||||||
@ -53,12 +40,7 @@ int32_t SI2::Init(int32_t a1) {
|
|||||||
|
|
||||||
int32_t enableSoftwareHRTF = 0;
|
int32_t enableSoftwareHRTF = 0;
|
||||||
|
|
||||||
if (!(s_initFlags & 0x2)) {
|
static auto enableSoftwareHRTFVar = CVar::Lookup("Sound_EnableSoftwareHRTF");
|
||||||
SI2::s_pCVar_Sound_EnableSoftwareHRTF = CVar::Lookup("Sound_EnableSoftwareHRTF");
|
|
||||||
s_initFlags |= 0x2;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto enableSoftwareHRTFVar = SI2::s_pCVar_Sound_EnableSoftwareHRTF;
|
|
||||||
|
|
||||||
if (enableSoftwareHRTFVar) {
|
if (enableSoftwareHRTFVar) {
|
||||||
enableSoftwareHRTF = enableSoftwareHRTFVar->GetInt();
|
enableSoftwareHRTF = enableSoftwareHRTFVar->GetInt();
|
||||||
@ -68,12 +50,7 @@ int32_t SI2::Init(int32_t a1) {
|
|||||||
|
|
||||||
int32_t numChannels = 4;
|
int32_t numChannels = 4;
|
||||||
|
|
||||||
if (!(s_initFlags & 0x4)) {
|
static auto numChannelsVar = CVar::Lookup("Sound_NumChannels");
|
||||||
SI2::s_pCVar_Sound_NumChannels = CVar::Lookup("Sound_NumChannels");
|
|
||||||
s_initFlags |= 0x4;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto numChannelsVar = SI2::s_pCVar_Sound_NumChannels;
|
|
||||||
|
|
||||||
if (numChannelsVar) {
|
if (numChannelsVar) {
|
||||||
numChannels = numChannelsVar->GetInt();
|
numChannels = numChannelsVar->GetInt();
|
||||||
@ -83,12 +60,7 @@ int32_t SI2::Init(int32_t a1) {
|
|||||||
|
|
||||||
int32_t outputDriverIndex = 0;
|
int32_t outputDriverIndex = 0;
|
||||||
|
|
||||||
if (!(s_initFlags & 0x8)) {
|
static auto outputDriverIndexVar = CVar::Lookup("Sound_OutputDriverIndex");
|
||||||
SI2::s_pCVar_Sound_OutputDriverIndex = CVar::Lookup("Sound_OutputDriverIndex");
|
|
||||||
s_initFlags |= 0x8;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto outputDriverIndexVar = SI2::s_pCVar_Sound_OutputDriverIndex;
|
|
||||||
|
|
||||||
if (outputDriverIndexVar) {
|
if (outputDriverIndexVar) {
|
||||||
outputDriverIndex = outputDriverIndexVar->GetInt();
|
outputDriverIndex = outputDriverIndexVar->GetInt();
|
||||||
@ -98,12 +70,7 @@ int32_t SI2::Init(int32_t a1) {
|
|||||||
|
|
||||||
const char* outputDriverName = "";
|
const char* outputDriverName = "";
|
||||||
|
|
||||||
if (!(s_initFlags & 0x10)) {
|
static auto outputDriverNameVar = CVar::Lookup("Sound_OutputDriverName");
|
||||||
SI2::s_pCVar_Sound_OutputDriverName = CVar::Lookup("Sound_OutputDriverName");
|
|
||||||
s_initFlags |= 0x10;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto outputDriverNameVar = SI2::s_pCVar_Sound_OutputDriverName;
|
|
||||||
|
|
||||||
if (outputDriverNameVar) {
|
if (outputDriverNameVar) {
|
||||||
outputDriverName = outputDriverNameVar->GetString();
|
outputDriverName = outputDriverNameVar->GetString();
|
||||||
|
|||||||
@ -5,16 +5,9 @@
|
|||||||
#include "ui/Types.hpp"
|
#include "ui/Types.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class CVar;
|
|
||||||
|
|
||||||
class SI2 {
|
class SI2 {
|
||||||
public:
|
public:
|
||||||
// Static variables
|
// Static variables
|
||||||
static CVar* s_pCVar_Sound_EnableReverb;
|
|
||||||
static CVar* s_pCVar_Sound_EnableSoftwareHRTF;
|
|
||||||
static CVar* s_pCVar_Sound_NumChannels;
|
|
||||||
static CVar* s_pCVar_Sound_OutputDriverIndex;
|
|
||||||
static CVar* s_pCVar_Sound_OutputDriverName;
|
|
||||||
static FrameScript_Method s_ScriptFunctions[NUM_SCRIPT_FUNCTIONS_SI2];
|
static FrameScript_Method s_ScriptFunctions[NUM_SCRIPT_FUNCTIONS_SI2];
|
||||||
|
|
||||||
// Static functions
|
// Static functions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user