Skip to content

Commit 7ac5c7f

Browse files
author
Mischa Spiegelmock
authored
Merge pull request #313 from struktured/fix-qvar-bugs
Fix off by 1 qvar errors, var names
2 parents 0758b04 + e8343b3 commit 7ac5c7f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/libprojectM/MilkdropPresetFactory/BuiltinParams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ int BuiltinParams::load_all_builtin_param(const PresetInputs & presetInputs, Pre
396396

397397
for (unsigned int i = 0; i < NUM_Q_VARIABLES;i++) {
398398
std::ostringstream os;
399-
os << "q" << i;
399+
os << "q" << i+1;
400400
load_builtin_param_float(os.str().c_str(), (void*)&presetOutputs.q[i], NULL, P_FLAG_QVAR, 0, MAX_DOUBLE_SIZE, -MAX_DOUBLE_SIZE, "");
401401

402402
}

src/libprojectM/MilkdropPresetFactory/CustomShape.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ CustomShape::CustomShape ( int _id ) : Shape()
208208
abort();
209209
}
210210

211-
for (unsigned int i = 1; i <= NUM_Q_VARIABLES;i++) {
211+
for (unsigned int i = 0; i < NUM_Q_VARIABLES;i++) {
212212
std::ostringstream os;
213-
os << "q" << i;
213+
os << "q" << i+1;
214214
param = Param::new_param_float ( os.str().c_str(), P_FLAG_QVAR, &this->q[i], NULL, MAX_DOUBLE_SIZE,
215215
-MAX_DOUBLE_SIZE, 0.0 );
216216
if ( !ParamUtils::insert ( param, &this->param_tree ) )

src/libprojectM/MilkdropPresetFactory/CustomWave.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ CustomWave::CustomWave(int _id) : Waveform(512),
396396
abort();
397397
}
398398

399-
for (unsigned int i = 1; i <= NUM_Q_VARIABLES;i++) {
399+
for (unsigned int i = 0; i < NUM_Q_VARIABLES;i++) {
400400
std::ostringstream os;
401-
os << "q" << i;
401+
os << "q" << i+1;
402402
param = Param::new_param_float ( os.str().c_str(), P_FLAG_QVAR, &this->q[i], NULL, MAX_DOUBLE_SIZE,
403403
-MAX_DOUBLE_SIZE, 0.0 );
404404
if ( !ParamUtils::insert ( param, &this->param_tree ) )

0 commit comments

Comments
 (0)