mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-11 02:41:35 -10:00
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ with all the graphics converted to CLX and the unused files removed. This is primarily useful on RAM-constrained platforms, such as PS2, because it eliminates the MPQ overhead. Adds a build option to load from such unpacked directories instead of the MPQ. These directories are searched for in the same locations where the MPQs would be searched for otherwise. Example directory layout: * /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq * /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory) * /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq * /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq These directory structure is produced by calling `unpack_and_minify_mpq`
89 lines
2.2 KiB
C++
89 lines
2.2 KiB
C++
/**
|
|
* @file init.h
|
|
*
|
|
* Interface of routines for initializing the environment, disable screen saver, load MPQ.
|
|
*/
|
|
#pragma once
|
|
|
|
#include "miniwin/misc_msg.h"
|
|
#include "mpq/mpq_reader.hpp"
|
|
#include "utils/attributes.h"
|
|
|
|
namespace devilution {
|
|
|
|
extern bool gbActive;
|
|
extern EventHandler CurrentEventHandler;
|
|
extern DVL_API_FOR_TEST bool gbIsSpawn;
|
|
extern DVL_API_FOR_TEST bool gbIsHellfire;
|
|
extern DVL_API_FOR_TEST bool gbVanilla;
|
|
extern bool forceHellfire;
|
|
|
|
#ifdef UNPACKED_MPQS
|
|
extern DVL_API_FOR_TEST std::optional<std::string> spawn_data_path;
|
|
extern DVL_API_FOR_TEST std::optional<std::string> diabdat_data_path;
|
|
extern std::optional<std::string> hellfire_data_path;
|
|
extern std::optional<std::string> font_data_path;
|
|
extern std::optional<std::string> lang_data_path;
|
|
#else
|
|
/** A handle to the spawn.mpq archive. */
|
|
extern DVL_API_FOR_TEST std::optional<MpqArchive> spawn_mpq;
|
|
/** A handle to the diabdat.mpq archive. */
|
|
extern DVL_API_FOR_TEST std::optional<MpqArchive> diabdat_mpq;
|
|
/** A handle to an hellfire.mpq archive. */
|
|
extern std::optional<MpqArchive> hellfire_mpq;
|
|
extern std::optional<MpqArchive> hfmonk_mpq;
|
|
extern std::optional<MpqArchive> hfbard_mpq;
|
|
extern std::optional<MpqArchive> hfbarb_mpq;
|
|
extern std::optional<MpqArchive> hfmusic_mpq;
|
|
extern std::optional<MpqArchive> hfvoice_mpq;
|
|
extern std::optional<MpqArchive> font_mpq;
|
|
extern std::optional<MpqArchive> lang_mpq;
|
|
extern std::optional<MpqArchive> devilutionx_mpq;
|
|
#endif
|
|
|
|
inline bool HaveSpawn()
|
|
{
|
|
#ifdef UNPACKED_MPQS
|
|
return bool(spawn_data_path);
|
|
#else
|
|
return bool(spawn_mpq);
|
|
#endif
|
|
}
|
|
|
|
inline bool HaveDiabdat()
|
|
{
|
|
#ifdef UNPACKED_MPQS
|
|
return bool(diabdat_data_path);
|
|
#else
|
|
return bool(diabdat_mpq);
|
|
#endif
|
|
}
|
|
|
|
inline bool HaveHellfire()
|
|
{
|
|
#ifdef UNPACKED_MPQS
|
|
return bool(hellfire_data_path);
|
|
#else
|
|
return bool(hellfire_mpq);
|
|
#endif
|
|
}
|
|
|
|
inline bool HaveExtraFonts()
|
|
{
|
|
#ifdef UNPACKED_MPQS
|
|
return bool(font_data_path);
|
|
#else
|
|
return bool(font_mpq);
|
|
#endif
|
|
}
|
|
|
|
void init_cleanup();
|
|
void LoadCoreArchives();
|
|
void LoadLanguageArchive();
|
|
void LoadGameArchives();
|
|
void init_create_window();
|
|
void MainWndProc(const SDL_Event &event);
|
|
EventHandler SetEventHandler(EventHandler NewProc);
|
|
|
|
} // namespace devilution
|