From f933cb0a646ecebff27e93ddfb0fc2a3e417ce4e Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 12 May 2014 21:56:26 +0200 Subject: libgltf: Update to the new version. Change-Id: Iffc91425d4395699a1c5f18ac10f5ed065231fdf --- external/libgltf/UnpackedTarball_libgltf.mk | 10 --- .../patches/avoid_c++11_copy_filestream.patch | 12 --- .../libgltf/patches/constify_for_temporaries.patch | 24 ------ external/libgltf/patches/extern-C.patch | 20 ----- external/libgltf/patches/fmod_error_handling.patch | 22 ----- .../libgltf/patches/get_bitmap_new_syntax.patch | 69 ---------------- .../libgltf/patches/include_path_freetype.patch | 7 -- external/libgltf/patches/include_path_glew.patch | 19 +++-- .../libgltf/patches/remove_extra_include.patch | 11 --- .../shader_charbuffer_used_as_cstring.patch | 94 ---------------------- .../libgltf/patches/typedef_used_as_struct.patch | 14 ---- .../patches/unneeded_context_handling.patch | 18 ----- external/libgltf/patches/win_only_variables.patch | 13 --- 13 files changed, 12 insertions(+), 321 deletions(-) delete mode 100644 external/libgltf/patches/avoid_c++11_copy_filestream.patch delete mode 100644 external/libgltf/patches/constify_for_temporaries.patch delete mode 100644 external/libgltf/patches/extern-C.patch delete mode 100644 external/libgltf/patches/fmod_error_handling.patch delete mode 100644 external/libgltf/patches/get_bitmap_new_syntax.patch delete mode 100644 external/libgltf/patches/remove_extra_include.patch delete mode 100644 external/libgltf/patches/shader_charbuffer_used_as_cstring.patch delete mode 100644 external/libgltf/patches/typedef_used_as_struct.patch delete mode 100644 external/libgltf/patches/unneeded_context_handling.patch delete mode 100644 external/libgltf/patches/win_only_variables.patch (limited to 'external') diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk index bd2ee0bdd1d4..d8434b6e7abe 100644 --- a/external/libgltf/UnpackedTarball_libgltf.mk +++ b/external/libgltf/UnpackedTarball_libgltf.mk @@ -18,16 +18,6 @@ $(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/typedef_used_as_struct.patch \ - external/libgltf/patches/avoid_c++11_copy_filestream.patch \ - external/libgltf/patches/unneeded_context_handling.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/get_bitmap_new_syntax.patch \ - external/libgltf/patches/remove_extra_include.patch \ - external/libgltf/patches/fmod_error_handling.patch \ - external/libgltf/patches/extern-C.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libgltf/patches/avoid_c++11_copy_filestream.patch b/external/libgltf/patches/avoid_c++11_copy_filestream.patch deleted file mode 100644 index d44a4dc894f6..000000000000 --- a/external/libgltf/patches/avoid_c++11_copy_filestream.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 5f69a7ceed9e..000000000000 --- a/external/libgltf/patches/constify_for_temporaries.patch +++ /dev/null @@ -1,24 +0,0 @@ -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/extern-C.patch b/external/libgltf/patches/extern-C.patch deleted file mode 100644 index 88587b05f699..000000000000 --- a/external/libgltf/patches/extern-C.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- libgltf/inc/libgltf.h -+++ libgltf/inc/libgltf.h -@@ -48,7 +48,6 @@ - void gltf_get_camera_pos(glm::vec3 *pos,glm::vec3 *view,glm::vec3 *up); - - /*get model center position information*/ --extern "C" - glm::vec3 gltf_get_model_center_pos(); - /*get camera position information*/ - extern "C" ---- libgltf/src/libgltf.cpp -+++ libgltf/src/libgltf.cpp -@@ -59,7 +59,6 @@ - return; - } - --extern "C" - glm::vec3 gltf_get_model_center_pos() - { - return cameraScene->getModelCenterPos(); diff --git a/external/libgltf/patches/fmod_error_handling.patch b/external/libgltf/patches/fmod_error_handling.patch deleted file mode 100644 index 3a1329187f69..000000000000 --- a/external/libgltf/patches/fmod_error_handling.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp ---- libgltf.org/src/RenderScene.cpp 2014-05-06 18:26:20.097144491 +0200 -+++ libgltf/src/RenderScene.cpp 2014-05-06 18:26:26.281144733 +0200 -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - RenderPrimitive::RenderPrimitive() - : mVerterCount(0), mIndicesCount(0) -@@ -979,7 +980,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/get_bitmap_new_syntax.patch b/external/libgltf/patches/get_bitmap_new_syntax.patch deleted file mode 100644 index d3cec2d0e1c1..000000000000 --- a/external/libgltf/patches/get_bitmap_new_syntax.patch +++ /dev/null @@ -1,69 +0,0 @@ -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 2703bbb1f3f8..917b52c0dc8f 100644 --- a/external/libgltf/patches/include_path_freetype.patch +++ b/external/libgltf/patches/include_path_freetype.patch @@ -10,10 +10,3 @@ 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 ce3e534e2998..51d222fe1c51 100644 --- a/external/libgltf/patches/include_path_glew.patch +++ b/external/libgltf/patches/include_path_glew.patch @@ -1,3 +1,15 @@ +diff -ur libgltf/inc/libgltf.h libgltf/inc/libgltf.h +--- libgltf/inc/libgltf.h 2014-05-05 14:26:11.911346850 +0200 ++++ libgltf/inc/libgltf.h 2014-05-05 14:27:07.295349212 +0200 +@@ -9,7 +9,7 @@ + #define LIBGLTF_H + #include + #include "types.h" +-#include ++#include + #include + using namespace glTF; + diff -ur libgltf.org/src/Camera.h libgltf/src/Camera.h --- 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 @@ -10,13 +22,6 @@ 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-05-05 14:26:11.911346850 +0200 +++ libgltf/src/Common.h 2014-05-05 14:27:18.927349708 +0200 diff --git a/external/libgltf/patches/remove_extra_include.patch b/external/libgltf/patches/remove_extra_include.patch deleted file mode 100644 index b3880a81c606..000000000000 --- a/external/libgltf/patches/remove_extra_include.patch +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 145cccc26cdc..000000000000 --- a/external/libgltf/patches/shader_charbuffer_used_as_cstring.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp ---- 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; -+ size_t ivShaderSize = pGltfHandle->files[vShaderIdx]->size; - const char* pfShader = pGltfHandle->files[fShaderIdx]->buffer; -- mProgramId = mShaderProg.createProgram(pvShader, pfShader); -+ size_t ifShaderSize = pGltfHandle->files[fShaderIdx]->size; -+ mProgramId = mShaderProg.createProgram(pvShader, ivShaderSize, pfShader, ifShaderSize); - } - if (0 != mProgramId) - { -diff -ur libgltf.org/src/Shaders.cpp libgltf/src/Shaders.cpp ---- 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) -+unsigned int ShaderProgram::createProgram(const char* pvShader, size_t ivShaderSize, const char* pfShader, size_t ifShaderSize) - { - unsigned int programId = glCreateProgram(); -- if (!loadShader(programId, pvShader, GL_VERTEX_SHADER)) -+ if (!loadShader(programId, pvShader, ivShaderSize, GL_VERTEX_SHADER)) - return 0; -- if (!loadShader(programId, pfShader, GL_FRAGMENT_SHADER)) -+ if (!loadShader(programId, pfShader, ifShaderSize, GL_FRAGMENT_SHADER)) - return 0; - - return programId; -@@ -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; -@@ -153,11 +153,11 @@ - return true; - } - --bool ShaderProgram::loadShader(unsigned int programId, const char* pShader, int type) -+bool ShaderProgram::loadShader(unsigned int programId, const char* pShader, size_t iSize, int type) - { - unsigned int shaderId = glCreateShader(type); - -- if (!compileShader(pShader, shaderId)) -+ if (!compileShader(pShader, iSize, shaderId)) - { - std::cout << "compileShader : compileShader failed." << std::endl; - return false; -@@ -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); -diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h ---- 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); - - unsigned int createProgram(const std::string& vName, const std::string& fName); -- unsigned int createProgram(const char* pvShader, const char* pfShader); -+ unsigned int createProgram(const char* pvShader, size_t ivShaderSize, const char* pfShader, size_t ifShaderSize); - - void deleteProgram(unsigned int programId); - - void useProgram(unsigned int programId); - - 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);; - private: - -- bool compileShader(const char* pShader, unsigned int shaderId); -+ bool compileShader(const char* pShader, size_t iSize, unsigned int shaderId); - - bool linkProgram(unsigned int programId, unsigned int shaderId); - diff --git a/external/libgltf/patches/typedef_used_as_struct.patch b/external/libgltf/patches/typedef_used_as_struct.patch deleted file mode 100644 index 6d54e44e23c7..000000000000 --- a/external/libgltf/patches/typedef_used_as_struct.patch +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index c08c021c11b2..000000000000 --- a/external/libgltf/patches/unneeded_context_handling.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp ---- 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; - } - -@@ -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 deleted file mode 100644 index a81fd9255786..000000000000 --- a/external/libgltf/patches/win_only_variables.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur libgltf.org/src/FPSCounter.cpp libgltf/src/FPSCounter.cpp ---- 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:"<