Browse Source

Project structure changed:
- No more public headers.
- Unit test placeholders.
- Installer code separated.
- Several improvements and simplifications in CMakeLists files.

Iñigo Valentin 3 years ago
parent
commit
7a96606d01
100 changed files with 1463 additions and 3623 deletions
  1. 0 2
      .gitignore
  2. 92 0
      CMake/FindOIS.cmake
  3. 1 4
      CMake/FindOggVorbis.cmake
  4. 1 1
      CMake/FindOpenAL.cmake
  5. 74 0
      CMake/FindTinyXML.cmake
  6. 1 1
      CMake/cotire.cmake
  7. 36 337
      CMakeLists.txt
  8. 9 9
      PlugIns/Data/CMakeLists.txt
  9. 1 1
      PlugIns/Data/include/VGearsDataPlugin.h
  10. 1 1
      PlugIns/Data/src/VGearsDataPluginDll.cpp
  11. 1 1
      PlugIns/Data/test/tex_file_info.cpp
  12. 1 1
      PlugIns/Data/test/tex_file_test.cpp
  13. 0 12
      Tests/CMakeLists.txt
  14. 0 31
      Tests/FinalFantasy7/CMakeLists.txt
  15. BIN
      Tests/FinalFantasy7/misc/reference.flevel
  16. BIN
      Tests/FinalFantasy7/misc/reference.flevel.png
  17. BIN
      Tests/FinalFantasy7/misc/reference.model_list
  18. BIN
      Tests/FinalFantasy7/misc/reference.walkmesh
  19. BIN
      Tests/FinalFantasy7/misc/reference_compressed.flevel
  20. BIN
      Tests/FinalFantasy7/misc/reference_compressed.flevel.png
  21. 0 160
      Tests/FinalFantasy7/src/test_FF7FLevelFileSerializer.cpp
  22. 0 83
      Tests/FinalFantasy7/src/test_FF7ModelListFileSerializer.cpp
  23. 0 71
      Tests/FinalFantasy7/src/test_FF7WalkmeshFileSerializer.cpp
  24. 0 60
      Tests/VGearsMain/CMakeLists.txt
  25. 0 23
      Tests/VGearsMain/misc/map.xml
  26. BIN
      Tests/VGearsMain/misc/reference.a
  27. BIN
      Tests/VGearsMain/misc/reference.background
  28. 0 21
      Tests/VGearsMain/misc/reference.background2d.xml
  29. BIN
      Tests/VGearsMain/misc/reference.cam_matrix
  30. BIN
      Tests/VGearsMain/misc/reference.lgp
  31. BIN
      Tests/VGearsMain/misc/reference.p
  32. BIN
      Tests/VGearsMain/misc/reference.palette
  33. 0 24
      Tests/VGearsMain/misc/reference.rsd
  34. BIN
      Tests/VGearsMain/misc/reference.skeleton
  35. BIN
      Tests/VGearsMain/misc/reference_lzs.compressed
  36. BIN
      Tests/VGearsMain/misc/reference_lzs.decompressed
  37. 0 99
      Tests/VGearsMain/misc/reference_manual_object.mesh.xml
  38. 0 8
      Tests/VGearsMain/misc/test_hrc_empty.hrc
  39. 0 18
      Tests/VGearsMain/misc/test_hrc_simple.hrc
  40. 0 4
      Tests/VGearsMain/misc/walkmesh.xml
  41. 0 180
      Tests/VGearsMain/src/test_MapSerializer.cpp
  42. 0 50
      Tests/VGearsMain/src/test_TxzSerializer.cpp
  43. 0 76
      Tests/VGearsMain/src/test_VGearsAFileSerializer.cpp
  44. 0 53
      Tests/VGearsMain/src/test_VGearsBackground2D.cpp
  45. 0 92
      Tests/VGearsMain/src/test_VGearsBackground2DFileSerializer.cpp
  46. 0 145
      Tests/VGearsMain/src/test_VGearsBackgroundFileSerializer.cpp
  47. 0 69
      Tests/VGearsMain/src/test_VGearsCameraMatrixFileSerializer.cpp
  48. 0 115
      Tests/VGearsMain/src/test_VGearsHRCSerializer.cpp
  49. 0 111
      Tests/VGearsMain/src/test_VGearsLGPArchive.cpp
  50. 0 151
      Tests/VGearsMain/src/test_VGearsLZSDataStream.cpp
  51. 0 101
      Tests/VGearsMain/src/test_VGearsManualObject.cpp
  52. 0 69
      Tests/VGearsMain/src/test_VGearsMapFileXMLSerializer.cpp
  53. 0 58
      Tests/VGearsMain/src/test_VGearsPFile.cpp
  54. 0 92
      Tests/VGearsMain/src/test_VGearsPFileSerializer.cpp
  55. 0 80
      Tests/VGearsMain/src/test_VGearsPaletteFileSerializer.cpp
  56. 0 75
      Tests/VGearsMain/src/test_VGearsRSDSerializer.cpp
  57. 0 85
      Tests/VGearsMain/src/test_VGearsRingBuffer.cpp
  58. 0 70
      Tests/VGearsMain/src/test_VGearsWalkmeshFileXMLSerializer.cpp
  59. 0 2
      Tests/VGearsMain/src/test_all.cpp
  60. 0 258
      V-Gears-Installer/CMakeLists.txt
  61. 0 126
      V-Gears-Installer/src/CMakeLists.txt
  62. 0 413
      V-Gears/CMakeLists.txt
  63. 0 157
      V-Gears/src/Main.cpp
  64. 5 7
      lib/CMakeLists.txt
  65. 11 11
      lib/luajit/CMakeLists.txt
  66. 151 0
      lib/luajit/Makefile
  67. 118 0
      lib/luajit/cmake/FindLua.cmake
  68. 25 0
      lib/luajit/cmake/FindReadline.cmake
  69. 319 0
      lib/luajit/cmake/dist.cmake
  70. 297 0
      lib/luajit/cmake/lua.cmake
  71. 314 0
      src/CMakeLists.txt
  72. 0 0
      src/FF7Character.cpp
  73. 0 0
      src/FF7Character.h
  74. 0 0
      src/FF7Common.cpp
  75. 0 0
      src/FF7Common.h
  76. 0 0
      src/LuaIncludes.h
  77. 0 0
      src/VGearsGameState.cpp
  78. 0 0
      src/VGearsGameState.h
  79. 0 0
      src/VGearsPrerequisites.h
  80. 0 0
      src/Version.h
  81. 5 5
      src/Version.h.in
  82. 0 0
      src/common/File.cpp
  83. 0 0
      src/common/File.h
  84. 0 0
      src/common/FileSystem.cpp
  85. 0 0
      src/common/FileSystem.h
  86. 0 0
      src/common/FinalFantasy7/FF7NameLookup.cpp
  87. 0 0
      src/common/FinalFantasy7/FF7NameLookup.h
  88. 0 0
      src/common/LzsFile.cpp
  89. 0 0
      src/common/LzsFile.h
  90. 0 0
      src/common/TypeDefine.cpp
  91. 0 0
      src/common/TypeDefine.h
  92. 0 0
      src/common/VGearsApplication.cpp
  93. 0 0
      src/common/VGearsApplication.h
  94. 0 0
      src/common/VGearsManualObject.cpp
  95. 0 0
      src/common/VGearsManualObject.h
  96. 0 0
      src/common/VGearsResource.cpp
  97. 0 0
      src/common/VGearsResource.h
  98. 0 0
      src/common/VGearsStringUtil.cpp
  99. 0 0
      src/common/VGearsStringUtil.h
  100. 0 0
      src/core/Assert.h

+ 0 - 2
.gitignore

@@ -7,10 +7,8 @@
 *.sln
 *.filters
 *.lib
-*.cmake
 *.log
 **/ogre.cfg
-**/Makefile
 **/CMakeCache.txt
 build/
 output/share

+ 92 - 0
CMake/FindOIS.cmake

@@ -0,0 +1,92 @@
+# Searches for an OIS installation
+#
+# Defines:
+#
+#   OIS_FOUND         True if OIS was found, else false
+#   OIS_LIBRARIES     Libraries to link
+#   OIS_INCLUDE_DIRS  The directories containing the header files
+#
+# To specify an additional directory to search, set OIS_ROOT.
+#
+# Author: Siddhartha Chaudhuri, 2008
+#
+
+SET(OIS_FOUND FALSE)
+
+IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")  # OS X
+
+  #INCLUDE(CMakeFindFrameworks)
+  #CMAKE_FIND_FRAMEWORKS(OIS)
+  SET(OIS_FRAMEWORKS ../../../dependencies/Frameworks/OIS.framework)
+  IF(OIS_FRAMEWORKS)
+    LIST(GET OIS_FRAMEWORKS 0 OIS_LIBRARIES)
+    SET(OIS_INCLUDE_DIRS ${OIS_LIBRARIES}/Headers)
+    SET(OIS_LDFLAGS -F${OIS_LIBRARIES}/.. -framework OIS)
+    SET(OIS_LIBRARY_DIRS)
+    SET(OIS_LIBRARIES)
+    SET(OIS_CFLAGS)
+
+    SET(OIS_FOUND TRUE)
+  ENDIF(OIS_FRAMEWORKS)
+
+ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")  # Windows, Linux etc
+
+  SET(OIS_INCLUDE_DOC "The directory containing OIS/OIS.h")
+  FIND_PATH(OIS_INCLUDE_DIRS NAMES OIS/OIS.h PATHS ${OIS_ROOT} ${OIS_ROOT}/include DOC ${OIS_INCLUDE_DOC} NO_DEFAULT_PATH)
+  IF(NOT OIS_INCLUDE_DIRS)  # now look in system locations
+    FIND_PATH(OIS_INCLUDE_DIRS NAMES OIS/OIS.h DOC ${OIS_INCLUDE_DOC})
+  ENDIF(NOT OIS_INCLUDE_DIRS)
+
+  IF(OIS_INCLUDE_DIRS)
+    SET(OIS_LIBRARY_DIRS ${OIS_INCLUDE_DIRS})
+    IF("${OIS_LIBRARY_DIRS}" MATCHES "/include$")
+      # Strip off the trailing "/include" in the path.
+      GET_FILENAME_COMPONENT(OIS_LIBRARY_DIRS ${OIS_LIBRARY_DIRS} PATH)
+    ENDIF("${OIS_LIBRARY_DIRS}" MATCHES "/include$")
+
+    IF(EXISTS "${OIS_LIBRARY_DIRS}/lib")
+      SET(OIS_LIBRARY_DIRS ${OIS_LIBRARY_DIRS}/lib)
+    ENDIF(EXISTS "${OIS_LIBRARY_DIRS}/lib")
+
+    IF(WIN32)  # Windows
+      FIND_LIBRARY(OIS_DEBUG_LIBRARY   NAMES OISd OIS_d libOISd libOIS_d
+                   PATH_SUFFIXES Debug ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Debug
+                   PATHS ${OIS_LIBRARY_DIRS} NO_DEFAULT_PATH)
+      FIND_LIBRARY(OIS_RELEASE_LIBRARY NAMES OIS libOIS
+                   PATH_SUFFIXES Release ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Release
+                   PATHS ${OIS_LIBRARY_DIRS} NO_DEFAULT_PATH)
+
+      SET(OIS_LIBRARIES)
+      IF(OIS_DEBUG_LIBRARY AND OIS_RELEASE_LIBRARY)
+        SET(OIS_LIBRARIES debug ${OIS_DEBUG_LIBRARY} optimized ${OIS_RELEASE_LIBRARY})
+      ELSEIF(OIS_DEBUG_LIBRARY)
+        SET(OIS_LIBRARIES ${OIS_DEBUG_LIBRARY})
+      ELSEIF(OIS_RELEASE_LIBRARY)
+        SET(OIS_LIBRARIES ${OIS_RELEASE_LIBRARY})
+      ENDIF(OIS_DEBUG_LIBRARY AND OIS_RELEASE_LIBRARY)
+    ELSE(WIN32)  # Linux etc
+      FIND_LIBRARY(OIS_LIBRARIES NAMES OIS
+                   PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
+                   PATHS ${OIS_LIBRARY_DIRS} NO_DEFAULT_PATH)
+    ENDIF(WIN32)
+
+    IF(OIS_LIBRARIES)
+      SET(OIS_FOUND TRUE)
+    ENDIF(OIS_LIBRARIES)
+  ENDIF(OIS_INCLUDE_DIRS)
+
+ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+
+IF(OIS_FOUND)
+  IF(NOT OIS_FIND_QUIETLY)
+    IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+      #MESSAGE(STATUS "Found OIS: ${OIS_LIBRARIES}")
+    ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+      #MESSAGE(STATUS "Found OIS: headers at ${OIS_INCLUDE_DIRS}, libraries at ${OIS_LIBRARIES}")
+    ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+  ENDIF(NOT OIS_FIND_QUIETLY)
+ELSE(OIS_FOUND)
+  IF(OIS_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "OIS not found")
+  ENDIF(OIS_FIND_REQUIRED)
+ENDIF(OIS_FOUND)

+ 1 - 4
CMake/FindOggVorbis.cmake

@@ -26,9 +26,6 @@ find_library(VORBIS_LIBRARY NAMES vorbis)
 find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
 find_library(VORBISENC_LIBRARY NAMES vorbisenc)
 
-message(VORBIS_INCLUDE_DIR: ${VORBIS_INCLUDE_DIR})
-message(VORBIS_LIBRARY: ${VORBIS_LIBRARY})
-
 mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
                  OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
 
@@ -57,7 +54,7 @@ endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISEN
 
 if (OGGVORBIS_FOUND)
    if (NOT OggVorbis_FIND_QUIETLY)
-      message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
+      #message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
    endif (NOT OggVorbis_FIND_QUIETLY)
 else (OGGVORBIS_FOUND)
    if (OggVorbis_FIND_REQUIRED)

+ 1 - 1
CMake/FindOpenAL.cmake

@@ -84,5 +84,5 @@ ENDIF(${OPENAL_INCLUDE_DIR} MATCHES ".framework")
 SET(OPENAL_FOUND "NO")
 IF(OPENAL_LIBRARY)
   SET(OPENAL_FOUND "YES")
-	MESSAGE(STATUS "OpenAL was found. ${OPENAL_LIBRARY}")
+  #MESSAGE(STATUS "OpenAL was found. ${OPENAL_LIBRARY}")
 ENDIF(OPENAL_LIBRARY)

+ 74 - 0
CMake/FindTinyXML.cmake

@@ -0,0 +1,74 @@
+##################################################################################################
+# 
+# CMake script for finding TinyXML.
+# 
+# Input variables:
+# 
+# - TinyXML_ROOT_DIR (optional): When specified, header files and libraries will be searched for in
+#     ${TinyXML_ROOT_DIR}/include
+#     ${TinyXML_ROOT_DIR}/libs
+#   respectively, and the default CMake search order will be ignored. When unspecified, the default
+#   CMake search order is used.
+#   This variable can be specified either as a CMake or environment variable. If both are set,
+#   preference is given to the CMake variable.
+#   Use this variable for finding packages installed in a nonstandard location, or for enforcing
+#   that one of multiple package installations is picked up.
+# 
+# 
+# Cache variables (not intended to be used in CMakeLists.txt files)
+# 
+# - TinyXML_INCLUDE_DIR: Absolute path to package headers.
+# - TinyXML_LIBRARY: Absolute path to library.
+# 
+# 
+# Output variables:
+# 
+# - TinyXML_FOUND: Boolean that indicates if the package was found
+# - TinyXML_INCLUDE_DIRS: Paths to the necessary header files
+# - TinyXML_LIBRARIES: Package libraries
+# 
+# 
+# Example usage:
+# 
+#  find_package(TinyXML)
+#  if(NOT TinyXML_FOUND)
+#    # Error handling
+#  endif()
+#  ...
+#  include_directories(${TinyXML_INCLUDE_DIRS} ...)
+#  ...
+#  target_link_libraries(my_target ${TinyXML_LIBRARIES})
+# 
+##################################################################################################
+
+# Get package location hint from environment variable (if any)
+if(NOT TinyXML_ROOT_DIR AND DEFINED ENV{TinyXML_ROOT_DIR})
+  set(TinyXML_ROOT_DIR "$ENV{TinyXML_ROOT_DIR}" CACHE PATH
+      "TinyXML base directory location (optional, used for nonstandard installation paths)")
+endif()
+
+# Search path for nonstandard package locations
+if(TinyXML_ROOT_DIR)
+  set(TinyXML_INCLUDE_PATH PATHS "${TinyXML_ROOT_DIR}/include" NO_DEFAULT_PATH)
+  set(TinyXML_LIBRARY_PATH PATHS "${TinyXML_ROOT_DIR}/lib"     NO_DEFAULT_PATH)
+endif()
+
+# Find headers and libraries
+find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH})
+find_library(TinyXML_LIBRARY  NAMES tinyxml   PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH})
+
+mark_as_advanced(TinyXML_INCLUDE_DIR
+                 TinyXML_LIBRARY)
+
+# Output variables generation
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY
+                                                      TinyXML_INCLUDE_DIR)
+
+set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable...
+unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args
+
+if(TinyXML_FOUND)
+  set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR})
+  set(TinyXML_LIBRARIES ${TinyXML_LIBRARY})
+endif()

+ 1 - 1
CMake/cotire.cmake

@@ -4207,6 +4207,6 @@ else()
 			"Defaults to empty string."
 	)
 
-	message (STATUS "cotire ${COTIRE_CMAKE_MODULE_VERSION} loaded.")
+	#message (STATUS "cotire ${COTIRE_CMAKE_MODULE_VERSION} loaded.")
 
 endif()

+ 36 - 337
CMakeLists.txt

@@ -1,377 +1,76 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.0)
 
-# on / off for verbose build.
+
+# Build verbosity: on / off.
 set(CMAKE_VERBOSE_MAKEFILE off)
 
+
+# C++ Standard.
 set(CMAKE_CXX_STANDARD 14)
 set(CMAKE_CXX_STANDARD_REQUIRED True)
 
+
+# Add cotire
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake")
 include(cotire)
 
 # Project Information.
 project(V-Gears)
 set(CMAKE_PACKAGE_ICON v-gears.png)
-set(VGears_VERSION__MAJOR 0)
-set(VGears_VERSION__MINOR 1)
-set(VGears_VERSION__PATCH 1)
-set(VGears_VERSION ${VGears_VERSION__MAJOR}.${VGears_VERSION__MINOR}.${VGears_VERSION__PATCH})
+set(VGEARS_VERSION_MAJOR 0)
+set(VGEARS_VERSION_MINOR 1)
+set(VGEARS_VERSION_PATCH 1)
+set(VGEARS_VERSION ${VGEARS_VERSION_MAJOR}.${VGEARS_VERSION_MINOR}.${VGEARS_VERSION_PATCH})
+
+
+# Project options.
+option(BUILD_INSTALLER "Build the V-Gears-Installer" TRUE)
+option(BUILD_TESTS "Build the unit tests" FALSE)
+option(MULTITHREADING "Enable multithreading" FALSE)
+
 
 # Generate version header.
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/V-Gears/include/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/V-Gears/include/Version.h) 
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h) 
+
 
+# Hanle build type
 if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
     # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
     # differentiation between debug and release builds.
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
-    message("CMAKE_BUILD_TYPE was empty defaulting to Release")
 endif()
 
-message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE} CMAKE_BINARY_DIR is ${CMAKE_BINARY_DIR}")
 
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
+#Output directories
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
-
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug/lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin_debug)
 
 # Enable Visual Studio solution "folders".
 SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
 
-#if (APPLE)
-    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
-    #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
-    #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
-#endif()
-
-set(CMAKE_FRAMEWORK_PATH
-    ${CMAKE_FRAMEWORK_PATH}
-    ${CMAKE_CURRENT_SOURCE_DIR}/OgreSDK/lib/macosx/Release
-    ${CMAKE_CURRENT_SOURCE_DIR}/OgreSDK/lib/macosx/Debug
-)
-
-set(OGRE_FRAMEWORK_INCLUDES
-    ${CMAKE_CURRENT_SOURCE_DIR}/OgreSDK/include
-)
-
-option(VGears_BUILD_PLUGINS "Build the plugins" TRUE)
-option(VGears_BUILD_UTILITIES "Build the V-Gears-Installer" TRUE)
-option(VGears_BUILD_TESTS "Build the unit tests" FALSE)
-option(VGears_MULTITHREADING "Enable multithreading" FALSE)
-option(VGears_SOUND "Enable Sound" TRUE)
-
-find_path(OGRE_CMAKE_MODULE_PATH FindOGRE.cmake
-    HINTS
-    "$ENV{OGRE_HOME}/CMake/"
-    "/usr/local/lib/OGRE/cmake"
-    "/usr/lib/OGRE/cmake"
-    "/usr/share/OGRE/cmake/modules"
-    "${CMAKE_CURRENT_SOURCE_DIR}/OgreSDK/CMake"
-)
-if(OGRE_CMAKE_MODULE_PATH-NOTFOUND)
-    message(SEND_ERROR "Failed to find OGRE module path.")
-else()
-    set(CMAKE_MODULE_PATH "${OGRE_CMAKE_MODULE_PATH};${CMAKE_MODULE_PATH}")
-endif()
-
-set(VGears_SOURCE_DIR ${CMAKE_SOURCE_DIR})
-
-message("VGears_SOURCE_DIR ${VGears_SOURCE_DIR}")
-
-set(CMAKE_MODULE_PATH "${OGRE_CMAKE_MODULE_PATH};${CMAKE_MODULE_PATH}")
-set(CMAKE_MODULE_PATH 
-    "${CMAKE_MODULE_PATH}"
-    "${CMAKE_SOURCE_DIR}/CMake"
-)
 
+# Global configurations.
 set(CMAKE_DEBUG_POSTFIX "_d")
-
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-    set(CMAKE_INSTALL_PREFIX
-        "${VGears_SOURCE_DIR}/data" CACHE PATH "V-Gears install prefix" FORCE
+    set(CMAKE_CURRENT_SOURCE_DIR
+        "${VGEARS_SOURCE_DIR}/data" CACHE PATH "V-Gears install prefix" FORCE
     )
 endif()
 
-find_package(Qt5Widgets REQUIRED)
-find_package(ZLIB REQUIRED)
-find_package(OGRE REQUIRED)
-
-# Find Boost
-if(NOT OGRE_BUILD_PLATFORM_IPHONE)
-    if(WIN32)
-        set(Boost_USE_STATIC_LIBS TRUE)
-    else()
-        # Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
-        set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
-    endif ()
-    if(MINGW)
-        # This is probably a bug in CMake: the boost find module tries to look for
-        # boost libraries with name libboost_*, but CMake already prefixes library
-        # search names with "lib". This is the workaround.
-        set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
-    endif ()
-
-    set(Boost_ADDITIONAL_VERSIONS "1.55" "1.55.0" "1.53" "1.53.0" "1.52" "1.52.0" "1.51" "1.51.0" "1.50" "1.50.0" "1.49" "1.49.0" "1.48" "1.48.0" "1.47" "1.47.0" "1.46" "1.46.0" "1.45" "1.45.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40")
-    # Components that need linking (NB does not include header-only components like bind)
-    set(OGRE_BOOST_COMPONENTS thread date_time)
-    find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
-    if (NOT Boost_FOUND)
-        set(Boost_USE_STATIC_LIBS NOT ${Boost_USE_STATIC_LIBS})
-        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
-    endif()
-
-    if(Boost_FOUND AND Boost_VERSION GREATER 104900)
-        set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
-        find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
-    endif()
-
-    # Set up referencing of Boost
-    include_directories(${Boost_INCLUDE_DIR})
-    if (NOT APPLE)
-        add_definitions(-DBOOST_ALL_NO_LIB)
-    endif()
-
-    set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
-
-    find_package(Boost COMPONENTS program_options filesystem QUIET)
-    set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
-    set(VGears_LIBRARIES ${OGRE_LIBRARIES})
-
-    if(VGears_SOUND)
-        find_package(OpenAL REQUIRED)
-        find_package(OggVorbis REQUIRED)
-        add_definitions(-DVGears_SOUND)
-        set(VGears_LIBRARIES
-            ${VGears_LIBRARIES}
-            ${OPENAL_LIBRARY}
-            ${OGGVORBIS_LIBRARIES}
-        )
-    endif()
-
-    if(VGears_MULTITHREADING)
-        # Find Threads
-        find_package (Threads REQUIRED)
-        set(VGears_LIBRARIES
-            ${VGears_LIBRARIES}
-            ${CMAKE_THREAD_LIBS_INIT}
-        )
-    endif()
-
-    if(VGears_BUILD_TESTS)
-        #message(STATUS "Looking for boost unit test..")
-        find_package(Boost COMPONENTS unit_test_framework REQUIRED)
-        set(VGears_TEST_LIBRARIES
-            ${OGRE_LIBRARIES}
-            ${Boost_LIBRARIES}
-        )
-        # Enable CTest.
-        enable_testing()
-        endif()
-endif()
-
-set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_Overlay_LIBRARIES})
-
-find_package(Boost COMPONENTS unit_test_framework REQUIRED)
-
-if (Boost_LIBRARIES STREQUAL "")
-    message(SEND_ERROR "Boost_LIBRARIES is not set")
-endif()
-
-set(VGears_INCLUDE_DIRS
-    ${VGears_INCLUDE_DIRS}
-    ${CMAKE_CURRENT_SOURCE_DIR}/V-Gears/include/
-    ${OIS_INCLUDE_DIRS}
-    ${OGRE_Overlay_INCLUDE_DIRS}
-    ${CMAKE_CURRENT_SOURCE_DIR}/lib
-    ${CMAKE_CURRENT_BINARY_DIR}/lib/luajit
-    ${CMAKE_CURRENT_SOURCE_DIR}/lib/luajit/src
-    ${CMAKE_CURRENT_SOURCE_DIR}/lib/luabind
-    ${CMAKE_CURRENT_SOURCE_DIR}/lib/luabind/luabind/detail
-    ${CMAKE_CURRENT_SOURCE_DIR}/lib/tinyxml
-)
-
-if (MSVC)
-    # Build cpp files on all cores, up virtual mem for PCH's as cotire really makes the compiler scream
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Zm193")
-    # Shut up about insecure functions, as this is cross platform code we can't use the Win32 specifc functions
-    add_definitions( -D_CRT_SECURE_NO_WARNINGS )
-endif()
-
-if (UNIX AND $ENV{COVERAGE}==1)
-      message("Setting coverage compiler options")
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") # debug, no optimisation
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") # enabling coverage
-endif()
-
-#Compiler flags
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # Position Independent Code, required if QT is compiled with -reduce-relocations
-
-#TODO: Force DEBUG, no optimizations for now.
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
-
-add_definitions(-DTIXML_USE_STL)
+# First, build external libraries (luabind and luajit).
 add_subdirectory(lib)
-add_subdirectory(V-Gears)
-
-if(VGears_BUILD_PLUGINS)
-    add_subdirectory(PlugIns)
-endif()
-
-if(VGears_BUILD_UTILITIES)
-    add_subdirectory(V-Gears-Installer)
-endif()
-
-if(VGears_BUILD_TESTS)
-    add_subdirectory(Tests)
-endif()
-
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/output)
-
-# Set generic CPack properties
-# DO NOT include on win32 - causes CRT dlls to be included
-#INCLUDE(InstallRequiredSystemLibraries)
-
-set(CPACK_PACKAGE_NAME "v-gears")
-SET(CPACK_PACKAGE_VERSION ${VGears_VERSION})
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A free implementation of the Final Fantasy VII Engine")
-SET(CPACK_PACKAGE_VENDOR "V-Gears team")
-# TODO: Need to set these up properly, installing build instructions is a bit strange :)
-SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.txt")
-#SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/readme.md")
-
-MESSAGE( STATUS "CMAKE_BUILD_TYPE:         " ${CMAKE_BUILD_TYPE} )
-
-INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/data/field_models_and_animation_metadata.xml" DESTINATION ".")
-
-#OS SPECIFIC
-if(WIN32)
-    # On Windows generate MSI packages
-    SET(CPACK_GENERATOR "WIX")
-    SET(CPACK_WIX_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/wix.template.in")
-    SET(CPACK_WIX_UPGRADE_GUID 8fbb893f-5622-4f6d-a7f6-c221f7be5d52)
-    # TODO: Set MSI banner image, copyright info etc, also include startmenu/desktop shortcuts
-    #set the name of the installer default formating is name-version-os
-    # If empty assume release
-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-        message("RELEASE installer build")
-        install(FILES ${PROJECT_SOURCE_DIR}/output/resources.cfg DESTINATION ./)
-        install(FILES ${PROJECT_SOURCE_DIR}/output/plugins.cfg DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/release/OgreMain.dll DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/release/RenderSystem_GL.dll DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/release/OGREOVERLAY.DLL DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/release/OIS.DLL DESTINATION ./)
-        install(FILES ${QT_PLUGINS_DIR}/../bin/QtCore4.dll DESTINATION ./)
-        install(FILES ${QT_PLUGINS_DIR}/../bin/QtGui4.dll DESTINATION ./)
-    else()
-        message("DEBUG installer build")
-        install(FILES ${PROJECT_SOURCE_DIR}/output/resources_d.cfg DESTINATION ./)
-        install(FILES ${PROJECT_SOURCE_DIR}/output/plugins_d.cfg DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/debug/OgreMain_d.dll DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/debug/RenderSystem_GL_d.dll DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/debug/OGREOVERLAY_D.DLL DESTINATION ./)
-        install(FILES ${OGRE_CMAKE_MODULE_PATH}/../bin/debug/OIS_D.DLL DESTINATION ./)
-        install(FILES ${QT_PLUGINS_DIR}/../bin/QtCored4.dll DESTINATION ./)
-        install(FILES ${QT_PLUGINS_DIR}/../bin/QtGuid4.dll DESTINATION ./)
-    endif()
-elseif(APPLE)
-    # APPLE is also UNIX, so must check for APPLE before UNIX
-    SET(CPACK_GENERATOR "DragNDrop")
-    if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-       set(OSX_BIN_DIR "${CMAKE_BINARY_DIR}/bin_release")
-       message("DEBUG installer build, CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} OSX_BIN_DIR=${OSX_BIN_DIR}")
-    else()
-       set(OSX_BIN_DIR "${CMAKE_BINARY_DIR}/bin_debug")
-       message("RELEASE installer build, CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} OSX_BIN_DIR=${OSX_BIN_DIR}")
-    endif()
-    install(FILES ${PROJECT_SOURCE_DIR}/output/resources.cfg DESTINATION ./)
-    install(FILES ${PROJECT_SOURCE_DIR}/output/plugins.cfg DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/Ogre DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/RenderSystem_GL DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/OgreOverlay DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_thread-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_date_time-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_system-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_atomic-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_chrono-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_program_options-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_filesystem-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/libboost_filesystem-mt.dylib DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/QtCore DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/QtGui DESTINATION ./)
-    install(FILES ${OSX_BIN_DIR}/liblua.dylib DESTINATION ./)
-elseif(UNIX)
-    # On Linux generate TAR.GZ,DEB and RPM packages
-    # Find out what architecture are we running on and set the package architecture 
-    
-    # Set the generic files needing to be installed
-    install(FILES ${PROJECT_SOURCE_DIR}/v-gears.png DESTINATION ./share/pixmaps/ )
-    install(FILES ${PROJECT_SOURCE_DIR}/v-gears.desktop DESTINATION ./share/applications/ )
-    install(FILES ${PROJECT_SOURCE_DIR}/debian/menu DESTINATION share/menu/ RENAME v-gears )
-    install(FILES ${PROJECT_SOURCE_DIR}/output/plugins.cfg_linux DESTINATION share/v-gears/ RENAME plugins.cfg PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_WRITE WORLD_READ)
-    install(FILES ${PROJECT_SOURCE_DIR}/output/resources.cfg_linux DESTINATION share/v-gears/ RENAME resources.cfg PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_WRITE WORLD_READ)
-    install(FILES ${PROJECT_SOURCE_DIR}/output/v-gears.cfg_linux DESTINATION share/v-gears/ RENAME v-gears.cfg PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_WRITE WORLD_READ)
-        
-    if(EXISTS "/usr/lib/x86_64-linux-gnu/OGRE/RenderSystem_GL.so.1.12.10")
-        install(FILES /usr/lib/x86_64-linux-gnu/OGRE/RenderSystem_GL.so.1.12.10 DESTINATION lib/v-gears/plugins/ )
-    elseif(EXISTS "/usr/lib/i386-linux-gnu/OGRE/RenderSystem_GL.so.1.12.10")
-        install(FILES /usr/lib/i386-linux-gnu/OGRE/RenderSystem_GL.so.1.12.10 DESTINATION lib/v-gears/plugins/ )
-    endif()
-        
-    SET(CPACK_SOURCE_GENERATOR "TGZ;TZ")
-    SET(CPACK_GENERATOR "TGZ")
-    # Detect Distro Family DEB , RPM.
-    if(EXISTS "/etc/lsb-release")
-        set(DistroType DEB)
-    elseif(EXISTS "/etc/debian_release")
-        set(DistroType DEB)
-    elseif(EXISTS "/etc/fedora-release")
-        set(DistroType RPM)
-    endif()
-    message(STATUS "Distro Detected: ${DistroType} ")
 
-    if(DistroType MATCHES "DEB")
-        # Setup DEB package properties
-        MESSAGE(STATUS "DEB ADDED TO GENERATION LIST")
-        SET(CPACK_GENERATOR "${CPACK_GENERATOR};DEB")
-    endif()
-    if(EXISTS "/usr/bin/rpmbuild")
-        MESSAGE(STATUS "RPM ADDED TO GENERATION LIST (RPM IS DISABLED IN CMAKELISTS)")
-        # Uncomment to allow for rpm files to be built.   
-        # SET(CPACK_GENERATOR "${CPACK_GENERATOR};RPM")
-    endif()
+# Build v-gears (and, if requested, the installer).
+add_subdirectory(src)
 
-    # Setup DEB package properties
-    # TODO
-    SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Iñigo Valentin <i@v.com>")
-    
-    #Set DEBIAN INFO
-    SET(CPACK_DEBIAN_PACKAGE_SECTION games)
-    SET(CPACK_DEBIAN_PACKAGE_PRIORITY extra)
-    #SET(CPACK_PACKAGE_EXECUTABLE )
-    EXECUTE_PROCESS(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
-    MESSAGE (STATUS "Architecture: ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
-    # We should need no longer need postinst since we have added extra install steps to what it would.
-    #SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_SOURCE_DIR}/debian/postinst )
-    # Set the name to be debian package like.
-    SET(CPACK_PACKAGE_FILE_NAME "v-gears_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
-    #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.9, libois,libboost-program-options,libboost-filesystem,libvorbis,libopenal,libboost-test,zlib1g")
-    SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.9.0, libois-1.3.0,libboost-program-options1.54.0,libboost-filesystem1.54.0,libvorbis0a,libvorbisfile3,libvorbisenc2,libopenal1,libboost-test1.54.0,zlib1g,liblua5.1-0")
-    #Set RPM info
-    SET(CPACK_RPM_PACKAGE_SUMMARY CPACK_PACKAGE_DESCRIPTION_SUMMARY)
-    SET(CPACK_RPM_PACKAGE_NAME CPACK_PACKAGE_NAME)
-    SET(CPACK_RPM_PACKAGE_VERSION CPACK_PACKAGE_VERSION)
-    SET(CPACK_RPM_PACKAGE_RELEASE 1)
-    SET(CPACK_RPM_PACKAGE_LICENSE "GPLv3+")
-    SET(CPACK_RPM_PACKAGE_GROUP games)
-    SET(CPACK_RPM_PACKAGE_VENDOR)
-    SET(CPACK_RPM_PACKAGE_DESCRIPTION)
-    #REQUIREMENTS NEED TO BE CHECKED USING FEDORA.
-    #SET(CPACK_RPM_PACKAGE_REQUIRES "ogre,ois,boost,vorbis,lua,zlib1g")
+# If requested, build tests
+if(BUILD_TESTS)
+    add_subdirectory(test)
 endif()
 
-SET_PROPERTY(TARGET LuaBind PROPERTY FOLDER "3rdparty")
 
-INCLUDE(CPack)
-#End of install instructions
+# TODO: Generate Installer (.msi, .deb, .appImage...)

+ 9 - 9
PlugIns/Data/CMakeLists.txt

@@ -1,17 +1,17 @@
-set(V-Gears_SOURCE_DIR ../../V-Gears)
+set(V-Gears_SOURCE_DIR ../../src)
 
 # Define header and source files for the library.
 set(HEADER_FILES
-    ${V-Gears_SOURCE_DIR}/include/VGearsPrerequisites.h
-    ${V-Gears_SOURCE_DIR}/include/common/VGearsManualObject.h
-    ${V-Gears_SOURCE_DIR}/include/common/VGearsStringUtil.h
-    ${V-Gears_SOURCE_DIR}/include/common/TypeDefine.h
+    ${V-Gears_SOURCE_DIR}/VGearsPrerequisites.h
+    ${V-Gears_SOURCE_DIR}/common/VGearsManualObject.h
+    ${V-Gears_SOURCE_DIR}/common/VGearsStringUtil.h
+    ${V-Gears_SOURCE_DIR}/common/TypeDefine.h
     include/VGearsDataPlugin.h
 )
 set(SOURCE_FILES
-    ${V-Gears_SOURCE_DIR}/src/common/VGearsManualObject.cpp
-    ${V-Gears_SOURCE_DIR}/src/common/VGearsStringUtil.cpp
-    ${V-Gears_SOURCE_DIR}/src/common/TypeDefine.cpp
+    ${V-Gears_SOURCE_DIR}/common/VGearsManualObject.cpp
+    ${V-Gears_SOURCE_DIR}/common/VGearsStringUtil.cpp
+    ${V-Gears_SOURCE_DIR}/common/TypeDefine.cpp
     src/VGearsDataPlugin.cpp
     src/VGearsDataPluginDll.cpp
 )
@@ -20,7 +20,7 @@ include_directories(
     ${OIS_INCLUDE_DIRS}
     ${OGRE_INCLUDE_DIRS}
     ${OGRE_SAMPLES_INCLUDEPATH}
-    ${V-Gears_SOURCE_DIR}/include
+    ${V-Gears_SOURCE_DIR}
     ${CMAKE_CURRENT_SOURCE_DIR}/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../lib
 )

+ 1 - 1
PlugIns/Data/include/VGearsDataPlugin.h

@@ -15,7 +15,7 @@
 
 #pragma once
 
-#include <OgrePlugin.h>
+#include <Ogre/OgrePlugin.h>
 
 #include "data/VGearsBackgroundFileManager.h"
 #include "data/VGearsPaletteFileManager.h"

+ 1 - 1
PlugIns/Data/src/VGearsDataPluginDll.cpp

@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  */
 
-#include <OgreRoot.h>
+#include <Ogre/OgreRoot.h>
 #include "VGearsDataPlugin.h"
 
 #ifndef VGEARS_STATIC_LIB

+ 1 - 1
PlugIns/Data/test/tex_file_info.cpp

@@ -19,7 +19,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/program_options.hpp>
-#include <OgreDataStream.h>
+#include <Ogre/OgreDataStream.h>
 #include "data/VGearsTexFile.h"
 
 using std::back_inserter;

+ 1 - 1
PlugIns/Data/test/tex_file_test.cpp

@@ -26,7 +26,7 @@ THE SOFTWARE.
 
 #include <fstream>
 
-#include <OgreDataStream.h>
+#include <Ogre/OgreDataStream.h>
 
 #include "data/VGearsTexFile.h"
 

+ 0 - 12
Tests/CMakeLists.txt

@@ -1,12 +0,0 @@
-add_definitions(
-    -DBOOST_TEST_MODULE="standalone"
-)
-
-if(UNIX OR APPLE)
-    add_definitions(-DBOOST_TEST_DYN_LINK)
-endif()
-
-set(V-Gears_SOURCE_DIR ${VGears_SOURCE_DIR}/V-Gears)
-
-add_subdirectory(V-Gears)
-add_subdirectory(FinalFantasy7)

+ 0 - 31
Tests/FinalFantasy7/CMakeLists.txt

@@ -1,31 +0,0 @@
-file(COPY misc DESTINATION .)
-
-include_directories(
-    ${VGears_INCLUDE_DIRS}
-    ${V-Gears_SOURCE_DIR}/include
-    ${VGears_SOURCE_DIR}/SupportedGames/FinalFantasy7/include
-)
-
-set(LIBRARIES
-    ${VGears_TEST_LIBRARIES}
-    FinalFantasy7
-    V-Gears
-    v-gears-data
-)
-
-add_executable(TestFF7FLevelFileSerializer src/test_FF7FLevelFileSerializer)
-SET_PROPERTY(TARGET TestFF7FLevelFileSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestFF7FLevelFileSerializer ${LIBRARIES})
-
-add_executable(TestFF7ModelListFileSerializer src/test_FF7ModelListFileSerializer.cpp)
-SET_PROPERTY(TARGET TestFF7ModelListFileSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestFF7ModelListFileSerializer ${LIBRARIES})
-add_test(NAME TestFF7ModelListFileSerializer COMMAND TestFF7ModelListFileSerializer)
-
-add_executable(TestFF7WalkmeshFileSerializer src/test_FF7WalkmeshFileSerializer.cpp)
-SET_PROPERTY(TARGET TestFF7WalkmeshFileSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestFF7WalkmeshFileSerializer ${LIBRARIES})
-add_test(NAME TestFF7WalkmeshFileSerializer COMMAND TestFF7WalkmeshFileSerializer)

BIN
Tests/FinalFantasy7/misc/reference.flevel


BIN
Tests/FinalFantasy7/misc/reference.flevel.png


BIN
Tests/FinalFantasy7/misc/reference.model_list


BIN
Tests/FinalFantasy7/misc/reference.walkmesh


BIN
Tests/FinalFantasy7/misc/reference_compressed.flevel


BIN
Tests/FinalFantasy7/misc/reference_compressed.flevel.png


+ 0 - 160
Tests/FinalFantasy7/src/test_FF7FLevelFileSerializer.cpp

@@ -1,160 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-24 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsFLevelFileSerializer.h"
-
-#include "data/VGearsBackgroundFileManager.h"
-#include "data/VGearsCameraMatrixFileManager.h"
-#include "data/VGearsHRCFileManager.h"
-#include "data/VGearsPaletteFileManager.h"
-#include "data/VGearsLZSFLevelFileManager.h"
-#include "data/FF7ModelListFileManager.h"
-#include "map/VGearsBackground2DFileManager.h"
-#include "map/VGearsWalkmeshFileManager.h"
-
-using namespace Ogre;
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::FLevelFile
-    {
-    public:
-        TestFile() : VGears::FLevelFile( NULL, "reference.flevel", 0, "General" ) {}
-    };
-
-    class TestTexture : public Texture
-    {
-    public:
-        TestTexture( ResourceManager* creator, const String& name, ResourceHandle handle,
-                  const String& group, bool isManual = false, ManualResourceLoader* loader = 0 )
-            : Texture( creator, name, handle, group, isManual, loader )
-        {}
-
-    protected:
-        virtual void loadImpl() {}
-        virtual void unloadImpl() {}
-        // IVV compiler error
-        //virtual HardwarePixelBufferSharedPtr getBuffer( size_t, size_t ){ return HardwarePixelBufferSharedPtr( NULL ); }
-        virtual void createInternalResourcesImpl(){}
-        virtual void freeInternalResourcesImpl(){}
-    };
-
-    class TestTextureManager : public TextureManager
-    {
-    public:
-        virtual PixelFormat getNativeFormat( TextureType ttype, PixelFormat format, int usage )
-        {
-            return format;
-        }
-        virtual bool    isHardwareFilteringSupported( TextureType ttype, PixelFormat format, int usage, bool preciseFormatOnly=false )
-        {
-            return false;
-        }
-
-    protected:
-        virtual Resource* createImpl( const String &name
-          , ResourceHandle handle, const String &group, bool isManual
-          , ManualResourceLoader *loader
-          , const NameValuePairList *createParams )
-        {
-            return new TestTexture( this, name, handle, group, isManual, loader );
-        }
-    };
-
-
-    LogManager                          logMgr;
-    Root                                root("","");
-    ResourceGroupManager               &rgm( ResourceGroupManager::getSingleton() );
-    TestTextureManager                  tmgr;
-    VGears::CameraMatrixFileManager     cmgr;
-    VGears::WalkmeshFileManager         wmgr;
-    VGears::PaletteFileManager          pmgr;
-    VGears::BackgroundFileManager       bmgr;
-    VGears::Background2DFileManager     b2mgr;
-    VGears::ModelListFileManager   mmgr;
-    VGears::HRCFileManager              hmgr;
-    VGears::LZSFLevelFileManager        fmgr;
-    logMgr.createLog( "Default Log", true, true, true );
-
-    rgm.addResourceLocation( "misc", "FileSystem" );
-    rgm.initialiseAllResourceGroups();
-
-    TestFile        file;
-    DataStreamPtr   stream( rgm.openResource( file.getName(), file.getGroup() ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    VGears::FLevelFileSerializer    ser;
-    ser.importFLevelFile( stream, &file );
-    BOOST_CHECK_EQUAL( 757890, stream->tell() );
-
-    VGears::BackgroundFilePtr       background   ( file.getBackground() );
-    VGears::CameraMatrixFilePtr     camera_matrix( file.getCameraMatrix() );
-    VGears::ModelListFilePtr   model_list   ( file.getModelList() );
-    VGears::PaletteFilePtr          palette      ( file.getPalette() );
-    VGears::WalkmeshFilePtr         walkmesh     ( file.getWalkmesh() );
-
-    BOOST_REQUIRE(background != nullptr);
-    BOOST_REQUIRE(camera_matrix != nullptr);
-    BOOST_REQUIRE(model_list != nullptr);
-    BOOST_REQUIRE(palette != nullptr);
-    BOOST_REQUIRE(walkmesh != nullptr);
-    BOOST_CHECK_EQUAL( "reference.background", background->getName() );
-    BOOST_CHECK_EQUAL( "reference.cam_matrix", camera_matrix->getName() );
-    BOOST_CHECK_EQUAL( "reference.model_list", model_list->getName() );
-    BOOST_CHECK_EQUAL( "reference.palette"   , palette->getName() );
-    BOOST_CHECK_EQUAL( "reference.walkmesh"  , walkmesh->getName() );
-    Matrix3 m3_expected(
-        1, -0, -0
-       ,0, -1, -0
-       ,0, -0, -1
-    );
-    BOOST_CHECK_EQUAL( m3_expected, camera_matrix->getMatrix() );
-    BOOST_CHECK_EQUAL( Vector3( -1, 2, -3 ), camera_matrix->getPosition() );
-    BOOST_CHECK_EQUAL( 2, camera_matrix->getCount() );
-    BOOST_CHECK_EQUAL( 12345, camera_matrix->getFocalLength() );
-
-
-    Ogre::Image *image( background->createImage( palette ) );
-    // TODO: FIX ME ON OSX
-    //image->save( file.getName() + ".png" );
-    delete image;
-
-    VGears::FLevelFilePtr lzs_file = fmgr.load( "reference_compressed.flevel", "General" ).staticCast<VGears::FLevelFile>();
-    BOOST_CHECK(lzs_file->getPalette() != nullptr);
-    BOOST_CHECK(lzs_file->getBackground() != nullptr);
-
-    image = lzs_file->getBackground()->createImage( lzs_file->getPalette() );
-    // TODO: FIX ME ON OSX
-    //image->save( lzs_file->getName() + ".png" );
-    delete image;
-
-    lzs_file.reset();
-    logMgr.destroyLog( "Default Log" );
-    stream->close();
-}

+ 0 - 83
Tests/FinalFantasy7/src/test_FF7ModelListFileSerializer.cpp

@@ -1,83 +0,0 @@
-/*
------------------------------------------------------------------------------
-Copyright (c) 07.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-This file is part of V-Gears
-
-V-Gears is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.0 (GPLv2) of the License.
-
-V-Gears is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "data/FF7ModelListFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::ModelListFile
-    {
-    public:
-        TestFile() : VGears::ModelListFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {}
-    };
-    const char* file_name( "misc/reference.model_list" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    Ogre::LogManager                        logMgr;
-    VGears::ModelListFileSerializer    ser;
-    TestFile                                f;
-
-    logMgr.createLog( "Default Log", true, true, true );
-
-    ser.importModelListFile( stream, &f );
-    BOOST_CHECK_EQUAL( 1314, stream->tell() );
-
-    BOOST_CHECK_EQUAL( 512, f.getScale() );
-
-    VGears::ModelListFile::ModelList &models( f.getModels() );
-    BOOST_CHECK_EQUAL( 10, models.size() );
-
-    VGears::ModelListFile::ModelDescription &m1( models.front() );
-    BOOST_CHECK_EQUAL( "md1stinmain_n_cloud.char", m1.name );
-    BOOST_CHECK_EQUAL( "AAAA.HRC", m1.hrc_name );
-    BOOST_CHECK_EQUAL( "512", m1.scale );
-    VGears::ModelListFile::AnimationList &animations1( m1.animations );
-    BOOST_CHECK_EQUAL( 4, animations1.size() );
-    VGears::ModelListFile::AnimationDescription &a1_1( animations1.front() );
-    BOOST_CHECK_EQUAL( "ACFE.aki", a1_1.name );
-    BOOST_CHECK_EQUAL( 1, a1_1.unknown );
-    VGears::ModelListFile::AnimationDescription &a1_2( animations1.back() );
-    BOOST_CHECK_EQUAL( "BVJF.yos", a1_2.name );
-    BOOST_CHECK_EQUAL( 1, a1_2.unknown );
-
-    VGears::ModelListFile::ModelDescription &m2( models.back() );
-    BOOST_CHECK_EQUAL( "md1stinshinra_guard.char", m2.name );
-    BOOST_CHECK_EQUAL( "AZHE.HRC", m2.hrc_name );
-    BOOST_CHECK_EQUAL( "512", m2.scale );
-    VGears::ModelListFile::AnimationList &animations2( m2.animations );
-    BOOST_CHECK_EQUAL( 8, animations2.size() );
-    VGears::ModelListFile::AnimationDescription &a2_1( animations2.front() );
-    BOOST_CHECK_EQUAL( "AAFE.aki", a2_1.name );
-    BOOST_CHECK_EQUAL( 1, a2_1.unknown );
-    VGears::ModelListFile::AnimationDescription &a2_2( animations2.back() );
-    BOOST_CHECK_EQUAL( "BXIA.yos", a2_2.name );
-    BOOST_CHECK_EQUAL( 1, a2_2.unknown );
-
-    logMgr.destroyLog( "Default Log" );
-
-    ifs->close();
-}

+ 0 - 71
Tests/FinalFantasy7/src/test_FF7WalkmeshFileSerializer.cpp

@@ -1,71 +0,0 @@
-/*
------------------------------------------------------------------------------
-Copyright (c) 06.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-This file is part of V-Gears
-
-V-Gears is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.0 (GPLv2) of the License.
-
-V-Gears is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "map/FF7WalkmeshFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::WalkmeshFile
-    {
-    public:
-        TestFile() : VGears::WalkmeshFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {}
-    };
-    const char* file_name( "misc/reference.walkmesh" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    Ogre::LogManager                    logMgr;
-    VGears::WalkmeshFileSerializer ser;
-    TestFile                            f;
-
-    logMgr.createLog( "Default Log", true, true, true );
-
-    ser.importWalkmeshFile( stream, &f );
-    VGears::WalkmeshFile::TriangleList &triangles( f.getTriangles() );
-    BOOST_CHECK_EQUAL( 39, triangles.size() );
-
-    VGears::WalkmeshFile::Triangle &t1( triangles.front() );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 3784, 27544, 325 ), t1.a );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 3778, 27434, 325 ), t1.b );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 3751, 27410, 310 ), t1.c );
-    BOOST_CHECK_EQUAL( 26, t1.access_side[0] );
-    BOOST_CHECK_EQUAL( -1, t1.access_side[1] );
-    BOOST_CHECK_EQUAL(  1, t1.access_side[2] );
-
-    VGears::WalkmeshFile::Triangle &t2( triangles.back() );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 3506, 29251, 432 ), t2.a );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 3527, 29405, 432 ), t2.b );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 3566, 29245, 400 ), t2.c );
-    BOOST_CHECK_EQUAL( -1, t2.access_side[0] );
-    BOOST_CHECK_EQUAL( 37, t2.access_side[1] );
-    BOOST_CHECK_EQUAL( -1, t2.access_side[2] );
-
-    BOOST_CHECK_EQUAL( 1174, stream->tell() );
-
-    logMgr.destroyLog( "Default Log" );
-
-    ifs->close();
-}

+ 0 - 60
Tests/VGearsMain/CMakeLists.txt

@@ -1,60 +0,0 @@
-file(COPY misc DESTINATION .)
-
-include_directories(
-    ${VGears_INCLUDE_DIRS}
-    ${V-Gears_SOURCE_DIR}/include
-)
-
-set(LIBRARIES
-    ${VGears_TEST_LIBRARIES}
-    V-Gears
-    v-gears-data
-)
-
-add_executable(TestVGearsAFileSerializer src/test_VGearsAFileSerializer.cpp)
-SET_PROPERTY(TARGET TestVGearsAFileSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestVGearsAFileSerializer ${LIBRARIES})
-add_test(NAME TestVGearsAFileSerializer COMMAND TestVGearsAFileSerializer)
-
-add_executable(TestVGearsMapFileXMLSerializer src/test_VGearsMapFileXMLSerializer.cpp)
-SET_PROPERTY(TARGET TestVGearsMapFileXMLSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestVGearsMapFileXMLSerializer ${LIBRARIES})
-add_test(NAME TestVGearsMapFileXMLSerializer COMMAND TestVGearsMapFileXMLSerializer)
-
-# Field walk mesh.
-add_executable(TestVGearsWalkmeshFileXMLSerializer src/test_VGearsWalkmeshFileXMLSerializer.cpp)
-SET_PROPERTY(TARGET TestVGearsWalkmeshFileXMLSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestVGearsWalkmeshFileXMLSerializer ${LIBRARIES})
-add_test(NAME TestVGearsWalkmeshFileXMLSerializer COMMAND TestVGearsWalkmeshFileXMLSerializer)
-
-# LGP archive.
-add_executable(TestVGearsLGPArchive src/test_VGearsLGPArchive.cpp)
-SET_PROPERTY(TARGET TestVGearsLGPArchive PROPERTY FOLDER "tests")
-
-target_link_libraries(TestVGearsLGPArchive ${LIBRARIES})
-add_test(NAME TestVGearsLGPArchive COMMAND TestVGearsLGPArchive)
-
-# HRC archive.
-add_executable(TestVGearsHRCSerializer src/test_VGearsHRCSerializer.cpp)
-SET_PROPERTY(TARGET TestVGearsHRCSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestVGearsHRCSerializer ${LIBRARIES})
-add_test(NAME TestVGearsHRCSerializer COMMAND TestVGearsHRCSerializer)
-
-# World Map
-add_executable(TestMapSerializer src/test_MapSerializer.cpp)
-SET_PROPERTY(TARGET TestMapSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestMapSerializer ${LIBRARIES})
-# TODO FIX ME - test not currently working.
-#add_test(TestMapSerializer TestMapSerializer)
-
-add_executable(TestTxzSerializer src/test_TxzSerializer.cpp)
-SET_PROPERTY(TARGET TestTxzSerializer PROPERTY FOLDER "tests")
-
-target_link_libraries(TestTxzSerializer ${LIBRARIES})
-# TODO FIX ME - test not currently working
-#add_test(TestTxzSerializer TestTxzSerializer)

+ 0 - 23
Tests/VGearsMain/misc/map.xml

@@ -1,23 +0,0 @@
-<map>
-    <script file_name="path/to/script.lua" />
-    <background2d file_name="background_2d_resource_name" />
-    <walkmesh file_name="walkmesh_resource_name" />
-    <movement_rotation degree="-5.625" />
-    <entity_script name="Director" />
-    <!--entity_model name="Cloud" file_name="models/ffvii/field/units/cloud.mesh" position="29.0547 229.234 2.56082" direction="0" /-->
-    <entity_model name="Cloud" file_name="n_cloud.mesh" position="29.0547 229.234 2.56082" direction="0"
-                  scale="0.03125 0.03125 0.03125" root_orientation="0.7071067811865476 0.7071067811865476 0 0" />
-    <entity_model name="Barret" file_name="models/ffvii/field/units/barret.mesh" position="0 0 0" direction="0" />
-    <entity_script name="View" />
-    <entity_model name="Hei0" file_name="models/ffvii/field/units/soldier.mesh" position="0 0 0" direction="0" />
-    <entity_model name="Hei1" file_name="models/ffvii/field/units/soldier.mesh" position="0 0 0" direction="0" />
-    <entity_model name="Biggs" file_name="models/ffvii/field/units/biggs.mesh" position="0 0 0" direction="0" />
-    <entity_model name="Jessie" file_name="models/ffvii/field/units/jessie.mesh" position="0 0 0" direction="0" />
-    <entity_model name="Wedge" file_name="models/ffvii/field/units/wedge.mesh" position="0 0 0" direction="0" />
-    <entity_model name="Gu0" file_name="models/ffvii/field/units/guard.mesh" position="0 0 0" direction="0" />
-    <entity_model name="Gu1" file_name="models/ffvii/field/units/guard.mesh" position="0 0 0" direction="0" />
-    <entity_model name="GuAdd" file_name="models/ffvii/field/units/guard.mesh" position="0 0 0" direction="0" />
-
-    <entity_trigger name="Gateway0" point1="28.6016 228.562 2.75781" point2="28.6641 229.438 2.75781" enabled="true" />
-    <entity_point name="Spawn_md1_1" position="29.0547 229.234 2.56082" rotation="67.7647" />
-</map>

BIN
Tests/VGearsMain/misc/reference.a


BIN
Tests/VGearsMain/misc/reference.background


+ 0 - 21
Tests/VGearsMain/misc/reference.background2d.xml

@@ -1,21 +0,0 @@
-<background2d image="maps/ffvii/field/md1stin.png" position="28.4846 210.83 3.10751" orientation="0.742188 0.667516 -0.0403783 -0.0450658" fov="34.5389" range="-768 -768 768 768">
-    <tile destination="-720 192" width="48" height="48" uv="0 0 0.015625 0.03125" depth="123" blending="alpha" />
-    <tile destination="-672 192" width="48" height="48" uv="0.015625 0 0.03125 0.03125" depth="100" blending="add" />
-    <tile destination="-624 192" width="48" height="48" uv="0 0.03125 0.015625 0.0625" depth="200" blending="alpha" />
-    <tile destination="-576 192" width="48" height="48" uv="0.015625 0.03125 0.03125 0.0625" depth="300" blending="alpha" />
-    <tile destination="-240 -528" width="48" height="48" uv="0 0 0.015625 0.03125" depth="0.002" blending="alpha">
-        <animation name="Fan" length="0.5">
-          <keyframe time="0"     uv="0.015625 0 0.03125 0.03125" />
-          <keyframe time="0.1"   uv="0 0.03125 0.015625 0.0625" />
-          <keyframe time="0.233" uv="0.015625 0.03125 0.03125 0.0625" />
-        </animation>
-        <animation name="Light" length="0.25">
-          <keyframe time="0"     uv="0.015625 0 0.03125 0.03125" />
-          <keyframe time="0.1"   uv="0 0.03125 0.015625 0.0625" />
-          <keyframe time="0.233" uv="0.015625 0.03125 0.03125 0.0625" />
-        </animation>
-    </tile>
-    <tile destination="-192 -528" width="48" height="48" uv="0.03125 0 0.046875 0.03125" depth="0.002" blending="alpha">
-        <animation name="Fan" length="0.366" />
-    </tile>
-</background2d>

BIN
Tests/VGearsMain/misc/reference.cam_matrix


BIN
Tests/VGearsMain/misc/reference.lgp


BIN
Tests/VGearsMain/misc/reference.p


BIN
Tests/VGearsMain/misc/reference.palette


+ 0 - 24
Tests/VGearsMain/misc/reference.rsd

@@ -1,24 +0,0 @@
-# comment before the header might not be standard, but we allow it
-@RSD940102
-# comment, sould be ignored
-# 11 bytes
-PLY=Polygon.PLY
-# 12 bytes
-MAT=Material.MAT
-# 9 bytes
-GRP=Group.GRP
-# some textures
-NTEX=3
-# 17 bytes
-TEX[0]=First Texture.TIM
-# 17 bytes
-TEX[1]=SecondTexture.TIM
-#TEX[1]=unused texture.TIM
-# 17 bytes
-TEX[2]=Third Texture.TIM
-# calculated size shoud be
-# 11 + 12 + 9 + 17 + 17 + 17 = 83
-
-# blank lines are ok :)
-
-

BIN
Tests/VGearsMain/misc/reference.skeleton


BIN
Tests/VGearsMain/misc/reference_lzs.compressed


BIN
Tests/VGearsMain/misc/reference_lzs.decompressed


+ 0 - 99
Tests/VGearsMain/misc/reference_manual_object.mesh.xml

@@ -1,99 +0,0 @@
-<mesh>
-    <submeshes>
-        <submesh material="material1" usesharedvertices="false" use32bitindexes="false" operationtype="triangle_list">
-            <faces count="1">
-                <face v1="0" v2="1" v3="2" />
-            </faces>
-            <geometry vertexcount="3">
-                <vertexbuffer positions="true">
-                    <vertex>
-                        <position x="0" y="0" z="0" />
-                    </vertex>
-                    <vertex>
-                        <position x="1" y="0" z="0" />
-                    </vertex>
-                    <vertex>
-                        <position x="0" y="1" z="0" />
-                    </vertex>
-                </vertexbuffer>
-                <vertexbuffer normals="true">
-                    <vertex>
-                        <normal x="0" y="0" z="1" />
-                    </vertex>
-                    <vertex>
-                        <normal x="0" y="0" z="1" />
-                    </vertex>
-                    <vertex>
-                        <normal x="0" y="0" z="1" />
-                    </vertex>
-                </vertexbuffer>
-                <vertexbuffer colours_diffuse="true">
-                    <vertex>
-                        <colour_diffuse value="1 0 0 1" />
-                    </vertex>
-                    <vertex>
-                        <colour_diffuse value="0 1 0 1" />
-                    </vertex>
-                    <vertex>
-                        <colour_diffuse value="0 0 1 1" />
-                    </vertex>
-                </vertexbuffer>
-            </geometry>
-            <boneassignments>
-                <vertexboneassignment vertexindex="0" boneindex="1" weight="1" />
-                <vertexboneassignment vertexindex="1" boneindex="2" weight="3" />
-                <vertexboneassignment vertexindex="2" boneindex="2" weight="2" />
-            </boneassignments>
-        </submesh>
-        <submesh material="material2" usesharedvertices="false" use32bitindexes="false" operationtype="triangle_list">
-            <faces count="1">
-                <face v1="0" v2="1" v3="2" />
-            </faces>
-            <geometry vertexcount="3">
-                <vertexbuffer positions="true">
-                    <vertex>
-                        <position x="0" y="0" z="0" />
-                    </vertex>
-                    <vertex>
-                        <position x="1" y="0" z="0" />
-                    </vertex>
-                    <vertex>
-                        <position x="0" y="1" z="0" />
-                    </vertex>
-                </vertexbuffer>
-                <vertexbuffer normals="true">
-                    <vertex>
-                        <normal x="0" y="0" z="1" />
-                    </vertex>
-                    <vertex>
-                        <normal x="0" y="0" z="1" />
-                    </vertex>
-                    <vertex>
-                        <normal x="0" y="0" z="1" />
-                    </vertex>
-                </vertexbuffer>
-                <vertexbuffer colours_diffuse="true">
-                    <vertex>
-                        <colour_diffuse value="1 0 0 1" />
-                    </vertex>
-                    <vertex>
-                        <colour_diffuse value="0 1 0 1" />
-                    </vertex>
-                    <vertex>
-                        <colour_diffuse value="0 0 1 1" />
-                    </vertex>
-                </vertexbuffer>
-            </geometry>
-            <boneassignments>
-                <vertexboneassignment vertexindex="0" boneindex="1" weight="1" />
-                <vertexboneassignment vertexindex="1" boneindex="2" weight="3" />
-                <vertexboneassignment vertexindex="2" boneindex="2" weight="2" />
-            </boneassignments>
-        </submesh>
-    </submeshes>
-    <skeletonlink name="test.skeleton" />
-    <submeshnames>
-        <submeshname name="sub_name1" index="0" />
-        <submeshname name="sub_name2" index="1" />
-    </submeshnames>
-</mesh>

+ 0 - 8
Tests/VGearsMain/misc/test_hrc_empty.hrc

@@ -1,8 +0,0 @@
-:HEADER_BLOCK 2
-:SKELETON test_empty_skeleton
-:BONES 0
-
-null
-root
-1.5
-1 model.1

+ 0 - 18
Tests/VGearsMain/misc/test_hrc_simple.hrc

@@ -1,18 +0,0 @@
-:HEADER_BLOCK 2
-:SKELETON test_skeleton
-:BONES 3
-
-bone.1
-root
-1.5
-1 model.1
-
-bone.1.1
-bone.1
-2
-1 model.1.1
-
-bone.2
-root
-3.125
-3 model.2-1 model.2-2 model.2-3

+ 0 - 4
Tests/VGearsMain/misc/walkmesh.xml

@@ -1,4 +0,0 @@
-<walkmesh>
-    <triangle a="1 2 4" b="8 16 32" c="64 128 256" a_b="1" b_c="-1" c_a="-1"/>
-    <triangle a="4 2 1" b="32 16 8" c="256 128 64" a_b="-1" b_c="0" c_a="-1"/>
-</walkmesh>

+ 0 - 180
Tests/VGearsMain/src/test_MapSerializer.cpp

@@ -1,180 +0,0 @@
-#include <fstream>
-
-//#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "common/TypeDefine.h"
-#include "data/worldmap/MapFileSerializer.h"
-#include "data/worldmap/MapFile.h"
-#include "data/worldmap/MapFileManager.h"
-
-#include "data/VGearsTexCodec.h"
-#include <functional>
-
-#include "data/VGearsLGPArchiveFactory.h"
-
-using namespace Ogre;
-
-
-static void createReferenceFileInstance(std::function<void(Ogre::DataStreamPtr& stream, VGears::WorldMapFile& file)> callBack)
-{
-    class TestFile : public VGears::WorldMapFile
-    {
-    public:
-        TestFile() : VGears::WorldMapFile( NULL, "", 0, "" ) {}
-    };
-
-    const char* file_name = "/home/paul/vgears/v-gears/Tests/FinalFantasy7/misc/reference.map";
-    std::ifstream ifs( file_name, std::ifstream::binary );
-    {
-//        BOOST_REQUIRE( ifs.is_open() );
-        Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( &ifs, false ) );
-//        BOOST_REQUIRE( stream->isReadable() );
-
-        //Ogre::LogManager log;
-        TestFile f;
-
-       // log.createLog( "Default Log", true, true, true );
-
-        callBack(stream, f);
-
-       // log.destroyLog( "Default Log" );
-    }
-}
-
-/*
-BOOST_AUTO_TEST_CASE( file_size_is_multiple_of_block_size )
-{
-    createReferenceFileInstance([&](Ogre::DataStreamPtr& stream, VGears::WorldMapFile& file)
-    {
-        VGears::MapFileSerializer s;
-        s.importMapFile( stream, file );
-    });
-}
-
-// compare meshes to hand picked data that we know should be in the block
-BOOST_AUTO_TEST_CASE( parse_16_meshes_in_one_block )
-{
-
-}
-
-
-BOOST_AUTO_TEST_CASE( parsing_whole_map )
-{
-
-}
-
-BOOST_AUTO_TEST_CASE( replace_story_meshes )
-{
-
-}
-*/
-
-Camera *mainCam = nullptr;
-
-class GameFrameListener : public Ogre::FrameListener
-{
-public:
-    using Ogre::FrameListener::FrameListener;
-
-    bool frameStarted( const Ogre::FrameEvent& evt )
-    {
-        auto pos = mainCam->getPosition();
-
-        //pos.x += 1.0f;
-
-        //pos.z += 1.0f;
-
-        mainCam->setPosition(pos);
-
-        return true;
-    }
-};
-
-
-int main(int argc, char **argv)
-{
-    Root *root = new Root();
-    // choose renderer
-
-    // IVV
-    /*if(!root->showConfigDialog())
-    {
-        return 0;
-    }*/
-
-    // initialise root
-    root->initialise(false);
-
-
-    // create main window
-    RenderWindow *renderWindow = root->createRenderWindow("Main",320,240,false);
-    // create the scene
-    SceneManager *sceneMgr = root->createSceneManager(Ogre::ST_GENERIC);
-    // add a camera
-    mainCam = sceneMgr->createCamera("MainCam");
-    // add viewport
-    Viewport *vp = renderWindow->addViewport(mainCam);
-
-
-    Ogre::ArchiveManager::getSingleton().addArchiveFactory( new VGears::LGPArchiveFactory() );
-
-
-    Ogre::TextureManager* tm = root->getTextureManager();
-
-
-    VGears::MapFileManager* worldManager = new VGears::MapFileManager();
-
-    ResourceGroupManager::getSingleton().addResourceLocation(".", "FileSystem");
-    ResourceGroupManager::getSingleton().addResourceLocation("/home/paul/vgears/data/cd1pc/wm", "FileSystem", "TEST");
-    ResourceGroupManager::getSingleton().addResourceLocation("/home/paul/vgears/data/cd1pc/wm/world_us.lgp", VGears::LGPArchiveFactory::ARCHIVE_TYPE, "TEST");
-
-
-    VGears::TexCodec::install();
-    VGears::TexCodec::initialise();
-
-
-    ResourceGroupManager::getSingleton().declareResource("bridge.tex", "Texture", "TEST");
-
-    ResourceGroupManager::getSingleton().declareResource("wm0.map", VGears::WorldMapFile::RESOURCE_TYPE, "TEST");
-    ResourceGroupManager::getSingleton().declareResource("wm1.map", VGears::WorldMapFile::RESOURCE_TYPE, "TEST");
-    ResourceGroupManager::getSingleton().declareResource("wm2.map", VGears::WorldMapFile::RESOURCE_TYPE, "TEST");
-
-
-    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-
-    Ogre::ResourcePtr f = worldManager->load("wm0.map", "TEST");
-
-    //worldManager->load("wm/wm0.map", "TEST");
-
-    TexturePtr p = tm->load("bridge.tex", "TEST");
-
-    int th = p->getSrcHeight();
-    int tw = p->getSrcWidth();
-
-/*
-    GameFrameListener *frameListener= new GameFrameListener();
-  //  frameListener->showDebugOverlay(true);
-    // Create an Entity
-
-      Ogre::Entity* ogreHead = sceneMgr->createEntity("axes", "axes.mesh");
-
-      // Create a SceneNode and attach the Entity to it
-      Ogre::SceneNode* headNode = sceneMgr->getRootSceneNode()->createChildSceneNode("HeadNode");
-      headNode->attachObject(ogreHead);
-        headNode->setPosition( 0, 0, 0 );
-
-     // createColourCube(sceneMgr);
-
-      mainCam->setPolygonMode(PM_WIREFRAME);
-
-      mainCam->setFarClipDistance(900000.0f);
-      mainCam->setPosition( 50, 500, 500 );
-      mainCam->lookAt( 0, 0, 0);
-
-    root->addFrameListener(frameListener);
-
-    root->startRendering();
-*/
-    return 0;
-}

+ 0 - 50
Tests/VGearsMain/src/test_TxzSerializer.cpp

@@ -1,50 +0,0 @@
-#include <fstream>
-
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "common/TypeDefine.h"
-#include "data/worldmap/TxzFileSerializer.h"
-#include "data/worldmap/TxzFile.h"
-
-#include <functional>
-
-using namespace Ogre;
-
-
-static void createReferenceFileInstance(std::string filename, std::function<void(Ogre::DataStreamPtr& stream, VGears::TxzFile& file)> callBack)
-{
-    class TestFile : public VGears::TxzFile
-    {
-    public:
-        TestFile() : VGears::TxzFile( NULL, "", 0, "" ) {}
-    };
-
-    const char* file_name = filename.c_str();
-    std::ifstream ifs( file_name, std::ifstream::binary );
-    {
-        BOOST_REQUIRE( ifs.is_open() );
-        Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( &ifs, false ) );
-        BOOST_REQUIRE( stream->isReadable() );
-
-        Ogre::LogManager log;
-        TestFile f;
-
-        log.createLog( "Default Log", true, true, true );
-
-        callBack(stream, f);
-
-        log.destroyLog( "Default Log" );
-    }
-}
-
-
-BOOST_AUTO_TEST_CASE( read_blocks )
-{
-    createReferenceFileInstance( "/home/paul/vgears/data/cd1/world/wm0.txz", [&](Ogre::DataStreamPtr& stream, VGears::TxzFile& file)
-    {
-        VGears::TxzFileSerializer s;
-        s.import( stream, file );
-    });
-}
-

+ 0 - 76
Tests/VGearsMain/src/test_VGearsAFileSerializer.cpp

@@ -1,76 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-12 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "data/VGearsAFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( header_size )
-{
-    BOOST_CHECK_EQUAL( 0x24, sizeof( VGears::AFileSerializer::Header ) );
-}
-
-BOOST_AUTO_TEST_CASE( header_offset )
-{
-    BOOST_CHECK_EQUAL( 0x00, offsetof( VGears::AFileSerializer::Header, version ) );
-    BOOST_CHECK_EQUAL( 0x04, offsetof( VGears::AFileSerializer::Header, frame_count ) );
-    BOOST_CHECK_EQUAL( 0x08, offsetof( VGears::AFileSerializer::Header, bone_count ) );
-    BOOST_CHECK_EQUAL( 0x0C, offsetof( VGears::AFileSerializer::Header, rotation_order ) );
-}
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::AFile
-    {
-    public:
-        TestFile() : VGears::AFile( NULL, "", 0, "" ) {}
-    };
-    const char* file_name( "misc/reference.a" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    Ogre::LogManager            logMgr;
-    VGears::AFileSerializer     ser;
-    TestFile                    f;
-
-    logMgr.createLog( "Default Log", true, true, true );
-
-    ser.importAFile( stream, &f );
-
-    VGears::AFile::FrameList &frames( f.getFrames() );
-    BOOST_CHECK_EQUAL( 80, frames.size() );
-    BOOST_CHECK( Ogre::Vector3( -63.86031f, 71.90821f, -10.97811f    ).positionEquals( frames.front().root_translation ) );
-    BOOST_CHECK( Ogre::Vector3(   0.0f      , 13.53528f,   0.07706928f ).positionEquals( frames.back ().root_translation ) );
-
-    logMgr.destroyLog( "Default Log" );
-
-    ifs->close();
-}
-

+ 0 - 53
Tests/VGearsMain/src/test_VGearsBackground2D.cpp

@@ -1,53 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-28 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "core/Background2D.h"
-#include "map/VGearsBackground2DFileManager.h"
-
-BOOST_AUTO_TEST_SUITE( VGearsBackground2D )
-
-BOOST_AUTO_TEST_CASE( load )
-{
-    class TestFile : public Background2D
-    {
-    public:
-        TestFile() : Background2D() {}
-    };
-
-	Ogre::LogManager    logMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-    Ogre::Root          root;
-    TestFile            file;
-    VGears::Background2DFileManager b_mgr;
-    VGears::Background2DFilePtr     b;
-
-
-    logMgr.destroyLog( "Default Log" );
-}
-BOOST_AUTO_TEST_SUITE_END()

+ 0 - 92
Tests/VGearsMain/src/test_VGearsBackground2DFileSerializer.cpp

@@ -1,92 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-26 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "map/VGearsBackground2DFileXMLSerializer.h"
-
-BOOST_AUTO_TEST_SUITE( VGearsBackground2DFileSerializer )
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::Background2DFile
-    {
-    public:
-        TestFile() : VGears::Background2DFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {};
-    };
-
-	Ogre::LogManager                    logMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-
-    const char*                             file_name( "reference.background2d.xml" );
-    TestFile                                file;
-    VGears::Background2DFileXMLSerializer   ser;
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    ser.importBackground2DFile( stream, &file );
-    BOOST_CHECK_EQUAL( "maps/ffvii/field/md1stin.png", file.getTextureName() );
-    BOOST_CHECK_EQUAL( Ogre::Vector4( -768, -768, 768, 768 ), file.getRange() );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 28.4846, 210.83, 3.10751 ), file.getPosition() );
-    BOOST_CHECK_EQUAL( Ogre::Quaternion( 0.742188, 0.667516, -0.0403783, -0.0450658 ), file.getOrientation() );
-    BOOST_CHECK_EQUAL( Ogre::Radian( Ogre::Degree( 34.5389 ) ), file.getFov() );
-    BOOST_CHECK_EQUAL( 6, file.getTiles().size() );
-    BOOST_CHECK_EQUAL( VGears::B_ALPHA, file.getTiles()[0].blending );
-    BOOST_CHECK_EQUAL( 123, file.getTiles()[0].depth );
-
-    BOOST_CHECK_EQUAL( VGears::B_ADD  , file.getTiles()[1].blending );
-    BOOST_CHECK_EQUAL( 100, file.getTiles()[1].depth );
-
-    BOOST_CHECK_EQUAL( 48, file.getTiles()[2].width  );
-    BOOST_CHECK_EQUAL( 48, file.getTiles()[2].height );
-    BOOST_CHECK_EQUAL( 200, file.getTiles()[2].depth );
-
-    BOOST_CHECK_EQUAL( Ogre::Vector4( 0.015625, 0.03125, 0.03125, 0.0625 ), file.getTiles()[3].uv );
-    BOOST_CHECK_EQUAL( 300, file.getTiles()[3].depth );
-
-    BOOST_CHECK_CLOSE( 0.002, file.getTiles()[4].depth, 0.0001 );
-    BOOST_CHECK_EQUAL( 2    , file.getTiles()[4].animations.size() );
-    BOOST_CHECK_EQUAL( 0.5  , file.getTiles()[4].animations["Fan"].length );
-    BOOST_CHECK_EQUAL( 3    , file.getTiles()[4].animations["Fan"].key_frames.size() );
-    BOOST_CHECK_EQUAL( 0    , file.getTiles()[4].animations["Fan"].key_frames[0].time );
-    BOOST_CHECK_CLOSE( 0.1  , file.getTiles()[4].animations["Fan"].key_frames[1].time, 0.01 );
-    BOOST_CHECK_CLOSE( 0.233, file.getTiles()[4].animations["Fan"].key_frames[2].time, 0.01 );
-    BOOST_CHECK_EQUAL( 0.25 , file.getTiles()[4].animations["Light"].length );
-    BOOST_CHECK_EQUAL( 3    , file.getTiles()[4].animations["Light"].key_frames.size() );
-
-    BOOST_CHECK_CLOSE( 0.002, file.getTiles()[5].depth, 0.0001 );
-
-    logMgr.destroyLog( "Default Log" );
-    ifs->close();
-}
-BOOST_AUTO_TEST_SUITE_END()

+ 0 - 145
Tests/VGearsMain/src/test_VGearsBackgroundFileSerializer.cpp

@@ -1,145 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-07-31 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#define BOOST_TEST_MODULE VGearsBackgroundFileSerializer
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsBackgroundFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( header_size )
-{
-    BOOST_CHECK_EQUAL( 0x04, sizeof( VGears::BackgroundFile::Pixel) );
-}
-
-BOOST_AUTO_TEST_CASE( pixel_offset )
-{
-    BOOST_CHECK_EQUAL( 0x00, offsetof( VGears::BackgroundFile::Pixel, x ) );
-    BOOST_CHECK_EQUAL( 0x02, offsetof( VGears::BackgroundFile::Pixel, y ) );
-}
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::BackgroundFile
-    {
-    public:
-        TestFile() : VGears::BackgroundFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {};
-    };
-
-	Ogre::LogManager                    logMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-
-    const char*                         file_name( "reference.background" );
-    TestFile                            file;
-    VGears::BackgroundFileSerializer    ser;
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    ser.importBackgroundFile( stream, &file );
-    BOOST_CHECK_EQUAL( 726491, stream->tell() );
-    BOOST_CHECK_EQUAL( 721078, file.getCalculatedSize() );
-
-    VGears::BackgroundFile::Layer *layer( file.getLayers() );
-    BOOST_CHECK( layer[0].enabled );
-    BOOST_CHECK_EQUAL( 400, layer[0].width );
-    BOOST_CHECK_EQUAL( 736, layer[0].height );
-    BOOST_CHECK_EQUAL(1019, layer[0].sprites.size() );
-    BOOST_CHECK_EQUAL(-192, layer[0].sprites[0].dst.x );
-    BOOST_CHECK_EQUAL(-168, layer[0].sprites[0].dst.y );
-    BOOST_CHECK_EQUAL(   0, layer[0].sprites[0].src.x );
-    BOOST_CHECK_EQUAL(   0, layer[0].sprites[0].src.y );
-
-    BOOST_CHECK( layer[1].enabled );
-    BOOST_CHECK_EQUAL( 640, layer[1].width );
-    BOOST_CHECK_EQUAL( 480, layer[1].height );
-    BOOST_CHECK_EQUAL(  64, layer[1].sprites.size() );
-    BOOST_CHECK_EQUAL(  48, layer[1].sprites[0].dst.x );
-    BOOST_CHECK_EQUAL(-312, layer[1].sprites[0].dst.y );
-    BOOST_CHECK_EQUAL( 176, layer[1].sprites[0].src.x );
-    BOOST_CHECK_EQUAL( 240, layer[1].sprites[0].src.y );
-
-    BOOST_CHECK( layer[2].enabled );
-    BOOST_CHECK_EQUAL( 640, layer[2].width );
-    BOOST_CHECK_EQUAL( 480, layer[2].height );
-    BOOST_CHECK_EQUAL(   0, layer[2].sprites.size() );
-
-    BOOST_CHECK( layer[3].enabled );
-    BOOST_CHECK_EQUAL( 640, layer[3].width );
-    BOOST_CHECK_EQUAL( 480, layer[3].height );
-    BOOST_CHECK_EQUAL( 280, layer[3].sprites.size() );
-    BOOST_CHECK_EQUAL(-160, layer[3].sprites[0].dst.x );
-    BOOST_CHECK_EQUAL(-120, layer[3].sprites[0].dst.y );
-    BOOST_CHECK_EQUAL(   0, layer[3].sprites[0].src.x );
-    BOOST_CHECK_EQUAL(   0, layer[3].sprites[0].src.y );
-
-    VGears::uint8 palatte_expected[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 };
-    BOOST_CHECK_EQUAL( sizeof( palatte_expected ), VGears::BackgroundFile::PALETTE_ENTRY_COUNT );
-    BOOST_CHECK_EQUAL_COLLECTIONS( palatte_expected , palatte_expected  + sizeof( palatte_expected )
-                                  ,file.getPalette(), file.getPalette() + VGears::BackgroundFile::PALETTE_ENTRY_COUNT );
-
-    VGears::BackgroundFile::Page *page( file.getPages() );
-    bool enabled[] = { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-    BOOST_CHECK_EQUAL( sizeof(enabled), VGears::BackgroundFile::PAGE_COUNT );
-    for( size_t i( VGears::BackgroundFile::PAGE_COUNT ); i--; )
-    {
-        BOOST_CHECK_EQUAL( enabled[i], page[i].enabled );
-    }
-
-    logMgr.stream()
-        << "\n layer[0].unknown_06: " << layer[0].unknown_06
-
-        << "\n layer[1].unknown_06: " << layer[1].unknown_06
-        << "\n layer[1].unknown_08: " << layer[1].unknown_08[0]
-        << "\n layer[1].unknown_08: " << layer[1].unknown_08[1]
-        << "\n layer[1].unknown_08: " << layer[1].unknown_08[2]
-        << "\n layer[1].unknown_0E: " << layer[1].unknown_0E[0]
-        << "\n layer[1].unknown_0E: " << layer[1].unknown_0E[1]
-        << "\n layer[1].unknown_0E: " << layer[1].unknown_0E[2]
-        << "\n layer[1].unknown_0E: " << layer[1].unknown_0E[3]
-
-        << "\n layer[2].unknown_06: " << layer[2].unknown_06
-        << "\n layer[2].unknown_0E: " << layer[2].unknown_0E[0]
-        << "\n layer[2].unknown_0E: " << layer[2].unknown_0E[1]
-        << "\n layer[2].unknown_0E: " << layer[2].unknown_0E[2]
-        << "\n layer[2].unknown_0E: " << layer[2].unknown_0E[3]
-
-        << "\n layer[3].unknown_06: " << layer[3].unknown_06
-        << "\n layer[3].unknown_0E: " << layer[3].unknown_0E[0]
-        << "\n layer[3].unknown_0E: " << layer[3].unknown_0E[1]
-        << "\n layer[3].unknown_0E: " << layer[3].unknown_0E[2]
-        << "\n layer[3].unknown_0E: " << layer[3].unknown_0E[3]
-        << "\n";
-
-
-    logMgr.destroyLog( "Default Log" );
-    ifs->close();
-}

+ 0 - 69
Tests/VGearsMain/src/test_VGearsCameraMatrixFileSerializer.cpp

@@ -1,69 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-09-02 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsCameraMatrixFileSerializer.h"
-
-BOOST_AUTO_TEST_SUITE( VGearsCameraMatrixFileSerializer )
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::CameraMatrixFile
-    {
-    public:
-        TestFile() : VGears::CameraMatrixFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {};
-    };
-
-	Ogre::LogManager                    logMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-
-    const char*                         file_name( "reference.cam_matrix" );
-    TestFile                            file;
-    VGears::CameraMatrixFileSerializer  ser;
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    ser.importCameraMatrixFile( stream, &file );
-    BOOST_CHECK_EQUAL( Ogre::Quaternion( 0.864826, 0.382658, 0.131622, 0.297191 ), file.getOrientation() );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( -998, 930, 5141 ), file.getPosition() );
-    BOOST_CHECK_EQUAL( 0, file.getOffset().x );
-    BOOST_CHECK_EQUAL( 0, file.getOffset().y );
-    BOOST_CHECK_EQUAL( 703, file.getFocalLength() );
-    Ogre::Quaternion dir( file.getMatrix() );
-    BOOST_CHECK_EQUAL( 38, stream->tell() );
-
-    logMgr.destroyLog( "Default Log" );
-    ifs->close();
-}
-BOOST_AUTO_TEST_SUITE_END()

+ 0 - 115
Tests/VGearsMain/src/test_VGearsHRCSerializer.cpp

@@ -1,115 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-10 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-//#define BOOST_TEST_MODULE VGearsHRCFileSerializer
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsHRCFileSerializer.h"
-
-const char* LOG_NAME( "Default Log" );
-
-BOOST_AUTO_TEST_CASE( simple_hrc )
-{
-    class TestFile : public VGears::HRCFile
-    {
-    public:
-        TestFile() : VGears::HRCFile( NULL, "", 0, "" ) {}
-    };
-    Ogre::LogManager            logMgr;
-    logMgr.createLog( LOG_NAME, true, true, true );
-
-    const char* file_name( "misc/test_hrc_simple.hrc" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    TestFile                    file;
-    VGears::HRCFileSerializer   ser;
-    ser.importHRCFile( stream, &file );
-
-    BOOST_CHECK_EQUAL( "test_skeleton", file.getSkeletonName() );
-
-    const VGears::HRCFile::BoneList& bones( file.getBones() );
-    BOOST_CHECK_EQUAL( 3, bones.size() );
-    BOOST_CHECK_EQUAL( "bone.1", bones.at(0).name );
-    BOOST_CHECK_EQUAL( "root", bones.at(0).parent );
-    BOOST_CHECK_CLOSE( 1.5f, bones.at(0).length, 0.0001f );
-    BOOST_CHECK_EQUAL( 1, bones.at(0).rsd_names.size() );
-    BOOST_CHECK_EQUAL( "model.1", bones.at(0).rsd_names.at(0) );
-
-    BOOST_CHECK_EQUAL( "bone.1.1", bones.at(1).name );
-    BOOST_CHECK_EQUAL( bones.at(0).name, bones.at(1).parent );
-    BOOST_CHECK_CLOSE( 2.0f, bones.at(1).length, 0.0001f );
-    BOOST_CHECK_EQUAL( 1, bones.at(1).rsd_names.size() );
-    BOOST_CHECK_EQUAL( "model.1.1", bones.at(1).rsd_names.at(0) );
-
-    BOOST_CHECK_EQUAL( "bone.2", bones.at(2).name );
-    BOOST_CHECK_EQUAL( bones.at(0).parent, bones.at(2).parent );
-    BOOST_CHECK_CLOSE( 3.125f, bones.at(2).length, 0.0001f );
-    BOOST_CHECK_EQUAL( 3, bones.at(2).rsd_names.size() );
-    BOOST_CHECK_EQUAL( "model.2-1", bones.at(2).rsd_names.at(0) );
-    BOOST_CHECK_EQUAL( "model.2-2", bones.at(2).rsd_names.at(1) );
-    BOOST_CHECK_EQUAL( "model.2-3", bones.at(2).rsd_names.at(2) );
-
-    ifs->close();
-}
-
-BOOST_AUTO_TEST_CASE( empty_hrc )
-{
-    class TestFile : public VGears::HRCFile
-    {
-    public:
-        TestFile() : VGears::HRCFile( NULL, "", 0, "" ) {}
-    };
-    Ogre::LogManager            logMgr;
-    logMgr.createLog( LOG_NAME, true, true, true );
-
-    const char* file_name( "misc/test_hrc_empty.hrc" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    TestFile                    file;
-    VGears::HRCFileSerializer   ser;
-    ser.importHRCFile( stream, &file );
-
-    BOOST_CHECK_EQUAL( "test_empty_skeleton", file.getSkeletonName() );
-
-    const VGears::HRCFile::BoneList& bones( file.getBones() );
-    BOOST_CHECK_EQUAL( 1, bones.size() );
-    BOOST_CHECK_EQUAL( "null", bones.at(0).name );
-    BOOST_CHECK_EQUAL( "root", bones.at(0).parent );
-    BOOST_CHECK_CLOSE( 1.5f, bones.at(0).length, 0.0001f );
-    BOOST_CHECK_EQUAL( 1, bones.at(0).rsd_names.size() );
-    BOOST_CHECK_EQUAL( "model.1", bones.at(0).rsd_names.at(0) );
-
-    ifs->close();
-}

+ 0 - 111
Tests/VGearsMain/src/test_VGearsLGPArchive.cpp

@@ -1,111 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-09-22 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsLGPArchiveFactory.h"
-
-BOOST_AUTO_TEST_CASE( load )
-{
-    Ogre::LogManager        logMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-    const char* filename_1( "Filename 1" );
-    const char* filename_2( "max length filename!" );
-
-    class TestLGPArchive : public VGears::LGPArchive
-    {
-        public:
-
-            TestLGPArchive() :
-                VGears::LGPArchive( "misc/reference.lgp", "LGP" )
-              , test_stream( NULL )
-            {}
-
-            void load()
-            {
-                VGears::LGPArchive::load( test_stream );
-            }
-
-        Ogre::DataStream* test_stream;
-    };
-
-    TestLGPArchive lgp;
-    // TODO: use Ogre::MemoryDataStream and include data via byte array
-    std::ifstream *ifs( OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( lgp.getName().c_str(), std::ifstream::binary ) );
-    lgp.test_stream = OGRE_NEW Ogre::FileStreamDataStream( ifs );
-
-    BOOST_CHECK_EQUAL(  true, lgp.getFiles().empty() );
-    BOOST_CHECK_EQUAL( false, lgp.exists( filename_1 ) );
-    BOOST_CHECK_EQUAL( false, lgp.exists( filename_2 ) );
-
-    lgp.load();
-
-    BOOST_CHECK_EQUAL( 2, lgp.getFiles().size() );
-    BOOST_CHECK_EQUAL(  true, lgp.exists( filename_1 ) );
-    BOOST_CHECK_EQUAL(  true, lgp.exists( filename_2 ) );
-    BOOST_CHECK_EQUAL( lgp.getFiles().size(), lgp.list()->size() );
-    BOOST_CHECK_EQUAL( lgp.getFiles().size(), lgp.listFileInfo()->size() );
-
-    VGears::LGPArchive::FileEntry& entry( lgp.getFiles()[0] );
-    BOOST_CHECK_EQUAL( filename_1, entry.file_name );
-    BOOST_CHECK_EQUAL( entry.file_name, lgp.list()->at( 0 ) );
-    BOOST_CHECK_EQUAL( 0x00000050, entry.file_offset );
-    BOOST_CHECK_EQUAL( "FILENAME 1", entry.datafile_name_ );
-    BOOST_CHECK_EQUAL( 0x00000018, entry.data_size );
-    BOOST_CHECK_EQUAL( 0x00000068, entry.data_offset );
-
-    Ogre::FileInfoListPtr file_infos( lgp.listFileInfo() );
-    Ogre::FileInfo& file_info( file_infos->at( 0 ) );
-    BOOST_CHECK_EQUAL( &lgp, file_info.archive );
-    BOOST_CHECK_EQUAL( entry.file_name, file_info.filename );
-    BOOST_CHECK_EQUAL( entry.file_name, file_info.basename );
-    BOOST_CHECK_EQUAL( "", file_info.path );
-    BOOST_CHECK_EQUAL( entry.data_size, file_info.uncompressedSize );
-    BOOST_CHECK_EQUAL( file_info.uncompressedSize, file_info.compressedSize );
-
-    BOOST_CHECK_EQUAL( 1, lgp.find( "Filename*" )->size() );
-    BOOST_CHECK_EQUAL( 1, lgp.find( "*!" )->size() );
-    BOOST_CHECK_EQUAL( 2, lgp.find( "*name*" )->size() );
-
-    Ogre::StringVectorPtr found( lgp.find( "*name*" ) );
-    BOOST_CHECK_EQUAL( 2, found->size() );
-    BOOST_CHECK_EQUAL( filename_1, found->at( 0 ) );
-    BOOST_CHECK_EQUAL( filename_2, found->at( 1 ) );
-
-    Ogre::DataStreamPtr stream( lgp.open( filename_1 ) );
-    BOOST_CHECK_EQUAL( false, stream == nullptr );
-    BOOST_CHECK_EQUAL( entry.data_size, stream->size() );
-    BOOST_CHECK_EQUAL( "data of file 1 for test!", stream->getLine() );
-    BOOST_CHECK_EQUAL( true, stream->eof() );
-
-    lgp.unload();
-
-    BOOST_CHECK_EQUAL( false, lgp.exists( filename_1 ) );
-    BOOST_CHECK_EQUAL( false, lgp.exists( filename_2 ) );
-    logMgr.destroyLog( "Default Log" );
-}

+ 0 - 151
Tests/VGearsMain/src/test_VGearsLZSDataStream.cpp

@@ -1,151 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-18 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
-#define BOOST_TEST_MODULE VGearsLZSDataStream
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "VGearsLZSDataStream.h"
-
-const unsigned char hexData[] = {
-
-
-
-    0x00, 0x00, 0x6C, 0x6F, 0x00, 0x00, 0x54, 0x9E,
-    0x00, 0x00, 0x88, 0x9E, 0x00, 0x00, 0x70, 0xA1,
-    0x00, 0x00, 0x44, 0x4B, 0x00, 0x00, 0x02, 0x05,
-    0x0C, 0x0A, 0x90, 0x08, 0x02, 0x00, 0x00, 0x02,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x69,
-    0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x64,
-    0x31, 0x73, 0x74, 0x69, 0x6E, 0x00, 0x64, 0x69,
-    0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6C,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x61,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69,
-    0x65, 0x77, 0x00, 0x00, 0x00, 0x00, 0x68, 0x65,
-    0x69, 0x30, 0x00, 0x00, 0x00, 0x00, 0x68, 0x65,
-    0x69, 0x31, 0x00, 0x00, 0x00, 0x00, 0x61, 0x76,
-    0x5F, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x61, 0x76,
-    0x5F, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x61, 0x76,
-    0x5F, 0x73, 0x00, 0x00, 0x00, 0x00, 0x67, 0x75,
-    0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x75,
-    0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x75,
-    0x61, 0x64, 0x64, 0x00, 0x00, 0x00, 0x90, 0x1C
-};
-
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    const char* infile_name_( "reference_lzs.compressed" );
-    const char* outfile_name_( "test_lzs.decompressed" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( infile_name_, std::ifstream::binary ) );
-    std::ofstream ofs( outfile_name_, std::ifstream::binary );
-    BOOST_REQUIRE( ifs->is_open() );
-    BOOST_REQUIRE( ofs.is_open() );
-    Ogre::DataStreamPtr         file_stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    VGears::LZSDataStreamPtr    lzs_stream( OGRE_NEW VGears::LZSDataStream( file_stream ) );
-    BOOST_REQUIRE( file_stream->isReadable() );
-    BOOST_REQUIRE( lzs_stream->isReadable() );
-
-    BOOST_CHECK_EQUAL( 208640, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL(      0, lzs_stream->availableUncompressed() );
-    size_t data_size( sizeof(hexData) );
-    unsigned char data[sizeof(hexData)];
-    memset( data, 0x77, data_size );
-
-    BOOST_CHECK_EQUAL( 8, lzs_stream->read( data +  0, 8 ) );
-    BOOST_CHECK_EQUAL( 208629, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL(      4, lzs_stream->availableUncompressed() );
-    BOOST_CHECK( !lzs_stream->eof() );
-    BOOST_CHECK_EQUAL( 1, lzs_stream->read( data +  8, 1 ) );
-    BOOST_CHECK_EQUAL( 208629, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL(      3, lzs_stream->availableUncompressed() );
-    BOOST_CHECK( !lzs_stream->eof() );
-    BOOST_CHECK_EQUAL( 3, lzs_stream->read( data +  9, 3 ) );
-    BOOST_CHECK_EQUAL( 208629, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL(      0, lzs_stream->availableUncompressed() );
-    BOOST_CHECK( !lzs_stream->eof() );
-    BOOST_CHECK_EQUAL( 4, lzs_stream->read( data + 12, 4 ) );
-    BOOST_CHECK_EQUAL( 208619, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL(      6, lzs_stream->availableUncompressed() );
-    BOOST_CHECK( !lzs_stream->eof() );
-    BOOST_CHECK_EQUAL( 8, lzs_stream->read( data + 16, 8 ) );
-    BOOST_CHECK_EQUAL( 208610, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL(      6, lzs_stream->availableUncompressed() );
-
-    for( size_t i(0); i < 3*8; ++i )
-    {
-        ofs << data[i];
-    }
-
-    BOOST_REQUIRE_EQUAL( data_size, lzs_stream->read( data, data_size ) );
-    for( size_t i(0); i < data_size; ++i )
-    {
-        ofs << data[i];
-    }
-    BOOST_CHECK_EQUAL_COLLECTIONS(hexData, hexData + data_size, data, data + data_size );
-
-    for( size_t i(427020); i--; )
-    {
-        lzs_stream->read( data, 1 );
-        ofs << data[0];
-    }
-    BOOST_CHECK_EQUAL( 427196, lzs_stream->tell() );
-    BOOST_CHECK_EQUAL( 6, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL( 0, lzs_stream->availableUncompressed() );
-    for( size_t i(4); i--; )
-    {
-        lzs_stream->read( data, 1 );
-        ofs << data[0];
-    }
-    BOOST_CHECK_EQUAL( 427200, lzs_stream->tell() );
-    BOOST_CHECK_EQUAL( 0, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL( 1, lzs_stream->availableUncompressed() );
-    lzs_stream->read( data, 1 );
-    ofs << data[0];
-
-    BOOST_CHECK_EQUAL( 427201, lzs_stream->tell() );
-    BOOST_CHECK_EQUAL( 0, lzs_stream->availableCompressed() );
-    BOOST_CHECK_EQUAL( 0, lzs_stream->availableUncompressed() );
-    BOOST_CHECK( lzs_stream->eof() );
-    BOOST_CHECK_EQUAL( 0, lzs_stream->read( data, 1 ) );
-
-    VGears::uint32 flip( 0x12345678 );
-    lzs_stream->flipEndian( flip );
-    BOOST_CHECK_EQUAL( 0x78563412, flip );
-
-    lzs_stream.reset();
-    file_stream.reset();
-    ofs.close();
-
-    std::ifstream actual( outfile_name_ );
-    std::ifstream expected( "reference_lzs.decompressed" );
-
-    std::istream_iterator<char> it_actual  ( actual   ), end_actual;
-    std::istream_iterator<char> it_expected( expected ), end_expected;
-
-    BOOST_REQUIRE_EQUAL_COLLECTIONS(it_expected, end_actual, it_actual, end_expected);
-}

+ 0 - 101
Tests/VGearsMain/src/test_VGearsManualObject.cpp

@@ -1,101 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-10 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#define BOOST_TEST_MODULE VGearsManualObject
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-#include <OgreDefaultHardwareBufferManager.h>
-
-#include "VGearsManualObject.h"
-
-BOOST_AUTO_TEST_CASE( mesh_export )
-{
-	Ogre::LogManager  logMgr;
-    Ogre::ResourceGroupManager rgm;
-    Ogre::Math mth;
-    Ogre::LodStrategyManager lodMgr;
-    Ogre::MeshManager meshMgr;
-    Ogre::MaterialManager matMgr;
-    matMgr.initialise();
-    Ogre::SkeletonManager skelMgr;
-    Ogre::DefaultHardwareBufferManager bufferManager; // needed because we don't have a rendersystem
-    const char* name( "test" );
-    const char* filename_mesh( "test.mesh" );
-    const char* filename_skeleton( "test.skeleton" );
-
-    Ogre::MeshPtr mesh( Ogre::MeshManager::getSingleton().create( name, "General" ) );
-    mesh->setSkeletonName( filename_skeleton );
-
-    VGears::ManualObject mo( mesh.getPointer() );
-    mo.begin( "sub_name1", "material1", 3, 3 );
-    mo.position( Ogre::Vector3( 0, 0, 0 ) );
-    mo.normal( Ogre::Vector3( 0, 0, 1 ) );
-    mo.colour( Ogre::ColourValue( 1, 0, 0 ) );
-    mo.position( Ogre::Vector3( 1, 0, 0 ) );
-    mo.normal( Ogre::Vector3( 0, 0, 1 ) );
-    mo.colour( Ogre::ColourValue( 0, 1, 0 ) );
-    mo.position( Ogre::Vector3( 0, 1, 0 ) );
-    mo.normal( Ogre::Vector3( 0, 0, 1 ) );
-    mo.colour( Ogre::ColourValue( 0, 0, 1 ) );
-    mo.bone( 0, 1 );
-    mo.index( 0 );
-    mo.bone( 1, 2, 3 );
-    mo.index( 1 );
-    mo.bone( 2, 2, 2 );
-    mo.index( 2 );
-    mo.end();
-    mo.begin( "sub_name2", "material2", 3, 3 );
-    mo.position( Ogre::Vector3( 0, 0, 0 ) );
-    mo.normal( Ogre::Vector3( 0, 0, 1 ) );
-    mo.colour( Ogre::ColourValue( 1, 0, 0 ) );
-    mo.position( Ogre::Vector3( 1, 0, 0 ) );
-    mo.normal( Ogre::Vector3( 0, 0, 1 ) );
-    mo.colour( Ogre::ColourValue( 0, 1, 0 ) );
-    mo.position( Ogre::Vector3( 0, 1, 0 ) );
-    mo.normal( Ogre::Vector3( 0, 0, 1 ) );
-    mo.colour( Ogre::ColourValue( 0, 0, 1 ) );
-    mo.bone( 0, 1 );
-    mo.index( 0 );
-    mo.bone( 1, 2, 3 );
-    mo.index( 1 );
-    mo.bone( 2, 2, 2 );
-    mo.index( 2 );
-    mo.end();
-    // TODO use XMLMeshSerializer from converter, binary mesh can change
-    // without data actually differing
-    Ogre::MeshSerializer m_ser;
-    m_ser.exportMesh( mesh.getPointer(), filename_mesh );
-
-    std::ifstream actual( filename_mesh );
-    std::ifstream expected( "reference.mesh" );
-
-    std::istream_iterator<char> it_actual  ( actual   ), end_actual;
-    std::istream_iterator<char> it_expected( expected ), end_expected;
-
-    BOOST_CHECK_EQUAL_COLLECTIONS(it_expected, end_actual, it_actual, end_expected);
-}

+ 0 - 69
Tests/VGearsMain/src/test_VGearsMapFileXMLSerializer.cpp

@@ -1,69 +0,0 @@
-/*
------------------------------------------------------------------------------
-Copyright (c) 27.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-This file is part of V-Gears
-
-V-Gears is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.0 (GPLv2) of the License.
-
-V-Gears is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "map/VGearsMapFileXMLSerializer.h"
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::MapFile
-    {
-    public:
-        TestFile() : VGears::MapFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {}
-    };
-    const char* file_name( "misc/map.xml" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    Ogre::LogManager                logMgr;
-    VGears::MapFileXMLSerializer    ser;
-    TestFile                        f;
-
-    logMgr.createLog( "Default Log", true, true, true );
-    ser.importMapFile( stream, &f );
-
-    BOOST_CHECK_EQUAL( "path/to/script.lua"         , f.getScriptName() );
-    BOOST_CHECK_EQUAL( "background_2d_resource_name", f.getBackground2dName() );
-    BOOST_CHECK_EQUAL( "walkmesh_resource_name"     , f.getWalkmeshName() );
-    BOOST_CHECK_CLOSE( -5.625, f.getForwardDirection(), 0.001 );
-
-    VGears::MapFile::PointList     &points( f.getPoints() );
-    BOOST_REQUIRE_EQUAL( 1, points.size() );
-    VGears::MapFile::PointList::value_type    &point( points.at(0) );
-    BOOST_CHECK_EQUAL( "Spawn_md1_1", point.GetName() );
-    BOOST_CHECK( Ogre::Vector3( 29.0547f, 229.234f, 2.56082f ).positionEquals( point.GetPosition() ) );
-    BOOST_CHECK_CLOSE( 67.7647, point.GetRotation(), 0.001 );
-
-    VGears::MapFile::TriggerList   &triggers( f.getTriggers() );
-    BOOST_REQUIRE_EQUAL( 1, triggers.size() );
-    VGears::MapFile::TriggerList::value_type    &trigger( triggers.at(0) );
-    BOOST_CHECK_EQUAL( "Gateway0", trigger.GetName() );
-    BOOST_CHECK( Ogre::Vector3( 28.6016f, 228.562f, 2.75781f ).positionEquals( trigger.GetPoint1() ) );
-    BOOST_CHECK( Ogre::Vector3( 28.6641f, 229.438f, 2.75781f ).positionEquals( trigger.GetPoint2() ) );
-    BOOST_CHECK_EQUAL( true, trigger.IsEnabled() );
-
-    logMgr.destroyLog( "Default Log" );
-    ifs->close();
-}

+ 0 - 58
Tests/VGearsMain/src/test_VGearsPFile.cpp

@@ -1,58 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-11 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <cstddef>
-
-#define BOOST_TEST_MODULE VGearsPFile
-#include <boost/test/unit_test.hpp>
-
-#include "data/VGearsPFile.h"
-
-BOOST_AUTO_TEST_CASE( header_size )
-{
-    BOOST_CHECK_EQUAL( 0x18, sizeof( VGears::PFile::PolygonDefinition ) );
-    BOOST_CHECK_EQUAL( 0x38, sizeof( VGears::PFile::Group ) );
-}
-
-BOOST_AUTO_TEST_CASE( polygon_offset )
-{
-    BOOST_CHECK_EQUAL( 0x02, offsetof( VGears::PFile::PolygonDefinition, vertex ) );
-    BOOST_CHECK_EQUAL( 0x08, offsetof( VGears::PFile::PolygonDefinition, normal ) );
-    BOOST_CHECK_EQUAL( 0x0E, offsetof( VGears::PFile::PolygonDefinition, edge ) );
-}
-
-BOOST_AUTO_TEST_CASE( group_offset )
-{
-    BOOST_CHECK_EQUAL( 0x00, offsetof( VGears::PFile::Group, primitive_type ) );
-    BOOST_CHECK_EQUAL( 0x04, offsetof( VGears::PFile::Group, polygon_start_index ) );
-    BOOST_CHECK_EQUAL( 0x08, offsetof( VGears::PFile::Group, num_polygons ) );
-    BOOST_CHECK_EQUAL( 0x0C, offsetof( VGears::PFile::Group, vertex_start_index ) );
-    BOOST_CHECK_EQUAL( 0x10, offsetof( VGears::PFile::Group, num_vertices ) );
-    BOOST_CHECK_EQUAL( 0x14, offsetof( VGears::PFile::Group, edge_start_index ) );
-    BOOST_CHECK_EQUAL( 0x18, offsetof( VGears::PFile::Group, num_edges ) );
-    BOOST_CHECK_EQUAL( 0x2C, offsetof( VGears::PFile::Group, texture_coordinate_start_index ) );
-    BOOST_CHECK_EQUAL( 0x30, offsetof( VGears::PFile::Group, has_texture ) );
-    BOOST_CHECK_EQUAL( 0x34, offsetof( VGears::PFile::Group, texture_index ) );
-}

+ 0 - 92
Tests/VGearsMain/src/test_VGearsPFileSerializer.cpp

@@ -1,92 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-10 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#define BOOST_TEST_MODULE VGearsPFileSerializer
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "data/VGearsPFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( header_size )
-{
-    BOOST_CHECK_EQUAL( 0x80, sizeof( VGears::PFileSerializer::Header ) );
-}
-
-BOOST_AUTO_TEST_CASE( header_offset )
-{
-    BOOST_CHECK_EQUAL( 0x00, offsetof( VGears::PFileSerializer::Header, version                 ) );
-    BOOST_CHECK_EQUAL( 0x08, offsetof( VGears::PFileSerializer::Header, vertex_type             ) );
-    BOOST_CHECK_EQUAL( 0x0C, offsetof( VGears::PFileSerializer::Header, num_vertices            ) );
-    BOOST_CHECK_EQUAL( 0x10, offsetof( VGears::PFileSerializer::Header, num_normals             ) );
-    BOOST_CHECK_EQUAL( 0x14, offsetof( VGears::PFileSerializer::Header, num_unknown1            ) );
-    BOOST_CHECK_EQUAL( 0x18, offsetof( VGears::PFileSerializer::Header, num_texture_coordinates ) );
-    BOOST_CHECK_EQUAL( 0x1C, offsetof( VGears::PFileSerializer::Header, num_vertex_colors       ) );
-    BOOST_CHECK_EQUAL( 0x20, offsetof( VGears::PFileSerializer::Header, num_edges               ) );
-    BOOST_CHECK_EQUAL( 0x24, offsetof( VGears::PFileSerializer::Header, num_polygons            ) );
-    BOOST_CHECK_EQUAL( 0x30, offsetof( VGears::PFileSerializer::Header, num_materials           ) );
-    BOOST_CHECK_EQUAL( 0x34, offsetof( VGears::PFileSerializer::Header, num_groups              ) );
-    BOOST_CHECK_EQUAL( 0x38, offsetof( VGears::PFileSerializer::Header, num_bboxes              ) );
-    BOOST_CHECK_EQUAL( 0x3C, offsetof( VGears::PFileSerializer::Header, norm_index_table_flag   ) );
-}
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestPFile : public VGears::PFile
-    {
-    public:
-        TestPFile() : VGears::PFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-    };
-
-    const char* file_name( "reference.p" );
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-	Ogre::LogManager        logMgr;
-    VGears::PFileSerializer ser;
-    TestPFile               file;
-
-    logMgr.createLog( "Default Log", true, true, true );
-
-    ser.importPFile( stream, &file );
-
-    logMgr.destroyLog( "Default Log" );
-
-    BOOST_CHECK_EQUAL( 119, file.getVertices().size() );
-    BOOST_CHECK_EQUAL(  90, file.getNormals().size() );
-    BOOST_CHECK_EQUAL(  14, file.getTextureCoordinates().size() );
-    BOOST_CHECK_EQUAL( 119, file.getVertexColors().size() );
-    BOOST_CHECK_EQUAL( 291, file.getEdges().size() );
-    BOOST_CHECK_EQUAL( 180, file.getPolygonDefinitions().size() );
-    BOOST_CHECK_EQUAL( 180, file.getPolygonColors().size() );
-    BOOST_CHECK_EQUAL(   4, file.getGroups().size() );
-    BOOST_CHECK_EQUAL(   1, file.getBBoxes().size() );
-
-    ifs->close();
-}

+ 0 - 80
Tests/VGearsMain/src/test_VGearsPaletteFileSerializer.cpp

@@ -1,80 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-22 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#define BOOST_TEST_MODULE VGearsPaletteFileSerializer
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsPaletteFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::PaletteFile
-    {
-    public:
-        TestFile() : VGears::PaletteFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-
-        virtual void unload( void ) {};
-    };
-
-	Ogre::LogManager                    logMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-
-    const char*                     file_name( "reference.palette" );
-    TestFile                        file;
-    VGears::PaletteFileSerializer   ser;
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    ser.importPaletteFile( stream, &file );
-    BOOST_CHECK_EQUAL( 7180, stream->tell() );
-    BOOST_REQUIRE_EQUAL(   14, file.getPages().size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 0].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 1].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 2].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 3].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 4].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 5].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 6].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 7].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 8].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[ 9].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[10].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[11].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[12].size() );
-    BOOST_CHECK_EQUAL(  256, file.getPages()[13].size() );
-    BOOST_CHECK_EQUAL( 3584 * sizeof( VGears::PaletteFile::Color ), file.getCalculatedSize() );
-
-    BOOST_CHECK_EQUAL( 0x2A12, file.getPages()[0][0] );
-
-
-    logMgr.destroyLog( "Default Log" );
-    ifs->close();
-}

+ 0 - 75
Tests/VGearsMain/src/test_VGearsRSDSerializer.cpp

@@ -1,75 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-16 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include <fstream>
-
-#define BOOST_TEST_MODULE VGearsHRCFileSerializer
-#include <boost/test/unit_test.hpp>
-
-#include <Ogre.h>
-
-#include "data/VGearsRSDFileSerializer.h"
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestRSDFile : public VGears::RSDFile
-    {
-    public:
-        TestRSDFile() : VGears::RSDFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return calculateSize(); }
-    };
-
-	Ogre::LogManager                    logMgr;
-    Ogre::ResourceGroupManager          rgm;
-    Ogre::Math                          mth;
-    Ogre::LodStrategyManager            lodMgr;
-    Ogre::MeshManager                   meshMgr;
-    Ogre::MaterialManager               matMgr;
-    Ogre::SkeletonManager               skelMgr;
-    logMgr.createLog( "Default Log", true, true, true );
-    matMgr.initialise();
-
-    const char*                 file_name( "reference.rsd" );
-    TestRSDFile                 file;
-    VGears::RSDFileSerializer   ser;
-    std::ifstream *ifs(  OGRE_NEW_T( std::ifstream, Ogre::MEMCATEGORY_GENERAL )( file_name, std::ifstream::binary ) );
-    BOOST_REQUIRE( ifs->is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( ifs ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    ser.importRSDFile( stream, &file );
-
-    BOOST_CHECK_EQUAL( "Polygon.PLY"        , file.getPolygonName() );
-    BOOST_CHECK_EQUAL( "Material.MAT"       , file.getMaterialName() );
-    BOOST_CHECK_EQUAL( "Group.GRP"          , file.getGroupName() );
-    BOOST_CHECK_EQUAL( 3                    , file.getTextureNameCount() );
-    BOOST_CHECK_EQUAL( "First Texture.TIM"  , file.getTextureNames()[0] );
-    BOOST_CHECK_EQUAL( "SecondTexture.TIM"  , file.getTextureNames()[1] );
-    BOOST_CHECK_EQUAL( "Third Texture.TIM"  , file.getTextureNames()[2] );
-    BOOST_CHECK_EQUAL( 83                   , file.getCalculatedSize() );
-
-    logMgr.destroyLog( "Default Log" );
-    ifs->close();
-}

+ 0 - 85
Tests/VGearsMain/src/test_VGearsRingBuffer.cpp

@@ -1,85 +0,0 @@
-/*
------------------------------------------------------------------------------
-The MIT License (MIT)
-
-Copyright (c) 2013-08-18 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
-#define BOOST_TEST_MODULE VGearsRingBuffer
-#include <boost/test/unit_test.hpp>
-
-#include "VGearsLZSDataStream.h"
-
-BOOST_AUTO_TEST_CASE( overal )
-{
-    char data[] = { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8 };
-    VGears::RingBuffer<4> buffer;
-    BOOST_CHECK_EQUAL( 0, buffer.avail() );
-    BOOST_CHECK_EQUAL( 0, buffer.get( 0 ) );
-    BOOST_CHECK_EQUAL( 0, buffer.get( 1 ) );
-    BOOST_CHECK_EQUAL( 0, buffer.get( 2 ) );
-    BOOST_CHECK_EQUAL( 0, buffer.get( 3 ) );
-    BOOST_CHECK_EQUAL( 0, buffer.get( 4 ) );
-    buffer.write( data + 0 );
-    buffer.write( data + 1 );
-    buffer.write( data + 2 );
-    buffer.write( data + 3 );
-    BOOST_CHECK_EQUAL( data[0], buffer.get( 0 ) );
-    BOOST_CHECK_EQUAL( data[1], buffer.get( 1 ) );
-    BOOST_CHECK_EQUAL( data[2], buffer.get( 2 ) );
-    BOOST_CHECK_EQUAL( data[3], buffer.get( 3 ) );
-    BOOST_CHECK_EQUAL( data[0], buffer.get( 4 ) );
-    BOOST_CHECK_EQUAL( 4, buffer.avail() );
-    buffer.write( data + 4 );
-    buffer.write( data + 5 );
-    BOOST_CHECK_EQUAL( 4, buffer.avail() );
-    BOOST_CHECK_EQUAL( data[4], buffer.get( 0 ) );
-    BOOST_CHECK_EQUAL( data[5], buffer.get( 1 ) );
-    BOOST_CHECK_EQUAL( data[2], buffer.get( 2 ) );
-    BOOST_CHECK_EQUAL( data[3], buffer.get( 3 ) );
-    BOOST_CHECK_EQUAL( data[4], buffer.get( 4 ) );
-    BOOST_CHECK_EQUAL( data[5], buffer.get( 5 ) );
-    BOOST_CHECK_EQUAL( data[2], buffer.get( 6 ) );
-
-    memset( data, 0x77, sizeof( data ) );
-    const char expected[] = { 0x3, 0x4, 0x5, 0x6, 0x77, 0x77, 0x77, 0x77 };
-    BOOST_CHECK_EQUAL( sizeof( expected ), sizeof( data ) );
-
-    BOOST_CHECK_EQUAL( 4, buffer.avail() );
-    BOOST_CHECK_EQUAL( 4, buffer.read( data, sizeof( data ) ) );
-    BOOST_CHECK_EQUAL( 0, buffer.avail() );
-    BOOST_CHECK_EQUAL_COLLECTIONS( expected, expected + sizeof( expected ), data, data + sizeof( data ) );
-}
-
-BOOST_AUTO_TEST_CASE( read_single_bytes )
-{
-    VGears::RingBuffer<4> buffer;
-    char data;
-    data = 1; buffer.write( &data );
-    data = 2; buffer.write( &data );
-    data = 3; buffer.write( &data );
-    data = 4; buffer.write( &data );
-    BOOST_CHECK_EQUAL( 1, buffer.read( &data, sizeof( data ) ) ); BOOST_CHECK_EQUAL( 1, data );
-    BOOST_CHECK_EQUAL( 1, buffer.read( &data, sizeof( data ) ) ); BOOST_CHECK_EQUAL( 2, data );
-    BOOST_CHECK_EQUAL( 1, buffer.read( &data, sizeof( data ) ) ); BOOST_CHECK_EQUAL( 3, data );
-    BOOST_CHECK_EQUAL( 1, buffer.read( &data, sizeof( data ) ) ); BOOST_CHECK_EQUAL( 4, data );
-}

+ 0 - 70
Tests/VGearsMain/src/test_VGearsWalkmeshFileXMLSerializer.cpp

@@ -1,70 +0,0 @@
-/*
------------------------------------------------------------------------------
-Copyright (c) 06.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
-
-This file is part of V-Gears
-
-V-Gears is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.0 (GPLv2) of the License.
-
-V-Gears is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
------------------------------------------------------------------------------
-*/
-
-#include <fstream>
-
-#include <boost/test/unit_test.hpp>
-#include <Ogre.h>
-
-#include "map/VGearsWalkmeshFileXMLSerializer.h"
-
-BOOST_AUTO_TEST_CASE( read_file )
-{
-    class TestFile : public VGears::WalkmeshFile
-    {
-    public:
-        TestFile() : VGears::WalkmeshFile( NULL, "", 0, "" ) {}
-        size_t getCalculatedSize() const { return VGears::WalkmeshFile::calculateSize(); }
-        virtual void unload( void ) {}
-    };
-
-    const char* file_name( "misc/walkmesh.xml" );
-    std::ifstream ifs( file_name, std::ifstream::binary );
-    BOOST_REQUIRE( ifs.is_open() );
-    Ogre::DataStreamPtr stream( OGRE_NEW Ogre::FileStreamDataStream( &ifs, false ) );
-    BOOST_REQUIRE( stream->isReadable() );
-
-    Ogre::LogManager                    logMgr;
-    VGears::WalkmeshFileXMLSerializer   ser;
-    TestFile                            f;
-
-    logMgr.createLog( "Default Log", true, true, true );
-
-    ser.importWalkmeshFile( stream, &f );
-    VGears::WalkmeshFile::TriangleList &triangles( f.getTriangles() );
-    BOOST_CHECK_EQUAL( 2, triangles.size() );
-
-    VGears::WalkmeshFile::Triangle &t1( triangles.front() );
-    BOOST_CHECK_EQUAL( Ogre::Vector3(  1,   2,   4 ), t1.a );
-    BOOST_CHECK_EQUAL( Ogre::Vector3(  8,  16,  32 ), t1.b );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 64, 128, 256 ), t1.c );
-    BOOST_CHECK_EQUAL(  1, t1.access_side[0] );
-    BOOST_CHECK_EQUAL( -1, t1.access_side[1] );
-    BOOST_CHECK_EQUAL( -1, t1.access_side[2] );
-
-    VGears::WalkmeshFile::Triangle &t2( triangles.back() );
-    BOOST_CHECK_EQUAL( Ogre::Vector3(   4,   2,  1 ), t2.a );
-    BOOST_CHECK_EQUAL( Ogre::Vector3(  32,  16,  8 ), t2.b );
-    BOOST_CHECK_EQUAL( Ogre::Vector3( 256, 128, 64 ), t2.c );
-    BOOST_CHECK_EQUAL( -1, t2.access_side[0] );
-    BOOST_CHECK_EQUAL(  0, t2.access_side[1] );
-    BOOST_CHECK_EQUAL( -1, t2.access_side[2] );
-
-    logMgr.destroyLog( "Default Log" );
-
-    ifs.close();
-}

+ 0 - 2
Tests/VGearsMain/src/test_all.cpp

@@ -1,2 +0,0 @@
-#define BOOST_TEST_MODULE V-Gears
-#include <boost/test/included/unit_test.hpp>

+ 0 - 258
V-Gears-Installer/CMakeLists.txt

@@ -1,258 +0,0 @@
-# Include directories.
-include_directories(
-    ${VGears_INCLUDE_DIRS}
-    ${VGears_SOURCE_DIR}/V-Gears/include
-    ${CMAKE_CURRENT_SOURCE_DIR}/include
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${ZLIB_INCLUDE_DIRS}
-)
-
-# Define headers and source files for the installer.
-set(HEADER_FILES
-    include/common/FontFile.h
-    include/VGearsUtility.h
-    include/common/Logger.h
-    include/common/Surface.h
-    include/common/TimToVram.h
-    include/common/BinGZipFile.h
-    include/common/OgreBase.h
-    include/common/OgreGenUtilites.h
-    include/common/Vram.h
-    include/common/DrawSkeleton.h
-    include/common/Logger.h
-    include/decompiler/ScriptFormatter.h
-    include/decompiler/LuaLanguage.h
-    include/decompiler/CodeGenerator.h
-    include/decompiler/ControlFlow.h
-    include/decompiler/Disassembler.h
-    include/decompiler/Decompiler.h
-    include/decompiler/Engine.h
-    include/decompiler/Graph.h
-    include/decompiler/Function.h
-    include/decompiler/instruction/Instruction.h
-    include/decompiler/instruction/BinaryOpInstruction.h
-    include/decompiler/instruction/BinaryOpStackInstruction.h
-    include/decompiler/instruction/BoolNegateInstruction.h
-    include/decompiler/instruction/BoolNegateStackInstruction.h
-    include/decompiler/instruction/CallInstruction.h
-    include/decompiler/instruction/CondJumpInstruction.h
-    include/decompiler/instruction/DupInstruction.h
-    include/decompiler/instruction/DupStackInstruction.h
-    include/decompiler/instruction/JumpInstruction.h
-    include/decompiler/instruction/KernelCallInstruction.h
-    include/decompiler/instruction/KernelCallStackInstruction.h
-    include/decompiler/instruction/LoadInstruction.h
-    include/decompiler/instruction/ReturnInstruction.h
-    include/decompiler/instruction/StackInstruction.h
-    include/decompiler/instruction/StoreInstruction.h
-    include/decompiler/instruction/UnaryOpInstruction.h
-    include/decompiler/instruction/UnaryOpPostfixStackInstruction.h
-    include/decompiler/instruction/UnaryOpPrefixStackInstruction.h
-    include/decompiler/instruction/UncondJumpInstruction.h
-    include/decompiler/ObjectFactory.h
-    include/decompiler/RefCounted.h
-    include/decompiler/Stack.h
-    include/decompiler/DecompilerException.h
-    include/decompiler/Value.h
-    include/decompiler/field/instruction/FieldBackgroundInstruction.h
-    include/decompiler/field/instruction/FieldCameraInstruction.h
-    include/decompiler/field/instruction/FieldCondJumpInstruction.h
-    include/decompiler/field/instruction/FieldControlFlowInstruction.h
-    include/decompiler/field/instruction/FieldMathInstruction.h
-    include/decompiler/field/instruction/FieldMediaInstruction.h
-    include/decompiler/field/instruction/FieldModelInstruction.h
-    include/decompiler/field/instruction/FieldModuleInstruction.h
-    include/decompiler/field/instruction/FieldNoOperationInstruction.h
-    include/decompiler/field/instruction/FieldPartyInstruction.h
-    include/decompiler/field/instruction/FieldUncategorizedInstruction.h
-    include/decompiler/field/instruction/FieldUncondJumpInstruction.h
-    include/decompiler/field/instruction/FieldWalkmeshInstruction.h
-    include/decompiler/field/instruction/FieldWindowInstruction.h
-    include/decompiler/field/FieldDisassembler.h
-    include/decompiler/field/FieldEngine.h
-    include/decompiler/field/FieldCodeGenerator.h
-    include/decompiler/field/FieldDecompiler.h
-    include/decompiler/field/FieldScriptFormatter.h
-    include/decompiler/world/instruction/WorldBinaryEqualStackInstruction.h
-    include/decompiler/world/instruction/WorldCondJumpInstruction.h
-    include/decompiler/world/instruction/WorldKernelCallInstruction.h
-    include/decompiler/world/instruction/WorldLoadBankInstruction.h
-    include/decompiler/world/instruction/WorldLoadInstruction.h
-    include/decompiler/world/instruction/WorldNoOutputInstruction.h
-    include/decompiler/world/instruction/WorldStackInstruction.h
-    include/decompiler/world/instruction/WorldStoreInstruction.h
-    include/decompiler/world/instruction/WorldSubStackInstruction.h
-    include/decompiler/world/instruction/WorldUncondJumpInstruction.h
-    include/decompiler/world/WorldCodeGenerator.h
-    include/decompiler/world/WorldDisassembler.h
-    include/decompiler/world/WorldEngine.h
-    include/common/scummsys.h
-    include/common/BinaryReader.h
-    include/common/Lzs.h
-    include/ModelsAndAnimationsDb.h
-    include/ScopedLgp.h
-    include/TexFile.h
-    include/SpawnPointDb.h
-    include/KernelDataInstaller.h
-    include/MediaDataInstaller.h
-    include/FieldDataInstaller.h
-)
-
-
-set(SOURCE_FILES
-    src/common/Logger.cpp
-    src/common/BinGZipFile.cpp
-    src/common/DrawSkeleton.cpp
-    src/common/Surface.cpp
-    src/common/OgreGenUtilites.cpp
-    src/common/FontFile.cpp
-    src/common/TimToVram.cpp
-    src/common/Vram.cpp
-    src/common/OgreBase.cpp
-    src/VGearsUtility.cpp
-    src/decompiler/ScriptFormatter.cpp
-    src/decompiler/LuaLanguage.cpp
-    src/decompiler/CodeGenerator.cpp
-    src/decompiler/ControlFlow.cpp
-    src/decompiler/Disassembler.cpp
-    src/decompiler/Engine.cpp
-    src/decompiler/Graph.cpp
-    src/decompiler/instruction/Instruction.cpp
-    src/decompiler/instruction/BinaryOpStackInstruction.cpp
-    src/decompiler/instruction/BoolNegateStackInstruction.cpp
-    src/decompiler/instruction/CallInstruction.cpp
-    src/decompiler/instruction/CondJumpInstruction.cpp
-    src/decompiler/instruction/DupStackInstruction.cpp
-    src/decompiler/instruction/KernelCallInstruction.cpp
-    src/decompiler/instruction/KernelCallStackInstruction.cpp
-    src/decompiler/instruction/LoadInstruction.cpp
-    src/decompiler/instruction/ReturnInstruction.cpp
-    src/decompiler/instruction/StackInstruction.cpp
-    src/decompiler/instruction/StoreInstruction.cpp
-    src/decompiler/instruction/UnaryOpPostfixStackInstruction.cpp
-    src/decompiler/instruction/UnaryOpPrefixStackInstruction.cpp
-    src/decompiler/instruction/UncondJumpInstruction.cpp
-    src/decompiler/DecompilerException.cpp
-    src/decompiler/Value.cpp
-    src/decompiler/field/instruction/FieldBackgroundInstruction.cpp
-    src/decompiler/field/instruction/FieldCameraInstruction.cpp
-    src/decompiler/field/instruction/FieldCondJumpInstruction.cpp
-    src/decompiler/field/instruction/FieldControlFlowInstruction.cpp
-    src/decompiler/field/instruction/FieldMathInstruction.cpp
-    src/decompiler/field/instruction/FieldMediaInstruction.cpp
-    src/decompiler/field/instruction/FieldModelInstruction.cpp
-    src/decompiler/field/instruction/FieldModuleInstruction.cpp
-    src/decompiler/field/instruction/FieldNoOperationInstruction.cpp
-    src/decompiler/field/instruction/FieldPartyInstruction.cpp
-    src/decompiler/field/instruction/FieldUncategorizedInstruction.cpp
-    src/decompiler/field/instruction/FieldUncondJumpInstruction.cpp
-    src/decompiler/field/instruction/FieldWalkmeshInstruction.cpp
-    src/decompiler/field/instruction/FieldWindowInstruction.cpp
-    src/decompiler/field/FieldDisassembler.cpp
-    src/decompiler/field/FieldEngine.cpp
-    src/decompiler/field/FieldCodeGenerator.cpp
-    src/decompiler/field/FieldDecompiler.cpp
-    src/decompiler/field/FieldScriptFormatter.cpp
-    src/decompiler/world/instruction/WorldBinaryEqualStackInstruction.cpp
-    src/decompiler/world/instruction/WorldCondJumpInstruction.cpp
-    src/decompiler/world/instruction/WorldKernelCallInstruction.cpp
-    src/decompiler/world/instruction/WorldLoadBankInstruction.cpp
-    src/decompiler/world/instruction/WorldLoadInstruction.cpp
-    src/decompiler/world/instruction/WorldNoOutputInstruction.cpp
-    src/decompiler/world/instruction/WorldStackInstruction.cpp
-    src/decompiler/world/instruction/WorldStoreInstruction.cpp
-    src/decompiler/world/instruction/WorldSubStackInstruction.cpp
-    src/decompiler/world/instruction/WorldUncondJumpInstruction.cpp
-    src/decompiler/world/WorldCodeGenerator.cpp
-    src/decompiler/world/WorldDisassembler.cpp
-    src/decompiler/world/WorldEngine.cpp
-    src/ModelsAndAnimationsDb.cpp
-    src/ScopedLgp.cpp
-    src/TexFile.cpp
-    src/KernelDataInstaller.cpp
-    src/MediaDataInstaller.cpp
-    src/FieldDataInstaller.cpp
-)
-
-# For SUDM. TODO: Add elses.
-if (UNIX)
-    add_definitions(-DPOSIX)
-endif()
-
-add_library(Utility STATIC
-    ${HEADER_FILES}
-    ${SOURCE_FILES}
-)
-
-target_link_libraries(Utility
-    ${OGRE_LIBRARIES}
-    ${OIS_LIBRARIES}
-    ${ZLIB_LIBRARIES}
-)
-SET_PROPERTY(TARGET Utility PROPERTY FOLDER "utilities")
-
-# DEBUG, no optimizations
-#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
-
-find_package ( Qt5Widgets REQUIRED )
-include_directories (
-    ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
-    ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
-)
-set ( v-gears-launcher_HDRS
-    include/MainWindow.h
-    include/DataInstaller.h
-    include/FieldTextWriter.h
-)
-
-set(v-gears-launcher_SRCS
-    src/main.cpp
-    src/MainWindow.cpp
-    src/DataInstaller.cpp
-    src/FieldTextWriter.cpp
-)
-
-set(v-gears-launcher_UIS
-    src/MainWindow.ui
-)
-QT5_WRAP_UI(UIS ${v-gears-launcher_UIS})
-
-message(UIS: ${UIS})
-
-set(v-gears-launcher_MOCS
-    include/MainWindow.h
-)
-QT5_WRAP_CPP(MOCS ${v-gears-launcher_MOCS})
-
-add_definitions(-DVGEARS_ADD_MANAGERS)
-add_executable (v-gears-launcher ${v-gears-launcher_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS})
-
-SET_PROPERTY(TARGET v-gears-launcher PROPERTY FOLDER "utilities")
-
-if (APPLE)
-    target_link_libraries(v-gears-launcher "-framework CoreFoundation -framework Cocoa -framework IOKit")
-endif()
-
-if(WIN32)
-    set_target_properties(v-gears-launcher PROPERTIES WIN32_EXECUTABLE ON)
-    if (MSVC)
-        set_target_properties(v-gears-launcher PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
-    endif()
-endif()
-
-set(LIBRARIES
-    Utility
-    V-Gears
-    v-gears-data
-    #Sudm_Lib
-)
-
-find_package(Qt5 COMPONENTS Widgets REQUIRED)
-find_package(Qt5 COMPONENTS Core REQUIRED)
-target_link_libraries ( v-gears-launcher  Qt5::Widgets Qt5::Core  ${LIBRARIES} )
-
-if(WIN32 OR APPLE)
-    install(TARGETS v-gears-launcher DESTINATION .)
-else()
-    install(TARGETS v-gears-launcher RUNTIME DESTINATION bin)
-endif()

+ 0 - 126
V-Gears-Installer/src/CMakeLists.txt

@@ -1,126 +0,0 @@
-include_directories(
-    ${VGears_INCLUDE_DIRS}
-    ${VGears_SOURCE_DIR}/V-Gears/include
-    ${CMAKE_CURRENT_SOURCE_DIR}/common/include
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${ZLIB_INCLUDE_DIRS}
-)
-
-# define header and source files for the library
-set(HEADER_FILES
-./common/FontFile.h
-./common/include/VGearsUtility.h
-./common/Logger.h
-./common/Surface.h
-./common/TimToVram.h
-./common/BinGZipFile.h
-./common/OgreBase.h
-./common/OgreGenUtilites.h
-./common/Vram.h
-./common/DrawSkeleton.h
-)
-
-set(SOURCE_FILES
-./common/Logger.cpp
-./common/BinGZipFile.cpp
-./common/DrawSkeleton.cpp
-./common/Surface.cpp
-./common/OgreGenUtilites.cpp
-./common/FontFile.cpp
-./common/TimToVram.cpp
-./common/Vram.cpp
-./common/OgreBase.cpp
-./common/src/VGearsUtility.cpp
-)
-
-add_library(Utility STATIC
-  ${HEADER_FILES}
-  ${SOURCE_FILES}
-)
-
-#DEBUG, no optimizations
-#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
-
-target_link_libraries(Utility
-    ${OGRE_LIBRARIES}
-    ${OIS_LIBRARIES}
-    ${ZLIB_LIBRARIES}
-)
-SET_PROPERTY(TARGET Utility PROPERTY FOLDER "utilities")
-
-add_subdirectory(flevel)
-add_subdirectory(lzs)
-#add_subdirectory(v-gears-launcher)
-
-
-find_package ( Qt5Widgets REQUIRED )
-#include ( ${QT_USE_FILE} )
-include_directories (
-    ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
-    ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR}
-    )
-set ( v-gears-launcher_HDRS
-    include/mainwindow.h
-    include/ff7DataInstaller.h
-    include/ff7FieldTextWriter.h
-    )
-
-set ( v-gears-launcher_SRCS
-    src/main.cpp
-    src/mainwindow.cpp
-    src/ff7DataInstaller.cpp
-    src/ff7FieldTextWriter.cpp
-    )
-
-set ( v-gears-launcher_UIS
-    src/mainwindow.ui
-    )
-QT5_WRAP_UI(UIS ${v-gears-launcher_UIS})
-
-message(UIS: ${UIS})
-
-set ( v-gears-launcher_MOCS
-    include/mainwindow.h
-    )
-QT5_WRAP_CPP(MOCS ${v-gears-launcher_MOCS})
-
-add_definitions(
-    -DVGEARS_ADD_MANAGERS
-)
-add_executable ( v-gears-launcher ${v-gears-launcher_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS} )
-
-SET_PROPERTY(TARGET v-gears-launcher PROPERTY FOLDER "utilities")
-
-if (APPLE)
-target_link_libraries(v-gears-launcher "-framework CoreFoundation -framework Cocoa -framework IOKit")
-endif()
-
-if(WIN32)
-  set_target_properties(v-gears-launcher PROPERTIES WIN32_EXECUTABLE ON)
-  if (MSVC)
-    set_target_properties(v-gears-launcher PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
-  endif()
-endif()
-
-set(LIBRARIES
-    Utility
-    V-Gears
-    v-gears-data
-    #Sudm_Lib
-)
-
-
-find_package(Qt5 COMPONENTS Widgets REQUIRED)
-
-find_package(Qt5 COMPONENTS Core REQUIRED)
-
-#target_link_libraries ( v-gears-launcher  ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${LIBRARIES} )
-target_link_libraries ( v-gears-launcher  Qt5::Widgets Qt5::Core  ${LIBRARIES} )
-
-if(WIN32 OR APPLE)
-  install(TARGETS v-gears-launcher DESTINATION . ) 
-else()
-  install(TARGETS v-gears-launcher RUNTIME DESTINATION bin ) 
-endif()
-
-

+ 0 - 413
V-Gears/CMakeLists.txt

@@ -1,413 +0,0 @@
-# Define header and source files for V-Gears
-set(HEADER_FILES
-    include/modules/worldmap/WorldMapModule.h
-    include/common/VGearsManualObject.h
-    include/common/VGearsResource.h
-    include/common/VGearsStringUtil.h
-    include/common/TypeDefine.h
-    include/common/LzsFile.h
-    include/common/File.h
-    include/common/FileSystem.h
-    include/map/VGearsBackground2DFile.h
-    include/map/VGearsBackground2DFileManager.h
-    include/map/VGearsBackground2DFileXMLSerializer.h
-    include/map/VGearsTile.h
-    include/map/VGearsMapFile.h
-    include/map/VGearsMapFileManager.h
-    include/map/VGearsMapFileXMLSerializer.h
-    include/map/VGearsWalkmeshFile.h
-    include/map/VGearsWalkmeshFileManager.h
-    include/map/VGearsWalkmeshFileXMLSerializer.h
-    include/LuaIncludes.h
-    include/VGearsGameState.h
-    include/VGearsPrerequisites.h
-    include/core/particles/emitters/PointEmitter.h
-    include/core/particles/emitters/PointEmitterFactory.h
-    include/core/particles/renderer/ParticleEntityAdditionalData.h
-    include/core/particles/renderer/ParticleEntityRenderer.h
-    include/core/particles/renderer/ParticleEntityRendererDictionary.h
-    include/core/particles/renderer/ParticleEntityRendererFactory.h
-    include/core/particles/Particle.h
-    include/core/particles/ParticleAdditionalData.h
-    include/core/particles/ParticleEmitter.h
-    include/core/particles/ParticleEmitterDictionary.h
-    include/core/particles/ParticleEmitterFactory.h
-    include/core/particles/ParticleEmitterTranslator.h
-    include/core/particles/ParticlePool.h
-    include/core/particles/ParticlePoolMap.h
-    include/core/particles/ParticleRenderer.h
-    include/core/particles/ParticleRendererFactory.h
-    include/core/particles/ParticleRendererTranslator.h
-    include/core/particles/ParticleSystem.h
-    include/core/particles/ParticleSystemFactory.h
-    include/core/particles/ParticleSystemManager.h
-    include/core/particles/ParticleSystemTranslator.h
-    include/core/particles/ParticleSystemTranslatorManager.h
-    include/core/particles/ParticleTechnique.h
-    include/core/particles/ParticleTechniqueTranslator.h
-    include/core/particles/ParticleVisual.h
-    include/core/Assert.h
-    include/core/AudioManager.h
-    include/core/Background2D.h
-    include/core/Background2DAnimation.h
-    include/core/CameraManager.h
-    include/core/CameraManagerCommands.h
-    include/core/ConfigCmd.h
-    include/core/ConfigCmdManager.h
-    include/core/ConfigCmdManagerCommands.h
-    include/core/ConfigFile.h
-    include/core/ConfigVar.h
-    include/core/ConfigVarManager.h
-    include/core/Console.h
-    include/core/DebugDraw.h
-    include/core/Entity.h
-    include/core/EntityCollision.h
-    include/core/EntityDirection.h
-    include/core/EntityManager.h
-    include/core/EntityModel.h
-    include/core/EntityPoint.h
-    include/core/EntityTrigger.h
-    include/core/Event.h
-    include/core/GameFrameListener.h
-    include/core/InputManager.h
-    include/core/InputManagerCommands.h
-    include/core/Logger.h
-    include/core/Module.h
-    include/core/Savemap.h
-    include/core/SavemapManager.h
-    include/core/ScriptManager.h
-    include/core/ScriptManagerBinds.h
-    include/core/ScriptManagerCommands.h
-    include/core/Timer.h
-    include/core/UiAnimation.h
-    include/core/UiFont.h
-    include/core/UiManager.h
-    include/core/UiSprite.h
-    include/core/UiTextArea.h
-    include/core/UiWidget.h
-    include/core/Utilites.h
-    include/core/Walkmesh.h
-    include/core/XmlBackground2DFile.h
-    include/core/XmlFile.h
-    include/core/XmlFontFile.h
-    include/core/XmlFontsFile.h
-    include/core/XmlMapFile.h
-    include/core/XmlMusicsFile.h
-    include/core/XmlPrototypesFile.h
-    include/core/XmlScreenFile.h
-    include/core/XmlScreensFile.h
-    include/core/XmlScriptsFile.h
-    include/core/XmlSoundsFile.h
-    include/core/XmlTextFile.h
-    include/core/XmlTextsFile.h
-    include/core/DialogsManager.h
-    include/core/ScriptManagerBinds.h
-    include/core/TextManager.h
-    include/core/TextManagerCommands.h
-    include/data/VGearsXMLSerializer.h
-    include/common/FinalFantasy7/FF7NameLookup.h
-    include/map/FinalFantasy7/FF7WalkmeshFileSerializer.h
-    include/FF7Character.h
-    include/FF7Common.h
-)
-
-set(HEADER_FILES_DATA
-    include/common/VGearsApplication.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/VGearsAFile.h
-    include/data/VGearsAFileManager.h
-    include/data/VGearsAFileSerializer.h
-    include/data/VGearsBackgroundFile.h
-    include/data/VGearsBackgroundFileManager.h
-    include/data/VGearsBackgroundFileSerializer.h
-    include/data/VGearsBackgroundTextureLoader.h
-    include/data/VGearsCameraMatrixFile.h
-    include/data/VGearsCameraMatrixFileManager.h
-    include/data/VGearsCameraMatrixFileSerializer.h
-    include/data/VGearsFLevelBackground2DLoader.h
-    include/data/VGearsFLevelFile.h
-    include/data/VGearsFLevelFileManager.h
-    include/data/VGearsFLevelFileSerializer.h
-    include/data/VGearsFLevelTextureLoader.h
-    include/data/VGearsHRCFile.h
-    include/data/VGearsHRCFileManager.h
-    include/data/VGearsHRCFileSerializer.h
-    include/data/VGearsHRCMeshLoader.h
-    include/data/VGearsHRCSkeletonLoader.h
-    include/data/VGearsLGPArchive.h
-    include/data/VGearsLGPArchiveFactory.h
-    include/data/VGearsLGPArchiveSerializer.h
-    include/data/VGearsLZSDataStream.h
-    include/data/VGearsLZSFLevelFile.h
-    include/data/VGearsLZSFLevelFileManager.h
-    include/data/VGearsPaletteFile.h
-    include/data/VGearsPaletteFileManager.h
-    include/data/VGearsPaletteFileSerializer.h
-    include/data/VGearsPFile.h
-    include/data/VGearsPFileManager.h
-    include/data/VGearsPFileSerializer.h
-    include/data/VGearsRSDFile.h
-    include/data/VGearsRSDFileManager.h
-    include/data/VGearsRSDFileSerializer.h
-    include/data/VGearsSerializer.h
-    include/data/VGearsTexCodec.h
-    include/data/VGearsTexFile.h
-    include/data/VGearsTriggersFile.h
-    include/data/VGearsMapListFile.h
-    include/data/FinalFantasy7/FF7ModelListFile.h
-    include/data/FinalFantasy7/FF7ModelListFileManager.h
-    include/data/FinalFantasy7/FF7ModelListFileSerializer.h
-)
-
-set(SOURCE_FILES_DATA
-    src/common/VGearsApplication.cpp
-    src/data/VGearsAFile.cpp
-    src/data/VGearsAFileManager.cpp
-    src/data/VGearsAFileSerializer.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/VGearsBackgroundFile.cpp
-    src/data/VGearsBackgroundFileManager.cpp
-    src/data/VGearsBackgroundFileSerializer.cpp
-    src/data/VGearsBackgroundTextureLoader.cpp
-    src/data/VGearsCameraMatrixFile.cpp
-    src/data/VGearsCameraMatrixFileManager.cpp
-    src/data/VGearsCameraMatrixFileSerializer.cpp
-    src/data/VGearsFLevelBackground2DLoader.cpp
-    src/data/VGearsFLevelFile.cpp
-    src/data/VGearsFLevelFileManager.cpp
-    src/data/VGearsFLevelFileSerializer.cpp
-    src/data/VGearsFLevelTextureLoader.cpp
-    src/data/VGearsHRCFile.cpp
-    src/data/VGearsHRCFileManager.cpp
-    src/data/VGearsHRCFileSerializer.cpp
-    src/data/VGearsHRCMeshLoader.cpp
-    src/data/VGearsHRCSkeletonLoader.cpp
-    src/data/VGearsLGPArchive.cpp
-    src/data/VGearsLGPArchiveFactory.cpp
-    src/data/VGearsLGPArchiveSerializer.cpp
-    src/data/VGearsLZSDataStream.cpp
-    src/data/VGearsLZSFLevelFile.cpp
-    src/data/VGearsLZSFLevelFileManager.cpp
-    src/data/VGearsPaletteFile.cpp
-    src/data/VGearsPaletteFileManager.cpp
-    src/data/VGearsPaletteFileSerializer.cpp
-    src/data/VGearsPFile.cpp
-    src/data/VGearsPFileManager.cpp
-    src/data/VGearsPFileSerializer.cpp
-    src/data/VGearsRSDFile.cpp
-    src/data/VGearsRSDFileManager.cpp
-    src/data/VGearsRSDFileSerializer.cpp
-    src/data/VGearsSerializer.cpp
-    src/data/VGearsTexCodec.cpp
-    src/data/VGearsTexFile.cpp
-    src/data/VGearsTriggersFile.cpp
-    src/data/VGearsMapListFile.cpp
-    src/data/FinalFantasy7/FF7ModelListFile.cpp
-    src/data/FinalFantasy7/FF7ModelListFileManager.cpp
-    src/data/FinalFantasy7/FF7ModelListFileSerializer.cpp
-)
-
-set(SOURCE_FILES
-    src/modules/worldmap/WorldMapModule.cpp
-    src/common/VGearsManualObject.cpp
-    src/common/VGearsResource.cpp
-    src/common/VGearsStringUtil.cpp
-    src/common/TypeDefine.cpp
-    src/common/LzsFile.cpp
-    src/common/File.cpp
-    src/common/FileSystem.cpp
-    src/core/particles/emitters/PointEmitter.cpp
-    src/core/particles/emitters/PointEmitterFactory.cpp
-    src/core/particles/Particle.cpp
-    src/core/particles/ParticleEmitter.cpp
-    src/core/particles/ParticleEmitterDictionary.cpp
-    src/core/particles/ParticleEmitterTranslator.cpp
-    src/core/particles/ParticleRenderer.cpp
-    src/core/particles/ParticleRendererTranslator.cpp
-    src/core/particles/ParticleSystem.cpp
-    src/core/particles/ParticleSystemFactory.cpp
-    src/core/particles/ParticleSystemManager.cpp
-    src/core/particles/ParticleSystemTranslator.cpp
-    src/core/particles/ParticleSystemTranslatorManager.cpp
-    src/core/particles/ParticleTechnique.cpp
-    src/core/particles/ParticleTechniqueTranslator.cpp
-    src/core/particles/ParticleVisual.cpp
-    src/core/particles/renderer/ParticleEntityRenderer.cpp
-    src/core/particles/renderer/ParticleEntityRendererDictionary.cpp
-    src/core/AudioManager.cpp
-    src/core/Background2D.cpp
-    src/core/Background2DAnimation.cpp
-    src/core/CameraManager.cpp
-    src/core/ConfigCmd.cpp
-    src/core/ConfigCmdManager.cpp
-    src/core/ConfigFile.cpp
-    src/core/ConfigVar.cpp
-    src/core/ConfigVarManager.cpp
-    src/core/Console.cpp
-    src/core/DebugDraw.cpp
-    src/core/Entity.cpp
-    src/core/EntityCollision.cpp
-    src/core/EntityDirection.cpp
-    src/core/EntityManager.cpp
-    src/core/EntityModel.cpp
-    src/core/EntityPoint.cpp
-    src/core/EntityTrigger.cpp
-    src/core/GameFrameListener.cpp
-    src/core/InputManager.cpp
-    src/core/Savemap.cpp
-    src/core/SavemapManager.cpp
-    src/core/ScriptManager.cpp
-    src/core/Timer.cpp
-    src/core/UiAnimation.cpp
-    src/core/UiFont.cpp
-    src/core/UiManager.cpp
-    src/core/UiSprite.cpp
-    src/core/UiTextArea.cpp
-    src/core/UiWidget.cpp
-    src/core/Utilites.cpp
-    src/core/Walkmesh.cpp
-    src/core/XmlBackground2DFile.cpp
-    src/core/XmlFile.cpp
-    src/core/XmlFontFile.cpp
-    src/core/XmlFontsFile.cpp
-    src/core/XmlMapFile.cpp
-    src/core/XmlMapsFile.cpp
-    src/core/XmlMusicsFile.cpp
-    src/core/XmlPrototypesFile.cpp
-    src/core/XmlScreenFile.cpp
-    src/core/XmlScreensFile.cpp
-    src/core/XmlScriptsFile.cpp
-    src/core/XmlSoundsFile.cpp
-    src/core/XmlTextFile.cpp
-    src/core/XmlTextsFile.cpp
-    src/core/DialogsManager.cpp
-    src/core/TextManager.cpp
-    src/map/VGearsBackground2DFile.cpp
-    src/map/VGearsBackground2DFileManager.cpp
-    src/map/VGearsBackground2DFileXMLSerializer.cpp
-    src/map/VGearsMapFile.cpp
-    src/map/VGearsMapFileManager.cpp
-    src/map/VGearsMapFileXMLSerializer.cpp
-    src/map/VGearsWalkmeshFile.cpp
-    src/map/VGearsWalkmeshFileManager.cpp
-    src/map/VGearsWalkmeshFileXMLSerializer.cpp
-    src/VGearsGameState.cpp
-    src/data/VGearsXMLSerializer.cpp
-    src/common/FinalFantasy7/FF7NameLookup.cpp
-    src/map/FinalFantasy7/FF7WalkmeshFileSerializer.cpp
-    src/FF7Character.cpp
-    src/FF7Common.cpp
-)
-
-# Find LibOIS. TODO: Find it.
-set(ois_lib "/usr/lib/x86_64-linux-gnu/libOIS.so")
-
-# TODO: Find OIS
-include_directories(
-    ${VGears_INCLUDE_DIRS}
-    ${CMAKE_CURRENT_SOURCE_DIR}/include
-    /usr/include/OIS/
-)
-
-# Compiler options
-if (MSVC)
-else()
-    if(WIN32)
-        add_definitions(
-            -W
-            -mthreads
-            -fmessage-length=0
-            -fexceptions
-            -fident
-        )
-    
-        # Linker options
-        add_definitions(
-            -Wl,--enable-runtime-pseudo-reloc
-            -Wl,--enable-auto-image-base
-            -Wl,--add-stdcall-alias
-        )
-    endif()
-endif()
-
-# Defines.
-if(WIN32)
-    # Check usage and remove if uneccessary
-    add_definitions(-DWIN32 -D__WIN32__ -D_WINDOWS)
-endif()
-
-# TODO: Find OIS
-add_library(V-Gears STATIC
-    ${HEADER_FILES}
-    ${SOURCE_FILES}
-    /usr/include/OIS/
-)
-
-# Coverage uses more memory, combined with PCH can cause OOM/ICE
-#if ($ENV{COVERAGE}!=1)
-cotire(V-Gears)
-#endif()
-SET_PROPERTY(TARGET V-Gears PROPERTY FOLDER "v-gears")
-
-add_library(v-gears-data STATIC
-    ${HEADER_FILES_DATA}
-    ${SOURCE_FILES_DATA}
-)
-add_dependencies(v-gears-data configure_vgears_version)
-# Coverage uses more memory, combined with PCH can cause OOM/ICE
-if ($ENV{COVERAGE}!=1)
-    cotire(v-gears-data)
-endif()
-SET_PROPERTY(TARGET v-gears-data PROPERTY FOLDER "v-gears")
-
-add_executable(v-gears src/Main.cpp)
-SET_PROPERTY(TARGET v-gears PROPERTY FOLDER "v-gears")
-set(CPACK_PACKAGE_EXECUTABLES v-gears "v-gears")
-set(CPACK_WIX_PROGRAM_MENU_FOLDER "VGears")
-
-if (APPLE)
-    target_link_libraries(v-gears "-framework CoreFoundation -framework Cocoa -framework IOKit" ${ois_lib})
-endif()
-
-if( WIN32 AND NOT (CMAKE_BUILD_TYPE MATCHES "Debug") )
-    set_target_properties( v-gears PROPERTIES WIN32_EXECUTABLE ON )
-    if (MSVC)
-        set_target_properties(v-gears PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
-    endif()
-endif()
-
-target_link_libraries(V-Gears 
-    ${VGears_LIBRARIES}
-    LuaBind
-    liblua
-    tinyxml
-    ${ois_lib}
-)
-
-target_link_libraries(v-gears 
-    V-Gears
-    ${Boost_LIBRARIES}
-    v-gears-data
-    ${ois_lib}
-)
-
-target_link_libraries(v-gears-data
-    V-Gears
-    ${ois_lib}
-)
-
-if(WIN32 OR APPLE)
-    install(TARGETS v-gears DESTINATION .)
-else()
-    install(TARGETS v-gears RUNTIME DESTINATION ./games)
-endif()

+ 0 - 157
V-Gears/src/Main.cpp

@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2022 The V-Gears Team
- *
- * This file is part of V-Gears
- *
- * V-Gears is free software: you can redistribute it and/or modify it under
- * terms of the GNU General Public License as published by the Free Software
- * Foundation, version 3.0 (GPLv3) of the License.
- *
- * V-Gears is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include <OgreRoot.h>
-#include <OgreConfigFile.h>
-#include <OgreArchiveManager.h>
-#include <OIS.h>
-#include <OgreFontManager.h>
-#include <OgreOverlayManager.h>
-#include <OgreOverlaySystem.h>
-#include "VGearsGameState.h"
-#include "common/VGearsApplication.h"
-#include "core/AudioManager.h"
-#include "core/CameraManager.h"
-#include "core/ConfigCmdManager.h"
-#include "core/ConfigFile.h"
-#include "core/ConfigVarManager.h"
-#include "core/Console.h"
-#include "core/DebugDraw.h"
-#include "core/EntityManager.h"
-#include "core/GameFrameListener.h"
-#include "core/InputManager.h"
-#include "core/Logger.h"
-#include "core/SavemapManager.h"
-#include "core/ScriptManager.h"
-#include "core/Timer.h"
-#include "core/UiManager.h"
-#include "core/particles/ParticleSystemManager.h"
-#include "core/TextManager.h"
-#include "core/DialogsManager.h"
-#include "data/VGearsLZSFLevelFileManager.h"
-#include "modules/worldmap/WorldMapModule.h"
-#include "data/worldmap/MapFileManager.h"
-#include "data/VGearsLGPArchiveFactory.h"
-
-/**
- * Main application function
- *
- * @param[in] argc Number of command line arguments.
- * @param[in] argv List of command line arguments.
- * @return 0 on sucess, an error code on error.
- */
-int main(int argc, char *argv[]){
-    try{
-        std::cout << "V-Gears Init" << std::endl;
-        VGears::Application app(argc, argv);
-        if (!app.initOgre()) return 0;
-        Ogre::Root *root(app.getRoot());
-        Ogre::RenderWindow *window(app.getRenderWindow());
-        Ogre::SceneManager *scene_manager(nullptr);
-
-        auto timer = std::make_unique<Timer>();
-        auto particle_system_manager =
-          std::make_unique<ParticleSystemManager>();
-
-        // Set scene camera and viewport for other modules.
-        // Create this before initialize particle because some of them use
-        // scene to create themselves.
-        scene_manager = root->createSceneManager(Ogre::ST_GENERIC, "Scene");
-        // TODO: Why is this used twice?
-        scene_manager->setAmbientLight(Ogre::ColourValue(1, 1, 1));
-        scene_manager->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
-        Ogre::Light *directionalLight(
-          scene_manager->createLight("directionalLight")
-        );
-        directionalLight->setType(Ogre::Light::LT_DIRECTIONAL);
-        directionalLight->setDiffuseColour(Ogre::ColourValue(0.5, 0.5, 0.5));
-        directionalLight->setSpecularColour(Ogre::ColourValue(0.0, 0.0, 0.0));
-        directionalLight->setDirection(Ogre::Vector3(0, 1, 0));
-        // auto fontManager = std::make_unique<Ogre::FontManager>();
-        //VGears::MapFileManager* worldManager = new VGears::MapFileManager();
-
-        // Initialize resources.
-        // TODO: Use correct file location in the end, now is OK for testing
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-          ".", "FileSystem"
-        );
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-          "./data/wm", "FileSystem", "TEST"
-        );
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-          "./data/wm/world_us.lgp",
-          VGears::LGPArchiveFactory::ARCHIVE_TYPE, "TEST"
-        );
-        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-
-        // Initialize it before console because it may use it
-        auto config_var_manager = std::make_unique<ConfigVarManager>();
-        auto config_cmd_manager = std::make_unique<ConfigCmdManager>();
-        auto debug_draw = std::make_unique<DebugDraw>();
-
-        // Initialize before GameFrameListener, but after ConfigCmdManager
-        auto input_manager = std::make_unique<InputManager>();
-
-        auto audio_manager = std::make_unique<AudioManager>();
-
-        auto savemap_manager = std::make_unique<SavemapManager>();
-
-        // Create this earlier than DisplayFrameListener cause it can fire
-        // events there
-        auto camera_manager = std::make_unique<CameraManager>();
-        auto text_manager = std::make_unique<TextManager>();
-        auto ui_manager = std::make_unique<UiManager>();
-        auto dialogs_manager = std::make_unique<DialogsManager>();
-        auto entity_manager = std::make_unique<EntityManager>();
-        auto console = std::make_unique<Console>();
-        auto worldMapModule = std::make_unique<VGears::WorldMapModule>();
-
-        // Initialize after game managers because it attaches them to script.
-        auto script_manager = std::make_unique<ScriptManager>();
-
-        // Set base listener for usual game modules.
-        auto frame_listener = std::make_unique<GameFrameListener>(window);
-        root->addFrameListener(frame_listener.get());
-
-        // Execute the configuration file to locad values.
-        ConfigFile config;
-        config.Execute("./data/config.cfg");
-
-
-        // Initialize UID and run it's scripts.
-        ui_manager->Initialise();
-        dialogs_manager->Initialise();
-
-        // Run application loop
-        VGears::g_ApplicationState = VGears::G_GAME;
-        root->startRendering();
-
-        // System modules
-        // Thes must be removed first cause this can fire events to console.
-        root->removeFrameListener(frame_listener.get());
-
-        // Must be destroyed before the script manager.
-        entity_manager.reset();
-        ui_manager.reset();
-        script_manager.reset();
-    }
-    catch (const std::runtime_error& ex){
-        std::cout << "std::runtime_error thrown: " << ex.what() << std::endl;
-    }
-    catch (const Ogre::Exception& ex){
-        std::cout << "Ogre::Exception thrown: " << ex.what() << std::endl;
-    }
-    return 0;
-}

+ 5 - 7
lib/CMakeLists.txt

@@ -1,15 +1,13 @@
 include_directories(
-    ${VGears_INCLUDE_DIRS}
     luabind
     luajit/src
     luabind/luabind
     luabind/luabind/detail
 )
 
-# LuaJIT has it's own configuration.
-add_subdirectory(luajit)
+add_subdirectory(luajit) # LuaJIT has it's own configuration.
 
-aux_source_directory(luabind/luabind LuaBind_header_FILES)
-aux_source_directory(luabind/luabind/details LuaBind_header_details_FILES)
-aux_source_directory(luabind/src LuaBind_src_FILES)
-add_library(LuaBind STATIC ${LuaBind_src_FILES} ${LuaBind_header_FILES} ${LuaBind_header_details_FILES})
+aux_source_directory(luabind/luabind LUABIND_HEADER_FILES)
+aux_source_directory(luabind/luabind/details LUABIND_HEADER_DETAILS_FILES)
+aux_source_directory(luabind/src LUABIND_SRC_FILES)
+add_library(libluabind STATIC ${LUABIND_SRC_FILES} ${LUABIND_HEADER_FILES} ${LUABIND_HEADER_DETAILS_FILES})

+ 11 - 11
lib/luajit/CMakeLists.txt

@@ -16,7 +16,7 @@ project ( luajit C ASM)
 
 set( CMAKE_VERBOSE_MAKEFILE on )
 
-cmake_minimum_required ( VERSION 2.8 )
+cmake_minimum_required ( VERSION 3.0 )
 include ( cmake/dist.cmake )
 include ( lua )
 
@@ -28,10 +28,10 @@ set ( LUA_INIT "LUA_INIT" CACHE STRING "Environment variable for initial script.
 
 option ( LUA_ANSI "Use only ansi features." OFF )
 option ( LUA_USE_RELATIVE_LOADLIB "Use modified loadlib.c with support for relative paths on posix systems." ON)
-set ( LUA_IDSIZE 60 CACHE NUMBER "gives the maximum size for the description of the source." )
+set ( LUA_IDSIZE "60" CACHE STRING "gives the maximum size for the description of the source." )
 set ( LUA_PROMPT "> " CACHE STRING "Is the default prompt used by stand-alone Lua." )
 set ( LUA_PROMPT2 ">> " CACHE STRING "Is the default continuation prompt used by stand-alone Lua." )
-set ( LUA_MAXINPUT 512 CACHE NUMBER "Is the maximum length for an input line in the stand-alone interpreter.")
+set ( LUA_MAXINPUT "512" CACHE STRING "Is the maximum length for an input line in the stand-alone interpreter.")
 
 # Version
 set ( MAJVER 2 )
@@ -56,11 +56,11 @@ option ( LUAJIT_CPU_SSE2 "Disable SSE2." OFF )
 option ( LUAJIT_CPU_NOCMOV "Disable NOCMOV." OFF )
 
 # Tunable variables
-set ( LUAI_MAXSTACK 65500 CACHE NUMBER "Max. # of stack slots for a thread (<64K)." )
-set ( LUAI_MAXCSTACK 8000 CACHE NUMBER "Max. # of stack slots for a C func (<10K)." )
-set ( LUAI_GCPAUSE 200 CACHE NUMBER "Pause GC until memory is at 200%." )
-set ( LUAI_GCMUL 200 CACHE NUMBER "Run GC at 200% of allocation speed." )
-set ( LUA_MAXCAPTURES 32 CACHE NUMBER "Max. pattern captures." )
+set ( LUAI_MAXSTACK "65500" CACHE STRING "Max. # of stack slots for a thread (<64K)." )
+set ( LUAI_MAXCSTACK "8000" CACHE STRING "Max. # of stack slots for a C func (<10K)." )
+set ( LUAI_GCPAUSE "200" CACHE STRING "Pause GC until memory is at 200%." )
+set ( LUAI_GCMUL "200" CACHE STRING "Run GC at 200% of allocation speed." )
+set ( LUA_MAXCAPTURES "32" CACHE STRING "Max. pattern captures." )
 
 ## SETUP
 set ( LUA_DIRSEP "/" )
@@ -106,7 +106,7 @@ endif ()
 
 ## LIBRARY DETECTION
 # Optional libraries
-find_package ( Readline )
+find_package ( Readline QUIET)
 if ( READLINE_FOUND )
   option ( LUA_USE_READLINE "Use readline in the Lua CLI." ON )
 endif ()
@@ -209,8 +209,8 @@ list ( APPEND DASM_FLAGS -D VER=${DASM_VER} )
 
 string ( REPLACE ";" " " DASM_FLAGS_STR "${DASM_FLAGS}")
 
-message ( STATUS "DASM_FLAGS: ${DASM_FLAGS_STR}")
-message ( STATUS "DASM_ARCH: ${DASM_ARCH}" )
+#message ( STATUS "DASM_FLAGS: ${DASM_FLAGS_STR}")
+#message ( STATUS "DASM_ARCH: ${DASM_ARCH}" )
 
 set ( DASM_DASC ${CMAKE_CURRENT_SOURCE_DIR}/src/vm_${DASM_ARCH}.dasc )
 

+ 151 - 0
lib/luajit/Makefile

@@ -0,0 +1,151 @@
+##############################################################################
+# LuaJIT top level Makefile for installation. Requires GNU Make.
+#
+# Please read doc/install.html before changing any variables!
+#
+# Suitable for POSIX platforms (Linux, *BSD, OSX etc.).
+# Note: src/Makefile has many more configurable options.
+#
+# ##### This Makefile is NOT useful for Windows! #####
+# For MSVC, please follow the instructions given in src/msvcbuild.bat.
+# For MinGW and Cygwin, cd to src and run make with the Makefile there.
+#
+# Copyright (C) 2005-2014 Mike Pall. See Copyright Notice in luajit.h
+##############################################################################
+
+MAJVER=  2
+MINVER=  0
+RELVER=  3
+VERSION= $(MAJVER).$(MINVER).$(RELVER)
+ABIVER=  5.1
+
+##############################################################################
+#
+# Change the installation path as needed. This automatically adjusts
+# the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!
+#
+export PREFIX= /usr/local
+export MULTILIB= lib
+##############################################################################
+
+DPREFIX= $(DESTDIR)$(PREFIX)
+INSTALL_BIN=   $(DPREFIX)/bin
+INSTALL_LIB=   $(DPREFIX)/$(MULTILIB)
+INSTALL_SHARE= $(DPREFIX)/share
+INSTALL_INC=   $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
+
+INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION)
+INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
+INSTALL_LMODD= $(INSTALL_SHARE)/lua
+INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
+INSTALL_CMODD= $(INSTALL_LIB)/lua
+INSTALL_CMOD= $(INSTALL_CMODD)/$(ABIVER)
+INSTALL_MAN= $(INSTALL_SHARE)/man/man1
+INSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig
+
+INSTALL_TNAME= luajit-$(VERSION)
+INSTALL_TSYMNAME= luajit
+INSTALL_ANAME= libluajit-$(ABIVER).a
+INSTALL_SONAME= libluajit-$(ABIVER).so.$(MAJVER).$(MINVER).$(RELVER)
+INSTALL_SOSHORT= libluajit-$(ABIVER).so
+INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib
+INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
+INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
+INSTALL_PCNAME= luajit.pc
+
+INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
+INSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME)
+INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT)
+INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT)
+INSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME)
+INSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME)
+INSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME)
+
+INSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \
+  $(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD)
+UNINSTALL_DIRS= $(INSTALL_JITLIB) $(INSTALL_LJLIBD) $(INSTALL_INC) \
+  $(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD)
+
+RM= rm -f
+MKDIR= mkdir -p
+RMDIR= rmdir 2>/dev/null
+SYMLINK= ln -sf
+INSTALL_X= install -m 0755
+INSTALL_F= install -m 0644
+UNINSTALL= $(RM)
+LDCONFIG= ldconfig -n
+SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
+            -e "s|^multilib=.*|multilib=$(MULTILIB)|"
+
+FILE_T= luajit
+FILE_A= libluajit.a
+FILE_SO= libluajit.so
+FILE_MAN= luajit.1
+FILE_PC= luajit.pc
+FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
+FILES_JITLIB= bc.lua v.lua dump.lua dis_x86.lua dis_x64.lua dis_arm.lua \
+	      dis_ppc.lua dis_mips.lua dis_mipsel.lua bcsave.lua vmdef.lua
+
+ifeq (,$(findstring Windows,$(OS)))
+  ifeq (Darwin,$(shell uname -s))
+    INSTALL_SONAME= $(INSTALL_DYLIBNAME)
+    INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_DYLIBSHORT1)
+    INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_DYLIBSHORT2)
+    LDCONFIG= :
+  endif
+endif
+
+##############################################################################
+
+INSTALL_DEP= src/luajit
+
+default all $(INSTALL_DEP):
+	@echo "==== Building LuaJIT $(VERSION) ===="
+	$(MAKE) -C src
+	@echo "==== Successfully built LuaJIT $(VERSION) ===="
+
+install: $(INSTALL_DEP)
+	@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
+	$(MKDIR) $(INSTALL_DIRS)
+	cd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T)
+	cd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || :
+	$(RM) $(INSTALL_TSYM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2)
+	cd src && test -f $(FILE_SO) && \
+	  $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \
+	  $(LDCONFIG) $(INSTALL_LIB) && \
+	  $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \
+	  $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || :
+	cd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN)
+	cd etc && $(SED_PC) $(FILE_PC) > $(FILE_PC).tmp && \
+	  $(INSTALL_F) $(FILE_PC).tmp $(INSTALL_PC) && \
+	  $(RM) $(FILE_PC).tmp
+	cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
+	cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
+	$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
+	@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
+
+uninstall:
+	@echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
+	$(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
+	for file in $(FILES_JITLIB); do \
+	  $(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
+	  done
+	for file in $(FILES_INC); do \
+	  $(UNINSTALL) $(INSTALL_INC)/$$file; \
+	  done
+	$(LDCONFIG) $(INSTALL_LIB)
+	$(RMDIR) $(UNINSTALL_DIRS) || :
+	@echo "==== Successfully uninstalled LuaJIT $(VERSION) from $(PREFIX) ===="
+
+##############################################################################
+
+amalg:
+	@echo "Building LuaJIT $(VERSION)"
+	$(MAKE) -C src amalg
+
+clean:
+	$(MAKE) -C src clean
+
+.PHONY: all install amalg clean
+
+##############################################################################

+ 118 - 0
lib/luajit/cmake/FindLua.cmake

@@ -0,0 +1,118 @@
+# Locate Lua library
+# This module defines
+#  LUA_EXECUTABLE, if found
+#  LUA_FOUND, if false, do not try to link to Lua 
+#  LUA_LIBRARIES
+#  LUA_INCLUDE_DIR, where to find lua.h
+#  LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
+#
+# Note that the expected include convention is
+#  #include "lua.h"
+# and not
+#  #include <lua/lua.h>
+# This is because, the lua location is not standardized and may exist
+# in locations other than lua/
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+# Modified to support Lua 5.2 by LuaDist 2012
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+#
+# The required version of Lua can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Lua 5.1)
+# Otherwise the module will search for any available Lua implementation
+
+# Always search for non-versioned lua first (recommended)
+SET(_POSSIBLE_LUA_INCLUDE include include/lua)
+SET(_POSSIBLE_LUA_EXECUTABLE lua)
+SET(_POSSIBLE_LUA_LIBRARY lua)
+
+# Determine possible naming suffixes (there is no standard for this)
+IF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
+  SET(_POSSIBLE_SUFFIXES "${Lua_FIND_VERSION_MAJOR}${Lua_FIND_VERSION_MINOR}" "${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}" "-${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}")
+ELSE(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
+  SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "51" "5.1" "-5.1")
+ENDIF(Lua_FIND_VERSION_MAJOR AND Lua_FIND_VERSION_MINOR)
+
+# Set up possible search names and locations
+FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES})
+  LIST(APPEND _POSSIBLE_LUA_INCLUDE "include/lua${_SUFFIX}")
+  LIST(APPEND _POSSIBLE_LUA_EXECUTABLE "lua${_SUFFIX}")
+  LIST(APPEND _POSSIBLE_LUA_LIBRARY "lua${_SUFFIX}")
+ENDFOREACH(_SUFFIX)
+
+# Find the lua executable
+FIND_PROGRAM(LUA_EXECUTABLE
+  NAMES ${_POSSIBLE_LUA_EXECUTABLE}
+)
+
+# Find the lua header
+FIND_PATH(LUA_INCLUDE_DIR lua.h
+  HINTS
+  $ENV{LUA_DIR}
+  PATH_SUFFIXES ${_POSSIBLE_LUA_INCLUDE}
+  PATHS
+  ~/Library/Frameworks
+  /Library/Frameworks
+  /usr/local
+  /usr
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+  /opt
+)
+
+# Find the lua library
+FIND_LIBRARY(LUA_LIBRARY 
+  NAMES ${_POSSIBLE_LUA_LIBRARY}
+  HINTS
+  $ENV{LUA_DIR}
+  PATH_SUFFIXES lib64 lib
+  PATHS
+  ~/Library/Frameworks
+  /Library/Frameworks
+  /usr/local
+  /usr
+  /sw
+  /opt/local
+  /opt/csw
+  /opt
+)
+
+IF(LUA_LIBRARY)
+  # include the math library for Unix
+  IF(UNIX AND NOT APPLE)
+    FIND_LIBRARY(LUA_MATH_LIBRARY m)
+    SET( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
+  # For Windows and Mac, don't need to explicitly include the math library
+  ELSE(UNIX AND NOT APPLE)
+    SET( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
+  ENDIF(UNIX AND NOT APPLE)
+ENDIF(LUA_LIBRARY)
+
+# Determine Lua version
+IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
+  FILE(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
+
+  STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
+  UNSET(lua_version_str)
+ENDIF()
+
+INCLUDE(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if 
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
+                                  REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
+                                  VERSION_VAR LUA_VERSION_STRING)
+
+MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY LUA_EXECUTABLE)
+

+ 25 - 0
lib/luajit/cmake/FindReadline.cmake

@@ -0,0 +1,25 @@
+# - Try to find Readline
+# Once done this will define
+#  READLINE_FOUND - System has readline
+#  READLINE_INCLUDE_DIRS - The readline include directories
+#  READLINE_LIBRARIES - The libraries needed to use readline
+#  READLINE_DEFINITIONS - Compiler switches required for using readline
+
+find_package ( PkgConfig )
+pkg_check_modules ( PC_READLINE QUIET readline )
+set ( READLINE_DEFINITIONS ${PC_READLINE_CFLAGS_OTHER} )
+
+find_path ( READLINE_INCLUDE_DIR readline/readline.h
+      HINTS ${PC_READLINE_INCLUDEDIR} ${PC_READLINE_INCLUDE_DIRS}
+      PATH_SUFFIXES readline )
+
+find_library ( READLINE_LIBRARY NAMES readline
+      HINTS ${PC_READLINE_LIBDIR} ${PC_READLINE_LIBRARY_DIRS} )
+
+set ( READLINE_LIBRARIES ${READLINE_LIBRARY} )
+set ( READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR} )
+
+include ( FindPackageHandleStandardArgs )
+# handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args ( Readline DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR )

+ 319 - 0
lib/luajit/cmake/dist.cmake

@@ -0,0 +1,319 @@
+# LuaDist CMake utility library.
+# Provides sane project defaults and macros common to LuaDist CMake builds.
+# 
+# Copyright (C) 2007-2012 LuaDist.
+# by David Manura, Peter Drahoš
+# Redistribution and use of this file is allowed according to the terms of the MIT license.
+# For details see the COPYRIGHT file distributed with LuaDist.
+# Please note that the package source code is licensed under its own license.
+
+## Extract information from dist.info
+if ( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/dist.info )
+  message ( FATAL_ERROR
+    "Missing dist.info file (${CMAKE_CURRENT_SOURCE_DIR}/dist.info)." )
+endif ()
+file ( READ ${CMAKE_CURRENT_SOURCE_DIR}/dist.info DIST_INFO )
+if ( "${DIST_INFO}" STREQUAL "" )
+  message ( FATAL_ERROR "Failed to load dist.info." )
+endif ()
+# Reads field `name` from dist.info string `DIST_INFO` into variable `var`.
+macro ( _parse_dist_field name var )
+  string ( REGEX REPLACE ".*${name}[ \t]?=[ \t]?[\"']([^\"']+)[\"'].*" "\\1"
+           ${var} "${DIST_INFO}" )
+  if ( ${var} STREQUAL DIST_INFO )
+    message ( FATAL_ERROR "Failed to extract \"${var}\" from dist.info" )
+  endif ()
+endmacro ()
+#
+_parse_dist_field ( name DIST_NAME )
+_parse_dist_field ( version DIST_VERSION )
+_parse_dist_field ( license DIST_LICENSE )
+_parse_dist_field ( author DIST_AUTHOR )
+_parse_dist_field ( maintainer DIST_MAINTAINER )
+_parse_dist_field ( url DIST_URL )
+_parse_dist_field ( desc DIST_DESC )
+#message ( STATUS "DIST_NAME: ${DIST_NAME}")
+#message ( STATUS "DIST_VERSION: ${DIST_VERSION}")
+#message ( STATUS "DIST_LICENSE: ${DIST_LICENSE}")
+#message ( STATUS "DIST_AUTHOR: ${DIST_AUTHOR}")
+#message ( STATUS "DIST_MAINTAINER: ${DIST_MAINTAINER}")
+#message ( STATUS "DIST_URL: ${DIST_URL}")
+#message ( STATUS "DIST_DESC: ${DIST_DESC}")
+string ( REGEX REPLACE ".*depends[ \t]?=[ \t]?[\"']([^\"']+)[\"'].*" "\\1"
+         DIST_DEPENDS ${DIST_INFO} )
+if ( DIST_DEPENDS STREQUAL DIST_INFO )
+  set ( DIST_DEPENDS "" )
+endif ()
+#message ( STATUS "DIST_DEPENDS: ${DIST_DEPENDS}")
+## 2DO: Parse DIST_DEPENDS and try to install Dependencies with automatically using externalproject_add
+
+
+## INSTALL DEFAULTS (Relative to CMAKE_INSTALL_PREFIX)
+# Primary paths
+set ( INSTALL_BIN bin CACHE PATH "Where to install binaries to." )
+set ( INSTALL_LIB lib CACHE PATH "Where to install libraries to." )
+set ( INSTALL_INC include CACHE PATH "Where to install headers to." )
+set ( INSTALL_ETC etc CACHE PATH "Where to store configuration files" )
+set ( INSTALL_SHARE share CACHE PATH "Directory for shared data." )
+
+# Secondary paths
+option ( INSTALL_VERSION
+      "Install runtime libraries and executables with version information." OFF)
+set ( INSTALL_DATA ${INSTALL_SHARE}/${DIST_NAME} CACHE PATH
+      "Directory the package can store documentation, tests or other data in.")  
+set ( INSTALL_DOC  ${INSTALL_DATA}/doc CACHE PATH
+      "Recommended directory to install documentation into.")
+set ( INSTALL_EXAMPLE ${INSTALL_DATA}/example CACHE PATH
+      "Recommended directory to install examples into.")
+set ( INSTALL_TEST ${INSTALL_DATA}/test CACHE PATH
+      "Recommended directory to install tests into.")
+set ( INSTALL_FOO  ${INSTALL_DATA}/etc CACHE PATH
+      "Where to install additional files")
+
+# Tweaks and other defaults
+# Setting CMAKE to use loose block and search for find modules in source directory
+set ( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
+set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} )
+option ( BUILD_SHARED_LIBS "Build shared libraries" ON )
+
+# In MSVC, prevent warnings that can occur when using standard libraries.
+if ( MSVC )
+  add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
+endif ()
+
+# RPath and relative linking
+option ( USE_RPATH "Use relative linking." ON)
+if ( USE_RPATH )
+  string ( REGEX REPLACE "[^!/]+" ".." UP_DIR ${INSTALL_BIN} )
+  set ( CMAKE_SKIP_BUILD_RPATH FALSE CACHE STRING "" FORCE )
+  set ( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE CACHE STRING "" FORCE )
+  set ( CMAKE_INSTALL_RPATH $ORIGIN/${UP_DIR}/${INSTALL_LIB}
+        CACHE STRING "" FORCE )
+  set ( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE STRING "" FORCE )
+  set ( CMAKE_INSTALL_NAME_DIR @executable_path/${UP_DIR}/${INSTALL_LIB}
+        CACHE STRING "" FORCE )
+endif ()
+
+## MACROS
+# Parser macro
+macro ( parse_arguments prefix arg_names option_names)
+  set ( DEFAULT_ARGS )
+  foreach ( arg_name ${arg_names} )
+    set ( ${prefix}_${arg_name} )
+  endforeach ()
+  foreach ( option ${option_names} )
+    set ( ${prefix}_${option} FALSE )
+  endforeach ()
+
+  set ( current_arg_name DEFAULT_ARGS )
+  set ( current_arg_list )
+  foreach ( arg ${ARGN} )            
+    set ( larg_names ${arg_names} )    
+    list ( FIND larg_names "${arg}" is_arg_name )                   
+    if ( is_arg_name GREATER -1 )
+      set ( ${prefix}_${current_arg_name} ${current_arg_list} )
+      set ( current_arg_name ${arg} )
+      set ( current_arg_list )
+    else ()
+      set ( loption_names ${option_names} )    
+      list ( FIND loption_names "${arg}" is_option )            
+      if ( is_option GREATER -1 )
+        set ( ${prefix}_${arg} TRUE )
+      else ()
+        set ( current_arg_list ${current_arg_list} ${arg} )
+      endif ()
+    endif ()
+  endforeach ()
+  set ( ${prefix}_${current_arg_name} ${current_arg_list} )
+endmacro ()
+
+
+# install_executable ( executable_targets )
+# Installs any executables generated using "add_executable".
+# USE: install_executable ( lua )
+# NOTE: subdirectories are NOT supported
+set ( CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "${DIST_NAME} Runtime" )
+set ( CPACK_COMPONENT_RUNTIME_DESCRIPTION
+      "Executables and runtime libraries. Installed into ${INSTALL_BIN}." )
+macro ( install_executable )
+  foreach ( _file ${ARGN} )
+    if ( INSTALL_VERSION )
+      set_target_properties ( ${_file} PROPERTIES VERSION ${DIST_VERSION}
+                              SOVERSION ${DIST_VERSION} )
+    endif ()
+    install ( TARGETS ${_file} RUNTIME DESTINATION ${INSTALL_BIN}
+              COMPONENT Runtime )
+  endforeach()
+endmacro ()
+
+# install_library ( library_targets )
+# Installs any libraries generated using "add_library" into apropriate places.
+# USE: install_library ( libexpat )
+# NOTE: subdirectories are NOT supported
+set ( CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "${DIST_NAME} Development Libraries" )
+set ( CPACK_COMPONENT_LIBRARY_DESCRIPTION
+  "Static and import libraries needed for development. Installed into ${INSTALL_LIB} or ${INSTALL_BIN}." )
+macro ( install_library )
+  foreach ( _file ${ARGN} )
+    if ( INSTALL_VERSION )
+      set_target_properties ( ${_file} PROPERTIES VERSION ${DIST_VERSION}
+                              SOVERSION ${DIST_VERSION} )
+    endif ()
+    install ( TARGETS ${_file}
+              RUNTIME DESTINATION . COMPONENT Runtime )
+  endforeach()
+endmacro ()
+
+# helper function for various install_* functions, for PATTERN/REGEX args.
+macro ( _complete_install_args )
+  if ( NOT("${_ARG_PATTERN}" STREQUAL "") )
+    set ( _ARG_PATTERN PATTERN ${_ARG_PATTERN} )
+  endif ()
+  if ( NOT("${_ARG_REGEX}" STREQUAL "") )
+    set ( _ARG_REGEX REGEX ${_ARG_REGEX} )
+  endif ()
+endmacro ()
+
+# install_header ( files/directories [INTO destination] )
+# Install a directories or files into header destination.
+# USE: install_header ( lua.h luaconf.h ) or install_header ( GL )
+# USE: install_header ( mylib.h INTO mylib )
+# For directories, supports optional PATTERN/REGEX arguments like install().
+set ( CPACK_COMPONENT_HEADER_DISPLAY_NAME "${DIST_NAME} Development Headers" )
+set ( CPACK_COMPONENT_HEADER_DESCRIPTION
+      "Headers needed for development. Installed into ${INSTALL_INC}." )
+macro ( install_header )
+  parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
+  _complete_install_args()
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO}
+                COMPONENT Header ${_ARG_PATTERN} ${_ARG_REGEX} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO}
+                COMPONENT Header )
+    endif ()
+  endforeach()
+endmacro ()
+
+# install_data ( files/directories [INTO destination] )
+# This installs additional data files or directories.
+# USE: install_data ( extra data.dat )
+# USE: install_data ( image1.png image2.png INTO images )
+# For directories, supports optional PATTERN/REGEX arguments like install().
+set ( CPACK_COMPONENT_DATA_DISPLAY_NAME "${DIST_NAME} Data" )
+set ( CPACK_COMPONENT_DATA_DESCRIPTION
+      "Application data. Installed into ${INSTALL_DATA}." )
+macro ( install_data )
+  parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
+  _complete_install_args()
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file}
+                DESTINATION ${INSTALL_DATA}/${_ARG_INTO}
+                COMPONENT Data ${_ARG_PATTERN} ${_ARG_REGEX} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_DATA}/${_ARG_INTO}
+                COMPONENT Data )
+    endif ()
+  endforeach()
+endmacro ()
+
+# INSTALL_DOC ( files/directories [INTO destination] )
+# This installs documentation content
+# USE: install_doc ( doc/ doc.pdf )
+# USE: install_doc ( index.html INTO html )
+# For directories, supports optional PATTERN/REGEX arguments like install().
+set ( CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "${DIST_NAME} Documentation" )
+set ( CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
+      "Application documentation. Installed into ${INSTALL_DOC}." )
+macro ( install_doc )
+  parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
+  _complete_install_args()
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO}
+                COMPONENT Documentation ${_ARG_PATTERN} ${_ARG_REGEX} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO}
+                COMPONENT Documentation )
+    endif ()
+  endforeach()
+endmacro ()
+
+# install_example ( files/directories [INTO destination]  )
+# This installs additional examples
+# USE: install_example ( examples/ exampleA )
+# USE: install_example ( super_example super_data INTO super)
+# For directories, supports optional PATTERN/REGEX argument like install().
+set ( CPACK_COMPONENT_EXAMPLE_DISPLAY_NAME "${DIST_NAME} Examples" )
+set ( CPACK_COMPONENT_EXAMPLE_DESCRIPTION
+    "Examples and their associated data. Installed into ${INSTALL_EXAMPLE}." )
+macro ( install_example )
+  parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
+  _complete_install_args()
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO}
+                COMPONENT Example ${_ARG_PATTERN} ${_ARG_REGEX} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO}
+                COMPONENT Example )
+    endif ()
+  endforeach()
+endmacro ()
+
+# install_test ( files/directories [INTO destination] )
+# This installs tests and test files, DOES NOT EXECUTE TESTS
+# USE: install_test ( my_test data.sql )
+# USE: install_test ( feature_x_test INTO x )
+# For directories, supports optional PATTERN/REGEX argument like install().
+set ( CPACK_COMPONENT_TEST_DISPLAY_NAME "${DIST_NAME} Tests" )
+set ( CPACK_COMPONENT_TEST_DESCRIPTION
+      "Tests and associated data. Installed into ${INSTALL_TEST}." )
+macro ( install_test )
+  parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
+  _complete_install_args()
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO}
+                COMPONENT Test ${_ARG_PATTERN} ${_ARG_REGEX} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO}
+                COMPONENT Test )
+    endif ()
+  endforeach()
+endmacro ()
+
+# install_foo ( files/directories [INTO destination] )
+# This installs optional or otherwise unneeded content
+# USE: install_foo ( etc/ example.doc )
+# USE: install_foo ( icon.png logo.png INTO icons)
+# For directories, supports optional PATTERN/REGEX argument like install().
+set ( CPACK_COMPONENT_OTHER_DISPLAY_NAME "${DIST_NAME} Unspecified Content" )
+set ( CPACK_COMPONENT_OTHER_DESCRIPTION
+      "Other unspecified content. Installed into ${INSTALL_FOO}." )
+macro ( install_foo )
+  parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
+  _complete_install_args()
+  foreach ( _file ${_ARG_DEFAULT_ARGS} )
+    if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
+      install ( DIRECTORY ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO}
+                COMPONENT Other ${_ARG_PATTERN} ${_ARG_REGEX} )
+    else ()
+      install ( FILES ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO}
+                COMPONENT Other )
+    endif ()
+  endforeach()
+endmacro ()
+
+## CTest defaults
+
+## CPack defaults
+set ( CPACK_GENERATOR "ZIP" )
+set ( CPACK_STRIP_FILES TRUE )
+set ( CPACK_PACKAGE_NAME "${DIST_NAME}" )
+set ( CPACK_PACKAGE_VERSION "${DIST_VERSION}")
+set ( CPACK_PACKAGE_VENDOR "LuaDist" )
+set ( CPACK_COMPONENTS_ALL Runtime Library Header Data Documentation Example Other )
+include ( CPack )

+ 297 - 0
lib/luajit/cmake/lua.cmake

@@ -0,0 +1,297 @@
+# LuaDist CMake utility library for Lua.
+# 
+# Copyright (C) 2007-2012 LuaDist.
+# by David Manura, Peter Drahos
+# Redistribution and use of this file is allowed according to the terms of the MIT license.
+# For details see the COPYRIGHT file distributed with LuaDist.
+# Please note that the package source code is licensed under its own license.
+
+set ( INSTALL_LMOD ${INSTALL_LIB}/lua
+      CACHE PATH "Directory to install Lua modules." )
+set ( INSTALL_CMOD ${INSTALL_LIB}/lua
+      CACHE PATH "Directory to install Lua binary modules." )
+
+option ( SKIP_LUA_WRAPPER
+         "Do not build and install Lua executable wrappers." OFF)
+
+# List of (Lua module name, file path) pairs.
+# Used internally by add_lua_test.  Built by add_lua_module.
+set ( _lua_modules )
+
+# utility function: appends path `path` to path `basepath`, properly
+# handling cases when `path` may be relative or absolute.
+macro ( _append_path basepath path result )
+  if ( IS_ABSOLUTE "${path}" )
+    set ( ${result} "${path}" )
+  else ()
+    set ( ${result} "${basepath}/${path}" )
+  endif ()
+endmacro ()
+
+# install_lua_executable ( target source )
+# Automatically generate a binary if srlua package is available
+# The application or its source will be placed into /bin 
+# If the application source did have .lua suffix then it will be removed
+# USE: lua_executable ( sputnik src/sputnik.lua )
+macro ( install_lua_executable _name _source )
+  # Find srlua and glue
+  find_program( SRLUA_EXECUTABLE NAMES srlua )
+  find_program( GLUE_EXECUTABLE NAMES glue )
+  # Executable output
+  set ( _exe ${CMAKE_CURRENT_BINARY_DIR}/${_name}${CMAKE_EXECUTABLE_SUFFIX} )
+  if ( NOT SKIP_LUA_WRAPPER AND SRLUA_EXECUTABLE AND GLUE_EXECUTABLE )
+    # Generate binary gluing the lua code to srlua, this is a robuust approach for most systems
+    # Recommended, expecially for Windows systems
+    add_custom_command(
+      OUTPUT ${_exe}
+      COMMAND ${GLUE_EXECUTABLE} 
+      ARGS ${SRLUA_EXECUTABLE} ${_source} ${_exe}
+      DEPENDS ${_source}
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      VERBATIM
+    )
+    # Make sure we have a target associated with the binary
+    add_custom_target(${_name} ALL
+        DEPENDS ${_exe}
+    )
+    # Install with run permissions
+    install ( PROGRAMS ${_exe} DESTINATION ${INSTALL_BIN} COMPONENT Runtime)
+	  # Also install the source as optional component
+	  install ( PROGRAMS ${_source} DESTINATION ${INSTALL_FOO} 
+            RENAME ${_name}
+			      COMPONENT Other 
+    )
+  else()
+    # Install into bin as is, we assume the executable uses UNIX shebang
+    # NOTE: This approach is unsuitable for non UNIX systems
+    install ( PROGRAMS ${_source} DESTINATION ${INSTALL_BIN}
+            RENAME ${_name}
+            COMPONENT Runtime
+    )
+  endif()
+endmacro ()
+
+macro ( _lua_module_helper is_install _name ) 
+  parse_arguments ( _MODULE "LINK;ALL_IN_ONE" "" ${ARGN} )
+  # _target is CMake-compatible target name for module (e.g. socket_core).
+  # _module is relative path of target (e.g. socket/core),
+  #   without extension (e.g. .lua/.so/.dll).
+  # _MODULE_SRC is list of module source files (e.g. .lua and .c files).
+  # _MODULE_NAMES is list of module names (e.g. socket.core).
+  if ( _MODULE_ALL_IN_ONE )
+    string ( REGEX REPLACE "\\..*" "" _target "${_name}" )
+    string ( REGEX REPLACE "\\..*" "" _module "${_name}" )
+    set ( _target "${_target}_all_in_one")
+    set ( _MODULE_SRC ${_MODULE_ALL_IN_ONE} )
+    set ( _MODULE_NAMES ${_name} ${_MODULE_DEFAULT_ARGS} )
+  else ()
+    string ( REPLACE "." "_" _target "${_name}" )
+    string ( REPLACE "." "/" _module "${_name}" )
+    set ( _MODULE_SRC ${_MODULE_DEFAULT_ARGS} )
+    set ( _MODULE_NAMES ${_name} )
+  endif ()
+  if ( NOT _MODULE_SRC )
+    message ( FATAL_ERROR "no module sources specified" )
+  endif ()
+  list ( GET _MODULE_SRC 0 _first_source )
+  
+  get_filename_component ( _ext ${_first_source} EXT )
+  if ( _ext STREQUAL ".lua" )  # Lua source module
+    list ( LENGTH _MODULE_SRC _len )
+    if ( _len GREATER 1 )
+      message ( FATAL_ERROR "more than one source file specified" )
+    endif ()
+  
+    set ( _module "${_module}.lua" )
+
+    get_filename_component ( _module_dir ${_module} PATH )
+    get_filename_component ( _module_filename ${_module} NAME )
+    _append_path ( "${CMAKE_CURRENT_SOURCE_DIR}" "${_first_source}" _module_path )
+    list ( APPEND _lua_modules "${_name}" "${_module_path}" )
+
+    if ( ${is_install} )
+      install ( FILES ${_first_source} DESTINATION ${INSTALL_LMOD}/${_module_dir}
+                RENAME ${_module_filename} 
+                COMPONENT Runtime
+      )
+    endif ()
+  else ()  # Lua C binary module
+    enable_language ( C )
+    find_package ( Lua REQUIRED )
+    include_directories ( ${LUA_INCLUDE_DIR} )
+
+    set ( _module "${_module}${CMAKE_SHARED_MODULE_SUFFIX}" )
+
+    get_filename_component ( _module_dir ${_module} PATH )
+    get_filename_component ( _module_filenamebase ${_module} NAME_WE )
+    foreach ( _thisname ${_MODULE_NAMES} )
+      list ( APPEND _lua_modules "${_thisname}"
+             "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_CFG_INTDIR}/${_module}" )
+    endforeach ()
+   
+    add_library( ${_target} MODULE ${_MODULE_SRC})
+    target_link_libraries ( ${_target} ${LUA_LIBRARY} ${_MODULE_LINK} )
+    set_target_properties ( ${_target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+                "${_module_dir}" PREFIX "" OUTPUT_NAME "${_module_filenamebase}" )
+    if ( ${is_install} )
+      install ( TARGETS ${_target} DESTINATION ${INSTALL_CMOD}/${_module_dir} COMPONENT Runtime)
+    endif ()
+  endif ()
+endmacro ()
+
+# add_lua_module
+# Builds a Lua source module into a destination locatable by Lua
+# require syntax.
+# Binary modules are also supported where this function takes sources and
+# libraries to compile separated by LINK keyword.
+# USE: add_lua_module ( socket.http src/http.lua )
+# USE2: add_lua_module ( mime.core src/mime.c )
+# USE3: add_lua_module ( socket.core ${SRC_SOCKET} LINK ${LIB_SOCKET} )
+# USE4: add_lua_module ( ssl.context ssl.core ALL_IN_ONE src/context.c src/ssl.c )
+#   This form builds an "all-in-one" module (e.g. ssl.so or ssl.dll containing
+#   both modules ssl.context and ssl.core).  The CMake target name will be
+#   ssl_all_in_one.
+# Also sets variable _module_path (relative path where module typically
+# would be installed).
+macro ( add_lua_module )
+  _lua_module_helper ( 0 ${ARGN} )
+endmacro ()
+
+
+# install_lua_module
+# This is the same as `add_lua_module` but also installs the module.
+# USE: install_lua_module ( socket.http src/http.lua )
+# USE2: install_lua_module ( mime.core src/mime.c )
+# USE3: install_lua_module ( socket.core ${SRC_SOCKET} LINK ${LIB_SOCKET} )
+macro ( install_lua_module )
+  _lua_module_helper ( 1 ${ARGN} )
+endmacro ()
+
+# Builds string representing Lua table mapping Lua modules names to file
+# paths.  Used internally.
+macro ( _make_module_table _outvar )
+  set ( ${_outvar} )
+  list ( LENGTH _lua_modules _n )
+  if ( ${_n} GREATER 0 ) # avoids cmake complaint
+  foreach ( _i RANGE 1 ${_n} 2 )
+    list ( GET _lua_modules ${_i} _path )
+    math ( EXPR _ii ${_i}-1 )
+    list ( GET _lua_modules ${_ii} _name )
+    set ( ${_outvar} "${_table}  ['${_name}'] = '${_path}'\;\n")
+  endforeach ()
+  endif ()
+  set ( ${_outvar}
+"local modules = {
+${_table}}" )
+endmacro ()
+
+# add_lua_test ( _testfile [ WORKING_DIRECTORY _working_dir ] )
+# Runs Lua script `_testfile` under CTest tester.
+# Optional named argument `WORKING_DIRECTORY` is current working directory to
+# run test under (defaults to ${CMAKE_CURRENT_BINARY_DIR}).
+# Both paths, if relative, are relative to ${CMAKE_CURRENT_SOURCE_DIR}.
+# Any modules previously defined with install_lua_module are automatically
+# preloaded (via package.preload) prior to running the test script.
+# Under LuaDist, set test=true in config.lua to enable testing.
+# USE: add_lua_test ( test/test1.lua [args...] [WORKING_DIRECTORY dir])
+macro ( add_lua_test _testfile )
+  if ( NOT SKIP_TESTING )
+    parse_arguments ( _ARG "WORKING_DIRECTORY" "" ${ARGN} )
+    include ( CTest )
+    find_program ( LUA NAMES lua lua.bat )
+    get_filename_component ( TESTFILEABS ${_testfile} ABSOLUTE )
+    get_filename_component ( TESTFILENAME ${_testfile} NAME )
+    get_filename_component ( TESTFILEBASE ${_testfile} NAME_WE )
+
+    # Write wrapper script.
+    # Note: One simple way to allow the script to find modules is
+    # to just put them in package.preload.
+    set ( TESTWRAPPER ${CMAKE_CURRENT_BINARY_DIR}/${TESTFILENAME} )
+    _make_module_table ( _table )
+    set ( TESTWRAPPERSOURCE
+"local CMAKE_CFG_INTDIR = ... or '.'
+${_table}
+local function preload_modules(modules)
+  for name, path in pairs(modules) do
+    if path:match'%.lua' then
+      package.preload[name] = assert(loadfile(path))
+    else
+      local name = name:gsub('.*%-', '') -- remove any hyphen prefix
+      local symbol = 'luaopen_' .. name:gsub('%.', '_')
+          --improve: generalize to support all-in-one loader?
+      local path = path:gsub('%$%{CMAKE_CFG_INTDIR%}', CMAKE_CFG_INTDIR)
+      package.preload[name] = assert(package.loadlib(path, symbol))
+    end
+  end
+end
+preload_modules(modules)
+arg[0] = '${TESTFILEABS}'
+table.remove(arg, 1)
+return assert(loadfile '${TESTFILEABS}')(unpack(arg))
+"    )
+    if ( _ARG_WORKING_DIRECTORY )
+      get_filename_component (
+         TESTCURRENTDIRABS ${_ARG_WORKING_DIRECTORY} ABSOLUTE )
+      # note: CMake 2.6 (unlike 2.8) lacks WORKING_DIRECTORY parameter.
+      set ( _pre ${CMAKE_COMMAND} -E chdir "${TESTCURRENTDIRABS}" )
+    endif ()
+    file ( WRITE ${TESTWRAPPER} ${TESTWRAPPERSOURCE})
+    add_test ( NAME ${TESTFILEBASE} COMMAND ${_pre} ${LUA}
+               ${TESTWRAPPER} "${CMAKE_CFG_INTDIR}"
+               ${_ARG_DEFAULT_ARGS} )
+  endif ()
+  # see also http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/CMakeModules/UsePythonTest.cmake
+  # Note: ${CMAKE_CFG_INTDIR} is a command-line argument to allow proper
+  # expansion by the native build tool.
+endmacro ()
+
+
+# Converts Lua source file `_source` to binary string embedded in C source
+# file `_target`.  Optionally compiles Lua source to byte code (not available
+# under LuaJIT2, which doesn't have a bytecode loader).  Additionally, Lua
+# versions of bin2c [1] and luac [2] may be passed respectively as additional
+# arguments.
+#
+# [1] http://lua-users.org/wiki/BinToCee
+# [2] http://lua-users.org/wiki/LuaCompilerInLua
+function ( add_lua_bin2c _target _source )
+  find_program ( LUA NAMES lua lua.bat )
+  execute_process ( COMMAND ${LUA} -e "string.dump(function()end)"
+                    RESULT_VARIABLE _LUA_DUMP_RESULT ERROR_QUIET )
+  if ( NOT ${_LUA_DUMP_RESULT} )
+    SET ( HAVE_LUA_DUMP true )
+  endif ()
+  message ( "-- string.dump=${HAVE_LUA_DUMP}" )
+
+  if ( ARGV2 )
+    get_filename_component ( BIN2C ${ARGV2} ABSOLUTE )
+    set ( BIN2C ${LUA} ${BIN2C} )
+  else ()
+    find_program ( BIN2C NAMES bin2c bin2c.bat )
+  endif ()
+  if ( HAVE_LUA_DUMP )
+    if ( ARGV3 )
+      get_filename_component ( LUAC ${ARGV3} ABSOLUTE )
+      set ( LUAC ${LUA} ${LUAC} )
+    else ()
+      find_program ( LUAC NAMES luac luac.bat )
+    endif ()
+  endif ( HAVE_LUA_DUMP )
+  message ( "-- bin2c=${BIN2C}" )
+  message ( "-- luac=${LUAC}" )
+
+  get_filename_component ( SOURCEABS ${_source} ABSOLUTE )
+  if ( HAVE_LUA_DUMP )
+    get_filename_component ( SOURCEBASE ${_source} NAME_WE )
+    add_custom_command (
+      OUTPUT  ${_target} DEPENDS ${_source}
+      COMMAND ${LUAC} -o ${CMAKE_CURRENT_BINARY_DIR}/${SOURCEBASE}.lo
+              ${SOURCEABS}
+      COMMAND ${BIN2C} ${CMAKE_CURRENT_BINARY_DIR}/${SOURCEBASE}.lo
+              ">${_target}" )
+  else ()
+    add_custom_command (
+      OUTPUT  ${_target} DEPENDS ${SOURCEABS}
+      COMMAND ${BIN2C} ${_source} ">${_target}" )
+  endif ()
+endfunction()

+ 314 - 0
src/CMakeLists.txt

@@ -0,0 +1,314 @@
+# Find Ogre module.
+set(CMAKE_FRAMEWORK_PATH
+    ${CMAKE_FRAMEWORK_PATH}
+    ${CMAKE_SOURCE_DIR}/OgreSDK/lib/macosx/Release
+    ${CMAKE_SOURCE_DIR}/OgreSDK/lib/macosx/Debug
+)
+set(OGRE_FRAMEWORK_INCLUDES ${CMAKE_SOURCE_DIR}/OgreSDK/include)
+find_path(OGRE_CMAKE_MODULE_PATH FindOGRE.cmake
+    HINTS
+    "$ENV{OGRE_HOME}/CMake/"
+    "/usr/local/lib/OGRE/cmake"
+    "/usr/lib/OGRE/cmake"
+    "/usr/share/OGRE/cmake/modules"
+    "${CMAKE_CURRENT_SOURCE_DIR}/OgreSDK/CMake"
+)
+if(OGRE_CMAKE_MODULE_PATH-NOTFOUND)
+    message(SEND_ERROR "Failed to find OGRE module path.")
+else()
+    set(CMAKE_MODULE_PATH "${OGRE_CMAKE_MODULE_PATH};${CMAKE_MODULE_PATH}")
+endif()
+set(CMAKE_MODULE_PATH "${OGRE_CMAKE_MODULE_PATH};${CMAKE_MODULE_PATH} ")
+set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/CMake")
+
+
+# Find Boost module.
+if (WIN32)
+    set(Boost_USE_STATIC_LIBS TRUE)
+else()
+    # Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit.
+    set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
+endif ()
+if (MINGW)
+    # This is probably a bug in CMake: the boost find module tries to look for boost libraries with
+    # name libboost_*, but CMake already prefixes library search names with "lib". This is the
+    # workaround.
+    set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
+endif ()
+# Components that need linking (NB does not include header-only components like bind).
+set(OGRE_BOOST_COMPONENTS thread date_time)
+find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
+if (NOT Boost_FOUND)
+    set(Boost_USE_STATIC_LIBS NOT ${Boost_USE_STATIC_LIBS})
+    find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
+endif()
+if(Boost_FOUND AND Boost_VERSION GREATER 104900)
+    set(OGRE_BOOST_COMPONENTS thread date_time system chrono)
+    find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
+endif()
+# Set up referencing of Boost.
+if (NOT APPLE)
+    add_definitions(-DBOOST_ALL_NO_LIB)
+endif()
+if (Boost_LIBRARIES STREQUAL "")
+    message(SEND_ERROR "Boost_LIBRARIES is not set")
+endif()
+
+
+# Find packacges required for V-Gears.
+find_package(OGRE REQUIRED QUIET)
+find_package(OIS REQUIRED)
+find_package(OpenAL REQUIRED)
+find_package(OggVorbis REQUIRED)
+find_package(TinyXML REQUIRED)
+find_package(Boost COMPONENTS program_options filesystem thread REQUIRED QUIET)
+
+
+# Source files for libvgears and v-gears.
+set(VGEARS_SOURCE_FILES
+    main.cpp
+    FF7Character.cpp
+    FF7Common.cpp
+    VGearsGameState.cpp
+    common/File.cpp
+    common/FileSystem.cpp
+    common/FinalFantasy7/FF7NameLookup.cpp
+    common/LzsFile.cpp
+    common/TypeDefine.cpp
+    common/VGearsApplication.cpp
+    common/VGearsManualObject.cpp
+    common/VGearsResource.cpp
+    common/VGearsStringUtil.cpp
+    core/AudioManager.cpp
+    core/Background2DAnimation.cpp
+    core/Background2D.cpp
+    core/CameraManager.cpp
+    core/ConfigCmd.cpp
+    core/ConfigCmdManager.cpp
+    core/ConfigFile.cpp
+    core/ConfigVar.cpp
+    core/ConfigVarManager.cpp
+    core/Console.cpp
+    core/DebugDraw.cpp
+    core/DialogsManager.cpp
+    core/EntityCollision.cpp
+    core/Entity.cpp
+    core/EntityDirection.cpp
+    core/EntityManager.cpp
+    core/EntityModel.cpp
+    core/EntityPoint.cpp
+    core/EntityTrigger.cpp
+    core/GameFrameListener.cpp
+    core/InputManager.cpp
+    core/particles/Particle.cpp
+    core/particles/ParticleEmitter.cpp
+    core/particles/ParticleEmitterDictionary.cpp
+    core/particles/ParticleEmitterTranslator.cpp
+    core/particles/ParticleRenderer.cpp
+    core/particles/ParticleRendererTranslator.cpp
+    core/particles/ParticleSystem.cpp
+    core/particles/ParticleSystemFactory.cpp
+    core/particles/ParticleSystemManager.cpp
+    core/particles/ParticleSystemTranslator.cpp
+    core/particles/ParticleSystemTranslatorManager.cpp
+    core/particles/ParticleTechnique.cpp
+    core/particles/ParticleTechniqueTranslator.cpp
+    core/particles/ParticleVisual.cpp
+    core/particles/emitters/PointEmitter.cpp
+    core/particles/emitters/PointEmitterFactory.cpp
+    core/particles/renderer/ParticleEntityRenderer.cpp
+    core/particles/renderer/ParticleEntityRendererDictionary.cpp
+    core/Savemap.cpp
+    core/SavemapManager.cpp
+    core/ScriptManager.cpp
+    core/TextManager.cpp
+    core/Timer.cpp
+    core/UiAnimation.cpp
+    core/UiFont.cpp
+    core/UiManager.cpp
+    core/UiSprite.cpp
+    core/UiTextArea.cpp
+    core/UiWidget.cpp
+    core/Utilites.cpp
+    core/Walkmesh.cpp
+    core/XmlBackground2DFile.cpp
+    core/XmlFile.cpp
+    core/XmlFontFile.cpp
+    core/XmlFontsFile.cpp
+    core/XmlMapFile.cpp
+    core/XmlMapsFile.cpp
+    core/XmlMusicsFile.cpp
+    core/XmlPrototypesFile.cpp
+    core/XmlScreenFile.cpp
+    core/XmlScreensFile.cpp
+    core/XmlScriptsFile.cpp
+    core/XmlSoundsFile.cpp
+    core/XmlTextFile.cpp
+    core/XmlTextsFile.cpp
+    core/XmlWalkmeshFile.cpp
+    data/VGearsAFile.cpp
+    data/VGearsAFileManager.cpp
+    data/VGearsAFileSerializer.cpp
+    data/VGearsBackgroundFile.cpp
+    data/VGearsBackgroundFileManager.cpp
+    data/VGearsBackgroundFileSerializer.cpp
+    data/VGearsBackgroundTextureLoader.cpp
+    data/VGearsCameraMatrixFile.cpp
+    data/VGearsCameraMatrixFileManager.cpp
+    data/VGearsCameraMatrixFileSerializer.cpp
+    data/VGearsFLevelBackground2DLoader.cpp
+    data/VGearsFLevelFile.cpp
+    data/VGearsFLevelFileManager.cpp
+    data/VGearsFLevelFileSerializer.cpp
+    data/VGearsFLevelTextureLoader.cpp
+    data/VGearsHRCFile.cpp
+    data/VGearsHRCFileManager.cpp
+    data/VGearsHRCFileSerializer.cpp
+    data/VGearsHRCMeshLoader.cpp
+    data/VGearsHRCSkeletonLoader.cpp
+    data/VGearsLGPArchive.cpp
+    data/VGearsLGPArchiveFactory.cpp
+    data/VGearsLGPArchiveSerializer.cpp
+    data/VGearsLZSDataStream.cpp
+    data/VGearsLZSFLevelFile.cpp
+    data/VGearsLZSFLevelFileManager.cpp
+    data/VGearsMapListFile.cpp
+    data/VGearsPaletteFile.cpp
+    data/VGearsPaletteFileManager.cpp
+    data/VGearsPaletteFileSerializer.cpp
+    data/VGearsPFile.cpp
+    data/VGearsPFileManager.cpp
+    data/VGearsPFileSerializer.cpp
+    data/VGearsRSDFile.cpp
+    data/VGearsRSDFileManager.cpp
+    data/VGearsRSDFileSerializer.cpp
+    data/VGearsSerializer.cpp
+    data/VGearsTexCodec.cpp
+    data/VGearsTexFile.cpp
+    data/VGearsTriggersFile.cpp
+    data/VGearsXMLSerializer.cpp
+    data/FinalFantasy7/FF7ModelListFile.cpp
+    data/FinalFantasy7/FF7ModelListFileManager.cpp
+    data/FinalFantasy7/FF7ModelListFileSerializer.cpp
+    data/worldmap/WorldmapFile.cpp
+    data/worldmap/WorldmapFileManager.cpp
+    data/worldmap/WorldmapFileSerializer.cpp
+    data/worldmap/TxzFile.cpp
+    data/worldmap/TxzFileManager.cpp
+    data/worldmap/TxzFileSerializer.cpp
+    map/VGearsBackground2DFile.cpp
+    map/VGearsBackground2DFileManager.cpp
+    map/VGearsBackground2DFileXMLSerializer.cpp
+    map/VGearsMapFile.cpp
+    map/VGearsMapFileManager.cpp
+    map/VGearsMapFileXMLSerializer.cpp
+    map/VGearsWalkmeshFile.cpp
+    map/VGearsWalkmeshFileManager.cpp
+    map/VGearsWalkmeshFileXMLSerializer.cpp
+    map/FinalFantasy7/FF7WalkmeshFileSerializer.cpp
+    modules/worldmap/WorldmapModule.cpp
+    #viewer/ViewerModule.cpp
+)
+
+
+# Directories for compiling libvgears and v-gears.
+include_directories(
+    ${VGEARS_SOURCE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${Boost_INCLUDE_DIR}
+    ${OIS_INCLUDE_DIRS}
+    ${OGRE_INCLUDE_DIRS}
+    ${OGRE_INCLUDE_DIRS}/Overlay
+    ${OGRE_INCLUDE_DIRS}/Bites
+    ${CMAKE_SOURCE_DIR}/lib/luajit
+    ${CMAKE_SOURCE_DIR}/lib/luajit/src
+    ${CMAKE_SOURCE_DIR}/lib/luabind
+    ${CMAKE_SOURCE_DIR}/lib/luabind/luabind/detail
+)
+
+
+# Compiler options.
+if(APPLE) # Apple specific options
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
+endif()
+if(WIN32) # Check usage and remove if uneccessary
+    add_definitions(-DWIN32 -D__WIN32__ -D_WINDOWS)
+    add_definitions(-W -mthreads -fmessage-length=0 -fexceptions -fident)
+    # Linker options
+    add_definitions(
+    -Wl,--enable-runtime-pseudo-reloc
+    -Wl,--enable-auto-image-base
+    -Wl,--add-stdcall-alias
+    )
+endif()
+if (MSVC) # Build cpp files on all cores, up virtual mem for PCH's as cotire really makes the compiler scream
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Zm193")
+    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+endif()
+if (UNIX AND $ENV{COVERAGE}==1) # Coverage options (disables optimization)
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") # debug, no optimisation
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") # enabling coverage
+endif()
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # Position Independent Code, required if QT is compiled with -reduce-relocations
+#if(CMAKE_BUILD_TYPE MATCHES "Debug") # Debug build
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic -O0")
+#endif()
+add_definitions(-DTIXML_USE_STL)
+
+
+# Generate libvgears.
+add_library(libvgears STATIC ${VGEARS_SOURCE_FILES})
+cotire(libvgears)
+SET_PROPERTY(TARGET libvgears PROPERTY FOLDER "build/libvgears")
+
+
+# Generate v-gears executable
+add_executable(v-gears ${VGEARS_SOURCE_FILES})
+SET_PROPERTY(TARGET v-gears PROPERTY FOLDER "build/v-gears")
+set(CPACK_PACKAGE_EXECUTABLES v-gears "v-gears")
+set(CPACK_WIX_PROGRAM_MENU_FOLDER "VGears")
+if(APPLE)
+    target_link_libraries(v-gears "-framework CoreFoundation -framework Cocoa -framework IOKit" ${ois_lib})
+endif()
+
+if(WIN32 AND NOT (CMAKE_BUILD_TYPE MATCHES "Debug"))
+    set_target_properties( v-gears PROPERTIES WIN32_EXECUTABLE ON )
+    if (MSVC)
+        set_target_properties(v-gears PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE")
+    endif()
+endif()
+set(VGEARS_LIBRARIES
+    libluabind
+    liblua
+    ${OPENAL_LIBRARY}
+    ${OGGVORBIS_LIBRARIES}
+    ${OGRE_LIBRARIES}
+    ${Boost_LIBRARIES}
+    Boost::thread
+    ${OIS_LIBRARIES}
+    ${TinyXML_LIBRARIES}
+)
+if(MULTITHREADING)
+    find_package (Threads REQUIRED) # Find Threads
+    set(VGEARS_LIBRARIES
+        ${VGEARS_LIBRARIES}
+        ${CMAKE_THREAD_LIBS_INIT}
+    )
+endif()
+target_link_libraries(v-gears ${VGEARS_LIBRARIES})
+
+
+# Install v-gears.
+if(WIN32 OR APPLE)
+    install(TARGETS v-gears DESTINATION .)
+else()
+    install(TARGETS v-gears RUNTIME DESTINATION ./games)
+endif()
+
+
+# If requested, build the installer.
+if(BUILD_INSTALLER)
+    add_subdirectory(installer)
+endif()

+ 0 - 0
V-Gears/src/FF7Character.cpp → src/FF7Character.cpp


+ 0 - 0
V-Gears/include/FF7Character.h → src/FF7Character.h


+ 0 - 0
V-Gears/src/FF7Common.cpp → src/FF7Common.cpp


+ 0 - 0
V-Gears/include/FF7Common.h → src/FF7Common.h


+ 0 - 0
V-Gears/include/LuaIncludes.h → src/LuaIncludes.h


+ 0 - 0
V-Gears/src/VGearsGameState.cpp → src/VGearsGameState.cpp


+ 0 - 0
V-Gears/include/VGearsGameState.h → src/VGearsGameState.h


+ 0 - 0
V-Gears/include/VGearsPrerequisites.h → src/VGearsPrerequisites.h


+ 0 - 0
V-Gears/include/Version.h → src/Version.h


+ 5 - 5
V-Gears/include/Version.h.in → src/Version.h.in

@@ -22,8 +22,8 @@
 /**
  * Application version.
  */
-#define VGEARS_VERSION "@VGears_VERSION@"
-#define VGEARS_VERSION_MAJOR "@VGears_VERSION__MAJOR@"
-#define VGEARS_VERSION_MINOR "@VGears_VERSION__MINOR@"
-#define VGEARS_VERSION_PATCH "@VGears_VERSION__PATCH@"
-#define VGEARS_VERSION_SIGNATURE "V-Gears v@VGears_VERSION@"
+#define VGEARS_VERSION "@VGEARS_VERSION@"
+#define VGEARS_VERSION_MAJOR "@VGEARS_VERSION_MAJOR@"
+#define VGEARS_VERSION_MINOR "@VGEARS_VERSION_MINOR@"
+#define VGEARS_VERSION_PATCH "@VGEARS_VERSION_PATCH@"
+#define VGEARS_VERSION_SIGNATURE "V-Gears v@VGEARS_VERSION@"

+ 0 - 0
V-Gears/src/common/File.cpp → src/common/File.cpp


+ 0 - 0
V-Gears/include/common/File.h → src/common/File.h


+ 0 - 0
V-Gears/src/common/FileSystem.cpp → src/common/FileSystem.cpp


+ 0 - 0
V-Gears/include/common/FileSystem.h → src/common/FileSystem.h


+ 0 - 0
V-Gears/src/common/FinalFantasy7/FF7NameLookup.cpp → src/common/FinalFantasy7/FF7NameLookup.cpp


+ 0 - 0
V-Gears/include/common/FinalFantasy7/FF7NameLookup.h → src/common/FinalFantasy7/FF7NameLookup.h


+ 0 - 0
V-Gears/src/common/LzsFile.cpp → src/common/LzsFile.cpp


+ 0 - 0
V-Gears/include/common/LzsFile.h → src/common/LzsFile.h


+ 0 - 0
V-Gears/src/common/TypeDefine.cpp → src/common/TypeDefine.cpp


+ 0 - 0
V-Gears/include/common/TypeDefine.h → src/common/TypeDefine.h


+ 0 - 0
V-Gears/src/common/VGearsApplication.cpp → src/common/VGearsApplication.cpp


+ 0 - 0
V-Gears/include/common/VGearsApplication.h → src/common/VGearsApplication.h


+ 0 - 0
V-Gears/src/common/VGearsManualObject.cpp → src/common/VGearsManualObject.cpp


+ 0 - 0
V-Gears/include/common/VGearsManualObject.h → src/common/VGearsManualObject.h


+ 0 - 0
V-Gears/src/common/VGearsResource.cpp → src/common/VGearsResource.cpp


+ 0 - 0
V-Gears/include/common/VGearsResource.h → src/common/VGearsResource.h


+ 0 - 0
V-Gears/src/common/VGearsStringUtil.cpp → src/common/VGearsStringUtil.cpp


+ 0 - 0
V-Gears/include/common/VGearsStringUtil.h → src/common/VGearsStringUtil.h


+ 0 - 0
V-Gears/include/core/Assert.h → src/core/Assert.h


Some files were not shown because too many files changed in this diff