Expose chunk texture scale

isolation_bkp/dynres
Dominik Madarász 2021-10-28 17:47:36 +02:00
parent bbc5856013
commit 8ab803bb5f
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@
#include "perlin.h"
#define BLOCKS_COUNT (sizeof(blocks)/sizeof(block))
#define WORLD_TEXTURE_BLOCK_SCALE 0.5f
ZPL_TABLE(static, blocks__chunk_tbl, blocks__chunk_tbl_, RenderTexture2D);
@ -99,7 +100,7 @@ void *blocks_get_img(uint8_t id) {
void blocks_build_chunk_tex(uint64_t id, uint8_t *chunk_blocks, uint8_t *outer_chunk_blocks, void *raw_view) {
world_view *view = (world_view*)raw_view;
uint16_t blk_dims = WORLD_BLOCK_SIZE * 0.5f;
uint16_t blk_dims = WORLD_BLOCK_SIZE * WORLD_TEXTURE_BLOCK_SCALE;
uint16_t dims = blk_dims * view->chunk_size;
RenderTexture2D canvas = LoadRenderTexture(dims, dims);
BeginTextureMode(canvas);