45 lines
917 B
C
45 lines
917 B
C
#pragma once
|
|
#include "player.h"
|
|
#include "tile.h"
|
|
#include "vec.h"
|
|
#include "visual_data.h"
|
|
#include <stdint.h>
|
|
|
|
struct LevelBin {
|
|
uint8_t format, chunk_size;
|
|
uint16_t width, height;
|
|
uint8_t data[];
|
|
} __attribute__((__packed__));
|
|
|
|
struct LevelBinNamed {
|
|
struct LevelBin *bin;
|
|
char *name;
|
|
};
|
|
|
|
struct Level {
|
|
int width, height, size, id;
|
|
uint8_t *data;
|
|
struct VisualData *visual_data;
|
|
struct Player *player;
|
|
};
|
|
|
|
void level_init(struct Player *);
|
|
void level_deinit(void);
|
|
|
|
void level_load(int id);
|
|
void level_save_kble(const char *path);
|
|
void level_reload(void);
|
|
void level_regen_visual_data(int editing);
|
|
void level_next(void);
|
|
|
|
void level_draw(void);
|
|
void level_draw_name(void);
|
|
|
|
int level_get(int x, int y);
|
|
int level_get_px(int x, int y);
|
|
void level_set(int x, int y, int v);
|
|
void level_set_px(int x, int y, int v);
|
|
struct Vec level_find(enum Tile);
|
|
int level_count(enum Tile);
|
|
struct Vec level_dim(void);
|