@@ -437,47 +437,48 @@ static void parse_fireball_tbl(const char *table_filename)
437
437
default :
438
438
error_display (0 , " Invalid warp model style. Must be classic or cinematic." );
439
439
}
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
- }
451
-
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
440
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
+ }
466
478
}
467
479
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;
481
482
}
482
483
}
483
484
@@ -1150,12 +1151,12 @@ static float cutscene_wormhole(float t) {
1150
1151
float fireball_wormhole_intensity (fireball *fb)
1151
1152
{
1152
1153
float t = fb->time_elapsed ;
1153
-
1154
- float rad = cutscene_wormhole (t / fb->warp_open_duration );
1154
+ float rad;
1155
1155
1156
1156
fireball_info* fi = &Fireball_info[fb->fireball_info_index ];
1157
1157
1158
1158
if (fi->warp_model_style == warp_style::CINEMATIC) {
1159
+ rad = cutscene_wormhole (t / fb->warp_open_duration );
1159
1160
rad *= cutscene_wormhole ((fb->total_time - t) / fb->warp_close_duration );
1160
1161
rad /= cutscene_wormhole (fb->total_time / (2 .0f * fb->warp_open_duration ));
1161
1162
rad /= cutscene_wormhole (fb->total_time / (2 .0f * fb->warp_close_duration ));
0 commit comments