2016-01-27 16:42:15 +01:00
|
|
|
#ifndef UTIL_H
|
|
|
|
#define UTIL_H
|
2015-01-24 03:37:10 +01:00
|
|
|
|
2015-01-24 07:46:15 +01:00
|
|
|
#include "../types.h"
|
2015-01-24 03:37:10 +01:00
|
|
|
|
2015-01-25 19:32:01 +01:00
|
|
|
typedef enum {
|
|
|
|
RGB565,
|
|
|
|
RGBA4444
|
|
|
|
} PixelFormat;
|
|
|
|
|
2015-01-26 03:24:32 +01:00
|
|
|
void utf8_to_utf16(u16* dst, const char* src, size_t max_len);
|
2015-01-25 19:32:01 +01:00
|
|
|
u16 pack_color(u8 r, u8 g, u8 b, u8 a, PixelFormat format);
|
2015-02-02 03:48:13 +01:00
|
|
|
u8* load_image(const char* image, u32 width, u32 height);
|
|
|
|
u16* image_data_to_tiles(u8* img, u32 width, u32 height, PixelFormat format, u32* size);
|
2015-01-25 19:32:01 +01:00
|
|
|
u16* image_to_tiles(const char* image, u32 width, u32 height, PixelFormat format, u32* size);
|
2015-01-24 03:37:10 +01:00
|
|
|
|
|
|
|
#endif
|