@@ -555,7 +555,7 @@ static void blit_with_alpha_overlay(video::IImage *src, video::IImage *dst,
555
555
556
556
// Draw or overlay a crack
557
557
static void draw_crack (video::IImage *crack, video::IImage *dst,
558
- bool use_overlay, u32 frame_count, u32 progression,
558
+ bool use_overlay, s32 frame_count, s32 progression,
559
559
video::IVideoDriver *driver);
560
560
561
561
// Brighten image
@@ -1058,8 +1058,8 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas
1058
1058
bool use_overlay = (part_of_name[6 ] == ' o' );
1059
1059
Strfnd sf (part_of_name);
1060
1060
sf.next (" :" );
1061
- u32 frame_count = stoi (sf.next (" :" ));
1062
- u32 progression = stoi (sf.next (" :" ));
1061
+ s32 frame_count = stoi (sf.next (" :" ));
1062
+ s32 progression = stoi (sf.next (" :" ));
1063
1063
1064
1064
/*
1065
1065
Load crack image.
@@ -1499,19 +1499,19 @@ static void blit_with_alpha_overlay(video::IImage *src, video::IImage *dst,
1499
1499
}
1500
1500
1501
1501
static void draw_crack (video::IImage *crack, video::IImage *dst,
1502
- bool use_overlay, u32 frame_count, u32 progression,
1502
+ bool use_overlay, s32 frame_count, s32 progression,
1503
1503
video::IVideoDriver *driver)
1504
1504
{
1505
1505
// Dimension of destination image
1506
1506
core::dimension2d<u32> dim_dst = dst->getDimension ();
1507
1507
// Dimension of original image
1508
1508
core::dimension2d<u32> dim_crack = crack->getDimension ();
1509
1509
// Count of crack stages
1510
- u32 crack_count = dim_crack.Height / dim_crack.Width ;
1510
+ s32 crack_count = dim_crack.Height / dim_crack.Width ;
1511
1511
// Limit frame_count
1512
- if (frame_count > dim_dst.Height )
1512
+ if (frame_count > (s32) dim_dst.Height )
1513
1513
frame_count = dim_dst.Height ;
1514
- if (frame_count == 0 )
1514
+ if (frame_count < 1 )
1515
1515
frame_count = 1 ;
1516
1516
// Limit progression
1517
1517
if (progression > crack_count-1 )
@@ -1543,7 +1543,7 @@ static void draw_crack(video::IImage *crack, video::IImage *dst,
1543
1543
// Scale crack image by copying
1544
1544
crack_cropped->copyToScaling (crack_scaled);
1545
1545
// Copy or overlay crack image onto each frame
1546
- for (u32 i = 0 ; i < frame_count; ++i)
1546
+ for (s32 i = 0 ; i < frame_count; ++i)
1547
1547
{
1548
1548
v2s32 dst_pos (0 , dim_crack_scaled.Height * i);
1549
1549
if (use_overlay)
0 commit comments