Examples: Fix MeshInfos since material update
Former-commit-id: 1d019a7c6659f2ca0f173711c03e3eb89ed1659b
This commit is contained in:
parent
385c597434
commit
ed3b9f9a21
|
|
@ -2,6 +2,7 @@
|
||||||
#include <Nazara/Core/File.hpp>
|
#include <Nazara/Core/File.hpp>
|
||||||
#include <Nazara/Math/Box.hpp>
|
#include <Nazara/Math/Box.hpp>
|
||||||
#include <Nazara/Utility/Animation.hpp>
|
#include <Nazara/Utility/Animation.hpp>
|
||||||
|
#include <Nazara/Utility/MaterialData.hpp>
|
||||||
#include <Nazara/Utility/Mesh.hpp>
|
#include <Nazara/Utility/Mesh.hpp>
|
||||||
#include <Nazara/Utility/Utility.hpp>
|
#include <Nazara/Utility/Utility.hpp>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
@ -22,7 +23,7 @@ int main()
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
Nz::Directory resourceDirectory("resources/");
|
Nz::Directory resourceDirectory("resources");
|
||||||
if (!resourceDirectory.Open())
|
if (!resourceDirectory.Open())
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to open resource directory" << std::endl;
|
std::cerr << "Failed to open resource directory" << std::endl;
|
||||||
|
|
@ -68,7 +69,7 @@ int main()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Nz::Mesh mesh;
|
Nz::Mesh mesh;
|
||||||
if (!mesh.LoadFromFile("resources/" + models[iChoice-1]))
|
if (!mesh.LoadFromFile(resourceDirectory.GetPath() + '/' + models[iChoice-1]))
|
||||||
{
|
{
|
||||||
std::cout << "Failed to load mesh" << std::endl;
|
std::cout << "Failed to load mesh" << std::endl;
|
||||||
std::getchar();
|
std::getchar();
|
||||||
|
|
@ -168,8 +169,18 @@ int main()
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < materialCount; ++i)
|
for (unsigned int i = 0; i < materialCount; ++i)
|
||||||
{
|
{
|
||||||
std::cout << "\t" << (i+1) << ": " << mesh.GetMaterial(i) << std::endl;
|
const Nz::ParameterList& matData = mesh.GetMaterialData(i);
|
||||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
|
||||||
|
Nz::String data;
|
||||||
|
if (!matData.GetStringParameter(Nz::MaterialData::FilePath, &data))
|
||||||
|
{
|
||||||
|
if (matData.HasParameter(Nz::MaterialData::CustomDefined))
|
||||||
|
data = "<Custom>";
|
||||||
|
else
|
||||||
|
data = "<No data>";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "\t" << (i+1) << ": " << data << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue