From c2037ec26efa4169623456351092c733a6740bee Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Thu, 12 Dec 2013 10:58:14 +0000 Subject: [PATCH] Global files --- CMakeLists.txt.user | 321 +++++++++++++++++++++++++++++++++++++++++ tests/test_globals.hpp | 33 +++++ tests/test_object.cpp | 2 +- 3 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt.user create mode 100644 tests/test_globals.hpp diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 00000000..ce5c625e --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,321 @@ + + + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + true + 1 + true + 0 + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {c0b898f4-d002-45f0-a6f8-01dc0bae760a} + 0 + 0 + 1 + + /home/dan/Projects/gtfw-build + false + + + + + all + + false + false + true + Make + + CMakeProjectManager.MakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + clean + + true + false + true + Make + + CMakeProjectManager.MakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + all + + CMakeProjectManager.CMakeBuildConfiguration + + 1 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + + false + false + false + false + true + 0.01 + 10 + true + 25 + + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + datadump + ../viewer/GTA3/anim/ped.ifp + false + + + datadump + + CMakeProjectManager.CMakeRunConfiguration.datadump + 3768 + true + false + false + true + + + true + + false + false + false + false + true + 0.01 + 10 + true + 25 + + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + viewer + GTA3 -w 1600 -h 900s + false + + + viewer + + CMakeProjectManager.CMakeRunConfiguration.viewer + 3768 + true + false + false + true + + + true + + false + false + false + false + true + 0.01 + 10 + true + 25 + + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + analyzer + + false + + + analyzer + + CMakeProjectManager.CMakeRunConfiguration.analyzer + 3768 + true + false + false + true + + + true + + false + false + false + false + true + 0.01 + 10 + true + 25 + + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + run_tests + + false + + + run_tests + + CMakeProjectManager.CMakeRunConfiguration.run_tests + 3768 + true + false + false + true + + 4 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {1548d26f-0c52-4512-96d9-d63208a0e241} + + + ProjectExplorer.Project.Updater.FileVersion + 12 + + diff --git a/tests/test_globals.hpp b/tests/test_globals.hpp new file mode 100644 index 00000000..0b0c65f6 --- /dev/null +++ b/tests/test_globals.hpp @@ -0,0 +1,33 @@ +#ifndef _TESTGLOBABLS_HPP_ +#define _TESTGLOBABLS_HPP_ + +#include +#include + +// Many tests require OpenGL be functional, seems like a reasonable solution. + +class Global +{ +public: + sf::Window wnd; + GTAEngine* e; + + Global() { + wnd.create(sf::VideoMode(640, 360), "Testing"); + glewExperimental = GL_TRUE; + glewInit(); + e = new GTAEngine("data"); + } + + ~Global() { + wnd.close(); + } + + static Global& get() + { + static Global g; + return g; + } +}; + +#endif \ No newline at end of file diff --git a/tests/test_object.cpp b/tests/test_object.cpp index f14f056e..44af9eb9 100644 --- a/tests/test_object.cpp +++ b/tests/test_object.cpp @@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(instance_test_damage) BOOST_AUTO_TEST_CASE(instance_test_destroy) { std::shared_ptr object(new ObjectData); - GTAInstance inst(Global::get().e, + GTAInstance inst(Global::get().e, glm::vec3(0.f, 0.f, 0.f), glm::quat(), nullptr, glm::vec3(1.f),