/**
 * Copyright (c) 2025 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#pragma ocne
#include "display/shader/shaderbuffer.h"
#include "overworld/overworld.h"

#define MAP_BLOCK_NAME "b_Map"
#define MAP_TILE_PACK_SIZE sizeof(uvec4_t) / sizeof(tileid_t)

typedef struct {
  uvec4_t tileIds[OVERWORLD_TILE_COUNT_MAX / MAP_TILE_PACK_SIZE];
  uint_t mapSize;
  uvec3_t _p0;
} mapshaderdata_t;

extern shaderbuffer_t MAP_SHADER_DATA_BUFFER;
extern mapshaderdata_t MAP_SHADER_DATA_DATA;

/**
 * Initializes the map buffer and data.
 */
void mapShaderDataInit();

/**
 * Updates the map buffer with the current data.
 */
void mapShaderDataUpdate();

/**
 * Destroys the map buffer.
 */
void mapShaderDataDispose();