Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Remove support for 'spawn' install #11

Merged
merged 1 commit into from
Sep 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For a full list of changes see our [changelog](docs/CHANGELOG.md).

# How to Install

Note: You'll need access to the data from the original game. If you don't have an original CD then you can [buy Diablo from GoG.com](https://www.gog.com/game/diablo). Alternately you can use `spawn.mpq` from the [shareware](http://ftp.blizzard.com/pub/demos/diablosw.exe) version, in place of `DIABDAT.MPQ`, to play the shareware portion of the game.
Note: You'll need access to the data from the original game. If you don't have an original CD then you can [buy Diablo from GoG.com](https://www.gog.com/game/diablo).

Download the latest [DevilutionX release](https://github.com/diasurgical/devilutionX/releases) and extract the contents to a location of your choosing or [build from source](#building-from-source).

Expand Down
1 change: 0 additions & 1 deletion Source/DiabloUI/diabloui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Art ArtBackgroundWidescreen;
Art ArtBackground;
Art ArtCursor;
Art ArtHero;
bool gbSpawned;

void (*gfnSoundFunction)(const char *file);
void (*gfnListFocus)(int value);
Expand Down
3 changes: 0 additions & 3 deletions Source/DiabloUI/diabloui.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ struct _uiheroinfo {
uint16_t dexterity;
uint16_t vitality;
bool hassaved;
bool spawned;
};

extern std::array<Art, 3> ArtLogos;
Expand All @@ -72,7 +71,6 @@ extern Art ArtBackground;
extern Art ArtBackgroundWidescreen;
extern Art ArtCursor;
extern Art ArtHero;
extern bool gbSpawned;

extern void (*gfnSoundFunction)(const char *file);
extern bool (*gfnHeroInfo)(bool (*fninfofunc)(_uiheroinfo *));
Expand All @@ -86,7 +84,6 @@ inline SDL_Surface *DiabloUiSurface()

void UiDestroy();
void UiTitleDialog();
void UiSetSpawned(bool bSpawned);
void UiInitialize();
bool UiValidPlayerName(const char *name); /* check */
void UiSelHeroMultDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, uint32_t *saveNumber);
Expand Down
17 changes: 4 additions & 13 deletions Source/DiabloUI/mainmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ void MainmenuLoad(const char *name, void (*fnSound)(const char *file))
vecMenuItems.push_back(std::make_unique<UiListItem>("Show Credits", MAINMENU_SHOW_CREDITS));
vecMenuItems.push_back(std::make_unique<UiListItem>(gbIsHellfire ? "Exit Hellfire" : "Exit Diablo", MAINMENU_EXIT_DIABLO));

if (!gbSpawned || gbIsHellfire) {
if (gbIsHellfire)
LoadArt("ui_art\\mainmenuw.pcx", &ArtBackgroundWidescreen);
LoadBackgroundArt("ui_art\\mainmenu.pcx");
} else {
LoadBackgroundArt("ui_art\\swmmenu.pcx");
}
if (gbIsHellfire)
LoadArt("ui_art\\mainmenuw.pcx", &ArtBackgroundWidescreen);
LoadBackgroundArt("ui_art\\mainmenu.pcx");

UiAddBackground(&vecMainMenuDialog);
UiAddLogo(&vecMainMenuDialog);
Expand Down Expand Up @@ -87,17 +83,12 @@ bool UiMainMenuDialog(const char *name, _mainmenu_selections *pdwResult, void (*
while (MainMenuResult == MAINMENU_NONE) {
UiClearScreen();
UiPollAndRender();
if (!gbSpawned && SDL_GetTicks() >= dwAttractTicks) {
if (SDL_GetTicks() >= dwAttractTicks) {
MainMenuResult = MAINMENU_ATTRACT_MODE;
}
}

MainmenuFree();

if (gbSpawned && !gbIsHellfire && MainMenuResult == MAINMENU_REPLAY_INTRO) {
UiSelOkDialog(nullptr, "The Diablo introduction cinematic is only available in the full retail version of Diablo. Visit https://www.gog.com/game/diablo to purchase.", true);
MainMenuResult = MAINMENU_NONE;
}
}

*pdwResult = MainMenuResult;
Expand Down
7 changes: 0 additions & 7 deletions Source/DiabloUI/selhero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,6 @@ bool ShouldPrefillHeroName()
void SelheroClassSelectorSelect(int value)
{
auto hClass = static_cast<HeroClass>(vecSelHeroDlgItems[value]->m_value);
if (gbSpawned && (hClass == HeroClass::Rogue || hClass == HeroClass::Sorcerer || (hClass == HeroClass::Bard && hfbard_mpq == nullptr))) {
ArtBackground.Unload();
UiSelOkDialog(nullptr, "The Rogue and Sorcerer are only available in the full retail version of Diablo. Visit https://www.gog.com/game/diablo to purchase.", false);
LoadBackgroundArt("ui_art\\selhero.pcx");
SelheroListSelect(selhero_SaveCount);
return;
}

title = selhero_isMultiPlayer ? "New Multi Player Hero" : "New Single Player Hero";
memset(selhero_heroInfo.name, '\0', sizeof(selhero_heroInfo.name));
Expand Down
6 changes: 1 addition & 5 deletions Source/DiabloUI/selok.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ void UiSelOkDialog(const char *title, const char *body, bool background)
if (!background) {
LoadBackgroundArt("ui_art\\black.pcx");
} else {
if (!gbSpawned) {
LoadBackgroundArt("ui_art\\mainmenu.pcx");
} else {
LoadBackgroundArt("ui_art\\swmmenu.pcx");
}
LoadBackgroundArt("ui_art\\mainmenu.pcx");
}

UiAddBackground(&vecSelOkDialog);
Expand Down
5 changes: 0 additions & 5 deletions Source/DiabloUI/title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,4 @@ void UiTitleDialog()
TitleFree();
}

void UiSetSpawned(bool bSpawned)
{
gbSpawned = bSpawned;
}

} // namespace devilution
2 changes: 1 addition & 1 deletion Source/appfat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void InsertCDDlg()
text,
sizeof(text),
"%s",
"Unable to open main data archive (diabdat.mpq or spawn.mpq).\n"
"Unable to open main data archive (diabdat.mpq).\n"
"\n"
"Make sure that it is in the game folder.");

Expand Down
11 changes: 2 additions & 9 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ namespace {
char gszVersionNumber[64] = "internal version unknown";

bool gbGameLoopStartup;
bool forceSpawn;
bool forceDiablo;
int sgnTimeoutCurs;
bool gbShowIntro = true;
Expand Down Expand Up @@ -768,7 +767,6 @@ void RunGameLoop(interface_mode uMsg)
printInConsole(" %-20s %-30s\n", "-f", "Display frames per second");
printInConsole(" %-20s %-30s\n", "-x", "Run in windowed mode");
printInConsole(" %-20s %-30s\n", "--verbose", "Enable verbose logging");
printInConsole(" %-20s %-30s\n", "--spawn", "Force spawn mode even if diabdat.mpq is found");
printInConsole(" %-20s %-30s\n", "--record <#>", "Record a demo file");
printInConsole(" %-20s %-30s\n", "--demo <#>", "Play a demo file");
printInConsole(" %-20s %-30s\n", "--timedemo", "Disable all frame limiting during demo playback");
Expand Down Expand Up @@ -824,8 +822,6 @@ void DiabloParseFlags(int argc, char **argv)
EnableFrameCount();
} else if (strcasecmp("-x", argv[i]) == 0) {
gbForceWindowed = true;
} else if (strcasecmp("--spawn", argv[i]) == 0) {
forceSpawn = true;
} else if (strcasecmp("--diablo", argv[i]) == 0) {
forceDiablo = true;
} else if (strcasecmp("--nestart", argv[i]) == 0) {
Expand Down Expand Up @@ -893,8 +889,6 @@ void DiabloInit()
init_archives();
was_archives_init = true;

if (forceSpawn)
gbIsSpawn = true;
if (forceDiablo)
gbIsHellfire = false;

Expand All @@ -910,7 +904,6 @@ void DiabloInit()
}

UiInitialize();
UiSetSpawned(gbIsSpawn);
was_ui_init = true;

ReadOnlyTest();
Expand All @@ -937,7 +930,7 @@ void DiabloSplash()
play_movie("gendata\\Hellfire.smk", true);
sgOptions.Hellfire.bIntro = false;
}
if (!gbIsHellfire && !gbIsSpawn && sgOptions.Diablo.bIntro) {
if (!gbIsHellfire && sgOptions.Diablo.bIntro) {
play_movie("gendata\\diablo1.smk", true);
sgOptions.Diablo.bIntro = false;
}
Expand Down Expand Up @@ -2013,7 +2006,7 @@ void LoadGameLevel(bool firstflag, lvl_entry lvldir)
while (!IncProgress())
;

if (!gbIsSpawn && setlevel && setlvlnum == SL_SKELKING && Quests[Q_SKELKING]._qactive == QUEST_ACTIVE)
if (setlevel && setlvlnum == SL_SKELKING && Quests[Q_SKELKING]._qactive == QUEST_ACTIVE)
PlaySFX(USFX_SKING1);

// Reset mouse selection of entities
Expand Down
2 changes: 1 addition & 1 deletion Source/diablo.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace devilution {

#define GAME_ID (gbIsHellfire ? (gbIsSpawn ? LoadBE32("HSHR") : LoadBE32("HRTL")) : (gbIsSpawn ? LoadBE32("DSHR") : LoadBE32("DRTL")))
#define GAME_ID (gbIsHellfire ? LoadBE32("HRTL") : LoadBE32("DRTL"))

#define NUMLEVELS 25

Expand Down
3 changes: 1 addition & 2 deletions Source/effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,7 @@ void sound_init()
uint8_t mask = sfx_MISC;
if (gbIsMultiplayer) {
mask |= sfx_WARRIOR;
if (!gbIsSpawn)
mask |= (sfx_ROGUE | sfx_SORCERER);
mask |= (sfx_ROGUE | sfx_SORCERER);
if (gbIsHellfire)
mask |= sfx_MONK;
} else {
Expand Down
4 changes: 2 additions & 2 deletions Source/help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ void DrawHelp(const Surface &out)

const char *title;
if (gbIsHellfire)
title = gbIsSpawn ? "Shareware Hellfire Help" : "Hellfire Help";
title = "Hellfire Help";
else
title = gbIsSpawn ? "Shareware Diablo Help" : "Diablo Help";
title = "Diablo Help";
PrintSString(out, 0, 2, title, UiFlags::ColorWhitegold | UiFlags::AlignCenter);

DrawSLine(out, 5);
Expand Down
13 changes: 0 additions & 13 deletions Source/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ bool gbActive;
HANDLE hellfire_mpq;
/** The current input handler function */
WNDPROC CurrentProc;
/** A handle to the spawn.mpq archive. */
HANDLE spawn_mpq;
/** A handle to the diabdat.mpq archive. */
HANDLE diabdat_mpq;
/** A handle to the patch_rt.mpq archive. */
HANDLE patch_rt_mpq;
/** Indicate if we only have access to demo data */
bool gbIsSpawn;
/** Indicate if we have loaded the Hellfire expansion data */
bool gbIsHellfire;
/** Indicate if we want vanilla savefiles */
Expand Down Expand Up @@ -78,10 +74,6 @@ void init_cleanup()
pfile_write_hero(/*writeGameData=*/false, /*clearTables=*/true);
}

if (spawn_mpq != nullptr) {
SFileCloseArchive(spawn_mpq);
spawn_mpq = nullptr;
}
if (diabdat_mpq != nullptr) {
SFileCloseArchive(diabdat_mpq);
diabdat_mpq = nullptr;
Expand Down Expand Up @@ -165,11 +157,6 @@ void init_archives()
diabdat_mpq = LoadMPQ(paths, "diabdat.mpq");
}

if (diabdat_mpq == nullptr) {
spawn_mpq = LoadMPQ(paths, "spawn.mpq");
if (spawn_mpq != nullptr)
gbIsSpawn = true;
}
HANDLE fh = nullptr;
if (!SFileOpenFile("ui_art\\title.pcx", &fh))
InsertCDDlg();
Expand Down
2 changes: 0 additions & 2 deletions Source/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ namespace devilution {
extern bool gbActive;
extern HANDLE hellfire_mpq;
extern WNDPROC CurrentProc;
extern HANDLE spawn_mpq;
extern HANDLE diabdat_mpq;
extern bool gbIsSpawn;
extern bool gbIsHellfire;
extern bool gbVanilla;
extern HANDLE patch_rt_mpq;
Expand Down
2 changes: 1 addition & 1 deletion Source/inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ void InitInv()
pInvCels = LoadCel("Data\\Inv\\Inv_Sor.CEL", SPANEL_WIDTH);
break;
case HeroClass::Monk:
pInvCels = LoadCel(!gbIsSpawn ? "Data\\Inv\\Inv_Sor.CEL" : "Data\\Inv\\Inv.CEL", SPANEL_WIDTH);
pInvCels = LoadCel("Data\\Inv\\Inv_Sor.CEL", SPANEL_WIDTH);
break;
}

Expand Down
13 changes: 0 additions & 13 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,6 @@ void GetBookSpell(Item &item, int lvl)

rv = GenerateRnd(maxSpells) + 1;

if (gbIsSpawn && lvl > 5)
lvl = 5;

int s = SPL_FIREBOLT;
enum spell_id bs = SPL_FIREBOLT;
while (rv > 0) {
Expand Down Expand Up @@ -1282,9 +1279,6 @@ void GetStaffSpell(Item &item, int lvl, bool onlygood)
l = 1;
int rv = GenerateRnd(maxSpells) + 1;

if (gbIsSpawn && lvl > 10)
lvl = 10;

int s = SPL_FIREBOLT;
enum spell_id bs = SPL_NULL;
while (rv > 0) {
Expand Down Expand Up @@ -2498,13 +2492,6 @@ void NextItemRecord(int i)

bool IsItemAvailable(int i)
{
if (gbIsSpawn) {
if (i >= 62 && i <= 71)
return false; // Medium and heavy armors
if (i == AnyOf(105, 107, 108, 110, 111, 113))
return false; // Unavailable scrolls
}

if (gbIsHellfire)
return true;

Expand Down
Loading