20 lines
459 B
C
20 lines
459 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "chunk.h"
|
|
|
|
uint32_t chunkGetTileIndex(const chunkpos_t position) {
|
|
return (
|
|
(position.z * CHUNK_WIDTH * CHUNK_HEIGHT) +
|
|
(position.y * CHUNK_WIDTH) +
|
|
position.x
|
|
);
|
|
}
|
|
|
|
bool_t chunkPositionIsEqual(const chunkpos_t a, const chunkpos_t b) {
|
|
return (a.x == b.x) && (a.y == b.y) && (a.z == b.z);
|
|
} |