From b4b10fc873ba38ea24da23d8a2235d3ab34d8c72 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Tue, 6 May 2014 17:10:59 +0200 Subject: Upgrade libgltf Change-Id: Ib7bc9562602d1d8da4082987302834ac2486d78a --- external/libgltf/UnpackedTarball_libgltf.mk | 14 ++--- external/libgltf/patches/adress_of_temporary.patch | 13 ---- external/libgltf/patches/avoid_c++11.patch | 12 ---- .../patches/avoid_c++11_copy_filestream.patch | 12 ++++ .../libgltf/patches/constify_for_temporaries.patch | 24 ++++++++ external/libgltf/patches/extra_qualification.patch | 12 ---- external/libgltf/patches/fmod_error_handling.patch | 14 +++++ .../patches/format_parameter_for_bitmap.patch | 68 --------------------- .../libgltf/patches/get_bitmap_new_syntax.patch | 69 ++++++++++++++++++++++ .../libgltf/patches/include_path_freetype.patch | 11 +++- external/libgltf/patches/include_path_glew.patch | 27 +++++---- .../libgltf/patches/include_typo_texture.patch | 12 ---- .../patches/json_charbuffer_used_as_cstring.patch | 12 ---- .../libgltf/patches/missing_include_cstring.patch | 11 ---- .../libgltf/patches/remove_extra_include.patch | 11 ++++ .../shader_charbuffer_used_as_cstring.patch | 54 ++++++++--------- .../libgltf/patches/typedef_used_as_struct.patch | 14 +++++ .../patches/unneeded_context_handling.patch | 24 +++++--- external/libgltf/patches/win_only_variables.patch | 47 ++++----------- 19 files changed, 229 insertions(+), 232 deletions(-) delete mode 100644 external/libgltf/patches/adress_of_temporary.patch delete mode 100644 external/libgltf/patches/avoid_c++11.patch create mode 100644 external/libgltf/patches/avoid_c++11_copy_filestream.patch create mode 100644 external/libgltf/patches/constify_for_temporaries.patch delete mode 100644 external/libgltf/patches/extra_qualification.patch create mode 100644 external/libgltf/patches/fmod_error_handling.patch delete mode 100644 external/libgltf/patches/format_parameter_for_bitmap.patch create mode 100644 external/libgltf/patches/get_bitmap_new_syntax.patch delete mode 100644 external/libgltf/patches/include_typo_texture.patch delete mode 100644 external/libgltf/patches/json_charbuffer_used_as_cstring.patch delete mode 100644 external/libgltf/patches/missing_include_cstring.patch create mode 100644 external/libgltf/patches/remove_extra_include.patch create mode 100644 external/libgltf/patches/typedef_used_as_struct.patch (limited to 'external/libgltf') diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk index 6e6157dbc939..7b4c51923897 100644 --- a/external/libgltf/UnpackedTarball_libgltf.mk +++ b/external/libgltf/UnpackedTarball_libgltf.mk @@ -18,15 +18,15 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1)) $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\ external/libgltf/patches/include_path_glew.patch \ external/libgltf/patches/include_path_freetype.patch \ - external/libgltf/patches/missing_include_cstring.patch \ - external/libgltf/patches/win_only_variables.patch \ + external/libgltf/patches/typedef_used_as_struct.patch \ + external/libgltf/patches/avoid_c++11_copy_filestream.patch \ external/libgltf/patches/unneeded_context_handling.patch \ - external/libgltf/patches/include_typo_texture.patch \ - external/libgltf/patches/adress_of_temporary.patch \ - external/libgltf/patches/avoid_c++11.patch \ - external/libgltf/patches/json_charbuffer_used_as_cstring.patch \ + external/libgltf/patches/win_only_variables.patch \ + external/libgltf/patches/constify_for_temporaries.patch \ external/libgltf/patches/shader_charbuffer_used_as_cstring.patch \ - external/libgltf/patches/format_parameter_for_bitmap.patch \ + external/libgltf/patches/get_bitmap_new_syntax.patch \ + external/libgltf/patches/remove_extra_include.patch \ + external/libgltf/patches/fmod_error_handling.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libgltf/patches/adress_of_temporary.patch b/external/libgltf/patches/adress_of_temporary.patch deleted file mode 100644 index d5ea4bc1ef6f..000000000000 --- a/external/libgltf/patches/adress_of_temporary.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur libgltf.org/src/FPSCounter.cpp libgltf/src/FPSCounter.cpp ---- libgltf.org/src/FPSCounter.cpp 2014-04-18 12:21:54.655972783 +0200 -+++ libgltf/src/FPSCounter.cpp 2014-04-18 12:22:25.280971654 +0200 -@@ -107,7 +107,8 @@ - glUseProgram(uiFPSProgram); - glDisable(GL_DEPTH_TEST); - GLuint iLoc = glGetUniformLocation(uiFPSProgram, "matrices.projMatrix"); -- glUniformMatrix4fv(iLoc, 1,false, (GLfloat*)(&glm::ortho(0.0f, float(pViewport->width), 0.0f, float(pViewport->height)))); -+ const glm::mat4 aMat = glm::ortho(0.0f, float(pViewport->width), 0.0f, float(pViewport->height)); -+ glUniformMatrix4fv(iLoc, 1,false, glm::value_ptr(aMat)); - glm::vec4 lightVector = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f); - iLoc = glGetUniformLocation(uiFPSProgram, "vColor"); - glUniform4fv(iLoc, 1, (GLfloat*)&lightVector); diff --git a/external/libgltf/patches/avoid_c++11.patch b/external/libgltf/patches/avoid_c++11.patch deleted file mode 100644 index 827e4f584a96..000000000000 --- a/external/libgltf/patches/avoid_c++11.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp ---- libgltf.org/src/Shaders.cpp 2014-04-18 13:47:18.006783834 +0200 -+++ libgltf/src/Shaders.cpp 2014-04-18 13:49:20.175779328 +0200 -@@ -219,7 +219,7 @@ - - bool ShaderProgram::readShaderFile(const std::string& fileName, std::string& value) - { -- std::ifstream shaderStream(fileName, std::ios::in); -+ std::ifstream shaderStream(fileName.c_str(), std::ios::in); - if (!shaderStream.is_open()) - { - return false; diff --git a/external/libgltf/patches/avoid_c++11_copy_filestream.patch b/external/libgltf/patches/avoid_c++11_copy_filestream.patch new file mode 100644 index 000000000000..d44a4dc894f6 --- /dev/null +++ b/external/libgltf/patches/avoid_c++11_copy_filestream.patch @@ -0,0 +1,12 @@ +diff -ur libgltf.org/src/FPSCounter.h libgltf/src/FPSCounter.h +--- libgltf.org/src/FPSCounter.h 2014-05-05 14:36:38.983373597 +0200 ++++ libgltf/src/FPSCounter.h 2014-05-05 14:40:20.327383038 +0200 +@@ -70,7 +70,7 @@ + #endif + + #if WRITEFPS2FILE +- FPSFile = ofstream("./FPSCounter.txt"); ++ FPSFile.open("./FPSCounter.txt"); + #endif + } + ~FPSCounter() diff --git a/external/libgltf/patches/constify_for_temporaries.patch b/external/libgltf/patches/constify_for_temporaries.patch new file mode 100644 index 000000000000..5f69a7ceed9e --- /dev/null +++ b/external/libgltf/patches/constify_for_temporaries.patch @@ -0,0 +1,24 @@ +diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp +--- libgltf.org/src/RenderScene.cpp 2014-05-05 14:45:21.447395883 +0200 ++++ libgltf/src/RenderScene.cpp 2014-05-05 14:47:14.819400718 +0200 +@@ -776,7 +776,7 @@ + return; + } + +-void RenderScene::updateBoneMatrix(Bone* pBone, glm::mat4& matrix) ++void RenderScene::updateBoneMatrix(Bone* pBone, const glm::mat4& matrix) + { + if (0 == pBone) + { +diff -ur libgltf.org/src/RenderScene.h libgltf/src/RenderScene.h +--- libgltf.org/src/RenderScene.h 2014-05-05 14:45:21.447395883 +0200 ++++ libgltf/src/RenderScene.h 2014-05-05 14:47:48.111402138 +0200 +@@ -170,7 +170,7 @@ + void renderPrimitive(class RenderPrimitive* pPrimitive); + + void updateJointInfo(Bone* pBone); +- void updateBoneMatrix(Bone* pBone, glm::mat4& matrix); ++ void updateBoneMatrix(Bone* pBone, const glm::mat4& matrix); + + glm::mat4* calcProjectionMatrix(); + glm::vec3* calcLightColor(); diff --git a/external/libgltf/patches/extra_qualification.patch b/external/libgltf/patches/extra_qualification.patch deleted file mode 100644 index 213d8f08c1fd..000000000000 --- a/external/libgltf/patches/extra_qualification.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libgltf.org/Common.h libgltf/Common.h ---- libgltf.org/Common.h 2014-04-17 14:24:31.978887883 +0200 -+++ libgltf/Common.h 2014-04-17 14:24:57.505886942 +0200 -@@ -551,7 +551,7 @@ - std::map& getTechniqueMap(); - - const std::string getCameraIndex() const; -- const float* Scene::getCameraMatrix() const; -+ const float* getCameraMatrix() const; - - char* getBuffer(unsigned int length); - bool setBuffer(const std::string& binName, unsigned int length); diff --git a/external/libgltf/patches/fmod_error_handling.patch b/external/libgltf/patches/fmod_error_handling.patch new file mode 100644 index 000000000000..6b47ca13192d --- /dev/null +++ b/external/libgltf/patches/fmod_error_handling.patch @@ -0,0 +1,14 @@ +diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp +--- libgltf.org/src/RenderScene.cpp 2014-05-06 12:01:08.204238237 +0200 ++++ libgltf/src/RenderScene.cpp 2014-05-06 12:21:58.720287272 +0200 +@@ -979,7 +979,9 @@ + + double RenderScene::getAnimTime() + { +- return fmod(this->mCurrentTime, this->mDuration); ++ errno = 0; ++ double time = fmod(this->mCurrentTime, this->mDuration); ++ return errno == EDOM ? 0.0 : time; + } + + void RenderScene::setAnimLoop(int loop) diff --git a/external/libgltf/patches/format_parameter_for_bitmap.patch b/external/libgltf/patches/format_parameter_for_bitmap.patch deleted file mode 100644 index 526e95834cea..000000000000 --- a/external/libgltf/patches/format_parameter_for_bitmap.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -ur libgltf.org/inc/libgltf.h libgltf/inc/libgltf.h ---- libgltf.org/inc/libgltf.h 2014-04-27 14:10:06.191988313 +0200 -+++ libgltf/inc/libgltf.h 2014-04-27 14:12:03.171983919 +0200 -@@ -47,7 +47,7 @@ - /** Get a bitmap of the screen in the given point in time. */ - extern "C" - void gltf_renderer_get_bitmap(glTFHandle *handle, double time, -- char* buffer, long width, long height); -+ char* buffer, long width, long height, GLenum format); - - /** Start playing the glTF animation to the current openGLcontext. */ - extern "C" -@@ -80,4 +80,4 @@ - /** Query where exactly the animation is, in seconds. */ - extern "C" - double gltf_animation_get_time(glTFHandle *handle); --#endif -\ No newline at end of file -+#endif -diff -ur libgltf.org/src/libgltf.cpp libgltf/src/libgltf.cpp ---- libgltf.org/src/libgltf.cpp 2014-04-27 14:10:06.192988313 +0200 -+++ libgltf/src/libgltf.cpp 2014-04-27 14:12:06.648983788 +0200 -@@ -70,10 +70,10 @@ - - extern "C" - void gltf_renderer_get_bitmap(glTFHandle *handle, double time, -- char* buffer, long width, long height) -+ char* buffer, long width, long height, GLenum format) - { - class RenderScene* renderScene = (RenderScene*)handle->renderer; -- renderScene->renderToBuffer(&(handle->viewport), (unsigned char*)buffer); -+ renderScene->renderToBuffer(&(handle->viewport), (unsigned char*)buffer, format); - return; - } - -diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp ---- libgltf.org/src/RenderScene.cpp 2014-04-27 14:10:06.192988313 +0200 -+++ libgltf/src/RenderScene.cpp 2014-04-27 14:11:03.199986172 +0200 -@@ -630,7 +630,7 @@ - return pCamera; - } - --void RenderScene::renderToBuffer(glTFViewport* pViewport, unsigned char * buffer) -+void RenderScene::renderToBuffer(glTFViewport* pViewport, unsigned char * buffer, GLenum format) - { - createRenderObj(pViewport->width, pViewport->height); - createTextureObj(pViewport->width, pViewport->height); -@@ -647,7 +647,7 @@ - GLenum fbResult = glCheckFramebufferStatus(GL_FRAMEBUFFER); - if( fbResult != GL_FRAMEBUFFER_COMPLETE ) - result = false; -- glReadPixels(0, 0, pViewport->width, pViewport->height, GL_BGR, -+ glReadPixels(0, 0, pViewport->width, pViewport->height, format, - GL_UNSIGNED_BYTE, buffer); - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glDeleteFramebuffers(1, &mFBOID); -diff -ur libgltf.org/src/RenderScene.h libgltf/src/RenderScene.h ---- libgltf.org/src/RenderScene.h 2014-04-27 14:10:06.192988313 +0200 -+++ libgltf/src/RenderScene.h 2014-04-27 14:13:41.291980233 +0200 -@@ -91,7 +91,7 @@ - void render(void* lpParam); - void releaseRender(void* lpParam); - CPhysicalCamera* getCamera(); -- void renderToBuffer(glTFViewport* pViewpoit, unsigned char * buffer); -+ void renderToBuffer(glTFViewport* pViewpoit, unsigned char * buffer, GLenum format); - void renderRotateCamera(double horizontal, double vertical, - double planar, double time); - void renderMoveCamera(double x, double y, double z, double time); diff --git a/external/libgltf/patches/get_bitmap_new_syntax.patch b/external/libgltf/patches/get_bitmap_new_syntax.patch new file mode 100644 index 000000000000..d3cec2d0e1c1 --- /dev/null +++ b/external/libgltf/patches/get_bitmap_new_syntax.patch @@ -0,0 +1,69 @@ +diff -ur libgltf.org/inc/libgltf.h libgltf/inc/libgltf.h +--- libgltf.org/inc/libgltf.h 2014-05-06 11:56:54.756228299 +0200 ++++ libgltf/inc/libgltf.h 2014-05-06 11:57:55.104230666 +0200 +@@ -10,6 +10,7 @@ + #include + #include "types.h" + #include "Common.h" ++#include + #include + using namespace glTF; + +@@ -66,7 +67,7 @@ + /** Get a bitmap of the screen in the given point in time. */ + extern "C" + void gltf_renderer_get_bitmap(glTFHandle *handle, double time, +- char* buffer, long width, long height); ++ char* buffer, GLenum format); + + /** Start playing the glTF animation to the current openGLcontext. */ + extern "C" +diff -ur libgltf.org/src/libgltf.cpp libgltf/src/libgltf.cpp +--- libgltf.org/src/libgltf.cpp 2014-05-06 11:56:54.756228299 +0200 ++++ libgltf/src/libgltf.cpp 2014-05-06 11:57:00.620228529 +0200 +@@ -95,10 +95,10 @@ + + extern "C" + void gltf_renderer_get_bitmap(glTFHandle *handle, double time, +- char* buffer, long width, long height) ++ char* buffer, GLenum format) + { + RenderScene* renderScene = (RenderScene*)handle->renderer; +- renderScene->renderToBuffer(&(handle->viewport), (unsigned char*)buffer); ++ renderScene->renderToBuffer(&(handle->viewport), (unsigned char*)buffer, format); + return; + } + +diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp +--- libgltf.org/src/RenderScene.cpp 2014-05-06 11:56:54.756228299 +0200 ++++ libgltf/src/RenderScene.cpp 2014-05-06 11:57:03.852228656 +0200 +@@ -859,7 +859,7 @@ + return sCamera; + } + +-void RenderScene::renderToBuffer(glTFViewport* pViewport, unsigned char * buffer) ++void RenderScene::renderToBuffer(glTFViewport* pViewport, unsigned char * buffer, GLenum format) + { + createRenderObj(pViewport->width, pViewport->height); + createTextureObj(pViewport->width, pViewport->height); +@@ -876,7 +876,7 @@ + GLenum fbResult = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if( fbResult != GL_FRAMEBUFFER_COMPLETE ) + result = false; +- glReadPixels(0, 0, pViewport->width, pViewport->height, GL_BGR, ++ glReadPixels(0, 0, pViewport->width, pViewport->height, format, + GL_UNSIGNED_BYTE, buffer); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + glDeleteFramebuffers(1, &mFBOID); +diff -ur libgltf.org/src/RenderScene.h libgltf/src/RenderScene.h +--- libgltf.org/src/RenderScene.h 2014-05-06 11:56:54.756228299 +0200 ++++ libgltf/src/RenderScene.h 2014-05-06 11:57:01.524228565 +0200 +@@ -124,7 +124,7 @@ + void releaseRender(void* lpParam); + + // For bitmap +- void renderToBuffer(glTFViewport* pViewpoit, unsigned char * buffer); ++ void renderToBuffer(glTFViewport* pViewpoit, unsigned char * buffer, GLenum format); + + // For animation + void startAnimation(); diff --git a/external/libgltf/patches/include_path_freetype.patch b/external/libgltf/patches/include_path_freetype.patch index a365195ba6ed..2703bbb1f3f8 100644 --- a/external/libgltf/patches/include_path_freetype.patch +++ b/external/libgltf/patches/include_path_freetype.patch @@ -1,6 +1,6 @@ diff -ur libgltf.org/src/Font.h libgltf/src/Font.h ---- libgltf.org/src/Font.h 2014-04-18 12:07:57.573003655 +0200 -+++ libgltf/src/Font.h 2014-04-18 12:08:22.202002747 +0200 +--- libgltf.org/src/Font.h 2014-05-05 14:35:24.155370405 +0200 ++++ libgltf/src/Font.h 2014-05-05 14:35:39.715371069 +0200 @@ -8,7 +8,7 @@ #ifndef FONT_H #define FONT_H @@ -10,3 +10,10 @@ diff -ur libgltf.org/src/Font.h libgltf/src/Font.h #include FT_FREETYPE_H #include "Texture.h" +@@ -49,4 +49,4 @@ + FT_Face mFTFace; + unsigned int mShaderId; + }; +-#endif +\ No newline at end of file ++#endif diff --git a/external/libgltf/patches/include_path_glew.patch b/external/libgltf/patches/include_path_glew.patch index 0d516da29258..ce3e534e2998 100644 --- a/external/libgltf/patches/include_path_glew.patch +++ b/external/libgltf/patches/include_path_glew.patch @@ -1,6 +1,6 @@ diff -ur libgltf.org/src/Camera.h libgltf/src/Camera.h ---- libgltf.org/src/Camera.h 2014-04-18 12:05:38.343008790 +0200 -+++ libgltf/src/Camera.h 2014-04-18 12:05:50.331008348 +0200 +--- libgltf.org/src/Camera.h 2014-05-05 14:26:11.911346850 +0200 ++++ libgltf/src/Camera.h 2014-05-05 14:27:07.295349212 +0200 @@ -8,7 +8,7 @@ #ifndef CAMERA_H #define CAMERA_H @@ -10,9 +10,16 @@ diff -ur libgltf.org/src/Camera.h libgltf/src/Camera.h #include class CPhysicalCamera +@@ -45,4 +45,4 @@ + int iForw, iBack, iLeft, iRight; + }; + +-#endif +\ No newline at end of file ++#endif diff -ur libgltf.org/src/Common.h libgltf/src/Common.h ---- libgltf.org/src/Common.h 2014-04-18 12:05:38.343008790 +0200 -+++ libgltf/src/Common.h 2014-04-18 12:05:52.245008277 +0200 +--- libgltf.org/src/Common.h 2014-05-05 14:26:11.911346850 +0200 ++++ libgltf/src/Common.h 2014-05-05 14:27:18.927349708 +0200 @@ -7,7 +7,7 @@ */ #ifndef COMMON_H @@ -23,8 +30,8 @@ diff -ur libgltf.org/src/Common.h libgltf/src/Common.h #include #include diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h ---- libgltf.org/src/Shaders.h 2014-04-18 12:05:38.343008790 +0200 -+++ libgltf/src/Shaders.h 2014-04-18 12:06:02.907007884 +0200 +--- libgltf.org/src/Shaders.h 2014-05-05 14:26:11.923346850 +0200 ++++ libgltf/src/Shaders.h 2014-05-05 14:27:45.483350841 +0200 @@ -8,7 +8,7 @@ #ifndef SHADERS_H #define SHADERS_H @@ -35,14 +42,14 @@ diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h #include diff -ur libgltf.org/src/Texture.h libgltf/src/Texture.h ---- libgltf.org/src/Texture.h 2014-04-18 12:05:38.343008790 +0200 -+++ libgltf/src/Texture.h 2014-04-18 12:06:06.390007755 +0200 -@@ -10,7 +10,7 @@ +--- libgltf.org/src/Texture.h 2014-05-05 14:26:11.911346850 +0200 ++++ libgltf/src/Texture.h 2014-05-05 14:27:52.927351158 +0200 +@@ -11,7 +11,7 @@ #include #include #include -#include +#include #include - using namespace std; + using namespace std; diff --git a/external/libgltf/patches/include_typo_texture.patch b/external/libgltf/patches/include_typo_texture.patch deleted file mode 100644 index 9ddd269a0490..000000000000 --- a/external/libgltf/patches/include_typo_texture.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libgltf.org/src/Texture.cpp libgltf/src/Texture.cpp ---- libgltf.org/src/Texture.cpp 2014-04-18 12:19:41.806977683 +0200 -+++ libgltf/src/Texture.cpp 2014-04-18 12:20:08.065976714 +0200 -@@ -5,7 +5,7 @@ - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ --#include "texture.h" -+#include "Texture.h" - - Texture::Texture() - { diff --git a/external/libgltf/patches/json_charbuffer_used_as_cstring.patch b/external/libgltf/patches/json_charbuffer_used_as_cstring.patch deleted file mode 100644 index 58f57017495a..000000000000 --- a/external/libgltf/patches/json_charbuffer_used_as_cstring.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp ---- libgltf.org/src/RenderScene.cpp 2014-04-18 13:52:31.148772285 +0200 -+++ libgltf/src/RenderScene.cpp 2014-04-18 15:08:15.001604707 +0200 -@@ -211,7 +211,7 @@ - { - if(0 == jsonfile) - return 0; -- string tmpStr(jsonfile->buffer); -+ string tmpStr(jsonfile->buffer,jsonfile->size); - loadJson.setJsonInfo(tmpStr); - if (!loadJson.parseJsonFile()) - return 0; diff --git a/external/libgltf/patches/missing_include_cstring.patch b/external/libgltf/patches/missing_include_cstring.patch deleted file mode 100644 index 8b73389efe1b..000000000000 --- a/external/libgltf/patches/missing_include_cstring.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp ---- libgltf.org/src/Common.cpp 2014-04-18 12:09:30.459000229 +0200 -+++ libgltf/src/Common.cpp 2014-04-18 12:09:51.643999448 +0200 -@@ -6,6 +6,7 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - #include "Common.h" -+#include - - namespace glTF - { diff --git a/external/libgltf/patches/remove_extra_include.patch b/external/libgltf/patches/remove_extra_include.patch new file mode 100644 index 000000000000..b3880a81c606 --- /dev/null +++ b/external/libgltf/patches/remove_extra_include.patch @@ -0,0 +1,11 @@ +diff -ur libgltf.org/inc/libgltf.h libgltf/inc/libgltf.h +--- libgltf.org/inc/libgltf.h 2014-05-06 11:59:40.224234787 +0200 ++++ libgltf/inc/libgltf.h 2014-05-06 12:00:15.192236159 +0200 +@@ -9,7 +9,6 @@ + #define LIBGLTF_H + #include + #include "types.h" +-#include "Common.h" + #include + #include + using namespace glTF; diff --git a/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch b/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch index 000796c2f9f4..145cccc26cdc 100644 --- a/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch +++ b/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch @@ -1,7 +1,7 @@ diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp ---- libgltf.org/src/Common.cpp 2014-04-20 10:46:20.065036606 +0200 -+++ libgltf/src/Common.cpp 2014-04-20 12:12:26.940821223 +0200 -@@ -521,8 +521,10 @@ +--- libgltf.org/src/Common.cpp 2014-05-05 15:02:17.155439207 +0200 ++++ libgltf/src/Common.cpp 2014-05-05 15:04:25.631444687 +0200 +@@ -518,8 +518,10 @@ if(vShaderIdx >= 0 && fShaderIdx >= 0) { const char* pvShader = pGltfHandle->files[vShaderIdx]->buffer; @@ -14,10 +14,10 @@ diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp if (0 != mProgramId) { diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp ---- libgltf.org/src/Shaders.cpp 2014-04-20 10:46:20.065036606 +0200 -+++ libgltf/src/Shaders.cpp 2014-04-20 12:15:42.683813064 +0200 -@@ -110,12 +110,12 @@ - return programId; +--- libgltf.org/src/Shaders.cpp 2014-05-05 15:02:17.155439207 +0200 ++++ libgltf/src/Shaders.cpp 2014-05-05 15:09:30.143457676 +0200 +@@ -105,12 +105,12 @@ + return programId; } -unsigned int ShaderProgram::createProgram(const char* pvShader, const char* pfShader) @@ -32,17 +32,17 @@ diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp return 0; return programId; -@@ -142,7 +142,7 @@ - return false; - } +@@ -137,7 +137,7 @@ + return false; + } -- if (!compileShader(shaderCode.c_str(), shaderId)) -+ if (!compileShader(shaderCode.c_str(), shader.length(), shaderId)) - { - std::cout << "compileShader : compileShader failed." << std::endl; - return false; -@@ -158,11 +158,11 @@ - return true; +- if (!compileShader(shaderCode.c_str(), shaderId)) ++ if (!compileShader(shaderCode.c_str(), shader.length(), shaderId)) + { + std::cout << "compileShader : compileShader failed." << std::endl; + return false; +@@ -153,11 +153,11 @@ + return true; } -bool ShaderProgram::loadShader(unsigned int programId, const char* pShader, int type) @@ -55,22 +55,22 @@ diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp { std::cout << "compileShader : compileShader failed." << std::endl; return false; -@@ -178,9 +178,10 @@ +@@ -173,9 +173,10 @@ return true; } -bool ShaderProgram::compileShader(const char* pShader, unsigned int shaderId) +bool ShaderProgram::compileShader(const char* pShader, size_t iSize, unsigned int shaderId) { -- glShaderSource(shaderId, 1, &pShader, NULL); -+ GLint iGLSize = iSize; -+ glShaderSource(shaderId, 1, &pShader, &iGLSize); - glCompileShader(shaderId); - int iStatus = 0; - glGetShaderiv(shaderId, GL_COMPILE_STATUS, &iStatus); +- glShaderSource(shaderId, 1, &pShader, NULL); ++ GLint iGLSize = iSize; ++ glShaderSource(shaderId, 1, &pShader, &iGLSize); + glCompileShader(shaderId); + int iStatus = 0; + glGetShaderiv(shaderId, GL_COMPILE_STATUS, &iStatus); diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h ---- libgltf.org/src/Shaders.h 2014-04-20 10:46:20.065036606 +0200 -+++ libgltf/src/Shaders.h 2014-04-20 12:11:36.816823313 +0200 +--- libgltf.org/src/Shaders.h 2014-05-05 15:02:17.155439207 +0200 ++++ libgltf/src/Shaders.h 2014-05-05 15:10:26.003460059 +0200 @@ -39,17 +39,17 @@ void setUniform(unsigned int uProgId, const char* name, const glm::mat4 mMatrix); @@ -84,7 +84,7 @@ diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h bool loadShader(unsigned int programId, const std::string& shaderName, int type); - bool loadShader(unsigned int programId, const char* pShader, int type); -+ bool loadShader(unsigned int programId, const char* pShader, size_t iSize, int type); ++ bool loadShader(unsigned int programId, const char* pShader, size_t iSize, int type);; private: - bool compileShader(const char* pShader, unsigned int shaderId); diff --git a/external/libgltf/patches/typedef_used_as_struct.patch b/external/libgltf/patches/typedef_used_as_struct.patch new file mode 100644 index 000000000000..6d54e44e23c7 --- /dev/null +++ b/external/libgltf/patches/typedef_used_as_struct.patch @@ -0,0 +1,14 @@ +diff -ur libgltf.org/src/Common.h libgltf/src/Common.h +--- libgltf.org/src/Common.h 2014-05-05 14:31:00.483359159 +0200 ++++ libgltf/src/Common.h 2014-05-05 14:34:02.055366903 +0200 +@@ -536,8 +536,8 @@ + unsigned int mCount; + double mMaxTime; + double mMinTime; +- std::vector mTimeRorateVec; +- //std::vector mTimeTransfromVec; ++ std::vector mTimeRorateVec; ++ //std::vector mTimeTransfromVec; + }; + + class Animation diff --git a/external/libgltf/patches/unneeded_context_handling.patch b/external/libgltf/patches/unneeded_context_handling.patch index a5c14b5c7e3c..c08c021c11b2 100644 --- a/external/libgltf/patches/unneeded_context_handling.patch +++ b/external/libgltf/patches/unneeded_context_handling.patch @@ -1,12 +1,18 @@ diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp ---- libgltf.org/src/RenderScene.cpp 2014-04-18 12:13:26.226991534 +0200 -+++ libgltf/src/RenderScene.cpp 2014-04-18 12:13:46.133990800 +0200 -@@ -587,8 +587,6 @@ - } - pFPSCounter->timeStampEnd(); - pFPSCounter->printFPS(pViewport); -- -- SwapBuffers(wglGetCurrentDC()); +--- libgltf.org/src/RenderScene.cpp 2014-05-05 14:42:40.523389018 +0200 ++++ libgltf/src/RenderScene.cpp 2014-05-05 14:43:01.027389893 +0200 +@@ -746,7 +746,6 @@ + #if ENABLE_FPS + pFPSCounter->printFPS(&viewport); + #endif +- SwapBuffers(wglGetCurrentDC()); + return; } - void RenderScene::releaseRender(void* lpParam) +@@ -1004,4 +1003,4 @@ + int RenderScene::isAnimPlay() + { + return this->mAnimationPlay ? 1 : 0; +-} +\ No newline at end of file ++} diff --git a/external/libgltf/patches/win_only_variables.patch b/external/libgltf/patches/win_only_variables.patch index bf2931d3c7e9..a81fd9255786 100644 --- a/external/libgltf/patches/win_only_variables.patch +++ b/external/libgltf/patches/win_only_variables.patch @@ -1,40 +1,13 @@ diff -ur libgltf.org/src/FPSCounter.cpp libgltf/src/FPSCounter.cpp ---- libgltf.org/src/FPSCounter.cpp 2014-04-18 12:10:37.031997774 +0200 -+++ libgltf/src/FPSCounter.cpp 2014-04-18 12:12:00.025994713 +0200 -@@ -115,8 +115,10 @@ - { - mFPS = getFPS(); - mDurationTime = 0; +--- libgltf.org/src/FPSCounter.cpp 2014-05-05 14:44:01.711392481 +0200 ++++ libgltf/src/FPSCounter.cpp 2014-05-05 14:44:34.495393880 +0200 +@@ -119,7 +119,9 @@ + if (timeCounter>=TIMETHRESHOLD) + { + FPSFile<<"FPS:"<printFormattedString(20, pViewport->height-30, 20, "FPS: %d", mFPS); -+#ifdef _WIN32 - pFont->printFormattedString(20, pViewport->height-60, 20, "Render Total Time: %.2f ms, Draw Time: %.2f ms", mTotalTime*1000,mGPUTime*1000); -+#endif - glEnable(GL_DEPTH_TEST); --} -\ No newline at end of file -+} -diff -ur libgltf.org/src/FPSCounter.h libgltf/src/FPSCounter.h ---- libgltf.org/src/FPSCounter.h 2014-04-18 12:10:37.038997774 +0200 -+++ libgltf/src/FPSCounter.h 2014-04-18 12:11:32.301995736 +0200 -@@ -51,9 +51,11 @@ - mFPS=0; - mDurationTime =0; - mGPUTime =0; -+#ifdef _WIN32 - mTotalTime = 0; - QueryPerformanceFrequency(&f); - dqFreq=(double)f.QuadPart; -+#endif - } - ~FPSCounter() - { + timeCounter = 0; + } + #endif -- cgit