Skip to content
Snippets Groups Projects
Commit d9b6b748 authored by Trevor Hollmann's avatar Trevor Hollmann
Browse files

[#79] Get rid of obsolete cerr print.

parent 52005c96
No related branches found
No related tags found
1 merge request!69Resolve "Rework Asset Loader API"
......@@ -189,8 +189,8 @@ typedef struct {
uint32_t offset; // offset in bytes
uint32_t length; // length of ... in bytes
uint32_t stride; // stride in bytes
ComponentType componentType; // eg. 5126 for float
uint8_t componentCount; // eg. 3 for vec3
ComponentType componentType; // eg. 5126 for float
uint8_t componentCount; // eg. 3 for vec3
} VertexAttribute;
/** This struct represents one (possibly the only) part of a mesh. There is
......
......@@ -50,13 +50,17 @@ void print_what (const std::exception& e, const std::string &path) {
}
}
/** Translate the component type used in the index accessor of fx-gltf to our
/**
* Translate the component type used in the index accessor of fx-gltf to our
* enum for index type. The reason we have defined an incompatible enum that
* needs translation is that only a subset of component types is valid for
* indices and we want to catch these incompatibilities here. */
enum IndexType getIndexType(const enum fx::gltf::Accessor::ComponentType &t)
* indices and we want to catch these incompatibilities here.
* @param t The component type
* @return enum representation
*/
enum IndexType getIndexType(const enum fx::gltf::Accessor::ComponentType &type)
{
switch (t) {
switch (type) {
case fx::gltf::Accessor::ComponentType::UnsignedByte:
return IndexType::UINT8;
case fx::gltf::Accessor::ComponentType::UnsignedShort:
......@@ -64,8 +68,6 @@ enum IndexType getIndexType(const enum fx::gltf::Accessor::ComponentType &t)
case fx::gltf::Accessor::ComponentType::UnsignedInt:
return IndexType::UINT32;
default:
std::cerr << "ERROR: Index type not supported: " <<
static_cast<uint16_t>(t) << std::endl;
return IndexType::UNDEFINED;
}
}
......@@ -272,7 +274,7 @@ int loadScene(const std::string &path, Scene &scene){
indexType = getIndexType(indexAccessor.componentType);
if (indexType == IndexType::UNDEFINED){
vkcv_log(LogLevel::ERROR, "Index Type undefined.");
vkcv_log(LogLevel::ERROR, "Index Type undefined or not supported.");
return ASSET_ERROR;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment