summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-06-25 15:19:41 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-29 11:10:54 +0000
commitb8ee401f7a3be5d8a3252983829eb0f5f371280e (patch)
tree1643ec3461c41fb0f1df09366d4211e7b9faa268 /external
parent2387c53dba185b45b0e34beae2a8ddaa315bb689 (diff)
Update libgltf: new build system and various fixes
Building: - The new tarball has reasonable build system so build libgltf as external package instead of compiling source files directly. - Freetype dependancy is removed Improvements comes with the new libgltf - Can rotate the models too (orbit mode) - Two camera handling mode: walkthrough and orbit (press M to change). - gltf_animation_set_time() works - FPS can be displayed without freetype (press F) Additional notes: - There were some bugs/regressions which are fixed during the integration (see patches). - License files are uddated now. - libgltf building is enabled only on those platforms on which gltf support actually works (windows and linux) Reviewed-on: https://gerrit.libreoffice.org/9895 Reviewed-by: Zolnai Tamás <zolnaitamas2000@gmail.com> Tested-by: Zolnai Tamás <zolnaitamas2000@gmail.com> (cherry picked from commit 6403f2b59b4c83e0899012e5ca0ddd705784350c) Conflicts: avmedia/source/opengl/oglplayer.cxx Change-Id: Ia6c9c4da53a9b4fedba0d73aa5791489f8ad424b libgltf: variable names need module prefix Change-Id: Id144a483fe5576cdd546ac5da87890dc61f964b3 (cherry picked from commit d83e66da94d9c789190c4729c8f0c8464e99ba88) libgltf: add patch to find the headers in WORKDIR Change-Id: I8570511be7c1d6de94ee82e18bad5b00b36d99bb (cherry picked from commit dfe787ef5de1b38e61989507b26ee4b92f25b9d5) libgltf: try to fix the MSVC2010 build Change-Id: I8dde439d19be45d5039904b6e917b17ca0ee4758 (cherry picked from commit 96ff10449464ae9d869fe21dccf193a6eef670c1) glTF rendering: moving in walktrough mode is to fast Change-Id: I2b7869c6c14b69732db864a03a2d9b6638424cf7 (cherry picked from commit f2b5ece0caca18f21f7c8e42a84d451bb399ec35) libgltf: use --with-pick Change-Id: Ide01491460c9c81ed044be762c7dd07e8a5ca575 (cherry picked from commit bb9078e3dee48afc4c2bd8006a892924f8b38b39) libgltf: replace configure patch to avoid using autoreconf Change-Id: Idcab012af9c27c4fed31c07ce230816d1c61d605 (cherry picked from commit c5bb272883e042e38c58847f6eb2a2f94c6ef919) libgltf: try again with this configure patch Touch only the configure but not the configure.ac Change-Id: Iee93036f2378f29530ffae9be8b4324e8425d2ec (cherry picked from commit 211e07c0e02ebfe9cea4b5d97b614a23f8b2012c) libgltf: remove dependencies of config.h.in It seems something is wrong with the files in the libgltf tarball (maybe wrong timestamps?), because config.h.in is always regenerated by make (autoheader). It causes build problems so just remove the deps for this time. Change-Id: I404c29673987d7c8f75ec8fe4978173593c75a2f (cherry picked from commit 3bebda9cd3269d684a3b430e25f17951deaf3d3d) libgltf: fix typo in license Change-Id: I0e5f3afb19c2457c5ccca922e75e617312801ab9 (cherry picked from commit 1d5e875a6c61ddc9fbf0ed09878b7dfb75f89fe3) libgltf: compiler error fixes: missing include and missing namespace Thanks to Rene Engelhard for the report and the fixes. Change-Id: Ia14980bdbcd9e714b1e9cd41f04af9371aa22371 (cherry picked from commit 481a17b6a6fb332935c3e41c077cc5f60b751021) libgltf: it seems gb_SPACE is not that we need here Change-Id: I099f2bb007cdd29db25a99ca84e53115a12379bd (cherry picked from commit c7d6541f5daa59d04accb30c727a83d936f02150) libgltf: fix wrong include path to config_$(gb_Side) Change-Id: I63d1822fd08c997a9432ed09ada6d5299bc658b1 (cherry picked from commit ab028bf00e3e5f8424ea5e746815e8438144e4bf) libgltf: use WHITESPACE Change-Id: I47ca82d5f08431c8af8b8a85cfbfd083ebd6fda0 (cherry picked from commit b05b970daaf69b5b491b847375ee07539de9481f) libgltf: make 'Requires' valid in libgltf-0.0.pc file Thanks to Rene Engelhard for help to make it valid. Plus glu is not used, so remove it. Change-Id: I5e3631e9b3d24c2b1d9044192d7c0a55c234f7c0 (cherry picked from commit 4bdbc1c93bb3b7e6b1f2fc9a700977ccfa3daae4) Change-Id: Ia14980bdbcd9e714b1e9cd41f04af9371aa22371 Reviewed-on: https://gerrit.libreoffice.org/9922 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'external')
-rw-r--r--external/libgltf/ExternalProject_libgltf.mk71
-rw-r--r--external/libgltf/Module_libgltf.mk2
-rw-r--r--external/libgltf/StaticLibrary_libgltf.mk44
-rw-r--r--external/libgltf/UnpackedTarball_libgltf.mk18
-rw-r--r--external/libgltf/patches/compiler_error_fixes.patch41
-rw-r--r--external/libgltf/patches/deallocation_fix.patch12
-rw-r--r--external/libgltf/patches/extend_get_bitmap_for_rgba_ones.patch76
-rw-r--r--external/libgltf/patches/fix_package_file.patch13
-rw-r--r--external/libgltf/patches/include_path_freetype.patch12
-rw-r--r--external/libgltf/patches/include_path_glew.patch60
-rw-r--r--external/libgltf/patches/init_scene_set_handle.patch68
-rw-r--r--external/libgltf/patches/libgltf_configure.patch61
-rw-r--r--external/libgltf/patches/move_fps_closer_to_the_corner.patch12
-rw-r--r--external/libgltf/patches/no_animation_in_orbit_mode.patch43
-rw-r--r--external/libgltf/patches/no_effect_of_set_looping.patch14
-rw-r--r--external/libgltf/patches/openmp-disable.patch12
-rw-r--r--external/libgltf/patches/remove_config_h_in_dependencies.patch12
-rw-r--r--external/libgltf/patches/rgba_textures.patch12
-rw-r--r--external/libgltf/patches/walkthrough_mode_affects_orbit_mode_unexpectedly.patch12
-rw-r--r--external/libgltf/patches/wrong_animation_state_when_set_time_to_null.patch12
-rw-r--r--external/libgltf/patches/wrong_duration_caused_by_uninitialized_member.patch13
-rw-r--r--external/libgltf/patches/wrong_media_time_at_first_run_caused_by_uninitilized_member.patch11
-rw-r--r--external/libgltf/patches/wrong_media_time_caused_by_missing_fmod.patch14
23 files changed, 444 insertions, 201 deletions
diff --git a/external/libgltf/ExternalProject_libgltf.mk b/external/libgltf/ExternalProject_libgltf.mk
new file mode 100644
index 000000000000..3e390b91aebc
--- /dev/null
+++ b/external/libgltf/ExternalProject_libgltf.mk
@@ -0,0 +1,71 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,libgltf))
+
+$(eval $(call gb_ExternalProject_use_autoconf,libgltf,build))
+
+$(eval $(call gb_ExternalProject_register_targets,libgltf,\
+ build \
+))
+
+$(eval $(call gb_ExternalProject_use_externals,libgltf,\
+ boost_headers \
+ glew \
+ glm_headers \
+))
+
+
+ifeq ($(COM),MSC)
+
+libgltf_AdditionalIncludes :=
+
+ifeq ($(SYSTEM_BOOST),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,boost)"
+libgltf_AdditionalIncludes += "$(BUILDDIR)/config_$(gb_Side)"
+endif
+
+ifeq ($(SYSTEM_GLEW),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,glew)/include"
+endif
+
+ifeq ($(SYSTEM_GLM),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,glm)"
+endif
+
+$(call gb_ExternalProject_get_state_target,libgltf,build) :
+ $(call gb_ExternalProject_run,build,\
+ msbuild.exe libgltf.vcxproj \
+ /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
+ $(if $(filter 110,$(VCVER)),/p:PlatformToolset=$(if $(filter 80,$(WINDOWS_SDK_VERSION)),v110,v110_xp) \
+ /p:VisualStudioVersion=11.0) \
+ $(if $(filter 100,$(VCVER)),/p:PlatformToolset=v100 \
+ /p:VisualStudioVersion=10.0) \
+ '/p:AdditionalIncludeDirectories=$(subst $(WHITESPACE),;,$(subst /,\,$(strip $(libgltf_AdditionalIncludes))))' \
+ /p:AdditionalLibraryDirectories=$(if $(SYSTEM_GLEW),,"$(subst /,\,$(call gb_UnpackedTarball_get_dir,glew))\lib\$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)\Win32") \
+ ,build/win32)
+
+else
+
+$(call gb_ExternalProject_get_state_target,libgltf,build) :
+ $(call gb_ExternalProject_run,build,\
+ export PKG_CONFIG="" \
+ && ./configure \
+ --with-pic \
+ --disable-debug \
+ --disable-werror \
+ BOOST_CFLAGS="$(if $(SYSTEM_BOOST),$(BOOST_CPPFLAGS),-I$(call gb_UnpackedTarball_get_dir,boost)) -I$(BUILDDIR)/config_$(gb_Side)" \
+ GLEW_CFLAGS="$(if $(SYSTEM_GLEW),$(GLEW_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glew)/include)" \
+ GLM_CFLAGS="$(if $(SYSTEM_GLM),$(GLM_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glm))" \
+ && $(MAKE) \
+ )
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/Module_libgltf.mk b/external/libgltf/Module_libgltf.mk
index b593f89398ea..c6ebed6102d8 100644
--- a/external/libgltf/Module_libgltf.mk
+++ b/external/libgltf/Module_libgltf.mk
@@ -10,7 +10,7 @@
$(eval $(call gb_Module_Module,libgltf))
$(eval $(call gb_Module_add_targets,libgltf,\
- StaticLibrary_libgltf \
+ ExternalProject_libgltf \
UnpackedTarball_libgltf \
))
diff --git a/external/libgltf/StaticLibrary_libgltf.mk b/external/libgltf/StaticLibrary_libgltf.mk
deleted file mode 100644
index 3575d1585a62..000000000000
--- a/external/libgltf/StaticLibrary_libgltf.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# 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/.
-#
-
-$(eval $(call gb_StaticLibrary_StaticLibrary,libgltf))
-
-$(eval $(call gb_StaticLibrary_set_warnings_not_errors,libgltf))
-
-$(eval $(call gb_StaticLibrary_use_unpacked,libgltf,libgltf))
-
-$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,libgltf,cpp))
-
-# Avoid warnings
-$(eval $(call gb_StaticLibrary_add_cxxflags,libgltf,-w))
-
-$(eval $(call gb_StaticLibrary_use_externals,libgltf,\
- boost_headers \
- glm_headers \
- mesa_headers \
- glew \
- zlib \
-))
-
-$(eval $(call gb_StaticLibrary_set_include,libgltf,\
- -I$(call gb_UnpackedTarball_get_dir,libgltf)/inc \
- $$(INCLUDE) \
-))
-
-$(eval $(call gb_StaticLibrary_add_generated_exception_objects,libgltf,\
- UnpackedTarball/libgltf/src/Camera \
- UnpackedTarball/libgltf/src/Common \
- UnpackedTarball/libgltf/src/libgltf \
- UnpackedTarball/libgltf/src/LoadScene \
- UnpackedTarball/libgltf/src/RenderScene \
- UnpackedTarball/libgltf/src/Shaders \
- UnpackedTarball/libgltf/src/Texture \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk
index a1314bb19484..174e719d7999 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -16,12 +16,20 @@ $(eval $(call gb_UnpackedTarball_set_patchflags,libgltf,--binary))
$(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/openmp-disable.patch \
- external/libgltf/patches/rgba_textures.patch \
- external/libgltf/patches/deallocation_fix.patch \
+ external/libgltf/patches/libgltf_configure.patch \
+ external/libgltf/patches/remove_config_h_in_dependencies.patch \
external/libgltf/patches/init_scene_set_handle.patch \
+ external/libgltf/patches/extend_get_bitmap_for_rgba_ones.patch \
+ external/libgltf/patches/wrong_duration_caused_by_uninitialized_member.patch \
+ external/libgltf/patches/wrong_media_time_caused_by_missing_fmod.patch \
+ external/libgltf/patches/wrong_animation_state_when_set_time_to_null.patch \
+ external/libgltf/patches/no_effect_of_set_looping.patch \
+ external/libgltf/patches/wrong_media_time_at_first_run_caused_by_uninitilized_member.patch \
+ external/libgltf/patches/no_animation_in_orbit_mode.patch \
+ external/libgltf/patches/walkthrough_mode_affects_orbit_mode_unexpectedly.patch \
+ external/libgltf/patches/move_fps_closer_to_the_corner.patch \
+ external/libgltf/patches/compiler_error_fixes.patch \
+ external/libgltf/patches/fix_package_file.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/patches/compiler_error_fixes.patch b/external/libgltf/patches/compiler_error_fixes.patch
new file mode 100644
index 000000000000..a2ff1728c72f
--- /dev/null
+++ b/external/libgltf/patches/compiler_error_fixes.patch
@@ -0,0 +1,41 @@
+diff -ur libgltf.org/src/Camera.cpp libgltf/src/Camera.cpp
+--- libgltf.org/src/Camera.cpp 2014-06-26 15:49:57.807687346 +0200
++++ libgltf/src/Camera.cpp 2014-06-26 15:50:46.195685296 +0200
+@@ -161,7 +161,7 @@
+ }
+ else
+ {
+- if (abs(x) > 0.0001 || abs(y) > 0.0001 || abs(z) > 0.0001)
++ if (std::abs(x) > 0.0001 || std::abs(y) > 0.0001 || std::abs(z) > 0.0001)
+ {
+ bMoveCmeraModel = true;
+ }
+@@ -240,7 +240,7 @@
+ {
+ if (!bAerialView)
+ return;
+- if (abs(horizontal) > planar || abs(vertical) > 0.0001)
++ if (std::abs(horizontal) > planar || std::abs(vertical) > 0.0001)
+ {
+ bRotateCameraModel = true;
+ fRotateCameraXSpeed = 0;
+@@ -275,7 +275,7 @@
+ void CPhysicalCamera::RotateCamera(double horizontal, double vertical,
+ double planar)
+ {
+- if (abs(horizontal) > planar || abs(vertical) > 0.0001)
++ if (std::abs(horizontal) > planar || std::abs(vertical) > 0.0001)
+ {
+ bRotateCameraModel = true;
+ }
+diff -ur libgltf.org/src/Font.cpp libgltf/src/Font.cpp
+--- libgltf.org/src/Font.cpp 2014-06-26 15:49:57.807687346 +0200
++++ libgltf/src/Font.cpp 2014-06-26 15:50:57.619684812 +0200
+@@ -8,6 +8,7 @@
+ #include "Font.h"
+
+ #include <glm/gtc/matrix_transform.hpp>
++#include <cstdio>
+
+ using namespace std;
+
diff --git a/external/libgltf/patches/deallocation_fix.patch b/external/libgltf/patches/deallocation_fix.patch
deleted file mode 100644
index 4049e2faf16f..000000000000
--- a/external/libgltf/patches/deallocation_fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
---- libgltf.org/src/LoadScene.cpp 2014-05-28 15:35:48.232375923 +0200
-+++ libgltf/src/LoadScene.cpp 2014-05-28 15:36:02.600375314 +0200
-@@ -144,7 +144,7 @@
- free(gHandle->files);
- gHandle->files = NULL;
- }
-- delete gHandle;
-+ free(gHandle);
- return true;
- }
-
diff --git a/external/libgltf/patches/extend_get_bitmap_for_rgba_ones.patch b/external/libgltf/patches/extend_get_bitmap_for_rgba_ones.patch
new file mode 100644
index 000000000000..8b9f3dbf7b25
--- /dev/null
+++ b/external/libgltf/patches/extend_get_bitmap_for_rgba_ones.patch
@@ -0,0 +1,76 @@
+diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+--- libgltf.org/src/RenderScene.cpp 2014-06-23 18:49:46.603119797 +0200
++++ libgltf/src/RenderScene.cpp 2014-06-23 19:00:17.583092627 +0200
+@@ -1735,28 +1735,29 @@
+
+ void RenderScene::setBitZoom(unsigned char* Dstbuffer,
+ unsigned char* Srcbuffer,
+- glTFViewport* pViewport)
++ glTFViewport* pViewport,
++ int bufferDepth )
+ {
+ const int width = pViewport->width;
+ const int height = pViewport->height;
+- const int newLineByte = (width * 3 + 3) / 4 * 4;
+- const int lineByte = (width * SSAA * 3 + 3) / 4 * 4;
++ const int newLineByte = width * bufferDepth;
++ const int lineByte = width * SSAA * bufferDepth;
+ for (int i = 0; i < height; i++)
+ {
+ for (int j = 0; j < width; j++)
+- for (int k = 0; k < 3; k++)
++ for (int k = 0; k < bufferDepth; k++)
+ {
+ long xData = (long)(i * SSAA + 0.5);
+ long yData = (long)(j * SSAA + 0.5);
+ if((yData >= 0) && (yData < width * SSAA) &&
+ (xData >= 0) && (xData < height * SSAA))
+ {
+- *(Dstbuffer + i * newLineByte + j * 3 + k) =
+- *(Srcbuffer + xData * lineByte + yData * 3 + k);
++ *(Dstbuffer + i * newLineByte + j * bufferDepth + k) =
++ *(Srcbuffer + xData * lineByte + yData * bufferDepth + k);
+ }
+ else
+ {
+- *(Dstbuffer + i * newLineByte + j * 3 + k) = 255;
++ *(Dstbuffer + i * newLineByte + j * bufferDepth + k) = 255;
+ }
+ }
+ }
+@@ -1782,12 +1783,20 @@
+ {
+ return;
+ }
+- int imageSize = ((width + ((4 - (width % 4)) % 4)) *
+- height * 3) + 2;
++
++ int bufferDepth;
++ if( format == GL_RGB || format == GL_BGR )
++ bufferDepth = 3;
++ else if( format == GL_RGBA || format == GL_BGRA )
++ bufferDepth = 4;
++ else
++ return;
++
++ int imageSize = width * height * bufferDepth;
+ unsigned char *pbuffer = new unsigned char[imageSize];
+ glReadPixels(0, 0, width, height, format,
+ GL_UNSIGNED_BYTE, pbuffer);
+- setBitZoom(buffer, pbuffer, pViewport);
++ setBitZoom(buffer, pbuffer, pViewport, bufferDepth);
+ if (pbuffer)
+ {
+ delete [] pbuffer;
+diff -ur libgltf.org/src/RenderScene.h libgltf/src/RenderScene.h
+--- libgltf.org/src/RenderScene.h 2014-06-23 18:49:46.587119798 +0200
++++ libgltf/src/RenderScene.h 2014-06-23 18:59:46.991093944 +0200
+@@ -234,7 +234,7 @@
+ void completeRenderBitmap(glTFViewport* pViewport,
+ unsigned char* buffer, GLenum format);
+ void setBitZoom(unsigned char* Dstbuffer,
+- unsigned char* Srcbuffer, glTFViewport* pViewport);
++ unsigned char* Srcbuffer, glTFViewport* pViewport, int bufferDepth );
+
+ // For animation
+ void startAnimation();
diff --git a/external/libgltf/patches/fix_package_file.patch b/external/libgltf/patches/fix_package_file.patch
new file mode 100644
index 000000000000..509634d7327a
--- /dev/null
+++ b/external/libgltf/patches/fix_package_file.patch
@@ -0,0 +1,13 @@
+diff -ur libgltf.org/libgltf.pc.in libgltf/libgltf.pc.in
+--- libgltf.org/libgltf.pc.in 2014-06-27 18:52:24.323562505 +0200
++++ libgltf/libgltf.pc.in 2014-06-27 18:52:48.423561484 +0200
+@@ -6,8 +6,7 @@
+ Name: libgltf-@GLTF_MAJOR_VERSION@.@GLTF_MINOR_VERSION@
+ Description: Library for rendering glTF models.
+ Version: @VERSION@
+-Requires: glew-1.10.0 glm glu
++Requires: glew
+ Libs: -L${libdir} -lgltf-@GLTF_MAJOR_VERSION@.@GLTF_MINOR_VERSION@
+ Cflags: -I${includedir}/libgltf-@GLTF_MAJOR_VERSION@.@GLTF_MINOR_VERSION@
+
+-Requires.private: boost
diff --git a/external/libgltf/patches/include_path_freetype.patch b/external/libgltf/patches/include_path_freetype.patch
deleted file mode 100644
index 917b52c0dc8f..000000000000
--- a/external/libgltf/patches/include_path_freetype.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur libgltf.org/src/Font.h libgltf/src/Font.h
---- 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
-
--#include "freetype/ft2build.h"
-+#include "ft2build.h"
- #include FT_FREETYPE_H
- #include "Texture.h"
-
diff --git a/external/libgltf/patches/include_path_glew.patch b/external/libgltf/patches/include_path_glew.patch
deleted file mode 100644
index 51d222fe1c51..000000000000
--- a/external/libgltf/patches/include_path_glew.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-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 <stddef.h>
- #include "types.h"
--#include <glew/glew.h>
-+#include <GL/glew.h>
- #include <glm/glm.hpp>
- 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
-@@ -8,7 +8,7 @@
- #ifndef CAMERA_H
- #define CAMERA_H
-
--#include <glew/glew.h>
-+#include <GL/glew.h>
- #include <glm/glm.hpp>
-
- class CPhysicalCamera
-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
-@@ -7,7 +7,7 @@
- */
- #ifndef COMMON_H
- #define COMMON_H
--#include <glew/glew.h>
-+#include <GL/glew.h>
- #include <glm/glm.hpp>
- #include <string>
- #include <vector>
-diff -ur libgltf.org/src/Shaders.h libgltf/src/Shaders.h
---- 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
-
--#include <glew/glew.h>
-+#include <GL/glew.h>
- #include <glm/glm.hpp>
-
- #include <string>
-diff -ur libgltf.org/src/Texture.h libgltf/src/Texture.h
---- 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 <string>
- #include <vector>
- #include <map>
--#include <glew/glew.h>
-+#include <GL/glew.h>
- #include <glm/glm.hpp>
-
- using namespace std;
diff --git a/external/libgltf/patches/init_scene_set_handle.patch b/external/libgltf/patches/init_scene_set_handle.patch
index ef34fe34ed3f..88ad05325cf3 100644
--- a/external/libgltf/patches/init_scene_set_handle.patch
+++ b/external/libgltf/patches/init_scene_set_handle.patch
@@ -1,7 +1,7 @@
diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
---- libgltf.org/src/LoadScene.cpp 2014-06-13 01:13:40.654653289 +0200
-+++ libgltf/src/LoadScene.cpp 2014-06-13 01:15:45.034648018 +0200
-@@ -148,10 +148,14 @@
+--- libgltf.org/src/LoadScene.cpp 2014-06-23 14:55:58.099723870 +0200
++++ libgltf/src/LoadScene.cpp 2014-06-23 14:56:04.399723599 +0200
+@@ -149,10 +149,14 @@
return true;
}
@@ -16,12 +16,12 @@ diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
int status;
- this->pScene = pscene;
- {
- TRACE_TIME ("parseScene->readBuffers", CPU);
+ status = this->readBuffers();
+ if (status < 0)
diff -ur libgltf.org/src/LoadScene.h libgltf/src/LoadScene.h
---- libgltf.org/src/LoadScene.h 2014-06-13 01:13:40.654653289 +0200
-+++ libgltf/src/LoadScene.h 2014-06-13 01:16:03.886647220 +0200
-@@ -27,7 +27,8 @@
+--- libgltf.org/src/LoadScene.h 2014-06-23 14:55:58.079723871 +0200
++++ libgltf/src/LoadScene.h 2014-06-23 14:56:37.303722182 +0200
+@@ -21,7 +21,8 @@
public:
glTFHandle* getFileNameInJson(const std::string& jsonFile);
bool releaseFileName();
@@ -31,41 +31,30 @@ diff -ur libgltf.org/src/LoadScene.h libgltf/src/LoadScene.h
bool parseJsonFile();
void setJsonInfo(const std::string& sbuffer);
void setJsonInfo(const std::string& direct, const std::string& fileName);
-@@ -81,4 +82,4 @@
- bool is_json_in_buffer;
- };
-
--#endif
-\ No newline at end of file
-+#endif
diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
---- libgltf.org/src/RenderScene.cpp 2014-06-13 01:13:40.654653289 +0200
-+++ libgltf/src/RenderScene.cpp 2014-06-13 01:15:11.222649451 +0200
-@@ -561,7 +561,7 @@
+--- libgltf.org/src/RenderScene.cpp 2014-06-23 14:55:58.099723870 +0200
++++ libgltf/src/RenderScene.cpp 2014-06-23 14:56:07.239723477 +0200
+@@ -657,16 +657,15 @@
{
return LIBGLTF_PARSE_JSON_ERROR;
}
- int iStatus = mLoadJson.parseScene(&scene);
+ int iStatus = mLoadJson.parseScene();
- if (iStatus != LIBGLTF_SUCESS)
- {
- return iStatus;
-@@ -571,12 +571,11 @@
+ return iStatus;
+ }
int RenderScene::loadScene(Scene& scene, glTFHandle* handle)
{
- scene.setGltfHandle(handle);
try
{
- {
- TRACE_TIME ("loadScene->parseScene", CPU);
-- int iStatus = mLoadJson.parseScene(&scene);
-+ int iStatus = mLoadJson.parseScene();
- if (iStatus != LIBGLTF_SUCESS)
- {
- return iStatus;
-@@ -612,7 +611,11 @@
- }
+- int iStatus = mLoadJson.parseScene(&scene);
++ int iStatus = mLoadJson.parseScene();
+ return iStatus;
+ }
+ catch (boost::property_tree::ptree_error& e)
+@@ -694,7 +693,11 @@
+ return 0;
}
string tmpFileName(jsonfile->filename);
- return mLoadJson.getFileNameInJson(tmpFileName);
@@ -77,22 +66,15 @@ diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
}
unsigned int RenderScene::bindAttribute(const Attribute* pAttr)
-@@ -844,11 +847,6 @@
-
- int RenderScene::initRender(glTFHandle* handle)
+@@ -969,11 +972,6 @@
{
+ initOpengl();
+
- pScene = new Scene();
-- if(0 == pScene)
+- if (0 == pScene)
- {
- return LIBGLTF_MEMORY_ERROR;
- }
int iResult = loadScene(*pScene, handle);
- if( iResult != LIBGLTF_SUCESS)
+ if (iResult != LIBGLTF_SUCCESS)
{
-@@ -1543,4 +1541,4 @@
- int RenderScene::isAnimPlay()
- {
- return this->mAnimationPlay ? 1 : 0;
--}
-\ No newline at end of file
-+}
diff --git a/external/libgltf/patches/libgltf_configure.patch b/external/libgltf/patches/libgltf_configure.patch
new file mode 100644
index 000000000000..d224ab9b7a8c
--- /dev/null
+++ b/external/libgltf/patches/libgltf_configure.patch
@@ -0,0 +1,61 @@
+diff -ur libgltf.org/configure libgltf/configure
+--- libgltf.org/configure 2014-06-25 18:41:32.470228670 +0200
++++ libgltf/configure 2014-06-25 18:42:03.922227337 +0200
+@@ -15581,15 +15581,18 @@
+ # =========
+ # Find boost
+ # =========
++save_CPPFLAGS=$CPPFLAGS
++CPPFLAGS="$CPPFLAGS $BOOST_CFLAGS"
+
+ ac_fn_cxx_check_header_mongrel "$LINENO" "boost/property_tree/json_parser.hpp" "ac_cv_header_boost_property_tree_json_parser_hpp" "$ac_includes_default"
+ if test "x$ac_cv_header_boost_property_tree_json_parser_hpp" = xyes; then :
+- BOOST_CFLAGS=
++
+ else
+ as_fn_error $? "boost/property_tree/json_parser.hpp not found. install boost" "$LINENO" 5
+ fi
+
+
++CPPFLAGS=$save_CPPFLAGS
+
+
+ # =========
+@@ -15685,14 +15688,17 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+
++ save_CPPFLAGS=$CPPFLAGS
++ CPPFLAGS="$CPPFLAGS $GLEW_CFLAGS"
+ ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glew.h" "ac_cv_header_GL_glew_h" "$ac_includes_default"
+ if test "x$ac_cv_header_GL_glew_h" = xyes; then :
+- GLEW_CFLAGS=
++
+ else
+ as_fn_error $? "GL/glew.h not found. install glew" "$LINENO" 5
+ fi
+
+
++ CPPFLAGS=$save_CPPFLAGS
+
+ fi
+
+@@ -15707,14 +15713,17 @@
+ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
++save_CPPFLAGS=$CPPFLAGS
++CPPFLAGS="$CPPFLAGS $GLM_CFLAGS"
+ ac_fn_cxx_check_header_mongrel "$LINENO" "glm/glm.hpp" "ac_cv_header_glm_glm_hpp" "$ac_includes_default"
+ if test "x$ac_cv_header_glm_glm_hpp" = xyes; then :
+- GLM_CFLAGS=
++
+ else
+ as_fn_error $? "glm/glm.hpp not found. install glm" "$LINENO" 5
+ fi
+
+
++CPPFLAGS=$save_CPPFLAGS
+ ac_ext=cpp
+ ac_cpp='$CXXCPP $CPPFLAGS'
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
diff --git a/external/libgltf/patches/move_fps_closer_to_the_corner.patch b/external/libgltf/patches/move_fps_closer_to_the_corner.patch
new file mode 100644
index 000000000000..10ef74c096bc
--- /dev/null
+++ b/external/libgltf/patches/move_fps_closer_to_the_corner.patch
@@ -0,0 +1,12 @@
+diff -ur libgltf.org/src/FPSCounter.cpp libgltf/src/FPSCounter.cpp
+--- libgltf.org/src/FPSCounter.cpp 2014-06-24 18:10:46.317967903 +0200
++++ libgltf/src/FPSCounter.cpp 2014-06-24 18:10:58.629967382 +0200
+@@ -104,7 +104,7 @@
+ ++mFrames;
+ }
+
+- pFont->printFormattedString(pViewport->width - 100, 30, 15, "%d", mFPS);
++ pFont->printFormattedString(pViewport->width - 40, 10, 15, "%d", mFPS);
+
+ glEnable(GL_DEPTH_TEST);
+ }
diff --git a/external/libgltf/patches/no_animation_in_orbit_mode.patch b/external/libgltf/patches/no_animation_in_orbit_mode.patch
new file mode 100644
index 000000000000..dab0244b9ef2
--- /dev/null
+++ b/external/libgltf/patches/no_animation_in_orbit_mode.patch
@@ -0,0 +1,43 @@
+diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+--- libgltf.org/src/RenderScene.cpp 2014-06-24 16:53:41.030163890 +0200
++++ libgltf/src/RenderScene.cpp 2014-06-24 16:53:44.406163746 +0200
+@@ -1848,8 +1848,6 @@
+
+ void RenderScene::startAnimation()
+ {
+- if (bAerialView)
+- return;
+ this->mAnimationPlay = true;
+ mCurrentTime = 0;
+ mUpdateTimeOut = 0;
+@@ -1858,8 +1856,6 @@
+
+ void RenderScene::stopAnimation()
+ {
+- if (bAerialView)
+- return;
+ if (pScene->getSkinSize() != 0)
+ {
+ this->mAnimationPlay = false;
+@@ -1874,10 +1870,6 @@
+ roCameraY = glm::mat4(1.0);
+ pCamera->AerialViewY = 0.0;
+ bAerialView = false;
+- if (bAnimation)
+- {
+- startAnimation();
+- }
+ if (IsAerialMode)
+ {
+ pScene->setUseCameraInJson(true);
+@@ -1897,10 +1889,6 @@
+ roCameraX = glm::mat4(1.0);
+ roCameraY = glm::mat4(1.0);
+ //Stop animation.
+- if (pScene->getSkinSize() != 0)
+- {
+- this->mAnimationPlay = false;
+- }
+ bAerialView = true;
+ if (pScene->getUseCameraInJson())
+ {
diff --git a/external/libgltf/patches/no_effect_of_set_looping.patch b/external/libgltf/patches/no_effect_of_set_looping.patch
new file mode 100644
index 000000000000..1bfa4c901456
--- /dev/null
+++ b/external/libgltf/patches/no_effect_of_set_looping.patch
@@ -0,0 +1,14 @@
+diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+--- libgltf.org/src/RenderScene.cpp 2014-06-23 21:16:55.134739637 +0200
++++ libgltf/src/RenderScene.cpp 2014-06-23 21:16:58.834739477 +0200
+@@ -1976,5 +1976,10 @@
+ {
+ bIsTimeAvailable = false;
+ }
++ if( !mAnimationLoop && mCurrentTime > mDuration )
++ {
++ stopAnimation();
++ setAnimTime(0.0);
++ }
+ }
+
diff --git a/external/libgltf/patches/openmp-disable.patch b/external/libgltf/patches/openmp-disable.patch
deleted file mode 100644
index ef8bc2ef4a3b..000000000000
--- a/external/libgltf/patches/openmp-disable.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- libgltf/src/RenderScene.h
-+++ libgltf/src/RenderScene.h
-@@ -16,7 +16,8 @@
- #define TRACE_TIME
- #endif
-
--#define OPENMPENABLE 1
-+// Needs a configure / etc. detection to see if omp.h is on the system ...
-+#define OPENMPENABLE 0
- #if OPENMPENABLE
- #include <omp.h>
- #define WAVESIZE 4
diff --git a/external/libgltf/patches/remove_config_h_in_dependencies.patch b/external/libgltf/patches/remove_config_h_in_dependencies.patch
new file mode 100644
index 000000000000..fae09e77d4be
--- /dev/null
+++ b/external/libgltf/patches/remove_config_h_in_dependencies.patch
@@ -0,0 +1,12 @@
+diff -ur libgltf.org/Makefile.in libgltf/Makefile.in
+--- libgltf.org/Makefile.in 2014-06-25 23:16:52.417528674 +0200
++++ libgltf/Makefile.in 2014-06-25 23:16:56.493528501 +0200
+@@ -419,7 +419,7 @@
+ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+-$(srcdir)/config.h.in: $(am__configure_deps)
++$(srcdir)/config.h.in:
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
diff --git a/external/libgltf/patches/rgba_textures.patch b/external/libgltf/patches/rgba_textures.patch
deleted file mode 100644
index b22089475038..000000000000
--- a/external/libgltf/patches/rgba_textures.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur libgltf.org/src/Texture.cpp libgltf/src/Texture.cpp
---- libgltf.org/src/Texture.cpp 2014-05-27 16:40:18.625920865 +0200
-+++ libgltf/src/Texture.cpp 2014-05-27 16:41:45.601917179 +0200
-@@ -60,7 +60,7 @@
- bool Texture::loadTexture2DFromBuffer(unsigned char* buffer, int width,
- int height)
- {
-- GLenum format = GL_BGRA;
-+ GLenum format = GL_RGBA;
-
- createFromData(buffer, width, height, format, false);
-
diff --git a/external/libgltf/patches/walkthrough_mode_affects_orbit_mode_unexpectedly.patch b/external/libgltf/patches/walkthrough_mode_affects_orbit_mode_unexpectedly.patch
new file mode 100644
index 000000000000..ef7217b0e0f7
--- /dev/null
+++ b/external/libgltf/patches/walkthrough_mode_affects_orbit_mode_unexpectedly.patch
@@ -0,0 +1,12 @@
+diff -ur libgltf.org/src/Camera.cpp libgltf/src/Camera.cpp
+--- libgltf.org/src/Camera.cpp 2014-06-24 17:36:27.870055125 +0200
++++ libgltf/src/Camera.cpp 2014-06-24 17:36:43.514054463 +0200
+@@ -243,6 +243,8 @@
+ if (abs(horizontal) > planar || abs(vertical) > 0.0001)
+ {
+ bRotateCameraModel = true;
++ fRotateCameraXSpeed = 0;
++ fRotateCameraYSpeed = 0;
+ float deltaX = (float)(horizontal * fSensitivity * 0.01f);
+ float deltaY = (float)(-vertical * fSensitivity * 0.01f);
+ AerialViewY += -vertical;
diff --git a/external/libgltf/patches/wrong_animation_state_when_set_time_to_null.patch b/external/libgltf/patches/wrong_animation_state_when_set_time_to_null.patch
new file mode 100644
index 000000000000..56548e24f648
--- /dev/null
+++ b/external/libgltf/patches/wrong_animation_state_when_set_time_to_null.patch
@@ -0,0 +1,12 @@
+diff -ur libgltf.org/src/libgltf.cpp libgltf/src/libgltf.cpp
+--- libgltf.org/src/libgltf.cpp 2014-06-23 20:38:35.470838661 +0200
++++ libgltf/src/libgltf.cpp 2014-06-23 20:44:37.042823092 +0200
+@@ -235,7 +235,7 @@
+ RenderScene* renderScene = (RenderScene*)handle->renderer;
+ if (time <= 0)
+ {
+- renderScene->startAnimation();
++ renderScene->setAnimTime(0.0);
+ }
+ else
+ {
diff --git a/external/libgltf/patches/wrong_duration_caused_by_uninitialized_member.patch b/external/libgltf/patches/wrong_duration_caused_by_uninitialized_member.patch
new file mode 100644
index 000000000000..7e5554e6e648
--- /dev/null
+++ b/external/libgltf/patches/wrong_duration_caused_by_uninitialized_member.patch
@@ -0,0 +1,13 @@
+diff -ur libgltf.org/src/Common.cpp libgltf/src/Common.cpp
+--- libgltf.org/src/Common.cpp 2014-06-23 20:16:17.746896264 +0200
++++ libgltf/src/Common.cpp 2014-06-23 20:17:50.610892265 +0200
+@@ -1037,7 +1037,8 @@
+
+ /* -- Scene -- */
+ Scene::Scene()
+- : pRootNode(0)
++ : mDuration(0.0)
++ , pRootNode(0)
+ , pBuffer(0)
+ , pGltfHandle(0)
+ , bUseCameraInJson(false)
diff --git a/external/libgltf/patches/wrong_media_time_at_first_run_caused_by_uninitilized_member.patch b/external/libgltf/patches/wrong_media_time_at_first_run_caused_by_uninitilized_member.patch
new file mode 100644
index 000000000000..aa30dc225256
--- /dev/null
+++ b/external/libgltf/patches/wrong_media_time_at_first_run_caused_by_uninitilized_member.patch
@@ -0,0 +1,11 @@
+diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+--- libgltf.org/src/RenderScene.cpp 2014-06-23 21:17:51.466737211 +0200
++++ libgltf/src/RenderScene.cpp 2014-06-23 21:23:23.718722904 +0200
+@@ -602,6 +602,7 @@
+ , roCameraX(1.0f), roCameraY(1.0f)
+ , initCameraLocalMatrix(1.0f),initCameraGlobalMatrix(1.0f)
+ , bAnimation(true), pTempMatrix(0)
++ , bIsTimeAvailable(false)
+ {
+ mLastModelView = glm::mat4(0.0);
+ #if ENABLE_FPS
diff --git a/external/libgltf/patches/wrong_media_time_caused_by_missing_fmod.patch b/external/libgltf/patches/wrong_media_time_caused_by_missing_fmod.patch
new file mode 100644
index 000000000000..07f7f6f84e80
--- /dev/null
+++ b/external/libgltf/patches/wrong_media_time_caused_by_missing_fmod.patch
@@ -0,0 +1,14 @@
+diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+--- libgltf.org/src/RenderScene.cpp 2014-06-23 20:35:06.246847670 +0200
++++ libgltf/src/RenderScene.cpp 2014-06-23 20:35:24.366846890 +0200
+@@ -1919,7 +1919,9 @@
+
+ double RenderScene::getAnimTime()
+ {
+- return mCurrentTime;
++ errno = 0;
++ double time = fmod(this->mCurrentTime, this->mDuration);
++ return errno == EDOM ? 0.0 : time;
+ }
+
+ void RenderScene::setAnimLoop(int loop)