Merge branch 'master' into stl_exporter
This commit is contained in:
@@ -242,8 +242,8 @@ namespace OpenVulkano
|
||||
{
|
||||
if (format == m_format)
|
||||
{
|
||||
return format >= BC1_RGB_UNORM_BLOCK && format <= ASTC_12x12_SRGB_BLOCK
|
||||
|| format >= ASTC_4x4_SFLOAT_BLOCK && format <= PVRTC2_4BPP_SRGB_BLOCK_IMG;
|
||||
return (format >= BC1_RGB_UNORM_BLOCK && format <= ASTC_12x12_SRGB_BLOCK) ||
|
||||
(format >= ASTC_4x4_SFLOAT_BLOCK && format <= PVRTC2_4BPP_SRGB_BLOCK_IMG);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -268,4 +268,4 @@ namespace OpenVulkano
|
||||
#ifndef __APPLE__
|
||||
DataFormat DataFormat::GetFromMetalPixelFormat(int formatId) { return UNDEFINED; }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,18 +130,18 @@ namespace OpenVulkano::Scene
|
||||
std::stringstream objContents;
|
||||
WriteObjContents(geometry, DEFAULT_OBJ_MATERIAL_NAME, objContents);
|
||||
std::string objContentsStr = objContents.str();
|
||||
FileDescription objDesc = FileDescription::MakeDescriptionForFile("model.obj", objContentsStr.size());
|
||||
FileDescription objDesc = FileDescription::MkFile("model.obj", objContentsStr.size());
|
||||
zipWriter.AddFile(objDesc, objContentsStr.data());
|
||||
}
|
||||
{
|
||||
FileDescription mtlDesc = FileDescription::MakeDescriptionForFile("material.mtl", DEFAULT_OBJ_MATERIAL_CONTENTS.size());
|
||||
FileDescription mtlDesc = FileDescription::MkFile("material.mtl", DEFAULT_OBJ_MATERIAL_CONTENTS.size());
|
||||
zipWriter.AddFile(mtlDesc, DEFAULT_OBJ_MATERIAL_CONTENTS.data());
|
||||
}
|
||||
|
||||
if (!texturePath.empty() && std::filesystem::exists(texturePath))
|
||||
{
|
||||
MemMappedFile textureFile(texturePath);
|
||||
FileDescription texDesc = FileDescription::MakeDescriptionForFile("texture.png", textureFile.Size());
|
||||
FileDescription texDesc = FileDescription::MkFile("texture.png", textureFile.Size());
|
||||
zipWriter.AddFile(texDesc, textureFile.Data());
|
||||
}
|
||||
}
|
||||
@@ -154,14 +154,14 @@ namespace OpenVulkano::Scene
|
||||
std::stringstream usdFile;
|
||||
WriteUsdContents(usdFile, geometry);
|
||||
std::string usdFileStr = usdFile.str();
|
||||
FileDescription usdDesc = FileDescription::MakeDescriptionForFile("geometry.usda", usdFileStr.size());
|
||||
FileDescription usdDesc = FileDescription::MkFile("geometry.usda", usdFileStr.size());
|
||||
zipWriter.AddFile(usdDesc, usdFileStr.data());
|
||||
}
|
||||
|
||||
if (!texturePath.empty() && std::filesystem::exists(texturePath))
|
||||
{
|
||||
MemMappedFile textureFile(texturePath);
|
||||
FileDescription texDesc = FileDescription::MakeDescriptionForFile("texture.png", textureFile.Size());
|
||||
FileDescription texDesc = FileDescription::MkFile("texture.png", textureFile.Size());
|
||||
zipWriter.AddFile(texDesc, textureFile.Data());
|
||||
}
|
||||
}
|
||||
@@ -232,4 +232,4 @@ namespace OpenVulkano::Scene
|
||||
throw std::runtime_error("Unable to convert the scene to FBX: Assimp is not available!");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace OpenVulkano::Scene
|
||||
indices = nullptr;
|
||||
}
|
||||
|
||||
uint32_t Geometry::GetIndex(uint32_t index) const
|
||||
uint32_t Geometry::GetIndex(size_t index) const
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenVulkano
|
||||
|
||||
Vertex* GetVertices() const { return vertices; }
|
||||
void* GetIndices() const { return indices; }
|
||||
uint32_t GetIndex(uint32_t index) const;
|
||||
uint32_t GetIndex(size_t index) const;
|
||||
uint16_t* GetIndices16() const { return static_cast<uint16_t*>(indices); }
|
||||
uint32_t* GetIndices32() const { return static_cast<uint32_t*>(indices); }
|
||||
uint32_t GetIndexCount() const { return indexCount; }
|
||||
|
||||
Reference in New Issue
Block a user