summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/test/modelfile_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics/engine/test/modelfile_test.cpp')
-rw-r--r--src/graphics/engine/test/modelfile_test.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/graphics/engine/test/modelfile_test.cpp b/src/graphics/engine/test/modelfile_test.cpp
index 6879a1b..e7078a9 100644
--- a/src/graphics/engine/test/modelfile_test.cpp
+++ b/src/graphics/engine/test/modelfile_test.cpp
@@ -15,12 +15,11 @@
// * along with this program. If not, see http://www.gnu.org/licenses/.
-#include "common/iman.h"
#include "common/logger.h"
#include "graphics/engine/modelfile.h"
#include "math/func.h"
-#include "gtest/gtest.h"
+#include <gtest/gtest.h>
#include <cassert>
#include <sstream>
@@ -41,8 +40,7 @@ const char* const TEXT_MODEL =
"tex1 lemt.png\n"
"tex2\n"
"var_tex2 N\n"
-"min 200\n"
-"max 1e+06\n"
+"lod_level 0\n"
"state 1024\n"
"\n"
"p1 c -19 -1 4 n -1 0 0 t1 0.248047 0.123047 t2 0.905224 0.52067\n"
@@ -52,8 +50,7 @@ const char* const TEXT_MODEL =
"tex1 derrick.png\n"
"tex2\n"
"var_tex2 Y\n"
-"min 200\n"
-"max 1e+06\n"
+"lod_level 1\n"
"state 0\n"
"";
@@ -82,8 +79,7 @@ void Init()
TRIANGLE_1.material.specular = Gfx::Color(0, 0, 0, 0);
TRIANGLE_1.tex1Name = "lemt.png";
TRIANGLE_1.variableTex2 = false;
- TRIANGLE_1.min = 200.0f;
- TRIANGLE_1.max = 1e+06f;
+ TRIANGLE_1.lodLevel = Gfx::LOD_Constant;
TRIANGLE_1.state = 1024;
TRIANGLE_2.p1 = Gfx::VertexTex2(Math::Vector(-19, -1, 4),
@@ -103,8 +99,7 @@ void Init()
TRIANGLE_2.material.specular = Gfx::Color(0, 0, 0, 0);
TRIANGLE_2.tex1Name = "derrick.png";
TRIANGLE_2.variableTex2 = true;
- TRIANGLE_2.min = 200.0f;
- TRIANGLE_2.max = 1e+06f;
+ TRIANGLE_2.lodLevel = Gfx::LOD_Low;
TRIANGLE_2.state = 0;
}
@@ -172,10 +167,7 @@ bool CompareTriangles(const Gfx::ModelTriangle& t1, const Gfx::ModelTriangle& t2
if (t1.variableTex2 != t2.variableTex2)
return false;
- if (!Math::IsEqual(t1.min, t2.min))
- return false;
-
- if (!Math::IsEqual(t1.max, t2.max))
+ if (t1.lodLevel != t2.lodLevel)
return false;
if (t1.state != t2.state)
@@ -190,8 +182,7 @@ TEST(ModelFileTest, RWTxtModel)
std::stringstream str;
str.str(TEXT_MODEL);
- CInstanceManager iMan;
- Gfx::CModelFile modelFile(&iMan);
+ Gfx::CModelFile modelFile;
EXPECT_TRUE(modelFile.ReadTextModel(str));
@@ -216,8 +207,7 @@ TEST(ModelFileTest, RWBinModel)
std::stringstream str;
str.str(TEXT_MODEL);
- CInstanceManager iMan;
- Gfx::CModelFile modelFile(&iMan);
+ Gfx::CModelFile modelFile;
EXPECT_TRUE(modelFile.ReadTextModel(str));
@@ -242,8 +232,7 @@ TEST(ModelFileTest, RWOldModel)
std::stringstream str;
str.str(TEXT_MODEL);
- CInstanceManager iMan;
- Gfx::CModelFile modelFile(&iMan);
+ Gfx::CModelFile modelFile;
EXPECT_TRUE(modelFile.ReadTextModel(str));