Add shared atlas header

isolation_bkp/dynres
Dominik Madarász 2021-01-11 17:29:18 +01:00
parent bdb04aa2b0
commit 9b6b80e5fe
2 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,8 @@
#include "blocks.h"
#include "atlas_shared.h"
static block blocks[] = {
{.tex_id = 0, .name = "base-ground", .flags = 0, .kind = BLOCK_KIND_GROUND, .biome = 0, .symbol = '.'},
{.tex_id = 1, .name = "base-wall", .flags = BLOCK_FLAG_COLLISION, .kind = BLOCK_KIND_WALL, .biome = 0, .symbol = '#'},
{.tex_id = 2, .name = "base-water", .flags = BLOCK_FLAG_COLLISION, .kind = BLOCK_KIND_WATER, .biome = 0, .symbol = '~'},
{.tex_id = ATLAS_XY(0, 0), .name = "base-ground", .flags = 0, .kind = BLOCK_KIND_GROUND, .biome = 0, .symbol = '.'},
{.tex_id = ATLAS_XY(1, 0), .name = "base-wall", .flags = BLOCK_FLAG_COLLISION, .kind = BLOCK_KIND_WALL, .biome = 0, .symbol = '#'},
{.tex_id = ATLAS_XY(0, 1), .name = "base-water", .flags = BLOCK_FLAG_COLLISION, .kind = BLOCK_KIND_WATER, .biome = 0, .symbol = '~'},
};

View File

@ -0,0 +1,4 @@
#pragma once
#define ATLAS_STRIDE 10
#define ATLAS_XY(x,y) ((y*ATLAS_STRIDE)+x)