28 lines
594 B
C++
28 lines
594 B
C++
#ifndef GAME_GBM_H
|
|
#define GAME_GBM_H
|
|
|
|
#include <cstddef>
|
|
|
|
#include "../graphics/Bitmap.h"
|
|
|
|
namespace Gbm {
|
|
struct GbmHeader {
|
|
uint32_t signature;
|
|
uint16_t width;
|
|
uint16_t height;
|
|
struct {
|
|
uint8_t r;
|
|
uint8_t g;
|
|
uint8_t b;
|
|
} __attribute__((__packed__)) palette[16];
|
|
uint8_t data[0];
|
|
} __attribute__((__packed__));
|
|
|
|
Bitmap loadFromMemory(const void *data, size_t size);
|
|
Bitmap loadFromFile(const char *path);
|
|
|
|
void writeToFile(const char *path, const Bitmap &bitmap);
|
|
};
|
|
|
|
|
|
#endif //GAME_GBM_H
|