diff --git a/main.c b/main.c index 331dd40525885bb9591936585853e400e7241d83..730a1615d5cd62c14c6c71a62a353d62e1ae3995 100644 --- a/main.c +++ b/main.c @@ -77,7 +77,7 @@ free(path->filename); free(path->extension); } -void dxt1_to_rgba(const uint8_t* dxt1_block, uint8_t* rgba_pixels) { +void dxt1_to_rgba(const uint8_t *dxt1_block, uint8_t *rgba_pixels) { uint16_t color0 = (dxt1_block[0] | (dxt1_block[1] << 8)); uint16_t color1 = (dxt1_block[2] | (dxt1_block[3] << 8)); uint32_t color_bits = (dxt1_block[4] | (dxt1_block[5] << 8) | (dxt1_block[6] << 16) | (dxt1_block[7] << 24)); @@ -127,7 +127,7 @@ pixel[3] = colors[color_idx][3]; } } -void dxt3_to_rgba(const uint8_t* dxt3_block, uint8_t* rgba_pixels) { +void dxt3_to_rgba(const uint8_t *dxt3_block, uint8_t *rgba_pixels) { // First 8 bytes contain the alpha values (4 bits per pixel). uint64_t alpha_bits; memcpy(&alpha_bits, dxt3_block, 8); @@ -142,7 +142,7 @@ rgba_pixels[i * 4 + 3] = alpha; // Set the alpha channel. } } -void dxt5_to_rgba(const uint8_t* dxt5_block, uint8_t* rgba_pixels) { +void dxt5_to_rgba(const uint8_t *dxt5_block, uint8_t *rgba_pixels) { // First 8 bytes contain the interpolated alpha values. uint8_t alpha0 = dxt5_block[0]; uint8_t alpha1 = dxt5_block[1]; @@ -196,7 +196,7 @@ rgba_pixels[i * 4 + 3] = alpha_table[alpha_index]; } } -void decode_dxt_image(const uint8_t* image_data, uint32_t width, uint32_t height, int dxt_type, path_components *path, bool verbose) { +void decode_dxt_image(const uint8_t *image_data, uint32_t width, uint32_t height, int dxt_type, path_components *path, bool verbose) { uint32_t blocks_wide = (width + 3) / 4; uint32_t blocks_high = (height + 3) / 4; uint32_t total_pixels = width * height; @@ -212,7 +212,7 @@ // Process each block. for (uint32_t by = 0; by < blocks_high; by++) { for (uint32_t bx = 0; bx < blocks_wide; bx++) { uint8_t block_rgba[64]; - const uint8_t* dxt_block = image_data + (by * blocks_wide + bx) * block_size; + const uint8_t *dxt_block = image_data + (by * blocks_wide + bx) * block_size; switch (dxt_type) { case 1: