# RogueSquadron Extractor - TERRAIN module Inspired by the work of **dpethes** (https://github.com/dpethes/rerogue) :clap: This set of git repos are a compilation of tools coded in C to make RS modding far more than a dream! The collection consist of few independants modules, each of them deals with specific data like sound, textures, heightmaps, etc... All modules are independants. This is the **'TERRAIN'** module. [![Build Status](https://ci.jcsmith.fr/job/JCS-Prod/job/RSE-Terrain/job/master/badge/icon)](https://ci.jcsmith.fr/job/JCS-Prod/job/RSE-Terrain/job/master/) ## TERRAIN MODULE It's extract terrain datas from Rogue Squadron 3D (PC) game map files (hmp). This module can do: - Interpolate 3D model mesh of the terrain, - Export it as OBJ model file (pretty heavy (~15MB), not to be use direcly for display), - Export an heightmap-like PNG, - Multiple inputs files. ## TODO - Add textures to terrain. - Adding LOD method to optimize datas manipulation and rendering. - Discover all last unknowns fields, etc. ### Using `RSETerrain [options] ` or you can simply drag&drop HOB files on it. A futur main program can extract all HOB files directly from DAT file. Due to issue with copyrights, I can't provide samples... You need to extract HOB files yourself. ### Options - -h Print this message - -v,-vv Activate verbose/debug output mode respectively - -subdir Export outputs to a sub-directory - -neg Negative heightmap output ### Dependencies - [zlib](https://www.zlib.net/) (1.3.1) - [libpng](http://www.libpng.org/pub/png/libpng.html) (1.6.43) - [obj-lib](https://git.jcsmith.fr/jackcartersmith/obj "obj file exporter") ### Compiling You can compile on both Windows (MinGW) or native Linux environment thanks to CMake, you only need to adjust your dependencies on Windows or use Conan packages manager (https://conan.io). libpng16-dev distrib package can be used on debian/ubuntu. ### Compiling I've a preference for compiling libraries by hand, mainly for backward compatibility, but I recommend using Conan packages manager (https://conan.io) for simplicity. (**Don't forget git submodules**) ```shell conan install . -of build -b missing -s build_type=Release -o tools=True -pr:b=default -pr:h=default cmake --preset conan-release -G "Unix Makefiles" cmake --build --preset conan-release ``` On Windows environment, you can use MinGW `-G "MinGW Makefiles"` or Ninja `-G "Ninja"` as CMake generator. ### Compiling (HARDCORE) If you want to do it manually without Conan, you will probably need to specify the dependency flags for CMake. Ex: `cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.3.1/include" -D"ZLIB_LIBRARY=zlib/1.3.1/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.43/include" -D"PNG_LIBRARY=libpng/1.6.43/lib/libpng.dll.a" . -G "MinGW Makefiles"` I've tested cross-compilation too, but since I want to check that Conan is working properly at each release, I've integrated it into the Jenkins flow using Conan for the cross-abstraction.