From 4275877191838a417a87af5808cc6f632c1b4abf Mon Sep 17 00:00:00 2001 From: Arne de Bruijn Date: Fri, 17 Jun 2022 13:09:36 +0200 Subject: [PATCH] Version ar3 --- README | 22 -------------- README.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 4 ++- include/vers_id.h | 4 +-- main/descent.cpp | 13 +++++--- 5 files changed, 90 insertions(+), 29 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 24c224102..000000000 --- a/README +++ /dev/null @@ -1,22 +0,0 @@ -D2X-XL version from SVN (2021-04-11) with a few stability and build fixes applied. - -Building on linux requires the following libraries: SDL 1.2, SDL-mixer 1.2, SDL-net 1.2, GLEW and libcurl. - -To build on debian/ubuntu, use the following command to install all required packages: -sudo apt install build-essential automake autoconf libsdl1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libglew-dev libcurl3-dev - -You can then build it with the following commands: -./autogen.sh -./configure -make - -You can run a minimal version with just the following Descent 2 data files (must be lower case filenames): -alien1.pig alien2.pig fire.pig groupa.pig ice.pig water.pig descent2.hog descent2.ham descent2.s11 descent2.s22 - -Specify the directory with these files with the -datadir argument: -./d2x-xl -datadir ~/data/d2 - -D2X-XL will copy the data files to a data/ subdirectory and create a few other subdirectories there. - -For a more complete version follow the original installation guide: -https://www.descent2.de/installation.html diff --git a/README.md b/README.md new file mode 100644 index 000000000..fe99dda7e --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +# D2X-XL-ar + +[D2X-XL](https://www.descent2.de) with stability, compatibility and build fixes. + +## Download current Windows build + +[d2x-xl-1.18.74-ar3.zip](https://github.com/arbruijn/d2x-xl/releases/download/v1.18.74-ar3/d2x-xl-1.18.74-ar3.zip) + +## Changes + +#### Stability + +- Disable OpenMP, network and sound threads +- Fix various out of bounds access +- Fix various unintialized memory access +- Fix memory leak with FindFileFirst + +#### Game play + +- Restore bot / powerup collision if Collision model set to standard +- Restore GuideBot flare fire behaviour +- Fix level 12 boss not spewing on energy hits +- Fire primary in same frame +- GuideBot pathing fixes +- Various AI fixes + +#### Setup + +- Run without d2x-xl files +- Set default brightness to standard +- Use energy spark texture if effect bitmap missing + +#### Build/platform + +- Fix cmake build +- Fix Windows build with cmake/autotools/gcc +- Fix build with newer gcc versions +- Use unpatched SDL on Windows +- Fix midi on Win64 +- Fix Fx volume on Linux +- Fix warnings +- Disable structure packing except for network structs +- Print warnings/errors to console on Linux + +## How to build + +d2x-xl requires the following libraries: SDL 1.2, SDL-mixer 1.2, SDL-net 1.2, GLEW and libcurl. + +Install packages for Debian/Ubuntu: + +`apt install build-essential cmake libsdl1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libglew-dev +libcurl3-dev` + +Install packages for MSYS2 (Windows): + +`pacman -S + mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc + mingw64/mingw-w64-x86_64-SDL mingw64/mingw-w64-x86_64-SDL_image + mingw64/mingw-w64-x86_64-SDL_mixer mingw64/mingw-w64-x86_64-SDL_net mingw64/mingw-w64-x86_64-glew` + +Configure build in subdirectory `build`: + +`cmake -B build` + +Compile: + +`cmake --build build` + +Run: + +`build/d2x-xl -datadir /path/to/xl/or/d2/files` + +If you specify a path to the D2 files (.hog, .pig, .ham, etc.) it will copy the files into a `data/` subdirectory and create a few more subdirectories. + +To make all options work you need the d2x-xl data files: +[d2x-xl-data-1.18.64.7z](https://www.descent2.de/files/d2x-xl-data-1.18.64.7z) diff --git a/configure.ac b/configure.ac index 6703be4c7..70c6ff964 100644 --- a/configure.ac +++ b/configure.ac @@ -4,8 +4,9 @@ define([D2X_MAJOR],1) define([D2X_MINOR],18) define([D2X_MICRO],74) +define([D2X_VARIANT],ar3) -AC_INIT(d2x-xl,[D2X_MAJOR.D2X_MINOR.D2X_MICRO],[karx11erx@hotmail.com]) +AC_INIT(d2x-xl,[D2X_MAJOR.D2X_MINOR.D2X_MICRO-D2X_VARIANT],[karx11erx@hotmail.com]) AC_PREREQ(2.52) AC_CANONICAL_BUILD @@ -22,6 +23,7 @@ AM_CONFIG_HEADER(conf.h) AC_DEFINE_UNQUOTED(D2XMAJOR,D2X_MAJOR,[d2x major version]) AC_DEFINE_UNQUOTED(D2XMINOR,D2X_MINOR,[d2x minor version]) AC_DEFINE_UNQUOTED(D2XMICRO,D2X_MICRO,[d2x micro version]) +AC_DEFINE_UNQUOTED(D2XVARIANT,"D2X_VARIANT",[d2x variant]) AM_MAINTAINER_MODE diff --git a/include/vers_id.h b/include/vers_id.h index d122568c4..509c88073 100644 --- a/include/vers_id.h +++ b/include/vers_id.h @@ -3,7 +3,7 @@ //#ifndef HAVE_CONFIG_H # ifndef VERSION -# define VERSION "1.18.74\nar2" +# define VERSION "1.18.74-ar3" # endif //#endif @@ -19,7 +19,7 @@ # define D2X_MICRO 74 #endif #ifndef D2X_VARIANT -# define D2X_VARIANT "-ar2" +# define D2X_VARIANT "ar3" #endif #define VERSION_TYPE "Full Version" diff --git a/main/descent.cpp b/main/descent.cpp index 12805b0e9..46094aba9 100644 --- a/main/descent.cpp +++ b/main/descent.cpp @@ -277,13 +277,16 @@ else gameStates.menus.bDrawCopyright = 0; if (!nInfoType) { + #if 0 char szVersion[32]; - snprintf(szVersion, sizeof(szVersion), "V%d.%d%s", D2X_MAJOR, D2X_MINOR, D2X_VARIANT); + snprintf(szVersion, sizeof(szVersion), "V%s", VERSION); + #endif fontManager.SetCurrent (GAME_FONT); - fontManager.Current ()->StringSize (szVersion, w, h, aw); + //fontManager.Current ()->StringSize (szVersion, w, h, aw); + h = fontManager.Current ()->Height(); fontManager.SetColorRGBi (RGB_PAL (63, 47, 0), 1, 0, 0); h += 2; - GrPrintF (NULL, 0x8000, CCanvas::Current ()->Height () - h, "visit www.descent2.de"); + GrPrintF (NULL, 0x8000, CCanvas::Current ()->Height () - h, "variant d2x-xl.2ar.nl original www.descent2.de"); //fontManager.SetColorRGBi (RGB_PAL (51, 34, 0), 1, 0, 0); fontManager.SetColorRGBi (D2BLUE_RGBA, 1, 0, 0); GrPrintF (NULL, 0x8000, CCanvas::Current ()->Height () - 3 * h - 6, "Press F1 for help in menus"); @@ -302,7 +305,9 @@ if (!nInfoType) { NULL); #endif GrPrintF (NULL, 0x8000, CCanvas::Current ()->Height () - 2 * h - 2, TXT_COPYRIGHT); + #if 0 GrPrintF (NULL, CCanvas::Current ()->Width () - w - 2, CCanvas::Current ()->Height () - 2 * h - 2, "%s", szVersion); + #endif if (bVertigo < 0) bVertigo = CFile::Exist ("d2x.hog", gameFolders.missions.szRoot, 0); if (bVertigo) { @@ -327,7 +332,7 @@ if (!nInfoType) { if (!nInfoType) { fontManager.SetCurrent (MEDIUM2_FONT); fontManager.Current ()->StringSize (D2X_NAME, w, h, aw); - GrPrintF (NULL, CCanvas::Current ()->Width () - w - SUBVER_XOFFS, y + ((bVertigo && !gameOpts->menus.altBg.bHave) ? h + 2 : 0), D2X_NAME); + GrPrintF (NULL, CCanvas::Current ()->Width () - w - ws + aw / 2/*SUBVER_XOFFS*/, y + ((bVertigo && !gameOpts->menus.altBg.bHave) ? h + 2 : 0), D2X_NAME); } else { //gameStates.render.grAlpha = 0.75f;