diff --git a/CMakeLists.txt b/CMakeLists.txt index ea7f4b543..b2667b471 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ endif() option(ASAN "Enable address sanitizer" ON) option(DEBUG "Enable debug mode in engine" ON) +option(SPAWN "Build the shareware version" OFF) option(DIST "Dynamically link only glibc and SDL2" OFF) option(FASTER "Enable FASTER in engine" ON) option(BINARY_RELEASE "Enable options for binary release" OFF) @@ -266,6 +267,10 @@ foreach(target devilution devilutionx) target_compile_definitions(${target} PRIVATE NONET) endif() + if(SPAWN) + target_compile_definitions(${target} PRIVATE SPAWN) + endif() + if(ASAN) target_compile_options(${target} PUBLIC -fsanitize=address -fsanitize-recover=address) target_link_libraries(${target} PUBLIC -fsanitize=address -fsanitize-recover=address) diff --git a/README.md b/README.md index b31b68958..ac9e0e3b1 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,8 @@ make -j$(nproc) ### General The default build type is `Debug`. This can be changed with `-DBINARY_RELEASE=ON`. Independently of this, the debug mode of the Diablo engine is always enabled by default. It can be disabled with `-DDEBUG=OFF`. Finally, in debug builds the address sanitizer is enabled by default. This can be disabled with `-DASAN=OFF`. You can also generate 32bit builds on 64bit platforms by setting `-DCMAKE_TOOLCHAIN_FILE=../CMake/32bit.cmake` (remember to use the `linux32` command if on Linux). -Network support can be deiabled using `-DNONET`, this also removes the need for the ASIO and Sodium dependencies +Network support can be disabled using `-DNONET=ON`, this also removes the need for the ASIO and Sodium dependencies. +You can compile the shareware version with `-DSPAWN=ON` this will allow you to try the game using spawn.mpq from the original shareware which can still be [downloaded](http://ftp.blizzard.com/pub/demos/diablosw.exe) for free. ### mingw32 Use `-DCROSS_PREFIX=/path/to/prefix` if the `i686-w64-mingw32` directory is not in `/usr`. diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 121cb4530..ae5f7edcd 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -1943,6 +1943,6 @@ void DRLG_L4Pass3() yy += 2; } } +#endif DEVILUTION_END_NAMESPACE -#endif diff --git a/SourceX/DiabloUI/diabloui.cpp b/SourceX/DiabloUI/diabloui.cpp index 7b5723400..339c16867 100644 --- a/SourceX/DiabloUI/diabloui.cpp +++ b/SourceX/DiabloUI/diabloui.cpp @@ -24,6 +24,7 @@ Art ArtFocus[3]; Art ArtBackground; Art ArtCursor; Art ArtHero; +bool gbSpawned; void (*gfnSoundFunction)(char *file); void (*gfnListFocus)(int value); diff --git a/SourceX/DiabloUI/diabloui.h b/SourceX/DiabloUI/diabloui.h index 08cd75518..17e14ad0a 100644 --- a/SourceX/DiabloUI/diabloui.h +++ b/SourceX/DiabloUI/diabloui.h @@ -42,6 +42,7 @@ extern Art ArtFocus[3]; extern Art ArtBackground; extern Art ArtCursor; extern Art ArtHero; +extern bool gbSpawned; typedef enum TXT_JUST { JustLeft = 0, diff --git a/SourceX/DiabloUI/title.cpp b/SourceX/DiabloUI/title.cpp index 30be3a1b0..22bd02b1a 100644 --- a/SourceX/DiabloUI/title.cpp +++ b/SourceX/DiabloUI/title.cpp @@ -57,4 +57,9 @@ BOOL UiTitleDialog(int a1) return true; } +void UiSetSpawned(BOOL bSpawned) +{ + gbSpawned = bSpawned; +} + } diff --git a/SourceX/sound.cpp b/SourceX/sound.cpp index 50772908e..41942e07d 100644 --- a/SourceX/sound.cpp +++ b/SourceX/sound.cpp @@ -24,9 +24,11 @@ int sgnMusicTrack = 6; char *sgszMusicTracks[NUM_MUSIC] = { "Music\\DTowne.wav", "Music\\DLvlA.wav", +#ifndef SPAWN "Music\\DLvlB.wav", "Music\\DLvlC.wav", "Music\\DLvlD.wav", +#endif "Music\\Dintro.wav" };