crystal-tower/inc/level.h

28 lines
565 B
C

#pragma once
#include "tile.h"
#include "vec.h"
struct LevelBin {
unsigned char format;
unsigned char chunk_size;
unsigned short width;
unsigned short height;
unsigned char data[];
} __attribute__((__packed__));
struct Level {
int width;
int height;
int size;
char *data;
};
void level_load(struct LevelBin *);
void level_free(void);
void level_draw(void);
struct Vec level_find(enum Tile);
enum Tile level_get(int x, int y);
enum Tile level_get_px(int x, int y);
void level_set(int x, int y, enum Tile v);
void level_set_px(int x, int y, enum Tile v);