Getting shaders working with lua.
This commit is contained in:
26
src/duskrpg/map/mapchunk.c
Normal file
26
src/duskrpg/map/mapchunk.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "mapchunk.h"
|
||||
|
||||
uint32_t mapChunkGetTileindex(const chunkpos_t position) {
|
||||
return (
|
||||
(position.z * CHUNK_WIDTH * CHUNK_HEIGHT) +
|
||||
(position.y * CHUNK_WIDTH) +
|
||||
position.x
|
||||
);
|
||||
}
|
||||
|
||||
bool_t mapChunkPositionIsEqual(const chunkpos_t a, const chunkpos_t b) {
|
||||
return (a.x == b.x) && (a.y == b.y) && (a.z == b.z);
|
||||
}
|
||||
|
||||
void mapChunkRender(const mapchunk_t *chunk) {
|
||||
for(uint8_t i = 0; i < chunk->meshCount; i++) {
|
||||
meshDraw(&chunk->meshes[i], 0, -1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user