Bläddra i källkod

Merge pull request #62 from paulsapps/master

Avoid recompling most data cpp files by moving into a static lib
paulsapps 11 år sedan
förälder
incheckning
75f713029a
36 ändrade filer med 347 tillägg och 222 borttagningar
  1. 30 51
      .travis.yml
  2. 12 0
      CIBuild/linux/dependencies.sh
  3. 29 0
      CIBuild/osx/dependencies.sh
  4. 46 0
      CIBuild/osx/fix_lib_paths.sh
  5. 0 0
      CIBuild/windows/build.bat
  6. 11 3
      CMakeLists.txt
  7. 3 48
      PlugIns/Data/CMakeLists.txt
  8. 115 92
      QGearsMain/CMakeLists.txt
  9. 6 1
      QGearsMain/src/common/FileSystem.cpp
  10. 5 4
      Tests/FinalFantasy7/CMakeLists.txt
  11. 6 5
      Tests/QGearsMain/CMakeLists.txt
  12. 1 1
      readme.md
  13. 0 1
      utilities/CMakeLists.txt
  14. 2 0
      utilities/ffix_model_exporter/CMakeLists.txt
  15. 2 0
      utilities/ffix_script_dumper/CMakeLists.txt
  16. 2 0
      utilities/ffix_sound_dumper/CMakeLists.txt
  17. 2 0
      utilities/ffvii_battle_model_exporter/CMakeLists.txt
  18. 2 0
      utilities/ffvii_battle_scene_dumper/CMakeLists.txt
  19. 2 0
      utilities/ffvii_field_dat_dumper/CMakeLists.txt
  20. 2 0
      utilities/ffvii_field_model_exporter/CMakeLists.txt
  21. 14 5
      utilities/ffvii_field_model_exporter_pc/CMakeLists.txt
  22. 3 1
      utilities/ffvii_font_exporter/CMakeLists.txt
  23. 2 0
      utilities/ffvii_sound_dumper/CMakeLists.txt
  24. 2 0
      utilities/ffvii_sound_dumper_psf/CMakeLists.txt
  25. 2 0
      utilities/flevel/CMakeLists.txt
  26. 2 0
      utilities/lzs/CMakeLists.txt
  27. 3 1
      utilities/q-gears-launcher/CMakeLists.txt
  28. 7 0
      utilities/q-gears-launcher/src/ff7DataInstaller.cpp
  29. 5 5
      utilities/xeno_cd_extract/extract.cpp
  30. 2 0
      utilities/xeno_model_exporter/CMakeLists.txt
  31. 2 0
      utilities/xeno_script_dumper/CMakeLists.txt
  32. 6 1
      utilities/xeno_script_dumper/src/common/filesystem/driver/RealFileDriver.cpp
  33. 2 0
      utilities/xeno_sound_dumper/CMakeLists.txt
  34. 2 0
      utilities/xeno_walkmesh_exporter/CMakeLists.txt
  35. 9 2
      utilities/xeno_walkmesh_exporter/src/common/display/surface/SurfaceLoadBmp.cpp
  36. 6 1
      utilities/xeno_walkmesh_exporter/src/common/filesystem/driver/RealFileDriver.cpp

+ 30 - 51
.travis.yml

@@ -7,13 +7,15 @@ matrix:
 # Don't build using gcc on mac
 # Don't build using gcc on mac
   - os: osx
   - os: osx
     compiler: gcc
     compiler: gcc
-# Don't try to do Coverity builds on mac
+# Don't try to do Coverity or coverage builds on mac
   - os: osx
   - os: osx
     env: COVERITY=1
     env: COVERITY=1
-# Only do coverity build on Linux when the compiler is gcc
+    env: COVERAGE=1
+# Only do coverity or coverage build on Linux when the compiler is gcc
   - os: linux
   - os: linux
     compiler: clang
     compiler: clang
     env: COVERITY=1
     env: COVERITY=1
+    env: COVERAGE=1
 # Don't build with clang on Linux
 # Don't build with clang on Linux
   - os: linux
   - os: linux
     compiler: clang
     compiler: clang
@@ -24,68 +26,39 @@ compiler:
 before_script: 
 before_script: 
 - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi
 - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi
 - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:boost-latest/ppa -y; fi
 - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:boost-latest/ppa -y; fi
-- echo $CXX
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then wget http://llvm.org/apt/precise/pool/main/l/llvm-toolchain-3.5/clang-3.5_3.5~svn215019-1~exp1_amd64.deb; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then sudo dpkg -i clang-3.5_3.5~svn215019-1~exp1_amd64.deb; fi
-- echo $CXX
-- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then export CXX=clang3.5; fi
-
-- echo $CXX
-#- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then sudo apt-get install --allow-unauthenticated clang-3.4; fi
 - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi
 - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update; fi
-- echo $CXX
-#- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then export CXX="clang++-3.4"; fi
-#- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then export CXX="clang++-3.4"; fi
-
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install gcc-4.9; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install gcc-4.9; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install g++-4.9; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install g++-4.9; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20; fi
+- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 90; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config gcc; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config gcc; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config g++; fi
 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config g++; fi
-
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install boost1.55; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libvorbis-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libalut-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libfreetype6-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libfreeimage-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install zlib1g-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libzzip-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libois-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libglu-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libqt4-dev; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/ogre-build_1.9.0-1_amd64.deb; fi
-- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo dpkg -i ogre-build_1.9.0-1_amd64.deb; fi
-
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
-#- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew doctor; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew outdated wget || brew upgrade wget; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install qt; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/OgreDependencies_OSX_libc._20130610.zip; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/NVIDIA_Cg.tgz; fi
-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/OgreSDK.zip; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then unzip OgreSDK.zip >> OgreSDK_extract.log; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo tar xfzC NVIDIA_Cg.tgz /; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then unzip OgreDependencies_OSX_libc._20130610.zip >> extract.log; fi
+- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz; fi
+- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then tar xf lcov_1.11.orig.tar.gz; fi
+- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "$COVERAGE" == 1 ]]; then sudo make -C lcov-1.11/ install; fi
+- if [ "$TRAVIS_OS_NAME" == "linux" ]; then chmod +x ./CIBuild/linux/dependencies.sh; fi
+- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./CIBuild/linux/dependencies.sh; fi
+- if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./CIBuild/osx/dependencies.sh; fi
+- if [ "$TRAVIS_OS_NAME" == "osx" ]; then chmod +x ./CIBuild/osx/fix_lib_paths.sh; fi
+- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./CIBuild/osx/dependencies.sh; fi
 - $CXX --version
 - $CXX --version
 
 
 before_install: 
 before_install: 
 script: 
 script: 
-
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp OgreSDK/lib/macosx/Release/Ogre.framework/Versions/1.9.0/Ogre OgreSDK/lib/macosx/Release/Ogre.framework/Ogre; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp OgreSDK/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay OgreSDK/lib/macosx/Release/OgreOverlay.framework/OgreOverlay; fi
-
 - mkdir build_qgears
 - mkdir build_qgears
 - cd build_qgears
 - cd build_qgears
 
 
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OGRE_HOME=/Users/travis/build/q-gears/q-gears/OgreSDK; fi
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OGRE_HOME=/Users/travis/build/q-gears/q-gears/OgreSDK; fi
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OGRE_SDK=/Users/travis/build/q-gears/q-gears/OgreSDK; fi
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OGRE_SDK=/Users/travis/build/q-gears/q-gears/OgreSDK; fi
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OIS_HOME=/Users/travis/build/q-gears/q-gears/Dependencies; fi
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OIS_HOME=/Users/travis/build/q-gears/q-gears/Dependencies; fi
-- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -G"Unix Makefiles" ..; fi
-- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake ..; fi
 
 
+- if [ "$TRAVIS_OS_NAME" == "linux" ]; then cmake -G"Unix Makefiles" ..; fi
+- if [ "$TRAVIS_OS_NAME" == "osx" ]; then cmake -G"Unix Makefiles" .. -DBOOST_ROOT=${PWD}/../boost/1.55.0_1; fi
 - if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then make -j2; fi
 - if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then make -j2; fi
-- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then cpack -C Release; fi
+- if [[ "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then ../CIBuild/osx/fix_lib_paths.sh ./bin_release; fi
+- if [[ "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 ]]; then cpack -C Release; fi
+
 language: cpp
 language: cpp
 after_success: 
 after_success: 
 - hash=`git rev-parse HEAD`
 - hash=`git rev-parse HEAD`
@@ -122,14 +95,19 @@ after_success:
 - chmod 700 ~/.ssh
 - chmod 700 ~/.ssh
 - md5sum ~/.ssh/id_rsa
 - md5sum ~/.ssh/id_rsa
 
 
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then ssh -o StrictHostKeyChecking=no paul@itscovarr.com mkdir -p /var/www/storage/qgears/$hash/linux/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.deb paul@itscovarr.com:/var/www/storage/qgears/$hash/linux/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.tar.gz paul@itscovarr.com:/var/www/storage/qgears/$hash/linux/; fi
-
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then ssh -o StrictHostKeyChecking=no paul@itscovarr.com mkdir -p /var/www/storage/qgears/$hash/mac/; fi
-- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.dmg paul@itscovarr.com:/var/www/storage/qgears/$hash/mac/; fi
+- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then ssh -o StrictHostKeyChecking=no paul@itscovarr.com mkdir -p /var/www/storage/qgears/$hash/linux/; fi
+- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.deb paul@itscovarr.com:/var/www/storage/qgears/$hash/linux/; fi
+- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.tar.gz paul@itscovarr.com:/var/www/storage/qgears/$hash/linux/; fi
 
 
+- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then ssh -o StrictHostKeyChecking=no paul@itscovarr.com mkdir -p /var/www/storage/qgears/$hash/mac/; fi
+- if [[ "$TRAVIS_PULL_REQUEST" == 'false' && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" != 1 && "$TRAVIS_OS_NAME" == "osx" ]]; then scp -o StrictHostKeyChecking=no ~/build/q-gears/q-gears/build_qgears/*.dmg paul@itscovarr.com:/var/www/storage/qgears/$hash/mac/; fi
 
 
+after_success:
+  - if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then lcov --directory . --capture --output-file coverage.info; fi
+  - if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then lcov --remove coverage.info '*/googlemock/*' '/usr/*' --output-file coverage.info; fi
+  - if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then lcov --list coverage.info; fi
+  - if [[ "$CXX" == "g++" && "${COVERAGE}" == 1 && "$TRAVIS_OS_NAME" == "linux" ]]; then coveralls-lcov coverage.info; fi
+  
 notifications: 
 notifications: 
   on_failure: always
   on_failure: always
   irc: irc.esper.net#qhimm.com
   irc: irc.esper.net#qhimm.com
@@ -146,6 +124,7 @@ addons:
     branch_pattern: coverity_scan
     branch_pattern: coverity_scan
 env: 
 env: 
   global: 
   global: 
+  - COVERAGE=1
   - secure: "PUtlviIMOxgXYfBiAW+tsDHQPq+XfftHy2Te1qFvkzkqfGtHQMiCM5an1tZW8LuuYLhuRo+piG+XsK5A8THW4At+hsQZFRPK4b952aHGTQNimTPFr3COccKOlGsLDJD+iKEBJbME1u/Kml9IvwVFBLoL6UtjEWPUJ3jVOitfnoA="
   - secure: "PUtlviIMOxgXYfBiAW+tsDHQPq+XfftHy2Te1qFvkzkqfGtHQMiCM5an1tZW8LuuYLhuRo+piG+XsK5A8THW4At+hsQZFRPK4b952aHGTQNimTPFr3COccKOlGsLDJD+iKEBJbME1u/Kml9IvwVFBLoL6UtjEWPUJ3jVOitfnoA="
   - secure: pc5w4v8EzEtKD+iSZaao9Qq7FoPz2a65cpubHQjD36IN7g4gNaUcv2i/9cgqWk8+au7jKbJg0lFnkXRA/ldzBd30xsXubKWSmvcKt2dQRNJkKVBWsKW2ZiAtID/uibu5kwxdGn1zi4uO+WXygmu/fWSvOkToq87NsGrQYGU+Ahs=
   - secure: pc5w4v8EzEtKD+iSZaao9Qq7FoPz2a65cpubHQjD36IN7g4gNaUcv2i/9cgqWk8+au7jKbJg0lFnkXRA/ldzBd30xsXubKWSmvcKt2dQRNJkKVBWsKW2ZiAtID/uibu5kwxdGn1zi4uO+WXygmu/fWSvOkToq87NsGrQYGU+Ahs=
   - secure: fqca/ai9xM7M0TLcZHwr8YqWB2+/+k5Bg5D9C/gTaZQgQvvTbXRdI8LFUTgUYCHiFu/QphvzvXyVHPTVL1xB3xZIMC5G8Cqe2T+Zy+UprK0A8Fmxk/V/qTTMgigAevtCXeVYH7+I0M+LNZrz4oYYa6FRJY79OPv+T1QQ8FUGTqc=
   - secure: fqca/ai9xM7M0TLcZHwr8YqWB2+/+k5Bg5D9C/gTaZQgQvvTbXRdI8LFUTgUYCHiFu/QphvzvXyVHPTVL1xB3xZIMC5G8Cqe2T+Zy+UprK0A8Fmxk/V/qTTMgigAevtCXeVYH7+I0M+LNZrz4oYYa6FRJY79OPv+T1QQ8FUGTqc=

+ 12 - 0
CIBuild/linux/dependencies.sh

@@ -0,0 +1,12 @@
+sudo apt-get install boost1.55
+sudo apt-get install libvorbis-dev
+sudo apt-get install libalut-dev
+sudo apt-get install libfreetype6-dev
+sudo apt-get install libfreeimage-dev
+sudo apt-get install zlib1g-dev
+sudo apt-get install libzzip-dev
+sudo apt-get install libois-dev
+sudo apt-get install libglu-dev
+sudo apt-get install libqt4-dev
+wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/ogre-build_1.9.0-1_amd64.deb
+sudo dpkg -i ogre-build_1.9.0-1_amd64.deb

+ 29 - 0
CIBuild/osx/dependencies.sh

@@ -0,0 +1,29 @@
+brew update
+# brew doctor
+# brew outdated wget || brew upgrade wget
+echo "Download deps"
+brew install qt
+wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/OgreDependencies_OSX_libc._20130610.zip
+wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/NVIDIA_Cg.tgz
+wget https://github.com/paulsapps/Ogre1.9/releases/download/1.9.0/OgreSDK.zip
+echo "Install deps"
+unzip OgreSDK.zip >> OgreSDK_extract.log
+sudo tar xfzC NVIDIA_Cg.tgz /
+unzip OgreDependencies_OSX_libc._20130610.zip >> extract.log
+echo "Setup env vars"
+#export OGRE_HOME="${PWD}/../OgreSDK"
+#export OGRE_SDK="${PWD}/../OgreSDK"
+export OGRE_HOME="/Users/travis/build/q-gears/q-gears/OgreSDK"
+export OGRE_SDK="/Users/travis/build/q-gears/q-gears/OgreSDK"
+export OIS_HOME="/Users/travis/build/q-gears/q-gears/Dependencies"
+
+# /Users/travis/build/q-gears/q-gears/Dependencies;
+# /Users/travis/build/q-gears/q-gears/../Dependencies
+
+echo "Env vars are $OGRE_SDK and $OIS_HOME"
+# Overwrite broken symlink with actual file
+ls
+ls ./Dependencies
+
+cp ${PWD}/OgreSDK/lib/macosx/Release/Ogre.framework/Versions/1.9.0/Ogre ${PWD}/OgreSDK/lib/macosx/Release/Ogre.framework/Ogre
+cp ${PWD}/OgreSDK/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay ${PWD}/OgreSDK/lib/macosx/Release/OgreOverlay.framework/OgreOverlay

+ 46 - 0
CIBuild/osx/fix_lib_paths.sh

@@ -0,0 +1,46 @@
+# fix permissions on anything already there
+for file in $1/*
+do
+    chmod +rwx "$file" 
+done
+
+# Copy required dylibs
+cp "${OGRE_SDK}/lib/macosx/Release/Ogre.framework/Ogre" ./bin_release
+cp "${OGRE_SDK}/lib/macosx/Release/RenderSystem_GL.framework/Versions/1.9.0/RenderSystem_GL" ./bin_release/
+cp "${OGRE_SDK}/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay" ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_thread-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_date_time-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_system-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_atomic-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_chrono-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_program_options-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_filesystem-mt.dylib ./bin_release/
+cp ${PWD}/../boost/1.55.0_1/lib/libboost_unit_test_framework-mt.dylib ./bin_release/
+cp /usr/local/lib/QtCore.framework/Versions/4/QtCore ./bin_release/
+cp /usr/local/lib/QtGui.framework/Versions/4/QtGui ./bin_release/
+
+# fix permissions on anything we just copied
+for file in $1/*
+do
+    chmod +rwx "$file" 
+done
+
+# Update dylib paths in all binaries
+for file in $1/*
+do
+   install_name_tool "$file" -change @executable_path/../Frameworks/Ogre.framework/Versions/1.9.0/Ogre @executable_path/Ogre
+   install_name_tool "$file" -change @executable_path/../Frameworks/OgreOverlay.framework/Versions/1.9.0/OgreOverlay @executable_path/OgreOverlay
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_thread-mt.dylib @executable_path/libboost_thread-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_date_time-mt.dylib @executable_path/libboost_date_time-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_system-mt.dylib @executable_path/libboost_system-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_atomic-mt.dylib @executable_path/libboost_atomic-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_chrono-mt.dylib @executable_path/libboost_chrono-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_program_options-mt.dylib @executable_path/libboost_program_options-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_filesystem-mt.dylib @executable_path/libboost_filesystem-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_unit_test_framework-mt.dylib @executable_path/libboost_unit_test_framework-mt.dylib
+   install_name_tool "$file" -change @@HOMEBREW_PREFIX@@/lib/libboost_chrono-mt.dylib @executable_path/libboost_chrono-mt.dylib
+   install_name_tool "$file" -change ${PWD}/bin_release/liblua.dylib  @executable_path/liblua.dylib
+   install_name_tool "$file" -change /usr/local/lib/QtCore.framework/Versions/4/QtCore @executable_path/QtCore
+   install_name_tool "$file" -change /usr/local/lib/QtGui.framework/Versions/4/QtGui @executable_path/QtGui
+   otool "$file" -L
+done

+ 0 - 0
CIBuild/windows/build.bat


+ 11 - 3
CMakeLists.txt

@@ -9,6 +9,14 @@ set(QGears_VERSION_MAJOR 0)
 set(QGears_VERSION_MINOR 22)
 set(QGears_VERSION_MINOR 22)
 set(QGears_VERSION_PATCH 0)
 set(QGears_VERSION_PATCH 0)
 
 
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin_release)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin_release)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin_release)
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug)
+
 # Enable Visual Studio solution "folders"
 # Enable Visual Studio solution "folders"
 SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) 
 SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) 
 
 
@@ -254,9 +262,9 @@ elseif(APPLE)
     SET(CPACK_GENERATOR "DragNDrop")
     SET(CPACK_GENERATOR "DragNDrop")
     install(FILES ${PROJECT_SOURCE_DIR}/output/resources.cfg DESTINATION ./)
     install(FILES ${PROJECT_SOURCE_DIR}/output/resources.cfg DESTINATION ./)
     install(FILES ${PROJECT_SOURCE_DIR}/output/plugins.cfg DESTINATION ./)
     install(FILES ${PROJECT_SOURCE_DIR}/output/plugins.cfg DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../lib/macosx/Release/Ogre.framework/Ogre DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../lib/macosx/Release/RenderSystem_GL.framework/Versions/1.9.0/RenderSystem_GL DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay DESTINATION ./)
+        install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Ogre DESTINATION ./)
+        install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/RenderSystem_GL DESTINATION ./)
+        install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/OgreOverlay DESTINATION ./)
 
 
     # TODO: Fix up other files and use "otool" to fix dynlib + framework paths
     # TODO: Fix up other files and use "otool" to fix dynlib + framework paths
         #install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/release/OIS.DLL DESTINATION ./)
         #install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/release/OIS.DLL DESTINATION ./)

+ 3 - 48
PlugIns/Data/CMakeLists.txt

@@ -6,58 +6,12 @@ set(HEADER_FILES
   ${QGearsMain_SOURCE_DIR}/include/common/QGearsManualObject.h
   ${QGearsMain_SOURCE_DIR}/include/common/QGearsManualObject.h
   ${QGearsMain_SOURCE_DIR}/include/common/QGearsStringUtil.h
   ${QGearsMain_SOURCE_DIR}/include/common/QGearsStringUtil.h
   ${QGearsMain_SOURCE_DIR}/include/common/TypeDefine.h
   ${QGearsMain_SOURCE_DIR}/include/common/TypeDefine.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsAFile.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsAFileSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsBackgroundFile.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsBackgroundFileManager.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsBackgroundFileSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsHRCFile.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsHRCFileManager.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsHRCFileSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsHRCMeshLoader.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsHRCSkeletonLoader.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsLZSDataStream.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsPFile.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsPFileManager.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsPFileSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsPaletteFile.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsPaletteFileManager.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsPaletteFileSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsRSDFile.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsRSDFileManager.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsRSDFileSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsSerializer.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsTexCodec.h
-  ${QGearsMain_SOURCE_DIR}/include/data/QGearsTexFile.h
   include/QGearsDataPlugin.h
   include/QGearsDataPlugin.h
 )
 )
 set(SOURCE_FILES
 set(SOURCE_FILES
   ${QGearsMain_SOURCE_DIR}/src/common/QGearsManualObject.cpp
   ${QGearsMain_SOURCE_DIR}/src/common/QGearsManualObject.cpp
   ${QGearsMain_SOURCE_DIR}/src/common/QGearsStringUtil.cpp
   ${QGearsMain_SOURCE_DIR}/src/common/QGearsStringUtil.cpp
   ${QGearsMain_SOURCE_DIR}/src/common/TypeDefine.cpp
   ${QGearsMain_SOURCE_DIR}/src/common/TypeDefine.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsAFile.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsAFileSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsBackgroundFile.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsBackgroundFileManager.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsBackgroundFileSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsHRCFile.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsHRCFileManager.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsHRCFileSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsHRCMeshLoader.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsHRCSkeletonLoader.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsLZSDataStream.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsPFile.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsPFileManager.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsPFileSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsPaletteFile.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsPaletteFileManager.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsPaletteFileSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsRSDFile.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsRSDFileManager.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsRSDFileSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsSerializer.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsTexCodec.cpp
-  ${QGearsMain_SOURCE_DIR}/src/data/QGearsTexFile.cpp
   src/QGearsDataPlugin.cpp
   src/QGearsDataPlugin.cpp
   src/QGearsDataPluginDll.cpp
   src/QGearsDataPluginDll.cpp
 )
 )
@@ -86,8 +40,9 @@ set_target_properties(DataPlugin PROPERTIES
 )
 )
 
 
 set(LIBRARIES
 set(LIBRARIES
-  ${OGRE_LIBRARIES} FinalFantasy7
-
+  ${OGRE_LIBRARIES} 
+  FinalFantasy7
+  q-gears-data
 )
 )
 
 
 target_link_libraries(DataPlugin ${LIBRARIES})
 target_link_libraries(DataPlugin ${LIBRARIES})

+ 115 - 92
QGearsMain/CMakeLists.txt

@@ -1,7 +1,7 @@
 # define header and source files for the library
 # define header and source files for the library
 set(HEADER_FILES
 set(HEADER_FILES
   include/modules/worldmap/WorldMapModule.h
   include/modules/worldmap/WorldMapModule.h
-  include/common/QGearsApplication.h
+
   include/common/QGearsManualObject.h
   include/common/QGearsManualObject.h
   include/common/QGearsResource.h
   include/common/QGearsResource.h
   include/common/QGearsStringUtil.h
   include/common/QGearsStringUtil.h
@@ -10,51 +10,6 @@ set(HEADER_FILES
   include/common/File.h
   include/common/File.h
   include/common/FileSystem.h
   include/common/FileSystem.h
   include/common/make_unique.h
   include/common/make_unique.h
-  include/data/worldmap/MapFile.h
-  include/data/worldmap/MapFileManager.h
-  include/data/worldmap/MapFileSerializer.h
-  include/data/worldmap/TxzFile.h
-  include/data/worldmap/TxzFileManager.h
-  include/data/worldmap/TxzFileSerializer.h
-  include/data/QGearsAFile.h
-  include/data/QGearsAFileManager.h
-  include/data/QGearsAFileSerializer.h
-  include/data/QGearsBackgroundFile.h
-  include/data/QGearsBackgroundFileManager.h
-  include/data/QGearsBackgroundFileSerializer.h
-  include/data/QGearsBackgroundTextureLoader.h
-  include/data/QGearsCameraMatrixFile.h
-  include/data/QGearsCameraMatrixFileManager.h
-  include/data/QGearsCameraMatrixFileSerializer.h
-  include/data/QGearsFLevelBackground2DLoader.h
-  include/data/QGearsFLevelFile.h
-  include/data/QGearsFLevelFileManager.h
-  include/data/QGearsFLevelFileSerializer.h
-  include/data/QGearsFLevelTextureLoader.h
-  include/data/QGearsHRCFile.h
-  include/data/QGearsHRCFileManager.h
-  include/data/QGearsHRCFileSerializer.h
-  include/data/QGearsHRCMeshLoader.h
-  include/data/QGearsHRCSkeletonLoader.h
-  include/data/QGearsLGPArchive.h
-  include/data/QGearsLGPArchiveFactory.h
-  include/data/QGearsLGPArchiveSerializer.h
-  include/data/QGearsLZSDataStream.h
-  include/data/QGearsLZSFLevelFile.h
-  include/data/QGearsLZSFLevelFileManager.h
-  include/data/QGearsPaletteFile.h
-  include/data/QGearsPaletteFileManager.h
-  include/data/QGearsPaletteFileSerializer.h
-  include/data/QGearsPFile.h
-  include/data/QGearsPFileManager.h
-  include/data/QGearsPFileSerializer.h
-  include/data/QGearsRSDFile.h
-  include/data/QGearsRSDFileManager.h
-  include/data/QGearsRSDFileSerializer.h
-  include/data/QGearsSerializer.h
-  include/data/QGearsTexCodec.h
-  include/data/QGearsTexFile.h
-  include/data/QGearsXMLSerializer.h
   include/map/QGearsBackground2DFile.h
   include/map/QGearsBackground2DFile.h
   include/map/QGearsBackground2DFileManager.h
   include/map/QGearsBackground2DFileManager.h
   include/map/QGearsBackground2DFileXMLSerializer.h
   include/map/QGearsBackground2DFileXMLSerializer.h
@@ -144,10 +99,109 @@ set(HEADER_FILES
   include/core/XmlTextFile.h
   include/core/XmlTextFile.h
   include/core/XmlTextsFile.h
   include/core/XmlTextsFile.h
   #include/viewer/ViewerModule.h
   #include/viewer/ViewerModule.h
+  include/data/QGearsXMLSerializer.h
+)
+
+set(HEADER_FILES_DATA
+  include/common/QGearsApplication.h
+include/data/worldmap/MapFile.h
+  include/data/worldmap/MapFileManager.h
+  include/data/worldmap/MapFileSerializer.h
+  include/data/worldmap/TxzFile.h
+  include/data/worldmap/TxzFileManager.h
+  include/data/worldmap/TxzFileSerializer.h
+  include/data/QGearsAFile.h
+  include/data/QGearsAFileManager.h
+  include/data/QGearsAFileSerializer.h
+  include/data/QGearsBackgroundFile.h
+  include/data/QGearsBackgroundFileManager.h
+  include/data/QGearsBackgroundFileSerializer.h
+  include/data/QGearsBackgroundTextureLoader.h
+  include/data/QGearsCameraMatrixFile.h
+  include/data/QGearsCameraMatrixFileManager.h
+  include/data/QGearsCameraMatrixFileSerializer.h
+  include/data/QGearsFLevelBackground2DLoader.h
+  include/data/QGearsFLevelFile.h
+  include/data/QGearsFLevelFileManager.h
+  include/data/QGearsFLevelFileSerializer.h
+  include/data/QGearsFLevelTextureLoader.h
+  include/data/QGearsHRCFile.h
+  include/data/QGearsHRCFileManager.h
+  include/data/QGearsHRCFileSerializer.h
+  include/data/QGearsHRCMeshLoader.h
+  include/data/QGearsHRCSkeletonLoader.h
+  include/data/QGearsLGPArchive.h
+  include/data/QGearsLGPArchiveFactory.h
+  include/data/QGearsLGPArchiveSerializer.h
+  include/data/QGearsLZSDataStream.h
+  include/data/QGearsLZSFLevelFile.h
+  include/data/QGearsLZSFLevelFileManager.h
+  include/data/QGearsPaletteFile.h
+  include/data/QGearsPaletteFileManager.h
+  include/data/QGearsPaletteFileSerializer.h
+  include/data/QGearsPFile.h
+  include/data/QGearsPFileManager.h
+  include/data/QGearsPFileSerializer.h
+  include/data/QGearsRSDFile.h
+  include/data/QGearsRSDFileManager.h
+  include/data/QGearsRSDFileSerializer.h
+  include/data/QGearsSerializer.h
+  include/data/QGearsTexCodec.h
+  include/data/QGearsTexFile.h
 )
 )
+
+set(SOURCE_FILES_DATA
+  src/common/QGearsApplication.cpp
+  src/data/QGearsAFile.cpp
+  src/data/QGearsAFileManager.cpp
+  src/data/QGearsAFileSerializer.cpp
+  src/data/worldmap/MapFile.cpp
+  src/data/worldmap/MapFileManager.cpp
+  src/data/worldmap/MapFileSerializer.cpp
+  src/data/worldmap/TxzFile.cpp
+  src/data/worldmap/TxzFileManager.cpp
+  src/data/worldmap/TxzFileSerializer.cpp
+  src/data/QGearsBackgroundFile.cpp
+  src/data/QGearsBackgroundFileManager.cpp
+  src/data/QGearsBackgroundFileSerializer.cpp
+  src/data/QGearsBackgroundTextureLoader.cpp
+  src/data/QGearsCameraMatrixFile.cpp
+  src/data/QGearsCameraMatrixFileManager.cpp
+  src/data/QGearsCameraMatrixFileSerializer.cpp
+  src/data/QGearsFLevelBackground2DLoader.cpp
+  src/data/QGearsFLevelFile.cpp
+  src/data/QGearsFLevelFileManager.cpp
+  src/data/QGearsFLevelFileSerializer.cpp
+  src/data/QGearsFLevelTextureLoader.cpp
+  src/data/QGearsHRCFile.cpp
+  src/data/QGearsHRCFileManager.cpp
+  src/data/QGearsHRCFileSerializer.cpp
+  src/data/QGearsHRCMeshLoader.cpp
+  src/data/QGearsHRCSkeletonLoader.cpp
+  src/data/QGearsLGPArchive.cpp
+  src/data/QGearsLGPArchiveFactory.cpp
+  src/data/QGearsLGPArchiveSerializer.cpp
+  src/data/QGearsLZSDataStream.cpp
+  src/data/QGearsLZSFLevelFile.cpp
+  src/data/QGearsLZSFLevelFileManager.cpp
+  src/data/QGearsPaletteFile.cpp
+  src/data/QGearsPaletteFileManager.cpp
+  src/data/QGearsPaletteFileSerializer.cpp
+  src/data/QGearsPFile.cpp
+  src/data/QGearsPFileManager.cpp
+  src/data/QGearsPFileSerializer.cpp
+  src/data/QGearsRSDFile.cpp
+  src/data/QGearsRSDFileManager.cpp
+  src/data/QGearsRSDFileSerializer.cpp
+  src/data/QGearsSerializer.cpp
+  src/data/QGearsTexCodec.cpp
+  src/data/QGearsTexFile.cpp
+
+)
+
 set(SOURCE_FILES
 set(SOURCE_FILES
   src/modules/worldmap/WorldMapModule.cpp
   src/modules/worldmap/WorldMapModule.cpp
-  src/common/QGearsApplication.cpp
+
   src/common/QGearsManualObject.cpp
   src/common/QGearsManualObject.cpp
   src/common/QGearsResource.cpp
   src/common/QGearsResource.cpp
   src/common/QGearsStringUtil.cpp
   src/common/QGearsStringUtil.cpp
@@ -213,51 +267,6 @@ set(SOURCE_FILES
   src/core/XmlScriptsFile.cpp
   src/core/XmlScriptsFile.cpp
   src/core/XmlTextFile.cpp
   src/core/XmlTextFile.cpp
   src/core/XmlTextsFile.cpp
   src/core/XmlTextsFile.cpp
-  src/data/QGearsAFile.cpp
-  src/data/QGearsAFileManager.cpp
-  src/data/QGearsAFileSerializer.cpp
-  src/data/worldmap/MapFile.cpp
-  src/data/worldmap/MapFileManager.cpp
-  src/data/worldmap/MapFileSerializer.cpp
-  src/data/worldmap/TxzFile.cpp
-  src/data/worldmap/TxzFileManager.cpp
-  src/data/worldmap/TxzFileSerializer.cpp
-  src/data/QGearsBackgroundFile.cpp
-  src/data/QGearsBackgroundFileManager.cpp
-  src/data/QGearsBackgroundFileSerializer.cpp
-  src/data/QGearsBackgroundTextureLoader.cpp
-  src/data/QGearsCameraMatrixFile.cpp
-  src/data/QGearsCameraMatrixFileManager.cpp
-  src/data/QGearsCameraMatrixFileSerializer.cpp
-  src/data/QGearsFLevelBackground2DLoader.cpp
-  src/data/QGearsFLevelFile.cpp
-  src/data/QGearsFLevelFileManager.cpp
-  src/data/QGearsFLevelFileSerializer.cpp
-  src/data/QGearsFLevelTextureLoader.cpp
-  src/data/QGearsHRCFile.cpp
-  src/data/QGearsHRCFileManager.cpp
-  src/data/QGearsHRCFileSerializer.cpp
-  src/data/QGearsHRCMeshLoader.cpp
-  src/data/QGearsHRCSkeletonLoader.cpp
-  src/data/QGearsLGPArchive.cpp
-  src/data/QGearsLGPArchiveFactory.cpp
-  src/data/QGearsLGPArchiveSerializer.cpp
-  src/data/QGearsLZSDataStream.cpp
-  src/data/QGearsLZSFLevelFile.cpp
-  src/data/QGearsLZSFLevelFileManager.cpp
-  src/data/QGearsPaletteFile.cpp
-  src/data/QGearsPaletteFileManager.cpp
-  src/data/QGearsPaletteFileSerializer.cpp
-  src/data/QGearsPFile.cpp
-  src/data/QGearsPFileManager.cpp
-  src/data/QGearsPFileSerializer.cpp
-  src/data/QGearsRSDFile.cpp
-  src/data/QGearsRSDFileManager.cpp
-  src/data/QGearsRSDFileSerializer.cpp
-  src/data/QGearsSerializer.cpp
-  src/data/QGearsTexCodec.cpp
-  src/data/QGearsTexFile.cpp
-  src/data/QGearsXMLSerializer.cpp
   src/map/QGearsBackground2DFile.cpp
   src/map/QGearsBackground2DFile.cpp
   src/map/QGearsBackground2DFileManager.cpp
   src/map/QGearsBackground2DFileManager.cpp
   src/map/QGearsBackground2DFileXMLSerializer.cpp
   src/map/QGearsBackground2DFileXMLSerializer.cpp
@@ -269,6 +278,7 @@ set(SOURCE_FILES
   src/map/QGearsWalkmeshFileXMLSerializer.cpp
   src/map/QGearsWalkmeshFileXMLSerializer.cpp
   #src/viewer/ViewerModule.cpp
   #src/viewer/ViewerModule.cpp
   src/QGearsGameState.cpp
   src/QGearsGameState.cpp
+  src/data/QGearsXMLSerializer.cpp
 )
 )
 if(QGears_SOUND)
 if(QGears_SOUND)
     set(HEADER_FILES
     set(HEADER_FILES
@@ -326,6 +336,14 @@ add_library(QGearsMain STATIC
 )
 )
 SET_PROPERTY(TARGET QGearsMain PROPERTY FOLDER "q-gears")
 SET_PROPERTY(TARGET QGearsMain PROPERTY FOLDER "q-gears")
 
 
+add_library(q-gears-data STATIC
+ ${HEADER_FILES_DATA}
+ ${SOURCE_FILES_DATA}
+ )
+
+SET_PROPERTY(TARGET q-gears-data PROPERTY FOLDER "q-gears")
+
+
 add_executable(q-gears
 add_executable(q-gears
   src/Main.cpp
   src/Main.cpp
 )
 )
@@ -354,6 +372,11 @@ target_link_libraries(QGearsMain
 target_link_libraries(q-gears 
 target_link_libraries(q-gears 
 	QGearsMain
 	QGearsMain
 	${Boost_LIBRARIES}
 	${Boost_LIBRARIES}
+    q-gears-data
+)
+
+target_link_libraries(q-gears-data
+    QGearsMain
 )
 )
 
 
 if(WIN32 OR APPLE)
 if(WIN32 OR APPLE)

+ 6 - 1
QGearsMain/src/common/FileSystem.cpp

@@ -37,8 +37,13 @@ FileSystem::ReadFile(const Ogre::String &path, void* buffer, const unsigned int
     }
     }
 
 
     fseek(file, start, SEEK_SET);
     fseek(file, start, SEEK_SET);
-    fread(buffer, sizeof(char), length, file);
+    const auto ret = fread(buffer, sizeof(char), length, file);
     fclose(file);
     fclose(file);
+    if (ret != sizeof(char))
+    {
+        LOG_ERROR("Failed to read all data\n");
+        return false;
+    }
 
 
     return true;
     return true;
 }
 }

+ 5 - 4
Tests/FinalFantasy7/CMakeLists.txt

@@ -8,8 +8,9 @@ include_directories(
 
 
 set(LIBRARIES
 set(LIBRARIES
     ${QGears_TEST_LIBRARIES}
     ${QGears_TEST_LIBRARIES}
-    QGearsMain
     FinalFantasy7
     FinalFantasy7
+	QGearsMain
+	q-gears-data
 )
 )
 
 
 add_executable(TestFF7FLevelFileSerializer
 add_executable(TestFF7FLevelFileSerializer
@@ -19,7 +20,7 @@ SET_PROPERTY(TARGET TestFF7FLevelFileSerializer PROPERTY FOLDER "tests")
 
 
 
 
 target_link_libraries(TestFF7FLevelFileSerializer ${LIBRARIES})
 target_link_libraries(TestFF7FLevelFileSerializer ${LIBRARIES})
-add_test(TestFF7FLevelFileSerializer TestFF7FLevelFileSerializer)
+add_test(NAME TestFF7FLevelFileSerializer COMMAND TestFF7FLevelFileSerializer)
 
 
 
 
 add_executable(TestFF7ModelListFileSerializer
 add_executable(TestFF7ModelListFileSerializer
@@ -29,7 +30,7 @@ SET_PROPERTY(TARGET TestFF7ModelListFileSerializer PROPERTY FOLDER "tests")
 
 
 
 
 target_link_libraries(TestFF7ModelListFileSerializer ${LIBRARIES})
 target_link_libraries(TestFF7ModelListFileSerializer ${LIBRARIES})
-add_test(TestFF7ModelListFileSerializer TestFF7ModelListFileSerializer)
+add_test(NAME TestFF7ModelListFileSerializer COMMAND TestFF7ModelListFileSerializer)
 
 
 
 
 add_executable(TestFF7WalkmeshFileSerializer
 add_executable(TestFF7WalkmeshFileSerializer
@@ -38,4 +39,4 @@ add_executable(TestFF7WalkmeshFileSerializer
 SET_PROPERTY(TARGET TestFF7WalkmeshFileSerializer PROPERTY FOLDER "tests")
 SET_PROPERTY(TARGET TestFF7WalkmeshFileSerializer PROPERTY FOLDER "tests")
 
 
 target_link_libraries(TestFF7WalkmeshFileSerializer ${LIBRARIES})
 target_link_libraries(TestFF7WalkmeshFileSerializer ${LIBRARIES})
-add_test(TestFF7WalkmeshFileSerializer TestFF7WalkmeshFileSerializer)
+add_test(NAME TestFF7WalkmeshFileSerializer COMMAND TestFF7WalkmeshFileSerializer)

+ 6 - 5
Tests/QGearsMain/CMakeLists.txt

@@ -8,6 +8,7 @@ include_directories(
 set(LIBRARIES
 set(LIBRARIES
     ${QGears_TEST_LIBRARIES}
     ${QGears_TEST_LIBRARIES}
     QGearsMain
     QGearsMain
+	q-gears-data
 )
 )
 
 
 add_executable(TestQGearsAFileSerializer
 add_executable(TestQGearsAFileSerializer
@@ -16,7 +17,7 @@ add_executable(TestQGearsAFileSerializer
 SET_PROPERTY(TARGET TestQGearsAFileSerializer PROPERTY FOLDER "tests")
 SET_PROPERTY(TARGET TestQGearsAFileSerializer PROPERTY FOLDER "tests")
 
 
 target_link_libraries(TestQGearsAFileSerializer ${LIBRARIES})
 target_link_libraries(TestQGearsAFileSerializer ${LIBRARIES})
-add_test(TestQGearsAFileSerializer TestQGearsAFileSerializer)
+add_test(NAME TestQGearsAFileSerializer COMMAND TestQGearsAFileSerializer)
 
 
 
 
 add_executable(TestQGearsMapFileXMLSerializer
 add_executable(TestQGearsMapFileXMLSerializer
@@ -25,7 +26,7 @@ add_executable(TestQGearsMapFileXMLSerializer
 SET_PROPERTY(TARGET TestQGearsMapFileXMLSerializer PROPERTY FOLDER "tests")
 SET_PROPERTY(TARGET TestQGearsMapFileXMLSerializer PROPERTY FOLDER "tests")
 
 
 target_link_libraries(TestQGearsMapFileXMLSerializer ${LIBRARIES})
 target_link_libraries(TestQGearsMapFileXMLSerializer ${LIBRARIES})
-add_test(TestQGearsMapFileXMLSerializer TestQGearsMapFileXMLSerializer)
+add_test(NAME TestQGearsMapFileXMLSerializer COMMAND TestQGearsMapFileXMLSerializer)
 
 
 # field walk mesh
 # field walk mesh
 add_executable(TestQGearsWalkmeshFileXMLSerializer
 add_executable(TestQGearsWalkmeshFileXMLSerializer
@@ -34,7 +35,7 @@ add_executable(TestQGearsWalkmeshFileXMLSerializer
 SET_PROPERTY(TARGET TestQGearsWalkmeshFileXMLSerializer PROPERTY FOLDER "tests")
 SET_PROPERTY(TARGET TestQGearsWalkmeshFileXMLSerializer PROPERTY FOLDER "tests")
 
 
 target_link_libraries(TestQGearsWalkmeshFileXMLSerializer ${LIBRARIES})
 target_link_libraries(TestQGearsWalkmeshFileXMLSerializer ${LIBRARIES})
-add_test(TestQGearsWalkmeshFileXMLSerializer TestQGearsWalkmeshFileXMLSerializer)
+add_test(NAME TestQGearsWalkmeshFileXMLSerializer COMMAND TestQGearsWalkmeshFileXMLSerializer)
 
 
 # LGP archive
 # LGP archive
 add_executable(TestQGearsLGPArchive
 add_executable(TestQGearsLGPArchive
@@ -43,7 +44,7 @@ add_executable(TestQGearsLGPArchive
 SET_PROPERTY(TARGET TestQGearsLGPArchive PROPERTY FOLDER "tests")
 SET_PROPERTY(TARGET TestQGearsLGPArchive PROPERTY FOLDER "tests")
 
 
 target_link_libraries(TestQGearsLGPArchive ${LIBRARIES})
 target_link_libraries(TestQGearsLGPArchive ${LIBRARIES})
-add_test(TestQGearsLGPArchive TestQGearsLGPArchive)
+add_test(NAME TestQGearsLGPArchive COMMAND TestQGearsLGPArchive)
 
 
 # HRC archive
 # HRC archive
 add_executable(TestQGearsHRCSerializer
 add_executable(TestQGearsHRCSerializer
@@ -52,7 +53,7 @@ add_executable(TestQGearsHRCSerializer
 SET_PROPERTY(TARGET TestQGearsHRCSerializer PROPERTY FOLDER "tests")
 SET_PROPERTY(TARGET TestQGearsHRCSerializer PROPERTY FOLDER "tests")
 
 
 target_link_libraries(TestQGearsHRCSerializer ${LIBRARIES})
 target_link_libraries(TestQGearsHRCSerializer ${LIBRARIES})
-add_test(TestQGearsHRCSerializer TestQGearsHRCSerializer)
+add_test(NAME TestQGearsHRCSerializer COMMAND TestQGearsHRCSerializer)
 
 
 # world map
 # world map
 add_executable(TestMapSerializer
 add_executable(TestMapSerializer

+ 1 - 1
readme.md

@@ -1,4 +1,4 @@
-# What is QGears?  [![Build Status](https://travis-ci.org/q-gears/q-gears.svg?branch=master)](https://travis-ci.org/q-gears/q-gears) [![Coverity scan status](https://scan.coverity.com/projects/3861/badge.svg)](https://scan.coverity.com/projects/3861)
+# What is QGears?  [![Build Status](https://travis-ci.org/q-gears/q-gears.svg?branch=master)](https://travis-ci.org/q-gears/q-gears) [![Coverity scan status](https://scan.coverity.com/projects/3861/badge.svg)](https://scan.coverity.com/projects/3861) [![Coverage Status](https://coveralls.io/repos/q-gears/q-gears/badge.svg)](https://coveralls.io/r/q-gears/q-gears)
 
 
 Q-Gears is an RPG engine for games like Squaresoft's Final Fantasy 7, Final Fantasy IX or Xenogears. It is designed to be cross-platfrom and run on modern operating systems such as Win32 and Linux.
 Q-Gears is an RPG engine for games like Squaresoft's Final Fantasy 7, Final Fantasy IX or Xenogears. It is designed to be cross-platfrom and run on modern operating systems such as Win32 and Linux.
 
 

+ 0 - 1
utilities/CMakeLists.txt

@@ -40,7 +40,6 @@ add_library(Utility STATIC
 )
 )
 
 
 target_link_libraries(Utility
 target_link_libraries(Utility
-    QGearsMain
     ${OGRE_LIBRARIES}
     ${OGRE_LIBRARIES}
     ${OIS_LIBRARIES}
     ${OIS_LIBRARIES}
     ${ZLIB_LIBRARIES}
     ${ZLIB_LIBRARIES}

+ 2 - 0
utilities/ffix_model_exporter/CMakeLists.txt

@@ -39,6 +39,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff9_model_exporter    ${LIBRARIES})
 target_link_libraries(ff9_model_exporter    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffix_script_dumper/CMakeLists.txt

@@ -33,6 +33,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff9_script_dumper    ${LIBRARIES})
 target_link_libraries(ff9_script_dumper    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffix_sound_dumper/CMakeLists.txt

@@ -43,6 +43,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff9_sound_dumper    ${LIBRARIES})
 target_link_libraries(ff9_sound_dumper    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffvii_battle_model_exporter/CMakeLists.txt

@@ -47,6 +47,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff7_battle_model_exporter    ${LIBRARIES})
 target_link_libraries(ff7_battle_model_exporter    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffvii_battle_scene_dumper/CMakeLists.txt

@@ -39,6 +39,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff7_battle_scene_dumper    ${LIBRARIES})
 target_link_libraries(ff7_battle_scene_dumper    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffvii_field_dat_dumper/CMakeLists.txt

@@ -36,6 +36,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff7_field_dat_dumper    ${LIBRARIES})
 target_link_libraries(ff7_field_dat_dumper    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffvii_field_model_exporter/CMakeLists.txt

@@ -50,6 +50,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff7_field_model_exporter    ${LIBRARIES})
 target_link_libraries(ff7_field_model_exporter    ${LIBRARIES})
 
 

+ 14 - 5
utilities/ffvii_field_model_exporter_pc/CMakeLists.txt

@@ -11,13 +11,13 @@ set(SOURCE_FILES
     src/main.cpp
     src/main.cpp
 )
 )
 
 
-add_definitions(
-    -DQGEARS_ADD_MANAGERS
-)
+#add_definitions(
+#    -DQGEARS_ADD_MANAGERS
+#)
 
 
 add_executable(ff7_field_model_exporter_pc
 add_executable(ff7_field_model_exporter_pc
-  ${HEADER_FILES}
   ${SOURCE_FILES}
   ${SOURCE_FILES}
+  ${HEADER_FILES}
 )
 )
 SET_PROPERTY(TARGET ff7_field_model_exporter_pc PROPERTY FOLDER "utilities")
 SET_PROPERTY(TARGET ff7_field_model_exporter_pc PROPERTY FOLDER "utilities")
 
 
@@ -33,7 +33,16 @@ if(WIN32)
 endif()
 endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
-    Utility
+    q-gears-data
+
+    QGearsMain
+
+
+    ${OGRE_LIBRARIES}
+    ${OIS_LIBRARIES}
+    ${ZLIB_LIBRARIES}
+Utility
+
 )
 )
 target_link_libraries(ff7_field_model_exporter_pc    ${LIBRARIES})
 target_link_libraries(ff7_field_model_exporter_pc    ${LIBRARIES})
 
 

+ 3 - 1
utilities/ffvii_font_exporter/CMakeLists.txt

@@ -31,7 +31,9 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
-	${ZLIB_LIBRARIES}
+    QGearsMain
+    q-gears-data
+    ${ZLIB_LIBRARIES}
 )
 )
 target_link_libraries(ff7_font_exporter    ${LIBRARIES})
 target_link_libraries(ff7_font_exporter    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffvii_sound_dumper/CMakeLists.txt

@@ -41,6 +41,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff7_sound_dumper    ${LIBRARIES})
 target_link_libraries(ff7_sound_dumper    ${LIBRARIES})
 
 

+ 2 - 0
utilities/ffvii_sound_dumper_psf/CMakeLists.txt

@@ -71,6 +71,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(ff7_sound_dumper_psf    ${LIBRARIES})
 target_link_libraries(ff7_sound_dumper_psf    ${LIBRARIES})
 
 

+ 2 - 0
utilities/flevel/CMakeLists.txt

@@ -29,6 +29,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(flevel    ${LIBRARIES})
 target_link_libraries(flevel    ${LIBRARIES})
 
 

+ 2 - 0
utilities/lzs/CMakeLists.txt

@@ -29,6 +29,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(lzs    ${LIBRARIES})
 target_link_libraries(lzs    ${LIBRARIES})
 
 

+ 3 - 1
utilities/q-gears-launcher/CMakeLists.txt

@@ -49,6 +49,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 
 
 
 
@@ -58,4 +60,4 @@ if(WIN32 OR APPLE)
   install(TARGETS q-gears-launcher DESTINATION . ) 
   install(TARGETS q-gears-launcher DESTINATION . ) 
 else()
 else()
   install(TARGETS q-gears-launcher RUNTIME DESTINATION bin ) 
   install(TARGETS q-gears-launcher RUNTIME DESTINATION bin ) 
-endif()
+endif()

+ 7 - 0
utilities/q-gears-launcher/src/ff7DataInstaller.cpp

@@ -53,12 +53,14 @@ void FF7DataInstaller::Convert(std::string inputDir, std::string outputDir, cons
             auto fullPath = inputDir + file;
             auto fullPath = inputDir + file;
             mApp.getRoot()->addResourceLocation(fullPath, "LGP", "FFVII");
             mApp.getRoot()->addResourceLocation(fullPath, "LGP", "FFVII");
             ConvertFieldModels(fullPath, outputDir);
             ConvertFieldModels(fullPath, outputDir);
+            mApp.getRoot()->removeResourceLocation(fullPath, "FFVII");
         }
         }
         else if (file == "field\\flevel.lgp")
         else if (file == "field\\flevel.lgp")
         {
         {
             auto fullPath = inputDir + file;
             auto fullPath = inputDir + file;
             mApp.getRoot()->addResourceLocation(fullPath, "LGP", "FFVII");
             mApp.getRoot()->addResourceLocation(fullPath, "LGP", "FFVII");
             ConvertFields(fullPath, outputDir);
             ConvertFields(fullPath, outputDir);
+            mApp.getRoot()->removeResourceLocation(fullPath, "FFVII");
         }
         }
     }
     }
 }
 }
@@ -131,5 +133,10 @@ void FF7DataInstaller::ConvertFieldModels(std::string archive, std::string outDi
 
 
 void FF7DataInstaller::ConvertFields(std::string archive, std::string outDir)
 void FF7DataInstaller::ConvertFields(std::string archive, std::string outDir)
 {
 {
+    // Everything in here is a field
+    Ogre::StringVectorPtr resources = mApp.ResMgr()->listResourceNames("FFVII", "*.hrc");
+    for (auto& resourceName : *resources)
+    {
 
 
+    }
 }
 }

+ 5 - 5
utilities/xeno_cd_extract/extract.cpp

@@ -29,8 +29,8 @@ void parse_file(unsigned long start_sector, unsigned long file_size, int id, cha
 
 
     unsigned char arfile[2352];
     unsigned char arfile[2352];
     unsigned char type[4];
     unsigned char type[4];
-    char* extention;
-    unsigned long file_type;
+    const char* extention;
+    unsigned int file_type;
 
 
     char number[10];
     char number[10];
 
 
@@ -170,7 +170,7 @@ void parse_file(unsigned long start_sector, unsigned long file_size, int id, cha
 
 
     FILE* desc_file = fopen("description.txt", "a+");
     FILE* desc_file = fopen("description.txt", "a+");
     char desc[ 255 ];
     char desc[ 255 ];
-    sprintf(desc, "%s - 0x%04x, 0x%04x\n", file_name, start_sector, file_size);
+    sprintf(desc, "%s - 0x%04x, 0x%04x\n", file_name, static_cast<unsigned int>(start_sector), static_cast<unsigned int>(file_size));
     fputs (desc, desc_file);
     fputs (desc, desc_file);
     fclose(desc_file);
     fclose(desc_file);
 
 
@@ -308,12 +308,12 @@ void extract(char *filename)
             //mkdir(filename);
             //mkdir(filename);
             abort();
             abort();
 
 
-            printf("number of file %d, in dir %d", -file_size, directory_number);
+            printf("number of file %d, in dir %d", static_cast<int>(-file_size), directory_number);
         }
         }
         // file
         // file
         if (start_sector != 0 && file_size < 0xff000000 && file_size > 0)
         if (start_sector != 0 && file_size < 0xff000000 && file_size > 0)
         {
         {
-            printf("file number %d, size: 0x%x byte - ", i, file_size);
+            printf("file number %d, size: 0x%x byte - ", i, static_cast<unsigned int>(file_size));
             parse_file(start_sector, file_size, i, filename);
             parse_file(start_sector, file_size, i, filename);
         }
         }
     }
     }

+ 2 - 0
utilities/xeno_model_exporter/CMakeLists.txt

@@ -46,6 +46,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(xeno_model_exporter    ${LIBRARIES})
 target_link_libraries(xeno_model_exporter    ${LIBRARIES})
 
 

+ 2 - 0
utilities/xeno_script_dumper/CMakeLists.txt

@@ -64,6 +64,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(xeno_script_dumper    ${LIBRARIES})
 target_link_libraries(xeno_script_dumper    ${LIBRARIES})
 
 

+ 6 - 1
utilities/xeno_script_dumper/src/common/filesystem/driver/RealFileDriver.cpp

@@ -50,8 +50,13 @@ RealFileDriver::ReadFile(const RString &path, void* buffer, const unsigned int s
     }
     }
 
 
     fseek(file, start, SEEK_SET);
     fseek(file, start, SEEK_SET);
-    fread(buffer, sizeof(char), length, file);
+    const auto ret = fread(buffer, sizeof(char), length, file);
     fclose(file);
     fclose(file);
+    if (ret != sizeof(char))
+    {
+        LOGGER->Log("Expected to read %d but got %d bytes\n", sizeof(char), ret);
+        return false;
+    }
 
 
     return true;
     return true;
 }
 }

+ 2 - 0
utilities/xeno_sound_dumper/CMakeLists.txt

@@ -41,6 +41,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(xeno_sound_dumper    ${LIBRARIES})
 target_link_libraries(xeno_sound_dumper    ${LIBRARIES})
 
 

+ 2 - 0
utilities/xeno_walkmesh_exporter/CMakeLists.txt

@@ -98,6 +98,8 @@ endif()
 
 
 set(LIBRARIES
 set(LIBRARIES
     Utility
     Utility
+    QGearsMain
+    q-gears-data
 )
 )
 target_link_libraries(xeno_walkmesh_exporter    ${LIBRARIES})
 target_link_libraries(xeno_walkmesh_exporter    ${LIBRARIES})
 
 

+ 9 - 2
utilities/xeno_walkmesh_exporter/src/common/display/surface/SurfaceLoadBmp.cpp

@@ -141,7 +141,13 @@ SurfaceUtils::LoadBMP(const std::string &file, Surface* &img)
     fseek(image, 0, SEEK_SET);
     fseek(image, 0, SEEK_SET);
 
 
     buffer = (unsigned char*)malloc(sizeof(unsigned char) * size);
     buffer = (unsigned char*)malloc(sizeof(unsigned char) * size);
-    fread(buffer, 1, size, image);
+    const auto readRet = fread(buffer, 1, size, image);
+    if (readRet != sizeof(char))
+    {
+        LOGGER->Log(LOGGER_ERROR, "fread failure");
+        fclose(image);
+        return OPEN_FATAL_ERROR;
+    }
 
 
     SurfaceUtils::OpenResult ret;
     SurfaceUtils::OpenResult ret;
 
 
@@ -151,8 +157,9 @@ SurfaceUtils::LoadBMP(const std::string &file, Surface* &img)
     if (ret != SurfaceUtils::OPEN_OK && img != NULL)
     if (ret != SurfaceUtils::OPEN_OK && img != NULL)
     {
     {
         delete img;
         delete img;
-        img = NULL;
+        img = NULL;;
     }
     }
 
 
+    fclose(image);
     return ret;
     return ret;
 }
 }

+ 6 - 1
utilities/xeno_walkmesh_exporter/src/common/filesystem/driver/RealFileDriver.cpp

@@ -50,8 +50,13 @@ RealFileDriver::ReadFile(const RString &path, void* buffer, const unsigned int s
     }
     }
 
 
     fseek(file, start, SEEK_SET);
     fseek(file, start, SEEK_SET);
-    fread(buffer, sizeof(char), length, file);
+    const auto ret = fread(buffer, sizeof(char), length, file);
     fclose(file);
     fclose(file);
+    if (ret != sizeof(char))
+    {
+        LOGGER->Log(LOGGER_ERROR, "fread failure");
+        return false;
+    }
 
 
     return true;
     return true;
 }
 }