mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Merge pull request #529 from Lgt2x/release
Update release branch with latest commits
This commit is contained in:
commit
0388d07582
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@ -66,22 +66,25 @@ jobs:
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends \
|
||||
ninja-build cmake g++ libgtest-dev libsdl2-dev zlib1g-dev libspdlog-dev
|
||||
ninja-build cmake g++ curl pkg-config autoconf automake libtool libltdl-dev make python3-jinja2 libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev
|
||||
|
||||
- name: Install Windows dependencies
|
||||
if: ${{ matrix.os.runner == 'windows-latest' }}
|
||||
run: choco install ninja
|
||||
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
if: ${{ matrix.os.runner == 'windows-latest' }}
|
||||
with:
|
||||
arch: win64
|
||||
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
vcpkgJsonGlob: vcpkg.json
|
||||
|
||||
- name: Configure CMake
|
||||
env:
|
||||
CC: ${{ matrix.os.cc }}
|
||||
CXX: ${{ matrix.os.cxx }}
|
||||
VCPKG_ROOT: C:/vcpkg
|
||||
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON
|
||||
|
||||
- name: Build ${{ matrix.build_type }}
|
||||
|
30
.github/workflows/release.yml
vendored
Normal file
30
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: Release source tarball
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Generate git hash and tarball
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y ninja-build cmake g++ libsdl2-dev zlib1g-dev
|
||||
cmake --preset linux
|
||||
cmake --build --preset linux -t get_git_hash
|
||||
cmake --build --preset linux -t package_source
|
||||
|
||||
- name: Release
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
artifacts: "builds/linux/Descent3-*-Source.tar.xz"
|
||||
draft: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,3 +1,6 @@
|
||||
set(HEADERS
|
||||
gr.h
|
||||
lib2d.h)
|
||||
set(CPPS
|
||||
font.cpp
|
||||
hardsurf.cpp
|
||||
@ -9,7 +12,7 @@ set(CPPS
|
||||
viewport.cpp
|
||||
)
|
||||
|
||||
add_library(2dlib STATIC ${CPPS})
|
||||
add_library(2dlib STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(2dlib PRIVATE
|
||||
cfile
|
||||
mem
|
||||
|
@ -554,7 +554,7 @@ void grFont::translate_to_surfaces(int slot) {
|
||||
void grFont::translate_mono_char(grSurface *sf, int x, int y, int index, gr_font_file_record *ft, int width) {
|
||||
int row, col; // byte width of char
|
||||
int rowsize;
|
||||
uint8_t bit_mask = 0, byte;
|
||||
uint8_t bit_mask = 0, byte = 0;
|
||||
uint8_t *fp;
|
||||
|
||||
fp = ft->char_data[index];
|
||||
|
@ -1,10 +1,14 @@
|
||||
set(HEADERS
|
||||
adecode.h
|
||||
aencode.h
|
||||
audio_encode.h)
|
||||
set(CPPS
|
||||
adecode.cpp
|
||||
aencode.cpp
|
||||
encoder.cpp
|
||||
)
|
||||
|
||||
add_library(AudioEncode STATIC ${CPPS})
|
||||
add_library(AudioEncode STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(AudioEncode PRIVATE
|
||||
libacm
|
||||
)
|
||||
|
@ -42,9 +42,9 @@ bool aenc_Compress(char *input_filename, char *output_filename, const int *input
|
||||
FILE *in, *out;
|
||||
int32_t result;
|
||||
|
||||
int levels, samples_per_subband;
|
||||
unsigned sample_rate, channels;
|
||||
float factor, volume_scale;
|
||||
int levels = 0, samples_per_subband = 0;
|
||||
unsigned sample_rate = 0, channels = 0;
|
||||
float factor = 0, volume_scale = 0;
|
||||
int levels_set = 0, samples_per_subband_set = 0, sample_rate_set = 0, channels_set = 0, factor_set = 0,
|
||||
volume_scale_set = 0;
|
||||
|
||||
@ -105,7 +105,8 @@ bool aenc_Compress(char *input_filename, char *output_filename, const int *input
|
||||
}
|
||||
|
||||
if (!levels_set && !samples_per_subband_set) {
|
||||
levels = 7, samples_per_subband = 16;
|
||||
levels = 7;
|
||||
samples_per_subband = 16;
|
||||
} else if (!samples_per_subband_set) {
|
||||
samples_per_subband = 2048 / (1 << levels);
|
||||
|
||||
|
170
BUILD.md
Normal file
170
BUILD.md
Normal file
@ -0,0 +1,170 @@
|
||||
|
||||
# Building Descent 3 Open Source
|
||||
|
||||
## Dependencies
|
||||
The build process uses [**CMake**](https://cmake.org/) and, by default, [**Ninja**](https://ninja-build.org/). You must install these; the project cannot locate them for you. The source code depends on [**SDL2**](https://github.com/libsdl-org/SDL/tree/SDL2) and [**zlib**](https://github.com/madler/zlib). You can supply these dependencies yourself via your system's library management tools, or the build system can locate the dependencies for you using [vcpkg](https://github.com/microsoft/vcpkg), a cross-platform dependency-management system developed by Microsoft. The official builds source their dependencies from vcpkg.
|
||||
|
||||
## Installing and using vcpkg
|
||||
* When building for Windows, vcpkg is already installed and configured when using any of the Visual Studio command prompts (either actual Command Prompt, or PowerShell).
|
||||
* For Android, Linux or Mac (or non-standard-Windows) configurations, you will need to install vcpkg locally by cloning https://github.com/microsoft/vcpkg and setting your `VCPKG_ROOT` env var to the repository location. With this environment variable set, the build will automatically locate its dependencies.
|
||||
|
||||
## Building - Windows
|
||||
1. **Install the prerequisite build tools.**
|
||||
|
||||
Make sure that you have Git and Visual Studio 2022 with the “Desktop development with C++” workload and the “C++ MFC for latest v143 build tools (x86 & x64)” component. If you don’t already have those installed or you aren’t sure, then open an elevated Command Prompt and run:
|
||||
<!--
|
||||
The following code block specifies the full path to the Visual Studio Installer because the Visual Studio Installer doesn’t add itself to the user’s Path. The installer is guaranteed to be in a specific location on 64-bit systems [1]. The installer will be in a different location on 32-bit systems [2], but Visual Studio 2022 doesn’t support 32-bit systems [3] so we can ignore that detail.
|
||||
|
||||
[1]: <https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022>
|
||||
[2]: <https://github.com/microsoft/vswhere/wiki#installing>
|
||||
[3]: <https://learn.microsoft.com/en-us/answers/questions/1689898/does-visual-studio-build-tools-2022-support-32-bit>
|
||||
-->
|
||||
```batch
|
||||
winget install Git.Git Microsoft.VisualStudio.2022.Community
|
||||
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\setup.exe" modify^
|
||||
--passive^
|
||||
--channelId VisualStudio.17.Release^
|
||||
--productId Microsoft.VisualStudio.Product.Community^
|
||||
--add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended^
|
||||
--add Microsoft.VisualStudio.Component.VC.ATLMFC
|
||||
```
|
||||
|
||||
**NOTE:**
|
||||
Builds _must_ be performed in one of the Visual Studio-provided **x64 Native Tools** command prompts ("x64 Native Tools Command Prompt" or "x64 Native Tools PowerShell"), _not_ a standard Command Prompt or PowerShell. The VS prompts will already have vcpkg installed and configured for use, so no dependency management is needed.
|
||||
|
||||
2. **Clone the Descent3 source code.**
|
||||
|
||||
Open a "x64 Native Tools Command Prompt" or "x64 Native Tools PowerShell" and run:
|
||||
```batch
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
```
|
||||
|
||||
4. **Build Descent3.**
|
||||
|
||||
```batch
|
||||
cd Descent3
|
||||
cmake --preset win
|
||||
cmake --build --preset win --config [Debug|Release]
|
||||
```
|
||||
See [Build Options](#build-options) below for more information on `Debug` vs `Release`.
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds\win\Descent3\Debug` or `builds\win\Descent3\Release`.
|
||||
|
||||
## Building - macOS
|
||||
1. **Install the prerequisite build tools.**
|
||||
|
||||
* Make sure that [Xcode](https://developer.apple.com/xcode) is installed.
|
||||
* Make sure that [Homebrew](https://brew.sh) is installed.
|
||||
|
||||
2. **Acquire the library dependencies.**
|
||||
|
||||
* If you would like to use vcpkg:
|
||||
```sh
|
||||
git clone https://github.com/microsoft/vcpkg
|
||||
export VCPKG_ROOT="$PWD/vcpkg"
|
||||
```
|
||||
**NOTE:**
|
||||
You will need `$VCPKG_ROOT` defined in the environment for all build runs. It is a good idea to set this in your `.bashrc` or equivalent.
|
||||
* If you would like to manage the code dependencies yourself:
|
||||
```sh
|
||||
brew install sdl2 zlib googletest
|
||||
```
|
||||
|
||||
3. **Clone the Descent3 source code.**
|
||||
|
||||
```sh
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
```
|
||||
|
||||
4. **Build Descent3.**
|
||||
|
||||
```sh
|
||||
cd Descent3
|
||||
brew bundle install
|
||||
cmake --preset mac
|
||||
cmake --build --preset mac --config [Debug|Release]
|
||||
```
|
||||
See [Build Options](#build-options) below for more information on `Debug` vs `Release`.
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds/mac/Descent3/Debug` or `builds/mac/Descent3/Release`.
|
||||
|
||||
## Building - Linux
|
||||
1. **Install the prerequisite build tools.**
|
||||
|
||||
* APT users (Debian, Ubuntu)
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends git ninja-build cmake g++
|
||||
```
|
||||
* DNF users (Red Hat, Fedora)
|
||||
```sh
|
||||
sudo dnf update --refresh
|
||||
sudo dnf install -y git ninja-build cmake gcc-c++
|
||||
```
|
||||
|
||||
2. **Acquire the library dependencies.**
|
||||
|
||||
* If you would like to use vcpkg:
|
||||
1. Clone vcpkg:
|
||||
```sh
|
||||
git clone https://github.com/microsoft/vcpkg
|
||||
export VCPKG_ROOT="$PWD/vcpkg"
|
||||
```
|
||||
**NOTE:**
|
||||
You will need `$VCPKG_ROOT` defined in the environment for all build runs. It is a good idea to set this in your `.bashrc` or equivalent.
|
||||
2. Install vcpkg-needed build tools and dependencies:
|
||||
* APT users
|
||||
```sh
|
||||
sudo apt install -y --no-install-recommends curl pkg-config autoconf automake libtool libltdl-dev make python3-jinja2 libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev
|
||||
```
|
||||
* DNF users
|
||||
```sh
|
||||
sudo dnf install -y autoconf automake libtool perl-open perl-FindBin python-jinja2 libX11-devel libXft-devel libXext-devel wayland-devel libxkbcommon-devel mesa-libEGL-devel ibus-devel alsa-lib-devel pulseaudio-libs-devel
|
||||
```
|
||||
* If you would like to manage the code dependencies yourself:
|
||||
* APT users
|
||||
```sh
|
||||
sudo apt install -y --no-install-recommends libsdl2-dev zlib1g-dev libgtest-dev
|
||||
```
|
||||
* DNF users
|
||||
```sh
|
||||
sudo dnf install -y SDL2-devel zlib-devel gtest
|
||||
```
|
||||
|
||||
3. **Clone the Descent3 source code.**
|
||||
|
||||
```sh
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
```
|
||||
|
||||
4. **Build Descent3.**
|
||||
|
||||
```sh
|
||||
cd Descent3
|
||||
cmake --preset linux
|
||||
cmake --build --preset linux --config [Debug|Release]
|
||||
```
|
||||
See [Build Options](#build-options) below for more information on `Debug` vs `Release`.
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds/linux/Descent3/Debug` or `builds/linux/Descent3/Release`.
|
||||
|
||||
## Build Options
|
||||
|
||||
The Descent3 build can be customized by [setting CMake variables on the command line](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-D) during its "Configuration" phase (the command without the `--build` option). To set a variable, you prepend the variable name with `-D` and then append the value, all as one single parameter. For example:
|
||||
```sh
|
||||
cmake --preset linux -DENABLE_LOGGER=ON
|
||||
```
|
||||
|
||||
**NOTE:** CMake variables, or more technically _CMake cache entries_, will persist in their values until they are explicitly cleared. So, if you set a variable and then run another CMake command _without_ that variable specified, the variable will still be set. Variables must be explicitly unset, or the `builds/` directory cleaned, in order to be cleared.
|
||||
|
||||
| Option | Description | Default |
|
||||
| ------ | ----------- | ------- |
|
||||
| `CMAKE_BUILD_TYPE`<br/>(or just [`--config`](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-build-config), without the `-D` syntax) | <p>`Debug` builds are generally larger, slower and contain extra correctness checks that will validate game data and interrupt gameplay when problems are detected.</p><p>`Release` builds are optimized for size and speed and do not include debugging information, which makes it harder to find problems.</p> | `Debug` |
|
||||
| `BUILD_EDITOR` | _(Windows-only)_ Build internal editor. | `OFF` |
|
||||
| `BUILD_TESTING` | Enable testing. Requires GTest. | `OFF` |
|
||||
| `ENABLE_LOGGER` | Enable logging to the terminal. | `OFF` |
|
||||
| `ENABLE_MEM_RTL` | Enable Real-time library memory management functions (disable to verbose memory allocations). | `ON` |
|
||||
| `FORCE_COLORED_OUTPUT` | Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with Ninja). | `OFF` |
|
||||
| `FORCE_PORTABLE_INSTALL` | Install all files into local directory defined by `CMAKE_INSTALL_PREFIX`. | `ON` |
|
||||
| `USE_VCPKG` | Explicitly control whether or not to use vcpkg for dependency resolution. `ON` requires the environment variable `VCPKG_ROOT` to be set. | Determined by the existence of `VCPKG_ROOT` in the environment: If it exists, vcpkg is used. |
|
90
CHANGELOG.md
Normal file
90
CHANGELOG.md
Normal file
@ -0,0 +1,90 @@
|
||||
# Descent 3 Open Source - Changelog
|
||||
|
||||
## 1.5.0 - August 2024
|
||||
|
||||
This is the first release of the community port of Descent 3, release as open source software under the GPLv3 license on April 16th 2024.
|
||||
|
||||
This release is the work of 28 individual contributors over 4 months. It fills in the gaps left in the never-released 1.5 patch of the game, and makes it more accessible and convinient to run on modern devices.
|
||||
|
||||
Our focus for this release has been compatibility with modern CPUs and developer experience improvement, while keeping features mostly identical to the code initially released. The next releases will be given more latitude to improve in-game player experience.
|
||||
|
||||
Descent 3 now runs on 64-bit Linux, Windows and MacOS using SDL2, on AMD64 as well as ARM64 CPUs. 32-bit support has been dropped.
|
||||
|
||||
|
||||
### Added
|
||||
- New HogMaker utility script to build platform-specific HOG files containing level scripts (#122, #143, #153, #275, #277, #298)
|
||||
- Set up gtest as a unit testing framework (#171, #251)
|
||||
- Show git hash in main menu (#224, #440, #451)
|
||||
|
||||
|
||||
### Changed
|
||||
- Use SDL2 on all platforms (#241, #457). Upon code release, the Windows was using an old version of DirectX for input and window management, and Linux and MacOS were using SDL1.2 from the Loki port of the game. All operating systems now use a common SDL2 back-end.
|
||||
- Use a configuration file instead of the registry to store game settings on Windows, to be consistent with the other OSes.
|
||||
- Support 64-bit builds on all platforms (#59, #158, #178, #179, #192, #233, #272, #354, #356, #357, #385, #397). 32bit compatibility for existing savefiles and demos is not functional.
|
||||
- Eliminate assembly code specific to x86 (#72).
|
||||
- Add icons to Windows and MacOS bundles (#498)
|
||||
- Replace OS-specific filesystem functions by C++17 std::filesystem in the CFile and DDIO modules (#383, #443, #475, #484, #486, #499).
|
||||
- Use standard temporary directory for cache files instead of game data directory (#500)
|
||||
- Implement new byteswap functions (#85, #165, #172)
|
||||
- Build the internal level editor using MFC UI framework. The executable is not included in this release because it is still very unstable and not usable, and can only run on Windows (32-bit) (#397, #476)
|
||||
- Render the game to an OpenGL Frame Buffer Object at the game's resolution (#437)
|
||||
- Format code-base using clang-format (#13, #16, #19, #24, #51, #438)
|
||||
- Use upstream libacm 1.3 for ACM audio decoding (#135, #191, #221)
|
||||
- Implement a new MVE video decoder based on the open source implementation used in D2X (#289). MVE movies for intro and cutscenes can now be played on all platforms. OGV movies shipped with the Linux game cannot be played yet.
|
||||
- Use the "push" model of filling sound buffer for MVE playback (#491)
|
||||
- Write a new implementation of the md5 algorithm used to compute checksums. (#316)
|
||||
- Use VCPKG to build third-party dependencies not included in the code tree, such as SDL2 and zlib (#137, #430, #469, #512).
|
||||
- Set up automated build and testing using Github Actions for Linux (clang/gcc), Windows (MSVC) and MacOS (apple-clang, x64 & arm64) (#14, #28, #29, #45, #50, #60, #123, #133, #139, #155, #166, #177, #182)
|
||||
- Modernize build system: require CMake 3.20, use present-day CMake practices (#20, #63, #77, #86, #99, #104, #127, #131, #144, #220, #225, #227, #235, #256, #318, #340, #400, #407, #422, #460, #463, #482, #504)
|
||||
- Ensure compatibility with popular compilers, convert misc. pieces of code to modern C++ (#17, #20, #23, #40, #54, #58, #70, #108, #304, #328, #344, #358, #388, #405, #416)
|
||||
- Mark relevant variables and functions as static (#185)
|
||||
- Update the module system: isolate code for independant sub-modules in separate directories and CMake targets (#76, #89, #91, #195, #367, #374, #448, #470, #502)
|
||||
- Document build procedure and usage on all platforms (#116, #118, #119, #124, #147, #154, #170, #174, #175, #184, #190, #204, #210, #211, #222, #259, #261, #270, #285, #297, #384, #413, #435)
|
||||
- Unifiy Windows & Unix command line arguments: --foo, -foo and +foo is accepted on any OS (#199)
|
||||
- Refactor CleanupStr in misc/pstring.cpp (#207)
|
||||
- Change non-specific types (e.g. unsigned int) to their stdint specified counterparts (e.g. `uint32_t`) (#268, #464)
|
||||
- Support case-insensitive loading of content files (#294)
|
||||
- Build TCP/IP and PXO multiplayer modules (#296, #302, #420, #424, #432)
|
||||
- Refactor renderer: move non-OpenGL specific code to a base file, abstract triangle rendering code (#315, #323, #336)
|
||||
- Save screenshots in PNG format instead of the legacy TGA format (#325, #348)
|
||||
- Increment max cells value to increase render distance for outdoor terrain (#338)
|
||||
- Use chrono C++11 steady_clock for time measurement (#394)
|
||||
- Enable real-time library memory functions by default (#436, #445, #456)
|
||||
- Change `__LINUX__` defines to `POSIX` for general OS checks (#492)
|
||||
|
||||
|
||||
### Fixed
|
||||
- Cleanup warnings issued by modern compilers (#57, #74, #82, #87, #89, #109, #117, #218, #349, #387, #428, #434, #478, #507)
|
||||
- Replace sprintf by snprintf(#78, #252, #266)
|
||||
- Add object unlink sanity check (#140)
|
||||
- Use a static background image in the main menu if the video file is not present (#152)
|
||||
- Add virtual default constructors on abstract classes (#219)
|
||||
- Fix cursor not being grabbed on macOS (#223)
|
||||
- Fix detection of mercenary installation, where hogfiles are not the same for CD and digital installation (#260)
|
||||
- Fix some out-of-bounds array access (#263)
|
||||
- Fix for Level 5 script; Make CustomText2 centered on Y axis (#307)
|
||||
- Fix a crash when calling `quit` in the server console in dedicated server mode (#370)
|
||||
- Fix a game crash when launching with `-useexedir` argument (#372)
|
||||
- `-nomousegrab` command-line argument now works correctly (#401)
|
||||
- Only close SDL audio if it's open (#409)
|
||||
- Do not segfault when critical game files are missing (#414)
|
||||
- Avoid server crash during client connection (#431)
|
||||
- Fix `-aspect` aspect ratio argument for ship selection screen (#454)
|
||||
- Remove usage of non-glibc `GLOB_PERIOD` (#462)
|
||||
- Fix endian issues with iff importer (#481)
|
||||
- Fix a crash with `-nointro` command-line argument
|
||||
- Support `-nosound` option for movie playbacks
|
||||
- Use UTF-8 in more places on Windows using a manifest file (#494)
|
||||
|
||||
|
||||
### Removed
|
||||
- Remove unused supporting modules for obsolete hardware or unused features: Aureal 3D sound cards (#345), GameGauge performance benchmark (#238, #337), CD-ROM asset loading (#452, #455), Intellivibe interface for VRF Tactile Feedback System (#453), AngelScript (#15), legacy Macintosh (#188), IPX/SPX network protocol support (#237), Rock'n Ride (#292)
|
||||
- Unused library dynamic loading headers (#283)
|
||||
- References to libGLU (#246)
|
||||
- References to X11 and glX (#247, #244)
|
||||
- Unused mono debug code (#410)
|
||||
- Unused software renderer and d3m files (#305, #314, #321)
|
||||
- DDAccess.h header and access ring definitions (#342)
|
||||
- DMFC_DLL definition (#441)
|
||||
- Misc. removal of unfinished or unused code (#21, #55, #189, #197, #234, #245, #299, #303, #334, #396, #408)
|
||||
|
@ -5,21 +5,41 @@ if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED ENV{CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "default build type")
|
||||
endif()
|
||||
|
||||
project(Descent3
|
||||
LANGUAGES C CXX
|
||||
VERSION 1.5.0
|
||||
)
|
||||
|
||||
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with ninja)." OFF)
|
||||
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored compiler warnings/errors (GCC/Clang only; esp. useful with Ninja)." OFF)
|
||||
option(FORCE_PORTABLE_INSTALL "Install all files into local directory defined by CMAKE_INSTALL_PREFIX" ON)
|
||||
option(ENABLE_LOGGER "Enable logging to the terminal" OFF)
|
||||
option(ENABLE_MEM_RTL "Enable Real-time library memory management functions (disable to verbose memory allocations)" ON)
|
||||
option(BUILD_TESTING "Enable testing. Requires GTest." OFF)
|
||||
set(USE_VCPKG "DEFAULT" CACHE STRING "Use vcpkg for dependency management. DEFAULT defers to existence of $VCPKG_ROOT environment variable.")
|
||||
set_property(CACHE USE_VCPKG PROPERTY STRINGS "DEFAULT" "ON" "OFF")
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
option(BUILD_EDITOR "Build internal editor" OFF)
|
||||
endif()
|
||||
|
||||
if(USE_VCPKG)
|
||||
if(DEFINED ENV{VCPKG_ROOT})
|
||||
if (CMAKE_TOOLCHAIN_FILE)
|
||||
cmake_path(ABSOLUTE_PATH CMAKE_TOOLCHAIN_FILE NORMALIZE OUTPUT_VARIABLE VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
|
||||
endif()
|
||||
|
||||
set(VCPKG_TOOLCHAIN_FILE "scripts/buildsystems/vcpkg.cmake")
|
||||
cmake_path(ABSOLUTE_PATH VCPKG_TOOLCHAIN_FILE BASE_DIRECTORY $ENV{VCPKG_ROOT} NORMALIZE OUTPUT_VARIABLE CMAKE_TOOLCHAIN_FILE)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE STREQUAL VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
|
||||
# prevent endless recursion
|
||||
unset(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
|
||||
endif()
|
||||
elseif(NOT USE_VCPKG STREQUAL "DEFAULT")
|
||||
message(WARNING "USE_VCPKG=${USE_VCPKG} but ENV{VCPKG_ROOT} not set; will use system-provided libraries. Did you forget to set VCPKG_ROOT in your environment?")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
project(Descent3
|
||||
LANGUAGES C CXX
|
||||
VERSION 1.5.0
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
@ -103,7 +123,7 @@ add_custom_command(
|
||||
)
|
||||
|
||||
install(
|
||||
FILES LICENSE README.md THIRD_PARTY.md
|
||||
FILES CHANGELOG.md USAGE.md README.md BUILD.md LICENSE THIRD_PARTY.md
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
)
|
||||
|
||||
@ -233,3 +253,17 @@ add_subdirectory(tools)
|
||||
add_subdirectory(netcon)
|
||||
add_subdirectory(netgames)
|
||||
add_subdirectory(scripts)
|
||||
|
||||
# Packaging stuff
|
||||
set(CPACK_SOURCE_GENERATOR "TXZ")
|
||||
set(CPACK_SOURCE_IGNORE_FILES
|
||||
".git/"
|
||||
".github/"
|
||||
".idea"
|
||||
build[s]/
|
||||
cmake-build-*
|
||||
".*~$"
|
||||
)
|
||||
set(CPACK_VERBATIM_VARIABLES YES)
|
||||
include(CPack)
|
||||
|
||||
|
@ -21,8 +21,7 @@
|
||||
"architecture": {
|
||||
"strategy": "external",
|
||||
"value": "x64"
|
||||
},
|
||||
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mac",
|
||||
|
@ -1,7 +1,28 @@
|
||||
set(HEADERS
|
||||
aiambient.h
|
||||
AIGoal.h
|
||||
AIMain.h
|
||||
BOA.h
|
||||
Briefing.h
|
||||
BriefingParse.h
|
||||
ConfigItem.h
|
||||
CtlCfgElem.h
|
||||
D3ForceFeedback.h
|
||||
DeathInfo.h
|
||||
DllWrappers.h
|
||||
Inventory.h
|
||||
LoadLevel.h
|
||||
Mission.h
|
||||
NewPyroGauges.h
|
||||
ObjScript.h
|
||||
PilotPicsAPI.h
|
||||
SmallViews.h
|
||||
TelCom.h
|
||||
TelComAutoMap.h
|
||||
TelComCargo.h
|
||||
TelComEffects.h
|
||||
TelComEfxStructs.h
|
||||
TelComGoals.h
|
||||
aiambient.h
|
||||
aipath.h
|
||||
aistruct.h
|
||||
aistruct_external.h
|
||||
@ -11,31 +32,25 @@ set(HEADERS
|
||||
attach.h
|
||||
audiotaunts.h
|
||||
bnode.h
|
||||
BOA.h
|
||||
Briefing.h
|
||||
BriefingParse.h
|
||||
bsp.h
|
||||
buddymenu.h
|
||||
cinematics.h
|
||||
cockpit.h
|
||||
config.h
|
||||
ConfigItem.h
|
||||
controls.h
|
||||
credits.h
|
||||
CtlCfgElem.h
|
||||
ctlconfig.h
|
||||
ctlconfigtxt.h
|
||||
D3ForceFeedback.h
|
||||
d3movie.h
|
||||
d3music.h
|
||||
d3serial.h
|
||||
damage.h
|
||||
damage_external.h
|
||||
DeathInfo.h
|
||||
deathinfo_external.h
|
||||
debuggraph.h
|
||||
descent.h
|
||||
difficulty.h
|
||||
difficulty_external.h
|
||||
DllWrappers.h
|
||||
door.h
|
||||
doorway.h
|
||||
fireball.h
|
||||
@ -56,23 +71,19 @@ set(HEADERS
|
||||
hotspotmap.h
|
||||
hud.h
|
||||
init.h
|
||||
Inventory.h
|
||||
levelgoal.h
|
||||
levelgoal_external.h
|
||||
lighting.h
|
||||
lightmap_info.h
|
||||
list.h
|
||||
LoadLevel.h
|
||||
localization.h
|
||||
marker.h
|
||||
matcen.h
|
||||
matcen_external.h
|
||||
menu.h
|
||||
Mission.h
|
||||
mission_download.h
|
||||
mmItem.h
|
||||
multi.h
|
||||
multisafe.h
|
||||
multi_client.h
|
||||
multi_dll_mgr.h
|
||||
multi_external.h
|
||||
@ -80,7 +91,7 @@ set(HEADERS
|
||||
multi_server.h
|
||||
multi_ui.h
|
||||
multi_world_state.h
|
||||
NewPyroGauges.h
|
||||
multisafe.h
|
||||
newui.h
|
||||
newui_core.h
|
||||
object.h
|
||||
@ -88,12 +99,10 @@ set(HEADERS
|
||||
object_lighting.h
|
||||
objinfo.h
|
||||
objinit.h
|
||||
ObjScript.h
|
||||
osiris_dll.h
|
||||
osiris_predefs.h
|
||||
osiris_share.h
|
||||
pilot.h
|
||||
PilotPicsAPI.h
|
||||
pilot_class.h
|
||||
player.h
|
||||
player_external.h
|
||||
@ -113,7 +122,6 @@ set(HEADERS
|
||||
screens.h
|
||||
ship.h
|
||||
slew.h
|
||||
SmallViews.h
|
||||
soar.h
|
||||
soar_helpers.h
|
||||
sounds.h
|
||||
@ -122,12 +130,6 @@ set(HEADERS
|
||||
splinter.h
|
||||
stringtable.h
|
||||
subtitles.h
|
||||
TelCom.h
|
||||
TelComAutoMap.h
|
||||
TelComCargo.h
|
||||
TelComEffects.h
|
||||
TelComEfxStructs.h
|
||||
TelComGoals.h
|
||||
terrain.h
|
||||
trigger.h
|
||||
vclip.h
|
||||
@ -313,8 +315,12 @@ target_link_libraries(Descent3 PRIVATE
|
||||
music networking physics renderer rtperformance sndlib ui unzip vecmat md5
|
||||
${PLATFORM_LIBS})
|
||||
target_include_directories(Descent3 PRIVATE ${PROJECT_BINARY_DIR}/lib)
|
||||
target_link_options(Descent3 PRIVATE $<$<PLATFORM_ID:Windows>:/DEBUG:FULL>)
|
||||
add_dependencies(Descent3 get_git_hash Direct_TCP_IP_Hog HogFull NetgamesDir Parallax_Online_Hog)
|
||||
install(TARGETS Descent3 RUNTIME BUNDLE DESTINATION .)
|
||||
if(MSVC)
|
||||
install(FILES $<TARGET_PDB_FILE:Descent3> DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
|
@ -572,6 +572,8 @@ bool InitGameModule(const char *name, module *mod) {
|
||||
// Make the dll filename
|
||||
#if defined(WIN32)
|
||||
snprintf(dll_name, sizeof(dll_name), "%s.dll", name);
|
||||
#elif defined(MACOSX)
|
||||
snprintf(dll_name, sizeof(dll_name), "%s.dylib", name);
|
||||
#else
|
||||
snprintf(dll_name, sizeof(dll_name), "%s.so", name);
|
||||
#endif
|
||||
|
@ -1635,20 +1635,15 @@ bool DoMissionBriefing(int level) {
|
||||
return ret;
|
||||
}
|
||||
extern bool FirstGame;
|
||||
bool Skip_next_movie = false;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// play movie
|
||||
void DoMissionMovie(const char *movie) {
|
||||
char temppath[_MAX_PATH];
|
||||
if (PROGRAM(windowed)) {
|
||||
mprintf(0, "Skipping movie...can't do in windowed mode!\n");
|
||||
return;
|
||||
}
|
||||
// Don't play this movie the first time through. This is a horrible hack.
|
||||
if (Skip_next_movie) {
|
||||
Skip_next_movie = false;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef D3_FAST
|
||||
return;
|
||||
#endif
|
||||
@ -1657,8 +1652,8 @@ void DoMissionMovie(const char *movie) {
|
||||
ddio_MakePath(mpath, LocalD3Dir, "movies", movie, NULL);
|
||||
PlayMovie(mpath);
|
||||
}
|
||||
// PlayMovie(movie);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Script Management for Missions and Levels
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -622,7 +622,7 @@ bool LoadGameDialog() {
|
||||
|
||||
fp = fopen(pathname, "rb");
|
||||
if (fp) {
|
||||
int bm_handle;
|
||||
int bm_handle = -1;
|
||||
int *pbm_handle;
|
||||
fclose(fp);
|
||||
|
||||
@ -1121,11 +1121,11 @@ void SGSObjects(CFILE *fp) {
|
||||
gs_WriteInt(fp, op->attach_parent_handle);
|
||||
if ((op->attach_ultimate_handle) && (OBJECT_HANDLE_NONE != op->attach_ultimate_handle)) {
|
||||
mprintf(0, "Object %d has an ultimate parent of %d (%d)\n", i, OBJNUM(ObjGet(op->attach_ultimate_handle)),
|
||||
op->attach_parent_handle);
|
||||
op->attach_parent_handle);
|
||||
}
|
||||
if ((op->attach_ultimate_handle) && (OBJECT_HANDLE_NONE != op->attach_parent_handle)) {
|
||||
mprintf(0, "Object %d has a parent of %d (%d)\n", i, OBJNUM(ObjGet(op->attach_parent_handle)),
|
||||
op->attach_parent_handle);
|
||||
op->attach_parent_handle);
|
||||
}
|
||||
|
||||
gs_WriteInt(fp, pm->n_attach);
|
||||
|
@ -1059,7 +1059,7 @@ void PreInitD3Systems() {
|
||||
debugging = true;
|
||||
#endif
|
||||
|
||||
error_Init(debugging, false, PRODUCT_NAME);
|
||||
error_Init(debugging, PRODUCT_NAME);
|
||||
|
||||
if (FindArg("-lowmem"))
|
||||
Mem_low_memory_mode = true;
|
||||
@ -1117,9 +1117,6 @@ void PreInitD3Systems() {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Save game variables to the registry
|
||||
*/
|
||||
void SaveGameSettings() {
|
||||
char tempbuffer[TEMPBUFFERSIZE];
|
||||
int tempint;
|
||||
|
@ -98,4 +98,9 @@ void RestartD3();
|
||||
|
||||
void InitMessage(const char *c, float progress = -1);
|
||||
|
||||
/**
|
||||
* Save game variables to the registry
|
||||
*/
|
||||
void SaveGameSettings();
|
||||
|
||||
#endif
|
||||
|
@ -658,12 +658,12 @@
|
||||
#include "menu.h"
|
||||
#include "mmItem.h"
|
||||
#include "game.h"
|
||||
#include "gamesequence.h"
|
||||
#include "Mission.h"
|
||||
#include "multi_ui.h"
|
||||
#include "ctlconfig.h"
|
||||
#include "config.h"
|
||||
#include "gamesave.h"
|
||||
#include "gamesequence.h"
|
||||
#include "demofile.h"
|
||||
#include "pilot.h"
|
||||
#include "LoadLevel.h"
|
||||
@ -671,6 +671,8 @@
|
||||
#include "mem.h"
|
||||
#include "args.h"
|
||||
#include "cinematics.h"
|
||||
#include "multi_dll_mgr.h"
|
||||
#include "newui_core.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define USE_DIRECTPLAY
|
||||
@ -681,9 +683,6 @@
|
||||
#else
|
||||
bool Directplay_lobby_launched_game = false;
|
||||
#endif
|
||||
#include "multi_dll_mgr.h"
|
||||
#include "d3music.h"
|
||||
#include "newui_core.h"
|
||||
|
||||
#define IDV_QUIT 0xff
|
||||
// Menu Item Defines
|
||||
@ -702,8 +701,7 @@ bool MenuLoadLevel(void);
|
||||
#endif
|
||||
// for command line joining of games
|
||||
bool Auto_connected = false;
|
||||
// externed from init.cpp
|
||||
extern void SaveGameSettings();
|
||||
|
||||
// runs command line options.
|
||||
bool ProcessCommandLine();
|
||||
// new game selection
|
||||
@ -715,7 +713,6 @@ extern bool Demo_looping;
|
||||
bool FirstGame = false;
|
||||
|
||||
int MainMenu() {
|
||||
extern void ShowStaticScreen(char *bitmap_filename, bool timed = false, float delay_time = 0.0f);
|
||||
mmInterface main_menu;
|
||||
bool exit_game = false;
|
||||
bool exit_menu = false;
|
||||
@ -1127,15 +1124,16 @@ static inline int generate_mission_listbox(newuiListBox *lb, int n_maxfiles, cha
|
||||
}
|
||||
return c;
|
||||
}
|
||||
extern bool Skip_next_movie;
|
||||
|
||||
#define OEM_TRAINING_FILE "training.mn3"
|
||||
#define OEM_MISSION_FILE "d3oem.mn3"
|
||||
|
||||
bool MenuNewGame() {
|
||||
newuiTiledWindow menu;
|
||||
newuiSheet *select_sheet;
|
||||
newuiListBox *msn_lb;
|
||||
char **filelist = NULL;
|
||||
int n_missions, i, res; //,k
|
||||
char **filelist = nullptr;
|
||||
int n_missions, i, res;
|
||||
bool found = false;
|
||||
bool do_menu = true, load_mission = false, retval = true;
|
||||
#ifdef DEMO
|
||||
@ -1150,18 +1148,10 @@ bool MenuNewGame() {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
#ifdef RELEASE
|
||||
if ((!FindArg("-mission")) && (!FirstGame) && (-1 == Current_pilot.find_mission_data(TRAINING_MISSION_NAME))) {
|
||||
|
||||
FirstGame = true;
|
||||
|
||||
char moviepath[_MAX_PATH];
|
||||
ddio_MakePath(moviepath, LocalD3Dir, "movies", "level1.mve", nullptr);
|
||||
if (cfexist(moviepath)) {
|
||||
PlayMovie(moviepath);
|
||||
}
|
||||
Skip_next_movie = true;
|
||||
|
||||
if (LoadMission("training.mn3")) {
|
||||
CurrentPilotUpdateMissionStatus(true);
|
||||
// go into game mode.
|
||||
@ -1190,7 +1180,7 @@ bool MenuNewGame() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// create menu.
|
||||
menu.Create(TXT_MENUNEWGAME, 0, 0, 448, 384);
|
||||
|
||||
@ -1333,7 +1323,7 @@ redo_newgame_menu:
|
||||
goto redo_newgame_menu;
|
||||
} else {
|
||||
Current_mission.cur_level = start_level;
|
||||
// pull out the ship permssions and use them
|
||||
// pull out the ship permissions and use them
|
||||
Players[0].ship_permissions = GetPilotShipPermissions(&Current_pilot, Current_mission.name);
|
||||
}
|
||||
}
|
||||
|
@ -68,9 +68,12 @@
|
||||
*/
|
||||
#ifndef MMITEM_H
|
||||
#define MMITEM_H
|
||||
|
||||
#include "cinematics.h"
|
||||
#include "gamefont.h"
|
||||
#include "newui.h"
|
||||
#include "psclass.h"
|
||||
#include "gamefont.h"
|
||||
|
||||
#if ((!defined(OEM)) && (!defined(DEMO)))
|
||||
#define MOVIE_MENU
|
||||
#endif
|
||||
@ -176,7 +179,7 @@ protected:
|
||||
virtual void OnSelect();
|
||||
};
|
||||
// Main Menu Interface Object
|
||||
struct tCinematic;
|
||||
|
||||
class mmInterface : public UIWindow {
|
||||
int m_nmenu_items; // number of menu items available.
|
||||
mmItem m_menuitems[N_MMENU_ITEMS]; // main menu items
|
||||
|
@ -605,6 +605,8 @@ int LoadMultiDLL(const char *name) {
|
||||
// Make the dll filename
|
||||
#if defined(WIN32)
|
||||
snprintf(dll_name, sizeof(dll_name), "%s.dll", name);
|
||||
#elif defined(MACOSX)
|
||||
snprintf(dll_name, sizeof(dll_name), "%s.dylib", name);
|
||||
#else
|
||||
snprintf(dll_name, sizeof(dll_name), "%s.so", name);
|
||||
#endif
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "appdatabase.h"
|
||||
#include "args.h"
|
||||
#include "init.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "osiris_dll.h"
|
||||
|
||||
@ -134,7 +135,9 @@ void install_signal_handlers() {
|
||||
fprintf(stderr, "SIG: Unable to install SIGTRAP\n");
|
||||
}
|
||||
#else
|
||||
void install_signal_handlers() {}
|
||||
void install_signal_handlers() {
|
||||
SetUnhandledExceptionFilter(RecordExceptionInfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
168
README.md
168
README.md
@ -2,171 +2,11 @@
|
||||
|
||||
This is the Descent 3 open source engine, licensed under [GPL-3.0](https://github.com/DescentDevelopers/Descent3?tab=GPL-3.0-1-ov-file). It includes the '1.5' patch written by Kevin Bentley and Jeff Slutter several years ago and brought to a stable condition by the Descent community.
|
||||
|
||||
In order to use this, you must provide your own game files. See the **Usage** section for details.
|
||||
In order to use this, you must provide your own game files. See the [USAGE.md](USAGE.md) file for details about installation.
|
||||
|
||||
## Version 1.5 Notes
|
||||
There is no "release" yet. The current milestone is "1.5 Stable", which is meant to more or less be Descent 3 as it might have been if the 1.5 patch had made it to retail years ago. Artifacts can be downloaded from the [Actions](https://github.com/DescentDevelopers/Descent3/actions) tab.
|
||||
The milestone needs testing on all platforms. Please report issues when found.
|
||||
To build the game, follow build instructions in the [BUILD.md](BUILD.md) file.
|
||||
|
||||
## Usage
|
||||
1. Make sure that you have a copy of Descent 3. You can purchase a copy of Descent 3 from [GOG](https://www.gog.com/game/descent_3_expansion) or [Steam](https://store.steampowered.com/app/273590/Descent_3/).
|
||||
2. Install Descent 3.
|
||||
|
||||
- **Note for Steam users:** If you own Descent 3 on Steam, then it’s recommended that you install the Windows version of the game even if you’re running macOS or Linux, otherwise movies will not work due to [current lack of Ogv support](https://github.com/DescentDevelopers/Descent3/issues/240). You can use either [Steam Play](https://help.steampowered.com/en/faqs/view/08F7-5D56-9654-39AF) or [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Cross-Platform_Installation) to install the Windows version of the game on macOS or Linux.
|
||||
|
||||
- **Note for non-Windows users:** If you have the Windows version of the game on CDs but you don’t want to use Windows to install them, then you can follow these instructions:
|
||||
|
||||
<details>
|
||||
<summary>How to install the Windows Dual-Jewel version of Descent 3 in Wine</summary>
|
||||
|
||||
<ol type="1">
|
||||
<li>Make sure that you have <a href="https://www.winehq.org">Wine</a> installed.</li>
|
||||
<li><i>(Recommended)</i> Run <code>winecfg</code> and make sure that “Emulate a virtual desktop” is enabled.</li>
|
||||
<li>
|
||||
<p><i>(Optional)</i> Determine if you’re going to be affected by a bug with Descent 3’s installer, and potentially apply a workaround:</p>
|
||||
<ol type="a">
|
||||
<li>Download <a href="https://codeberg.org/JasonYundt/environment-size-checker">Environment Size Checker</a>.</li>
|
||||
<li>Run <code>wine environment-size-checker.exe</code>.</li>
|
||||
<li>If that program tells you that your environment is more than 32,724 bytes large, then you’ll need to unset or shorten environment variables before running Descent 3’s installer. If you don’t, then the installer will page fault.</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>
|
||||
<p>Install Descent 3:</p>
|
||||
<ol type="a">
|
||||
<li>Insert disc 1.</li>
|
||||
<li>Make sure that disc 1 is mounted.</li>
|
||||
<li>Determine which drive letter Wine is using for your CD drive. (Hint: try running <code>wine explorer</code>).</li>
|
||||
<li>Run <code>wine '<drive-letter>:\Setup.exe'</code>.</li>
|
||||
<li>Follow the installation wizard’s instructions until it asks you to choose a “Setup Type”.</li>
|
||||
<li>Select the “Full” Setup Type, then click “Next”.
|
||||
<li>Continue following the installation wizard’s instructions until it asks you to insert disc 2.</li>
|
||||
<li>
|
||||
<p>Switch to disc 2:</p>
|
||||
<!-- This really should be an <ol>, but I couldn’t get the numbering/lettering to work right: <https://github.com/orgs/community/discussions/124850> -->
|
||||
<ul>
|
||||
<li>Run <code>wine eject <drive-letter>:</code>.</li>
|
||||
<li>Make sure that the disc was unmounted and ejected.</li>
|
||||
<li>Insert disc 2.</li>
|
||||
<li>Mount disc 2.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Continue following the installation wizard’s instructions until it asks you to insert disc 1 again.</li>
|
||||
<li>Switch back to disc 1. Follow a similar procedure to the one that you used to switch to disc 2.</li>
|
||||
<li>Finish the going through the installation wizard.</li>
|
||||
<li>When the installation wizard finishes, it will open an explorer window. Close out of that window.</li>
|
||||
<li>Unmount the disc.</li>
|
||||
<li>Eject the disc.</li>
|
||||
</ol>
|
||||
<li>
|
||||
<p>Install Descent 3: Mercenary:</p>
|
||||
<ol type="a">
|
||||
<li>Insert disc 3.</li>
|
||||
<li>Make sure that disc 3 is mounted.</li>
|
||||
<li>Run <code>wine start /d <drive-letter>: setup.exe -autorun</code>.</li>
|
||||
<li>Follow the instructions in the installation wizard.</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
</details>
|
||||
|
||||
3. If your version of Descent 3 is older than v1.4, then [update it to v1.4](http://descent3.com/downloads.php).
|
||||
4. Create a new folder named `D3-open-source`.
|
||||
5. Copy the following files from your installation of Descent 3 to `D3-open-source`:
|
||||
- All `.hog` files
|
||||
- The `missions` folder
|
||||
- _(Optional)_ All `.pld` files
|
||||
- _(Optional)_ The `demo` folder
|
||||
- _(Optional)_ The `movies` folder
|
||||
6. Create the `custom/` folder in `D3-open-source`
|
||||
7. Obtain new Descent 3 engine files:
|
||||
- If you want to use pre-built binaries, then download one of the artifacts from our latest CI run. You can find a list of CI runs [here](https://github.com/DescentDevelopers/Descent3/actions/workflows/build.yml?query=branch%3Amain).
|
||||
- If you want to build the engine files yourself, the follow [these instructions](#building). Once you build the engine files, they’ll be put in `builds/<platform>/Descent3/<build-type>/`. For example, if you’re using Linux and you create a “Release” build, then the files will be located at `builds/linux/Descent3/Release`.
|
||||
8. Copy all of the new engine files into `D3-open-source` and overwrite any conflicts.
|
||||
9. Run the game:
|
||||
- On Windows, run `D3-open-source\Descent3.exe`.
|
||||
- On other platforms, run `D3-open-source/Descent3`.
|
||||
10. Special notes:
|
||||
- D3 Open Source compiles level scripts in their own hogfiles. Make sure you copy and overwrite `d3-{platform}.hog`.
|
||||
|
||||
## Building
|
||||
#### Building - Windows
|
||||
1. Make sure that you have Git and Visual Studio 2022 with the “Desktop development with C++” workload and the “C++ MFC for latest v143 build tools (x86 & x64)” component. If you don’t already have those installed or you aren’t sure, then open an elevated Command Prompt and run:
|
||||
|
||||
<!--
|
||||
The following code block specifies the full path to the Visual Studio Installer because the Visual Studio Installer doesn’t add itself to the user’s Path. The installer is guaranteed to be in a specific location on 64-bit systems [1]. The installer will be in a different location on 32-bit systems [2], but Visual Studio 2022 doesn’t support 32-bit systems [3] so we can ignore that detail.
|
||||
|
||||
[1]: <https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022>
|
||||
[2]: <https://github.com/microsoft/vswhere/wiki#installing>
|
||||
[3]: <https://learn.microsoft.com/en-us/answers/questions/1689898/does-visual-studio-build-tools-2022-support-32-bit>
|
||||
-->
|
||||
|
||||
```batch
|
||||
winget install Git.Git Microsoft.VisualStudio.2022.Community
|
||||
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\setup.exe" modify^
|
||||
--passive^
|
||||
--channelId VisualStudio.17.Release^
|
||||
--productId Microsoft.VisualStudio.Product.Community^
|
||||
--add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended^
|
||||
--add Microsoft.VisualStudio.Component.VC.ATLMFC
|
||||
```
|
||||
|
||||
2. Open a “x64 Native Tools Command Prompt” and run:
|
||||
|
||||
```batch
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
cd Descent3
|
||||
cmake --preset win -D ENABLE_LOGGER=[ON|OFF] -D BUILD_EDITOR=[ON|OFF]
|
||||
cmake --build --preset win --config [Debug|Release]
|
||||
```
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds\win\Descent3\Debug` or `builds\win\Descent3\Release`.
|
||||
|
||||
#### Building - macOS
|
||||
1. Make sure that [Xcode](https://developer.apple.com/xcode) is installed.
|
||||
|
||||
2. Make sure that [Homebrew](https://brew.sh) is installed.
|
||||
|
||||
3. Run these commands:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
cd Descent3
|
||||
brew bundle install
|
||||
cmake --preset mac -D ENABLE_LOGGER=[ON|OFF]
|
||||
cmake --build --preset mac --config [Debug|Release]
|
||||
```
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds/mac/Descent3/Debug` or `builds/mac/Descent3/Release`.
|
||||
|
||||
#### Building - Linux (Ubuntu)
|
||||
Run these commands:
|
||||
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install -y --no-install-recommends git ninja-build cmake g++ libsdl2-dev zlib1g-dev
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
cd Descent3
|
||||
cmake --preset linux -D ENABLE_LOGGER=[ON|OFF]
|
||||
cmake --build --preset linux --config [Debug|Release]
|
||||
```
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds/linux/Descent3/Debug` or `builds/linux/Descent3/Release`.
|
||||
|
||||
#### Building - Linux (Fedora)
|
||||
Run these commands:
|
||||
|
||||
```sh
|
||||
sudo dnf update --refresh
|
||||
sudo dnf install -y git ninja-build cmake gcc-c++ SDL2-devel zlib-devel
|
||||
git clone https://github.com/DescentDevelopers/Descent3
|
||||
cd Descent3
|
||||
cmake --preset linux -D ENABLE_LOGGER=[ON|OFF]
|
||||
cmake --build --preset linux --config [Debug|Release]
|
||||
```
|
||||
|
||||
Once CMake finishes, the built files will be put in `builds/linux/Descent3/Debug` or `builds/linux/Descent3/Release`.
|
||||
Build or runtime issues should be reported on our [GitHub tracker](https://github.com/DescentDevelopers/Descent3/issues).
|
||||
|
||||
## Contributing
|
||||
Anyone can contribute! We have an active Discord presence at [Descent Developer Network](https://discord.gg/GNy5CUQ). If you are interested in maintaining the project on a regular basis, please contact Kevin Bentley.
|
||||
Anyone can contribute! We have an active Discord presence at [Descent Developer Network](https://discord.gg/GNy5CUQ). Patches should be submitted on GitHub.
|
37
USAGE.md
Normal file
37
USAGE.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Descent 3 Open source usage instructions
|
||||
|
||||
**Important note**: This open source distribution of Descent 3 DOES NOT CONTAIN GAME ASSETS. Assets must be acquired separately from an official copy of the game, and copied as describe in the next section.
|
||||
|
||||
This is the first release of the Descent 3 open source engine, that should be considered a beta version. If you find a bug that has not been reported before, please open a new ticket it on our [online issue tracker](https://github.com/DescentDevelopers/Descent3/issues).
|
||||
|
||||
1. Make sure that you have a copy of Descent 3. You can purchase a copy of Descent 3 from [GOG](https://www.gog.com/game/descent_3_expansion) or [Steam](https://store.steampowered.com/app/273590/Descent_3/).
|
||||
2. Install Descent 3.
|
||||
**Note for Steam users:** If you own Descent 3 on Steam, then it’s recommended that you install the Windows version of the game even if you’re running macOS or Linux, otherwise movies will not work due to [current lack of Ogv support](https://github.com/DescentDevelopers/Descent3/issues/240). You can use either [Steam Play](https://help.steampowered.com/en/faqs/view/08F7-5D56-9654-39AF) or [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Cross-Platform_Installation) to install the Windows version of the game on macOS or Linux.
|
||||
3. If your version of Descent 3 is older than v1.4, then [update it to v1.4](http://descent3.com/downloads.php).
|
||||
4. Find the installation location of Descent 3. Using the Steam client, you can find it from the library page using the `Manage > Browse local files` context menu.
|
||||
5. Create a new folder named `D3-open-source`.
|
||||
6. Copy the following files from your installation of Descent 3 to `D3-open-source`:
|
||||
- All `.hog` files
|
||||
- The `missions` folder
|
||||
- _(Optional)_ All `.pld` files
|
||||
- _(Optional)_ The `movies` folder
|
||||
7. Create the `custom/` folder in `D3-open-source`
|
||||
8. Obtain new Descent 3 engine files:
|
||||
- If you want to use pre-built binaries, then download the latest [release](https://github.com/DescentDevelopers/Descent3/releases). For a more cutting-edge experience with the latest features, use the artifacts from the latest automated build. You can find the list of automated builds [here](https://github.com/DescentDevelopers/Descent3/actions/workflows/build.yml?query=branch%3Amain+event%3Apush).
|
||||
- If you want to build the engine files yourself, the follow the instructions in [BUILD.md](BUILD.md). Once you build the engine files, they’ll be put in `builds/<platform>/Descent3/<build-type>/`. For example, if you’re using Linux and you create a “Release” build, then the files will be located at `builds/linux/Descent3/Release`.
|
||||
9. Copy all of the new engine files into `D3-open-source` and overwrite any conflicts.
|
||||
10. Special notes:
|
||||
- D3 Open Source compiles level scripts in their own hogfiles. Make sure you copy and overwrite `d3-{platform}.hog`.
|
||||
11. Run the game:
|
||||
- On Windows, run `D3-open-source\Descent3.exe` from a command-line or double-click on the `Descent3` executable.
|
||||
- On Linux, `cd` to `D3-open-source` and run `./Descent3`. Wayland users may need to set environement variable `SDL_VIDEODRIVER=wayland` before launching the game.
|
||||
- On MacOS, the `.app` bundle is currently not signed, so your operating system will not let you run it by double-clicking it. To remediate that, open your terminal and `cd` to `D3-open-source`. Run `chmod +x ./Descent3.app/Content/MacOS/Descent3`, then run the game using `./Descent3.app/Content/MacOS/Descent3`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
```
|
||||
Descent 3 Message(Error: Couldn't find the string table.)
|
||||
```
|
||||
|
||||
This error means that game data could not be found. Make sure you copied all game files to the `D3-open-source` folder, and that you're running the game from this same folder.
|
||||
|
@ -1,8 +1,8 @@
|
||||
set(HEADERS iff.h)
|
||||
set(HEADERS
|
||||
NewBitmap.h
|
||||
iff.h)
|
||||
set(CPPS
|
||||
NewBitmap.cpp
|
||||
NewBitmap.h
|
||||
|
||||
bitmain.cpp
|
||||
bumpmap.cpp
|
||||
iff.cpp
|
||||
|
@ -329,7 +329,7 @@ typedef int bm_hashTableIndex; /* index into hash table */
|
||||
#define compEQ(a, b) (stricmp((a)->name, (b)->name) == 0)
|
||||
struct bm_Node {
|
||||
struct bm_Node *next; /* next bm_Node */
|
||||
bm_T data; /* data stored in bm_Node */
|
||||
bm_T data; /* data stored in bm_Node */
|
||||
};
|
||||
static bm_Node *bm_findNode(bm_T data);
|
||||
static void bm_deleteNode(bm_T data);
|
||||
@ -510,7 +510,7 @@ int bm_AllocateMemoryForIndex(int n, int w, int h, int add_mem) {
|
||||
// If add_mem is nonzero, adds that to the amount alloced
|
||||
// Returns bitmap handle if successful, -1 if otherwise
|
||||
int bm_AllocBitmap(int w, int h, int add_mem) {
|
||||
int n, i;
|
||||
int n = 0, i;
|
||||
if (!Bitmaps_initted) {
|
||||
Int3();
|
||||
mprintf(0, "Bitmaps not initted!!!\n");
|
||||
@ -539,7 +539,7 @@ int bm_AllocBitmap(int w, int h, int add_mem) {
|
||||
}
|
||||
// Just like bm_AllocBitmap but doesn't actually allocate memory. Useful for paging!
|
||||
int bm_AllocNoMemBitmap(int w, int h) {
|
||||
int n, i;
|
||||
int n = 0, i;
|
||||
if (!Bitmaps_initted) {
|
||||
Int3();
|
||||
mprintf(0, "Bitmaps not initted!!!\n");
|
||||
@ -654,7 +654,7 @@ void bm_ChangeEndName(const char *src, char *dest) {
|
||||
uint32_t i, limit;
|
||||
int last = -1;
|
||||
int curnum = -1;
|
||||
char namedest[256+16];
|
||||
char namedest[256 + 16];
|
||||
char path[256], ext[256], filename[256];
|
||||
|
||||
ddio_SplitPath(src, path, filename, ext);
|
||||
@ -1079,7 +1079,7 @@ int bm_MakeBitmapResident(int handle) {
|
||||
}
|
||||
// Saves a bitmap to a file. Saves the bitmap as an OUTRAGE_COMPRESSED_OGF.
|
||||
// Returns -1 if something is wrong.
|
||||
int bm_SaveFileBitmap(const std::filesystem::path& filename, int handle) {
|
||||
int bm_SaveFileBitmap(const std::filesystem::path &filename, int handle) {
|
||||
int ret;
|
||||
CFILE *fp;
|
||||
if (!GameBitmaps[handle].used) {
|
||||
|
@ -327,7 +327,7 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) {
|
||||
uint8_t upside_down = 0;
|
||||
uint16_t width, height;
|
||||
uint32_t pixel;
|
||||
int i, t, n, data8bit = 0, savepos;
|
||||
int i, t, n, data8bit = 0, savepos = 0;
|
||||
int mipped = 0;
|
||||
int num_mips = 1;
|
||||
int read_ok = 1;
|
||||
@ -539,7 +539,7 @@ int bm_page_in_file(int n) {
|
||||
uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor;
|
||||
uint8_t upside_down = 0;
|
||||
uint16_t width, height;
|
||||
int i, data8bit = 0, savepos;
|
||||
int i, data8bit = 0, savepos = 0;
|
||||
int mipped = 0, file_mipped = 0;
|
||||
int num_mips = 1;
|
||||
char name[BITMAP_NAME_LEN];
|
||||
|
@ -1,10 +1,14 @@
|
||||
set(HEADERS
|
||||
cfile.h
|
||||
hogfile.h
|
||||
inffile.h)
|
||||
set(CPPS
|
||||
cfile.cpp
|
||||
hogfile.cpp
|
||||
inffile.cpp
|
||||
)
|
||||
|
||||
add_library(cfile STATIC ${CPPS})
|
||||
add_library(cfile STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(cfile PRIVATE
|
||||
ddio
|
||||
mem
|
||||
|
@ -1,3 +1,7 @@
|
||||
set(HEADERS
|
||||
debug.h
|
||||
debugbreak.h
|
||||
mono.h)
|
||||
set(CPPS
|
||||
debug.cpp
|
||||
$<$<PLATFORM_ID:Darwin,Linux>:
|
||||
@ -10,7 +14,7 @@ set(CPPS
|
||||
>
|
||||
)
|
||||
|
||||
add_library(ddebug STATIC ${CPPS})
|
||||
add_library(ddebug STATIC ${HEADERS} ${CPPS})
|
||||
add_dependencies(ddebug get_git_hash)
|
||||
target_include_directories(ddebug PUBLIC
|
||||
$<BUILD_INTERFACE:
|
||||
|
@ -152,7 +152,7 @@ constexpr const int OSMBOX_OKCANCEL = 5;
|
||||
extern bool Debug_break;
|
||||
|
||||
// if we are running under a debugger, then pass true
|
||||
bool Debug_Init(bool debugger, bool mono_debug);
|
||||
bool Debug_Init(bool debugger);
|
||||
// Does a messagebox with a stack dump
|
||||
// Messagebox shows topstring, then stack dump, then bottomstring
|
||||
// Return types are the same as the Windows return values
|
||||
@ -180,10 +180,11 @@ void ddio_InternalKeyClose();
|
||||
#else
|
||||
#define debug_break()
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
// We forward declare PEXCEPTION_POINTERS so that the function
|
||||
// prototype doesn't needlessly require windows.h.
|
||||
typedef struct _EXCEPTION_POINTERS EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
|
||||
int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message);
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
long WINAPI RecordExceptionInfo(PEXCEPTION_POINTERS data);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -50,7 +50,7 @@ bool Debug_break = false;
|
||||
static char *Debug_DumpInfo();
|
||||
|
||||
// if we are running under a debugger, then pass true
|
||||
bool Debug_Init(bool debugger, bool mono_debug) {
|
||||
bool Debug_Init(bool debugger) {
|
||||
#ifndef RELEASE
|
||||
Debug_break = debugger;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,9 @@
|
||||
set(HEADERS
|
||||
chrono_timer.h
|
||||
ddio.h
|
||||
ddio_common.h
|
||||
ddio_lnx.h
|
||||
ddio_win.h)
|
||||
set(CPPS
|
||||
chrono_timer.cpp
|
||||
ddio.cpp
|
||||
@ -17,7 +23,7 @@ set(CPPS
|
||||
winfile.cpp
|
||||
>
|
||||
)
|
||||
add_library(ddio STATIC ${CPPS})
|
||||
add_library(ddio STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(ddio PRIVATE
|
||||
SDL2::SDL2
|
||||
ddebug
|
||||
|
@ -576,6 +576,13 @@ target_link_libraries(Descent3Editor PRIVATE
|
||||
fix grtext manage mem misc model module stream_audio
|
||||
music networking physics renderer rtperformance sndlib ui unzip vecmat md5
|
||||
${PLATFORM_LIBS})
|
||||
target_link_options(Descent3Editor PRIVATE $<$<PLATFORM_ID:Windows>:/DEBUG:FULL>)
|
||||
|
||||
add_dependencies(Descent3Editor get_git_hash)
|
||||
install(TARGETS Descent3Editor RUNTIME)
|
||||
|
||||
# FIXME: enable installation again when the editor is stable/usable
|
||||
# install(TARGETS Descent3Editor RUNTIME)
|
||||
# if(MSVC)
|
||||
# install(FILES $<TARGET_PDB_FILE:Descent3Editor> DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
# endif()
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
set(HEADERS)
|
||||
set(HEADERS
|
||||
fix.h)
|
||||
set(CPPS
|
||||
fix.cpp)
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
set(HEADERS
|
||||
grtext.h
|
||||
grtextlib.h)
|
||||
set(CPPS
|
||||
grfont.cpp
|
||||
grtext.cpp
|
||||
textaux.cpp
|
||||
)
|
||||
|
||||
add_library(grtext STATIC ${CPPS})
|
||||
add_library(grtext STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(grtext PRIVATE
|
||||
ddio
|
||||
mem
|
||||
|
@ -913,7 +913,7 @@ void grfont_TranslateToBitmaps(int handle) {
|
||||
// Font translation routines
|
||||
void grfont_XlateMonoChar(int bmp_handle, int x, int y, int index, tFontFileInfo *ft, int width) {
|
||||
int row, col; // byte width of char
|
||||
uint8_t bit_mask = 0, byte;
|
||||
uint8_t bit_mask = 0, byte = 0;
|
||||
uint8_t *fp;
|
||||
|
||||
fp = ft->char_data[index];
|
||||
|
17
lib/vecmat.h
17
lib/vecmat.h
@ -148,20 +148,13 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef _VECMAT_H
|
||||
#define _VECMAT_H
|
||||
#ifndef VECMAT_H
|
||||
#define VECMAT_H
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "math.h"
|
||||
#include "fix.h"
|
||||
|
||||
// what does this do? Why didn't Jason put a comment here?
|
||||
// Jason replies: This pragma disables the "possible loss of data" warning that
|
||||
// is generated when converting doubles to floats
|
||||
// A thousand pardons for the confusion
|
||||
|
||||
#pragma warning(disable : 4244)
|
||||
|
||||
// All structs, defines and inline functions are located in vecmat_external.h
|
||||
// vecmat_external.h is where anything that can be used by DLLs should be.
|
||||
#include "vecmat_external.h"
|
||||
@ -253,7 +246,7 @@ void vm_Orthogonalize(matrix *m);
|
||||
// Parameters: m - filled in with the orienation matrix
|
||||
// fvec,uvec,rvec - pointers to vectors that determine the matrix.
|
||||
// One or two of these must be specified, with the other(s) set to NULL.
|
||||
void vm_VectorToMatrix(matrix *m, vector *fvec, vector *uvec = NULL, vector *rvec = NULL);
|
||||
void vm_VectorToMatrix(matrix *m, vector *fvec, vector *uvec = nullptr, vector *rvec = nullptr);
|
||||
|
||||
// Computes a matrix from a vector and and angle of rotation around that vector
|
||||
// Parameters: m - filled in with the computed matrix
|
||||
|
@ -1,3 +1,9 @@
|
||||
set(HEADERS
|
||||
decoders.h
|
||||
movie_sound.h
|
||||
mve_audio.h
|
||||
mvelib.h
|
||||
sound_interface.h)
|
||||
set(CPPS
|
||||
decoder8.cpp
|
||||
decoder16.cpp
|
||||
@ -7,7 +13,7 @@ set(CPPS
|
||||
mveplay.cpp
|
||||
)
|
||||
|
||||
add_library(libmve STATIC ${CPPS})
|
||||
add_library(libmve STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(libmve PRIVATE
|
||||
ddio
|
||||
SDL2::SDL2
|
||||
|
@ -1,3 +1,8 @@
|
||||
set(HEADERS
|
||||
linux_fix.h
|
||||
lnxapp.h
|
||||
lnxcontroller.h
|
||||
registry.h)
|
||||
set(CPPS
|
||||
lnxcon.cpp
|
||||
lnxcon_raw.cpp
|
||||
@ -8,7 +13,7 @@ set(CPPS
|
||||
registry.cpp
|
||||
)
|
||||
|
||||
add_library(linux STATIC ${CPPS})
|
||||
add_library(linux STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(linux PRIVATE
|
||||
cfile
|
||||
)
|
||||
|
@ -72,7 +72,6 @@
|
||||
#include <cctype>
|
||||
#if defined(POSIX)
|
||||
#include <sys/time.h>
|
||||
#include <term.h>
|
||||
#include <termios.h>
|
||||
#else
|
||||
#include "winsock.h"
|
||||
|
@ -362,7 +362,7 @@ int mng_CheckIfPageLocked(mngs_Pagelock *pl) {
|
||||
|
||||
CFILE *infile;
|
||||
mngs_Pagelock testlock;
|
||||
int r, done = 0;
|
||||
int r = -1, done = 0;
|
||||
|
||||
if (!Network_up)
|
||||
return 1;
|
||||
@ -408,7 +408,7 @@ int mng_CheckIfPageOwned(mngs_Pagelock *pl, char *owner) {
|
||||
|
||||
CFILE *infile;
|
||||
mngs_Pagelock testlock;
|
||||
int r, done = 0;
|
||||
int r = -1, done = 0;
|
||||
|
||||
infile = (CFILE *)cfopen(TableLockFilename, "rb");
|
||||
if (infile == NULL) {
|
||||
|
@ -2,9 +2,7 @@ set(HEADERS md5.h)
|
||||
set(CPPS
|
||||
md5.cpp)
|
||||
|
||||
set(PLATFORMCPPS)
|
||||
|
||||
add_library(md5 STATIC ${HEADERS} ${CPPS} ${PLATFORMCPPS})
|
||||
add_library(md5 STATIC ${HEADERS} ${CPPS})
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
|
@ -1,8 +1,7 @@
|
||||
set(CPPS
|
||||
mem.cpp
|
||||
)
|
||||
set(HEADERS mem.h)
|
||||
set(CPPS mem.cpp)
|
||||
|
||||
add_library(mem STATIC ${CPPS})
|
||||
add_library(mem STATIC ${HEADERS} ${CPPS})
|
||||
target_compile_definitions(mem PUBLIC
|
||||
$<$<BOOL:${ENABLE_MEM_RTL}>:MEM_USE_RTL>
|
||||
)
|
||||
|
@ -1,3 +1,10 @@
|
||||
set(HEADERS
|
||||
log.h
|
||||
logfile.h
|
||||
pserror.h
|
||||
psglob.h
|
||||
psrand.h
|
||||
pstring.h)
|
||||
set(CPPS
|
||||
error.cpp
|
||||
logfile.cpp
|
||||
@ -7,7 +14,7 @@ set(CPPS
|
||||
pstring.cpp
|
||||
)
|
||||
|
||||
add_library(misc STATIC ${CPPS})
|
||||
add_library(misc STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(misc PRIVATE
|
||||
ddebug
|
||||
SDL2::SDL2
|
||||
|
@ -77,8 +77,6 @@
|
||||
|
||||
#define MAX_MSG_LEN 2000
|
||||
|
||||
void Default_dbgbrk_callback();
|
||||
|
||||
// Debug break chain handlers
|
||||
void (*DebugBreak_callback_stop)() = NULL;
|
||||
void (*DebugBreak_callback_resume)() = NULL;
|
||||
@ -97,8 +95,8 @@ void error_Spew();
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// initializes error handler.
|
||||
bool error_Init(bool debugger, bool mono_debug, const char *app_title) {
|
||||
Debug_Init(debugger, mono_debug);
|
||||
bool error_Init(bool debugger, const char *app_title) {
|
||||
Debug_Init(debugger);
|
||||
|
||||
Error_initialized = true;
|
||||
Exit_message[0] = 0;
|
||||
@ -114,8 +112,6 @@ bool error_Init(bool debugger, bool mono_debug, const char *app_title) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int no_debug_dialog = 0;
|
||||
|
||||
// exits the application and prints out a standard error message
|
||||
void Error(const char *fmt, ...) {
|
||||
std::va_list arglist;
|
||||
@ -132,20 +128,17 @@ void Error(const char *fmt, ...) {
|
||||
mprintf(0, "%s\n", Exit_message);
|
||||
|
||||
#ifdef _DEBUG
|
||||
int answer;
|
||||
int answer = IDOK;
|
||||
|
||||
if (DebugBreak_callback_stop)
|
||||
(*DebugBreak_callback_stop)();
|
||||
|
||||
if (Debug_break)
|
||||
answer = Debug_ErrorBox(OSMBOX_ABORTRETRYIGNORE, Exit_title_str, Exit_message, "Press RETRY to debug.");
|
||||
else if (!no_debug_dialog)
|
||||
else
|
||||
answer = Debug_ErrorBox(OSMBOX_OKCANCEL, Exit_title_str, Exit_message,
|
||||
"Press OK to exit, CANCEL to ignore this error and continue.");
|
||||
|
||||
if (no_debug_dialog)
|
||||
answer = IDOK;
|
||||
|
||||
switch (answer) {
|
||||
case IDRETRY:
|
||||
debug_break(); // Step Out of this function to see where Error() was called
|
||||
@ -225,7 +218,7 @@ void AssertionFailed(const char *expstr, const char *file, int line) {
|
||||
|
||||
// error message output function
|
||||
void error_Spew() {
|
||||
if (Exit_message[0] && !no_debug_dialog)
|
||||
if (Exit_message[0])
|
||||
Debug_MessageBox(OSMBOX_OK, Exit_title_str, Exit_message);
|
||||
}
|
||||
|
||||
@ -282,4 +275,4 @@ int OutrageMessageBox(int type, const char *str, ...) {
|
||||
"The dialog that follows this one overflowed its text buffer. The program may crash.");
|
||||
|
||||
return Debug_MessageBox(os_flags, Messagebox_title, buf);
|
||||
}
|
||||
}
|
||||
|
@ -152,10 +152,8 @@
|
||||
#include "debug.h"
|
||||
#include "mono.h"
|
||||
|
||||
extern int no_debug_dialog;
|
||||
|
||||
// initializes error handler.
|
||||
bool error_Init(bool debugger, bool mono_debug, const char *app_title);
|
||||
bool error_Init(bool debugger, const char *app_title);
|
||||
// exits the application and prints out a standard error message
|
||||
void Error(const char *fmt, ...);
|
||||
// prints out an assertion error
|
||||
|
@ -1,9 +1,11 @@
|
||||
set(HEADERS
|
||||
polymodel.h)
|
||||
set(CPPS
|
||||
newstyle.cpp
|
||||
polymodel.cpp
|
||||
)
|
||||
|
||||
add_library(model STATIC ${CPPS})
|
||||
add_library(model STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(model PRIVATE
|
||||
cfile
|
||||
mem
|
||||
|
@ -1154,7 +1154,7 @@ void SetPolymodelProperties(bsp_info *subobj, char *props) {
|
||||
subobj->flags |= SOF_TURRET;
|
||||
subobj->fov = fov_angle / 720.0f; // 720 = 360 * 2 and we want to make fov the amount we can move in either
|
||||
// direction it has a minimum value of (0.0) to [0.5]
|
||||
subobj->rps = 1.0f / turret_spr; // convert spr to rps (rotations per second)
|
||||
subobj->rps = 1.0f / turret_spr; // convert spr to rps (rotations per second)
|
||||
subobj->think_interval = reaction_time;
|
||||
|
||||
return;
|
||||
@ -1779,7 +1779,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) {
|
||||
|
||||
case ID_ROT_ANIM:
|
||||
case ID_ANIM: {
|
||||
int nframes;
|
||||
int nframes = 0;
|
||||
// mprintf(0,"ROT ANIM chunk!!!\n");
|
||||
|
||||
if (!timed) {
|
||||
@ -1861,7 +1861,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) {
|
||||
}
|
||||
|
||||
case ID_POS_ANIM: {
|
||||
int nframes;
|
||||
int nframes = 0;
|
||||
|
||||
// mprintf(0,"POS ANIM chunk!!!\n");
|
||||
if (!timed) {
|
||||
@ -3052,7 +3052,7 @@ void FreeAllModels() {
|
||||
|
||||
// Inits our models array and loads our ship pof
|
||||
int InitModels() {
|
||||
for (auto & Poly_model : Poly_models) {
|
||||
for (auto &Poly_model : Poly_models) {
|
||||
memset(&Poly_model, 0, sizeof(poly_model));
|
||||
Poly_model.used = 0;
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
set(HEADERS)
|
||||
set(HEADERS
|
||||
music.h
|
||||
musiclib.h)
|
||||
set(CPPS
|
||||
omflex.cpp
|
||||
sequencer.cpp
|
||||
|
@ -248,7 +248,7 @@ BOOL InetGetFile::IsFileReceived() {
|
||||
}
|
||||
|
||||
BOOL InetGetFile::IsFileError() {
|
||||
int state;
|
||||
int state = FTP_STATE_INTERNAL_ERROR;
|
||||
if (m_HardError)
|
||||
return true;
|
||||
if (m_bUseHTTP) {
|
||||
@ -278,7 +278,7 @@ BOOL InetGetFile::IsFileError() {
|
||||
}
|
||||
|
||||
int InetGetFile::GetErrorCode() {
|
||||
int state;
|
||||
int state = FTP_STATE_INTERNAL_ERROR;
|
||||
if (m_HardError)
|
||||
return m_HardError;
|
||||
if (m_bUseHTTP) {
|
||||
|
@ -1,6 +1,9 @@
|
||||
set(HEADERS
|
||||
lanclient.h
|
||||
lanstrings.h)
|
||||
set(CPPS lanclient.cpp)
|
||||
|
||||
add_library(Direct_TCP_IP MODULE ${CPPS})
|
||||
add_library(Direct_TCP_IP MODULE ${HEADERS} ${CPPS})
|
||||
set_target_properties(Direct_TCP_IP PROPERTIES PREFIX "")
|
||||
set_target_properties(Direct_TCP_IP PROPERTIES CXX_VISIBILITY_PRESET "hidden")
|
||||
set_target_properties(Direct_TCP_IP PROPERTIES OUTPUT_NAME "Direct TCP~IP")
|
||||
@ -11,6 +14,9 @@ target_link_libraries(Direct_TCP_IP PRIVATE
|
||||
ui
|
||||
$<$<PLATFORM_ID:Windows>:ws2_32>
|
||||
)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set_target_properties(Direct_TCP_IP PROPERTIES SUFFIX ".dylib")
|
||||
endif()
|
||||
|
||||
add_custom_target(Direct_TCP_IP_Hog
|
||||
COMMAND $<TARGET_FILE:HogMaker>
|
||||
|
@ -1,3 +1,10 @@
|
||||
set(HEADERS
|
||||
chat_api.h
|
||||
mt_net.h
|
||||
mtclient.h
|
||||
mtgametrack.h
|
||||
mtpilottrack.h
|
||||
mtstrings.h)
|
||||
set(CPPS
|
||||
chat_api.cpp
|
||||
mt_net.cpp
|
||||
@ -6,7 +13,7 @@ set(CPPS
|
||||
mtpilottracker.cpp
|
||||
)
|
||||
|
||||
add_library(Parallax_Online MODULE ${CPPS})
|
||||
add_library(Parallax_Online MODULE ${HEADERS} ${CPPS})
|
||||
set_target_properties(Parallax_Online PROPERTIES PREFIX "")
|
||||
set_target_properties(Parallax_Online PROPERTIES CXX_VISIBILITY_PRESET "hidden")
|
||||
set_target_properties(Parallax_Online PROPERTIES OUTPUT_NAME "Parallax Online")
|
||||
@ -17,6 +24,9 @@ target_link_libraries(Parallax_Online PRIVATE
|
||||
ui
|
||||
$<$<PLATFORM_ID:Windows>:ws2_32>
|
||||
)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set_target_properties(Parallax_Online PROPERTIES SUFFIX ".dylib")
|
||||
endif()
|
||||
|
||||
add_custom_target(Parallax_Online_Hog
|
||||
COMMAND $<TARGET_FILE:HogMaker>
|
||||
|
@ -1,4 +1,6 @@
|
||||
set(HEADERS coop.h)
|
||||
set(HEADERS
|
||||
coop.h
|
||||
coopstr.h)
|
||||
set(CPPS coop.cpp)
|
||||
|
||||
set(NETGAME_MODULE coop)
|
||||
|
@ -1,3 +1,7 @@
|
||||
set(HEADERS
|
||||
collide.h
|
||||
findintersection.h
|
||||
physics.h)
|
||||
set(CPPS
|
||||
collide.cpp
|
||||
findintersection.cpp
|
||||
@ -5,7 +9,7 @@ set(CPPS
|
||||
physics.cpp
|
||||
)
|
||||
|
||||
add_library(physics STATIC ${CPPS})
|
||||
add_library(physics STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(physics PRIVATE
|
||||
ddio
|
||||
mem
|
||||
|
@ -1,7 +1,9 @@
|
||||
set(HEADERS
|
||||
rtperformance.h)
|
||||
set(CPPS
|
||||
rtperformance.cpp)
|
||||
|
||||
add_library(rtperformance STATIC ${CPPS})
|
||||
add_library(rtperformance STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(rtperformance PRIVATE
|
||||
ddio
|
||||
)
|
||||
|
@ -1516,7 +1516,7 @@ struct guidebot_data {
|
||||
float mode_time;
|
||||
|
||||
uint16_t mp_slot; // Owner's slot number
|
||||
int my_player; // Owner's object reference
|
||||
int my_player; // Owner's object reference
|
||||
|
||||
bool f_parented; // Buddy will not collide with parent until it isn't parented
|
||||
bool f_pickup; // Marked for pickup by the owner
|
||||
@ -8072,8 +8072,8 @@ void BarnSwallow::DoFrame(int me) {
|
||||
case BSM_NEST: {
|
||||
if (Game_GetTime() > memory->next_mode_time) {
|
||||
int target;
|
||||
int room;
|
||||
int me_room;
|
||||
int room = 0;
|
||||
int me_room = 0;
|
||||
|
||||
AI_Value(me, VF_GET, AIV_I_TARGET_HANDLE, &target);
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
set(CMAKE_FOLDER "scripts")
|
||||
|
||||
set(HEADERS
|
||||
AIGame3_External.h
|
||||
linux_lib.h
|
||||
osiris_common.h
|
||||
osiris_import.h
|
||||
osiris_vector.h)
|
||||
set(CPPS
|
||||
$<$<PLATFORM_ID:Darwin,Linux>:
|
||||
linux_lib.cpp
|
||||
@ -69,7 +75,7 @@ set(SCRIPTS
|
||||
#)
|
||||
|
||||
foreach(SCRIPT ${SCRIPTS})
|
||||
add_library(${SCRIPT} MODULE ${CPPS} "${SCRIPT}.cpp")
|
||||
add_library(${SCRIPT} MODULE ${CPPS} ${HEADERS} "${SCRIPT}.cpp")
|
||||
target_link_libraries(${SCRIPT}
|
||||
fix
|
||||
misc
|
||||
|
@ -1,3 +1,15 @@
|
||||
set(HEADERS
|
||||
auddev.h
|
||||
ddsndgeometry.h
|
||||
ds3dlib.h
|
||||
ds3dlib_internal.h
|
||||
hlsoundlib.h
|
||||
mixer.h
|
||||
sdlsound.h
|
||||
sndrender.h
|
||||
soundload.h
|
||||
ssl_lib.h
|
||||
vmanpset.h)
|
||||
set(CPPS
|
||||
hlsoundlib.cpp
|
||||
sndrender.cpp
|
||||
@ -9,7 +21,7 @@ set(CPPS
|
||||
sdlsound.cpp
|
||||
)
|
||||
|
||||
add_library(sndlib STATIC ${CPPS})
|
||||
add_library(sndlib STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(sndlib PRIVATE
|
||||
cfile
|
||||
ddio
|
||||
|
@ -1,4 +1,5 @@
|
||||
set(HEADERS)
|
||||
set(HEADERS
|
||||
streamaudio.h)
|
||||
set(CPPS
|
||||
osfarchive.cpp
|
||||
streamaudio.cpp
|
||||
|
@ -1,3 +1,9 @@
|
||||
set(HEADERS
|
||||
UIlib.h
|
||||
ui.h
|
||||
uidraw.h
|
||||
uires.h
|
||||
uisys.h)
|
||||
set(CPPS
|
||||
UIButton.cpp
|
||||
UICombo.cpp
|
||||
@ -16,7 +22,7 @@ set(CPPS
|
||||
UIWindow.cpp
|
||||
)
|
||||
|
||||
add_library(ui STATIC ${CPPS})
|
||||
add_library(ui STATIC ${HEADERS} ${CPPS})
|
||||
target_link_libraries(ui PRIVATE
|
||||
ddio
|
||||
grtext
|
||||
|
@ -1,3 +1,4 @@
|
||||
set(HEADERS unzip.h)
|
||||
set(CPPS unzip.cpp)
|
||||
|
||||
add_library(unzip STATIC ${HEADERS} ${CPPS})
|
||||
|
11
vcpkg.json
11
vcpkg.json
@ -1,11 +1,18 @@
|
||||
{
|
||||
"builtin-baseline": "f7423ee180c4b7f40d43402c2feb3859161ef625",
|
||||
"builtin-baseline": "198d68dbcc6c907cb3d0b9b1d93c3df6ecf93c62",
|
||||
"dependencies": [
|
||||
"gtest",
|
||||
"zlib",
|
||||
{
|
||||
"name": "sdl2",
|
||||
"version>=": "2.30.3"
|
||||
"version>=": "2.30.3",
|
||||
"features": ["x11","wayland", "alsa"],
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "sdl2",
|
||||
"version>=": "2.30.3",
|
||||
"platform": "!linux"
|
||||
}
|
||||
],
|
||||
"overrides": [
|
||||
|
Loading…
Reference in New Issue
Block a user