Refactor the way resources are loaded (#191)
* WIP * WIP * Font works * WIP: Only Music remains * Looks like it's working * Fix oopsie * Core/ObjectRef: Add cast functions * Update ChangeLog.md * Audio/SoundStream: Make sound stream thread-safe
This commit is contained in:
@@ -153,7 +153,7 @@ namespace Nz
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
|
||||
MeshRef Load(Stream& stream, const MeshParams& parameters)
|
||||
{
|
||||
long long reservedVertexCount;
|
||||
if (!parameters.custom.GetIntegerParameter("NativeOBJLoader_VertexCount", &reservedVertexCount))
|
||||
@@ -163,9 +163,10 @@ namespace Nz
|
||||
if (!parser.Parse(stream, reservedVertexCount))
|
||||
{
|
||||
NazaraError("OBJ parser failed");
|
||||
return false;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MeshRef mesh = Mesh::New();
|
||||
mesh->CreateStatic();
|
||||
|
||||
const String* materials = parser.GetMaterials();
|
||||
@@ -341,7 +342,7 @@ namespace Nz
|
||||
ParseMTL(mesh, stream.GetDirectory() + mtlLib, materials, meshes, meshCount);
|
||||
}
|
||||
|
||||
return true;
|
||||
return mesh;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user