![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <stb/stb_image.h>
#include <stb/stb_image_write.h>
#include "n64graphics.h"
#include "utils.h"
Macros | |
#define | STBI_NO_LINEAR |
#define | STBI_NO_HDR |
#define | STBI_NO_TGA |
#define | STB_IMAGE_IMPLEMENTATION |
#define | STB_IMAGE_WRITE_IMPLEMENTATION |
#define | SCALE_5_8(VAL_) (((VAL_) * 0xFF) / 0x1F) |
#define | SCALE_8_5(VAL_) ((((VAL_) + 4) * 0x1F) / 0xFF) |
#define | SCALE_4_8(VAL_) ((VAL_) * 0x11) |
#define | SCALE_8_4(VAL_) ((VAL_) / 0x11) |
#define | SCALE_3_8(VAL_) ((VAL_) * 0x24) |
#define | SCALE_8_3(VAL_) ((VAL_) / 0x24) |
Enumerations | |
enum | img_format { IMG_FORMAT_RGBA, IMG_FORMAT_IA, IMG_FORMAT_I, IMG_FORMAT_CI, IMG_FORMAT_CI } |
Functions | |
rgba * | raw2rgba (const uint8_t *raw, int width, int height, int depth) |
ia * | raw2ia (const uint8_t *raw, int width, int height, int depth) |
ia * | raw2i (const uint8_t *raw, int width, int height, int depth) |
rgba * | rawci2rgba (const uint8_t *rawci, const uint8_t *palette, int width, int height, int depth) |
int | rgba2raw (uint8_t *raw, const rgba *img, int width, int height, int depth) |
int | ia2raw (uint8_t *raw, const ia *img, int width, int height, int depth) |
int | i2raw (uint8_t *raw, const ia *img, int width, int height, int depth) |
int | rgba2png (const char *png_filename, const rgba *img, int width, int height) |
int | ia2png (const char *png_filename, const ia *img, int width, int height) |
rgba * | png2rgba (const char *png_filename, int *width, int *height) |
ia * | png2ia (const char *png_filename, int *width, int *height) |
const char * | n64graphics_get_read_version (void) |
const char * | n64graphics_get_write_version (void) |
#define SCALE_3_8 | ( | VAL_ | ) | ((VAL_) * 0x24) |
#define SCALE_4_8 | ( | VAL_ | ) | ((VAL_) * 0x11) |
#define SCALE_5_8 | ( | VAL_ | ) | (((VAL_) * 0xFF) / 0x1F) |
#define SCALE_8_3 | ( | VAL_ | ) | ((VAL_) / 0x24) |
#define SCALE_8_4 | ( | VAL_ | ) | ((VAL_) / 0x11) |
#define SCALE_8_5 | ( | VAL_ | ) | ((((VAL_) + 4) * 0x1F) / 0xFF) |
#define STB_IMAGE_IMPLEMENTATION |
#define STB_IMAGE_WRITE_IMPLEMENTATION |
#define STBI_NO_HDR |
#define STBI_NO_LINEAR |
#define STBI_NO_TGA |
enum img_format |
rgba* rawci2rgba | ( | const uint8_t * | rawci, |
const uint8_t * | palette, | ||
int | width, | ||
int | height, | ||
int | depth | ||
) |