1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

use sizeof index 0

This commit is contained in:
FunkyFr3sh 2022-09-09 10:57:16 +02:00
parent 10d0477cbd
commit 1564c538fd

View File

@ -461,11 +461,11 @@ void blt_rgb565_to_rgba8888(
int src_y, int src_y,
int src_p) int src_p)
{ {
size_t s_a = (src_p / sizeof(unsigned short)) - dst_w; size_t s_a = (src_p / sizeof(src[0])) - dst_w;
size_t d_a = (dst_p / sizeof(unsigned int)) - dst_w; size_t d_a = (dst_p / sizeof(dst[0])) - dst_w;
src += (src_x * sizeof(unsigned short)) + (src_p * src_y); src += (src_x * sizeof(src[0])) + (src_p * src_y);
dst += (dst_x * sizeof(unsigned int)) + (dst_p * dst_y); dst += (dst_x * sizeof(dst[0])) + (dst_p * dst_y);
for (int y = 0; y < dst_h; y++) for (int y = 0; y < dst_h; y++)
{ {
@ -497,11 +497,11 @@ void blt_bgra8888_to_rgba8888(
int src_y, int src_y,
int src_p) int src_p)
{ {
size_t s_a = (src_p / sizeof(unsigned int)) - dst_w; size_t s_a = (src_p / sizeof(src[0])) - dst_w;
size_t d_a = (dst_p / sizeof(unsigned int)) - dst_w; size_t d_a = (dst_p / sizeof(dst[0])) - dst_w;
src += (src_x * sizeof(unsigned int)) + (src_p * src_y); src += (src_x * sizeof(src[0])) + (src_p * src_y);
dst += (dst_x * sizeof(unsigned int)) + (dst_p * dst_y); dst += (dst_x * sizeof(dst[0])) + (dst_p * dst_y);
for (int y = 0; y < dst_h; y++) for (int y = 0; y < dst_h; y++)
{ {