fix the stupidest shit I have ever written

This commit is contained in:
Lephenixnoir 2023-06-01 23:00:31 +02:00
parent 953634b967
commit 0e62ad062d
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 9 additions and 3 deletions

View File

@ -227,7 +227,7 @@ void render_effect_bpp(image_t **image, num t)
if(!*image) {
*image = image_alloc(bpp_W, bpp_H, IMAGE_P8_RGB565A);
image_set_palette(*image, bpp_palette, 1, false);
image_set_palette(*image, bpp_palette, 2, false);
}
image_clear(*image);
@ -239,19 +239,25 @@ void render_effect_bpp(image_t **image, num t)
if(t < start)
continue;
num16 local_time = num16(2 * ((t - start) % num(0.5)));
// if(local_time < num16(0) || local_time >= num16(1))
// abort();
int x0_int = (23 * i) % (bpp_W - 2);
num16 x0 = num16(x0_int);
num16 y0 = num16(bpp_H - 1 - ((37 * i) & 15));
num16 y0 = num16(bpp_H - 3 - ((37 * i) & 15));
num16 vx = num16(bpp_W / 2 - x0_int) / 4;
num16 x = x0 + vx * local_time;
num16 y = y0 - (bpp_H - 16) * local_time;
num16 y = y0 - (bpp_H - 18) * local_time;
for(int dy = 0; dy <= 3; dy++)
for(int dx = 0; dx <= 3; dx++) {
// if((unsigned)((int)y + dy) >= bpp_H)
// abort();
// if((unsigned)((int)x + dx) >= bpp_W)
// abort();
pixels[((int)y + dy) * (*image)->stride + (int)x + dx] =
BPP_PARTICLE;
}