diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2021-07-03 00:49:03 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:20:20 +0200 |
| commit | 6b9f686913efc3725b2690033cd4f398e07076ba (patch) | |
| tree | e9aa91a6b9f617d78123ebe7ad272fc42a60d306 /src/terrain/inc | |
| parent | c9e6ae44a9aeb89b3f48f3443d6baa80103f7445 (diff) | |
| download | jancity-6b9f686913efc3725b2690033cd4f398e07076ba.tar.gz | |
Add project source code
Diffstat (limited to 'src/terrain/inc')
| -rw-r--r-- | src/terrain/inc/terrain.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/terrain/inc/terrain.h b/src/terrain/inc/terrain.h new file mode 100644 index 0000000..9552555 --- /dev/null +++ b/src/terrain/inc/terrain.h @@ -0,0 +1,41 @@ +#ifndef TERRAIN_H +#define TERRAIN_H + +#include <camera.h> +#include <gfx.h> +#include <stddef.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + +enum +{ + MAP_TILES = 64, + TERRAIN_SZ = 32, + MAP_X = MAP_TILES * TERRAIN_SZ, + MAP_Y = MAP_TILES * TERRAIN_SZ +}; + +enum terrain_type +{ + TERRAIN_TYPE_GRASS +}; + +struct terrain_map +{ + enum terrain_type m[MAP_TILES][MAP_TILES]; + int nx, ny; +}; + +void terrain_init(struct terrain_map *map); +int terrain_render(const struct terrain_map *map, const struct camera *cam); + +extern struct sprite grass_sprite; + +#ifdef __cplusplus +} +#endif + +#endif /* TERRAIN_H */ |
