diff --git a/qcpl_dll.bat b/qcpl_dll.bat index 7e4b226eed..efb147d2a4 100644 --- a/qcpl_dll.bat +++ b/qcpl_dll.bat @@ -39,7 +39,7 @@ cd "%scriptdir%\res\dep" xcopy /s "%cd%" %lnkdir% echo Dependencies copied... cd %lnkdir% -g++ -o topaz_test_dependent.exe test.o "%scriptdir%\res\exe\topaz_test.res" -L. -L%libdir% -ltopaz -lmdl +g++ -O3 -o topaz_test_dependent.exe test.o "%scriptdir%\res\exe\topaz_test.res" -L. -L%libdir% -ltopaz -lmdl move test.o "%cpldir%" move libtopazdll.a "%cpldir%" diff --git a/res/exe/topaz_test.rc b/res/exe/topaz_test.rc index cf292d376d..774b564153 100644 --- a/res/exe/topaz_test.rc +++ b/res/exe/topaz_test.rc @@ -8,11 +8,11 @@ BEGIN BLOCK "080904E4" BEGIN VALUE "CompanyName", "Harrand" - VALUE "FileDescription", "Topaz Game Engine Test Build" + VALUE "FileDescription", "Topaz Test Executable" VALUE "FileVersion", "1.0" VALUE "InternalName", "topaz_test" VALUE "LegalCopyright", "Harrand" - VALUE "OriginalFilename", "topaz-test.exe" + VALUE "OriginalFilename", "topaz-test_dependent.exe" VALUE "ProductName", "TOPAZ ENGINE (TEST)" VALUE "ProductVersion", "1.0" END diff --git a/res/exe/topaz_test.res b/res/exe/topaz_test.res index fbd746a486..bd1a798492 100644 Binary files a/res/exe/topaz_test.res and b/res/exe/topaz_test.res differ diff --git a/res/icon/topaz_test.ico b/res/icon/topaz_test.ico index 11c8d89851..d8fc9c7f7a 100644 Binary files a/res/icon/topaz_test.ico and b/res/icon/topaz_test.ico differ diff --git a/res/icon/topaz_test_old.ico b/res/icon/topaz_test_old.ico new file mode 100644 index 0000000000..11c8d89851 Binary files /dev/null and b/res/icon/topaz_test_old.ico differ diff --git a/res/runtime/resources.data b/res/runtime/resources.data index fbaabdba05..baa7bd37bc 100644 --- a/res/runtime/resources.data +++ b/res/runtime/resources.data @@ -106,5 +106,5 @@ skybox.path: ../../../res/runtime/models/skybox.obj skybox.name: Cube no UVs or normals house.path: ../../../res/runtime/models/house.obj house.name: House Model with uniform UVs -speed: 350 -played: 238818 +speed: 200 +played: 244455 diff --git a/res/runtime/worlds/random.world b/res/runtime/worlds/random.world index 69cee3ba09..0c542d9fec 100644 --- a/res/runtime/worlds/random.world +++ b/res/runtime/worlds/random.world @@ -50,6 +50,27 @@ object6.parallaxmap: birch_parallaxmap object6.pos: [-50,35,0] object6.rot: [0,0,0] object6.scale: [9,9,9] +object7.mesh: cube +object7.texture: bricks +object7.normalmap: bricks_normalmap +object7.parallaxmap: bricks_parallaxmap +object7.pos: [-30,0,-20] +object7.rot: [0,0,0] +object7.scale: [2,2,2] +object8.mesh: cube +object8.texture: birch +object8.normalmap: birch_normalmap +object8.parallaxmap: birch_parallaxmap +object8.pos: [-30,0,-10] +object8.rot: [0,0,0] +object8.scale: [2,2,2] +object9.mesh: cube +object9.texture: undefined +object9.normalmap: default_normalmap +object9.parallaxmap: default_parallaxmap +object9.pos: [-20,0,-30] +object9.rot: [0,0,0] +object9.scale: [2,2,2] objects: %[ - object0 - object1 @@ -57,5 +78,8 @@ objects: %[ - object3 - object4 - object5 -- object6]% +- object6 +- object7 +- object8 +- object9]% entityobjects: %[ diff --git a/src/datatranslation.hpp b/src/datatranslation.hpp index 0d4628c689..9a7f932804 100644 --- a/src/datatranslation.hpp +++ b/src/datatranslation.hpp @@ -14,7 +14,6 @@ class DataTranslation DataTranslation(std::string datafilename); DataTranslation(const DataTranslation& copy) = default; DataTranslation(DataTranslation&& move) = default; - DataTranslation& operator=(const DataTranslation& rhs) = default; std::string getResourceLink(const std::string& resourceName) const; diff --git a/src/mesh.hpp b/src/mesh.hpp index cccea06573..c0018b3684 100644 --- a/src/mesh.hpp +++ b/src/mesh.hpp @@ -25,14 +25,13 @@ class Vertex class Mesh { public: + Mesh(std::string filename = "./res/models/undefined.obj"); Mesh(Vertex* vertices, unsigned int numVertices, unsigned int* indices, unsigned int numIndices); Mesh(const Mesh& copy) = delete; Mesh(Mesh&& move) = delete; + ~Mesh(); Mesh& operator=(const Mesh& rhs) = delete; // Don't want any of these because I only ever want one instance of mesh per model. Allowing us to copy and move instances around will be inefficient and pointless. - - Mesh(std::string filename = "./res/models/undefined.obj"); - ~Mesh(); IndexedModel getIndexedModel() const; std::string getFileName() const; void render() const; diff --git a/src/texture.cpp b/src/texture.cpp index 2f93881ead..445f9c6b85 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -37,7 +37,11 @@ void FrameBuffer::setRenderTarget() const void FrameBuffer::bind(unsigned int id) const { - assert(id >= 0 && id <= 31); + if(id > 31 || id < 0) + { + LogUtility::error("FrameBuffer bind ID " + CastUtility::toString(id) + " is invalid. Must be between 1-31"); + return; + } // this sets which texture we want to bind (id can be from 0 to 31) // GLTEXTURE0 is actually a number, so we can add the id instead of a massive switch statement glActiveTexture(GL_TEXTURE0 + id); @@ -110,7 +114,11 @@ Texture::~Texture() void Texture::bind(GLuint shaderProgram, unsigned int id) { - assert(id >= 0 && id <= 31); + if(id > 31 || id < 0) + { + LogUtility::error("FrameBuffer bind ID " + CastUtility::toString(id) + " is invalid. Must be between 1-31"); + return; + } // this sets which texture we want to bind (id can be from 0 to 31) // GLTEXTURE0 is actually a number, so we can add the id instead of a massive switch statement this->textureID = glGetUniformLocation(shaderProgram, "textureSampler"); @@ -139,7 +147,11 @@ NormalMap::NormalMap(std::string filename): Texture(filename){} void NormalMap::bind(GLuint shaderProgram, unsigned int id) { - assert(id >= 0 && id <= 31); + if(id > 31 || id < 0) + { + LogUtility::error("FrameBuffer bind ID " + CastUtility::toString(id) + " is invalid. Must be between 1-31"); + return; + } // this sets which texture we want to bind (id can be from 0 to 31) // GLTEXTURE0 is actually a number, so we can add the id instead of a massive switch statement this->textureID = glGetUniformLocation(shaderProgram, "normalMapSampler"); @@ -163,7 +175,11 @@ ParallaxMap::ParallaxMap(std::string filename): Texture(filename){} void ParallaxMap::bind(GLuint shaderProgram, unsigned int id) { - assert(id >= 0 && id <= 31); + if(id > 31 || id < 0) + { + LogUtility::error("FrameBuffer bind ID " + CastUtility::toString(id) + " is invalid. Must be between 1-31"); + return; + } // this sets which texture we want to bind (id can be from 0 to 31) // GLTEXTURE0 is actually a number, so we can add the id instead of a massive switch statement this->textureID = glGetUniformLocation(shaderProgram, "parallaxMapSampler"); @@ -222,7 +238,11 @@ CubeMap::~CubeMap() void CubeMap::bind(GLuint shaderProgram, unsigned int id) { - assert(id >= 0 && id <= 31); + if(id > 31 || id < 0) + { + LogUtility::error("FrameBuffer bind ID " + CastUtility::toString(id) + " is invalid. Must be between 1-31"); + return; + } // this sets which texture we want to bind (id can be from 0 to 31) // GLTEXTURE0 is actually a number, so we can add the id instead of a massive switch statement this->textureID = glGetUniformLocation(shaderProgram, "cubeMapSampler"); diff --git a/src/texture.hpp b/src/texture.hpp index 91bec91884..524bef48ef 100644 --- a/src/texture.hpp +++ b/src/texture.hpp @@ -1,6 +1,5 @@ #ifndef TEXTURE_HPP #define TEXTURE_HPP -#include #include #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" diff --git a/src/utility.hpp b/src/utility.hpp index 53db816006..f80e6bf179 100644 --- a/src/utility.hpp +++ b/src/utility.hpp @@ -3,10 +3,8 @@ #include #include #include -#include #include #include -#include #include #include #include "vector.hpp" diff --git a/src/window.hpp b/src/window.hpp index 7ba597a5c2..1f03c0f5b6 100644 --- a/src/window.hpp +++ b/src/window.hpp @@ -5,7 +5,6 @@ #endif #include #include -#include #include "SDL_mixer.h" #include "SDL.h" #include "glew.h"