Skip to content

Commit f88e5c4

Browse files
committed
modular table fix for cinematic warp
Small and subtle fix: move the CINEMATIC options inside the preceding if() block in the same way that the flare style options are inside their preceding if() block. This prevents the CINEMATIC options from being reset to their default values in subsequent modular table parsing. Followup to scp-fs2open#6500.
1 parent 90e1f18 commit f88e5c4

File tree

1 file changed

+39
-38
lines changed

1 file changed

+39
-38
lines changed

code/fireball/fireballs.cpp

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -437,47 +437,48 @@ static void parse_fireball_tbl(const char *table_filename)
437437
default:
438438
error_display(0, "Invalid warp model style. Must be classic or cinematic.");
439439
}
440-
} else if (first_time) {
441-
fi->warp_model_style = warp_style::CLASSIC;
442-
}
443-
444-
// Set warp_model_style options if cinematic style is chosen
445-
if (fi->warp_model_style == warp_style::CINEMATIC) {
446-
if (optional_string("+Warp size ratio:")) {
447-
stuff_float(&fi->warp_size_ratio);
448-
} else {
449-
fi->warp_size_ratio = 1.6f;
450-
}
451440

452-
// The first two values need to be implied multiples of PI
453-
// for convenience. These shouldn't need to be faster than a full
454-
// rotation per second, which is already ridiculous.
455-
if (optional_string("+Rotation anim:")) {
456-
stuff_float_list(fi->rot_anim, 3);
457-
458-
CLAMP(fi->rot_anim[0], 0.0f, 2.0f);
459-
CLAMP(fi->rot_anim[1], 0.0f, 2.0f);
460-
fi->rot_anim[2] = MAX(0.0f, fi->rot_anim[2]);
461-
} else {
462-
// PI / 2.75f, PI / 10.0f, 2.0f
463-
fi->rot_anim[0] = 0.365f;
464-
fi->rot_anim[1] = 0.083f;
465-
fi->rot_anim[2] = 2.0f;
441+
// Set warp_model_style options if cinematic style is chosen
442+
if (fi->warp_model_style == warp_style::CINEMATIC) {
443+
if (optional_string("+Warp size ratio:")) {
444+
stuff_float(&fi->warp_size_ratio);
445+
} else {
446+
fi->warp_size_ratio = 1.6f;
447+
}
448+
449+
// The first two values need to be implied multiples of PI
450+
// for convenience. These shouldn't need to be faster than a full
451+
// rotation per second, which is already ridiculous.
452+
if (optional_string("+Rotation anim:")) {
453+
stuff_float_list(fi->rot_anim, 3);
454+
455+
CLAMP(fi->rot_anim[0], 0.0f, 2.0f);
456+
CLAMP(fi->rot_anim[1], 0.0f, 2.0f);
457+
fi->rot_anim[2] = MAX(0.0f, fi->rot_anim[2]);
458+
} else {
459+
// PI / 2.75f, PI / 10.0f, 2.0f
460+
fi->rot_anim[0] = 0.365f;
461+
fi->rot_anim[1] = 0.083f;
462+
fi->rot_anim[2] = 2.0f;
463+
}
464+
465+
// Variable frame rate for faster propagation of ripples
466+
if (optional_string("+Frame anim:")) {
467+
stuff_float_list(fi->frame_anim, 3);
468+
469+
// A frame rate that is 4 times the normal speed is ridiculous
470+
CLAMP(fi->frame_anim[0], 0.0f, 4.0f);
471+
CLAMP(fi->frame_anim[1], 1.0f, 4.0f);
472+
fi->frame_anim[2] = MAX(0.0f, fi->frame_anim[2]);
473+
} else {
474+
fi->frame_anim[0] = 1.0f;
475+
fi->frame_anim[1] = 1.0f;
476+
fi->frame_anim[2] = 3.0f;
477+
}
466478
}
467479

468-
// Variable frame rate for faster propagation of ripples
469-
if (optional_string("+Frame anim:")) {
470-
stuff_float_list(fi->frame_anim, 3);
471-
472-
// A frame rate that is 4 times the normal speed is ridiculous
473-
CLAMP(fi->frame_anim[0], 0.0f, 4.0f);
474-
CLAMP(fi->frame_anim[1], 1.0f, 4.0f);
475-
fi->frame_anim[2] = MAX(0.0f, fi->frame_anim[2]);
476-
} else {
477-
fi->frame_anim[0] = 1.0f;
478-
fi->frame_anim[1] = 1.0f;
479-
fi->frame_anim[2] = 3.0f;
480-
}
480+
} else if (first_time) {
481+
fi->warp_model_style = warp_style::CLASSIC;
481482
}
482483
}
483484

0 commit comments

Comments
 (0)