@@ -84,7 +84,7 @@ struct RLE_Pair
uint32_t pixel;
};
-struct RLE_Compressed_Bng
+struct Bng
{
uint32_t magic;
uint32_t width;
@@ -94,15 +94,6 @@ struct RLE_Compressed_Bng
struct RLE_Pair pairs[];
} PACKED;
-struct Bng
-{
- uint32_t magic;
- uint32_t width;
- uint32_t height;
- struct Bng_Pixel_Format pixel_format;
- uint32_t pixels[];
-} PACKED;
-
// NOTE: You have to allocate `width * height` amount of pixels
void decompress_pixels(struct RLE_Pair *pairs, uint32_t pairs_count, uint32_t *pixels)
@@ -17,7 +17,7 @@ void* read_whole_file(const char *filename)
uint32_t *bng_load(const char *filepath, uint32_t *width, uint32_t *height)
- struct RLE_Compressed_Bng *compressed_bng = read_whole_file(filepath);
+ struct Bng *compressed_bng = read_whole_file(filepath);
uint32_t *pixels = malloc(compressed_bng->width * compressed_bng->height * sizeof(uint32_t));
decompress_pixels(compressed_bng->pairs, compressed_bng->pairs_count, pixels);
@@ -17,7 +17,7 @@ int main(int argc, char **argv)
uint32_t *data = (uint32_t*)stbi_load(input_filepath, &x, &y, &n, 4);
assert(data != NULL);
- struct RLE_Compressed_Bng bng = {
+ struct Bng bng = {
.magic = BNG_MAGIC,
.width = x,
.height = y,