FInished porting last asset loader types
This commit is contained in:
@@ -11,10 +11,40 @@
|
||||
#include "util/endian.h"
|
||||
#include "util/memory.h"
|
||||
|
||||
#include "asset/loader/assetloading.h"
|
||||
#include "asset/loader/assetentry.h"
|
||||
|
||||
errorret_t assetMeshLoaderNEW(assetloading_t *loading) {
|
||||
assertNotNull(loading, "Loading cannot be NULL");
|
||||
assertTrue(loading->type == ASSET_LOADER_TYPE_MESH, "Invalid type.");
|
||||
|
||||
assetmeshoutput_t *out = &loading->entry->data.mesh;
|
||||
assetfile_t *file = &loading->loading.mesh.file;
|
||||
|
||||
assetmeshloaderparams_t params = {
|
||||
.outMesh = &out->mesh,
|
||||
.outVertices = &out->vertices,
|
||||
.inputAxis = loading->entry->input->mesh
|
||||
};
|
||||
|
||||
errorChain(assetFileInit(file, loading->entry->name, NULL, ¶ms));
|
||||
errorChain(assetMeshLoader(file));
|
||||
assetFileDispose(file);
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t assetMeshDisposeNEW(assetentry_t *entry) {
|
||||
assertNotNull(entry, "Asset entry cannot be NULL");
|
||||
assertTrue(entry->type == ASSET_LOADER_TYPE_MESH, "Invalid type.");
|
||||
errorChain(meshDispose(&entry->data.mesh.mesh));
|
||||
memoryFree(entry->data.mesh.vertices);
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t assetMeshLoader(assetfile_t *file) {
|
||||
assertNotNull(file, "Asset file cannot be null");
|
||||
|
||||
assetmeshoutput_t *output = (assetmeshoutput_t *)file->output;
|
||||
|
||||
assetmeshloaderparams_t *output = (assetmeshloaderparams_t *)file->output;
|
||||
assertNotNull(output, "Output cannot be null");
|
||||
assertNotNull(output->outMesh, "Output mesh cannot be null");
|
||||
assertNotNull(output->outVertices, "Output vertices cannot be null");
|
||||
|
||||
Reference in New Issue
Block a user