This commit is contained in:
2025-11-11 19:52:09 -06:00
parent d39ed1ea5a
commit 7d7a3f30e6
7 changed files with 36 additions and 51 deletions

View File

@@ -73,7 +73,7 @@ static const assettypedef_t ASSET_TYPE_DEFINITIONS[ASSET_TYPE_COUNT] = {
[ASSET_TYPE_MAP] = {
.header = "DMF",
.loadStrategy = ASSET_LOAD_STRAT_ENTIRE,
.dataSize = sizeof(assetmap_t),
.dataSize = sizeof(1),
.entire = assetMapLoad
},

View File

@@ -111,7 +111,6 @@ errorret_t assetChunkLoad(assetcustom_t custom) {
errorThrow("Failed to read chunk model vertex data.");
}
// Init the mesh
mesh_t *mesh = &chunk->meshes[i];
meshInit(

View File

@@ -13,19 +13,7 @@ errorret_t assetMapLoad(void *data, void *output) {
assertNotNull(data, "Data cannot be NULL");
assertNotNull(output, "Output cannot be NULL");
assetmap_t *mapData = (assetmap_t *)data;
assetmap_t *out = (assetmap_t *)output;
memoryCopy(out, mapData, sizeof(assetmap_t));
meshInit(
&out->models[0].mesh,
MESH_PRIMITIVE_TRIANGLES,
out->models[0].vertexCount,
out->models[0].vertices
);
printf("Load asset\n");
assertUnreachable("map not finished");
errorOk();
}

View File

@@ -10,21 +10,6 @@
#include "rpg/world/map.h"
#include "display/mesh/mesh.h"
typedef struct {
uint32_t vertexCount;
meshvertex_t vertices[6 * CHUNK_TILE_COUNT];
mesh_t mesh;
} assetmapmodel_t;
#pragma pack(push, 1)
typedef struct {
uint32_t tileCount;
uint8_t modelCount;
tile_t tiles[CHUNK_TILE_COUNT];
assetmapmodel_t models[1];
} assetmap_t;
#pragma pack(pop)
/**
* Loads a map asset from the given data pointer into the output map structure.
*