remove unneeded code

This commit is contained in:
2025-08-28 16:46:27 +02:00
parent f1141e0db4
commit 5b5f1f54af
2 changed files with 0 additions and 35 deletions

View File

@@ -104,19 +104,3 @@ size_t mcx_calcsize(const u8 *restrict buf) {
size += *(buf + (i * 4) + 3);
return (size * 0x1000) + 0x2000;
}
/* an `*.mcX` contains a `0x2000` byte long table, the first `0x1000` containing
* `0x400` entries of chunk data.
* This chunk data is big-endian, where bytes `0xFFFFFF00` represent the `0x1000` sector offset.
* From the start, and bytes `0x000000FF` represent the length in `0x1000` sectors. */
void mcx_index(const u8 *restrict buf, struct mcx_chunk *restrict chunks) {
const u32 *ptr = (u32 *)buf;
for (uint i = 0; i < 0x400; i++) {
u32 dat = be32toh(ptr[i]);
chunks[i] = (struct mcx_chunk){
.idx = (dat >> 8) * 0x1000,
.len = (dat & 0xFF) * 0x1000,
.time = be32toh(ptr[i + 0x400]),
};
}
}

View File

@@ -35,22 +35,3 @@ size_t mcx_delchunk_bulk(u8 *restrict buf, const u16 *restrict chunks, int chunk
/* Computes the byte size of the `*.mcX` file in `buf` and returns it. */
size_t mcx_calcsize(const u8 *restrict buf) NONNULL((1)) PURE;
/* indexes the chunks in an `*.mcX` file, writing `0x400` of entries to `chunks` */
void mcx_index(const u8 *restrict buf, struct mcx_chunk *restrict chunks) NONNULL((1, 2));
/* the MCR (Minecraft region) and MCA (Minecraft anvil) files are similar
* MCA is the newer variant, where it includes:
* - a world height of 256, rather than 128.
* - block IDs have been extended to 4096 from 256
* - block ordering is now YZX, rather than XZY.
* - biomes are included in the data per XZ column.
* MCR start with an 8KiB header, split in two 4KiB tables
* - the first containing the offsets of chunks in the region file itself.
* - the second providing timestamps on when they were last updated.
* -
*
*
*
*
*/