diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2019-07-29 09:01:55 -0400 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2019-07-29 09:01:55 -0400 |
commit | 3e27227b83c2c602237f016f04f2c5fa1e31de87 (patch) | |
tree | 4bce050a1fc6c364f937c33dcf58daf283a241d1 /tools/gbagfx/gfx.h | |
parent | 7d02658bfce6a57a5f845f44cbda412b9777113a (diff) |
Add sources and compilation guide
Diffstat (limited to 'tools/gbagfx/gfx.h')
-rw-r--r-- | tools/gbagfx/gfx.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/gbagfx/gfx.h b/tools/gbagfx/gfx.h new file mode 100644 index 0000000..5355ced --- /dev/null +++ b/tools/gbagfx/gfx.h @@ -0,0 +1,36 @@ +// Copyright (c) 2015 YamaArashi + +#ifndef GFX_H +#define GFX_H + +#include <stdint.h> +#include <stdbool.h> + +struct Color { + unsigned char red; + unsigned char green; + unsigned char blue; +}; + +struct Palette { + struct Color colors[256]; + int numColors; +}; + +struct Image { + int width; + int height; + int bitDepth; + unsigned char *pixels; + bool hasPalette; + struct Palette palette; + bool hasTransparency; +}; + +void ReadImage(char *path, int tilesWidth, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors); +void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors); +void FreeImage(struct Image *image); +void ReadGbaPalette(char *path, struct Palette *palette); +void WriteGbaPalette(char *path, struct Palette *palette); + +#endif // GFX_H |