2021-03-18 18:30:36 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
/* Copyright (C) 2021 KikooDX */
|
2021-03-18 17:27:34 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-03-27 12:19:10 +01:00
|
|
|
#include "options.h"
|
|
|
|
|
2021-03-25 17:06:18 +01:00
|
|
|
typedef unsigned int Tile;
|
2021-03-18 17:27:34 +01:00
|
|
|
struct Level {
|
|
|
|
int width;
|
|
|
|
int height;
|
2021-03-25 17:06:18 +01:00
|
|
|
Tile *data;
|
2021-03-18 17:27:34 +01:00
|
|
|
};
|
|
|
|
|
2021-03-25 13:44:05 +01:00
|
|
|
/* return -1 if error */
|
|
|
|
int level_read(struct Level *, char *path);
|
2021-03-27 12:19:10 +01:00
|
|
|
/* return -1 if error */
|
|
|
|
int level_create(struct Level *, struct Options options);
|
2021-03-23 17:18:06 +01:00
|
|
|
void level_free(struct Level *);
|
2021-03-25 13:44:05 +01:00
|
|
|
/* return -1 if error */
|
|
|
|
int level_write(struct Level level, char *path);
|