Skip to content

Commit

Permalink
Version ar3
Browse files Browse the repository at this point in the history
  • Loading branch information
arbruijn committed Jun 17, 2022
1 parent 7e6aca7 commit 4275877
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 29 deletions.
22 changes: 0 additions & 22 deletions README

This file was deleted.

76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],[[email protected]])
AC_INIT(d2x-xl,[D2X_MAJOR.D2X_MINOR.D2X_MICRO-D2X_VARIANT],[[email protected]])
AC_PREREQ(2.52)

AC_CANONICAL_BUILD
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions include/vers_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

//#ifndef HAVE_CONFIG_H
# ifndef VERSION
# define VERSION "1.18.74\nar2"
# define VERSION "1.18.74-ar3"
# endif
//#endif

Expand All @@ -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"
Expand Down
13 changes: 9 additions & 4 deletions main/descent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 4275877

Please sign in to comment.