mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-10 17:20:56 -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`
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
#include "selstart.h"
|
|
|
|
#include "DiabloUI/diabloui.h"
|
|
#include "control.h"
|
|
#include "engine/load_clx.hpp"
|
|
#include "options.h"
|
|
#include "utils/language.h"
|
|
#include "utils/sdl_geometry.h"
|
|
|
|
namespace devilution {
|
|
namespace {
|
|
|
|
bool endMenu;
|
|
|
|
std::vector<std::unique_ptr<UiListItem>> vecDialogItems;
|
|
std::vector<std::unique_ptr<UiItemBase>> vecDialog;
|
|
|
|
void ItemSelected(int value)
|
|
{
|
|
auto option = static_cast<StartUpGameMode>(vecDialogItems[value]->m_value);
|
|
sgOptions.StartUp.gameMode.SetValue(option);
|
|
SaveOptions();
|
|
endMenu = true;
|
|
}
|
|
|
|
void EscPressed()
|
|
{
|
|
endMenu = true;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
void UiSelStartUpGameOption()
|
|
{
|
|
ArtBackgroundWidescreen = LoadOptionalClx("ui_art\\mainmenuw.clx");
|
|
LoadBackgroundArt("ui_art\\mainmenu");
|
|
UiAddBackground(&vecDialog);
|
|
UiAddLogo(&vecDialog);
|
|
|
|
const Point uiPosition = GetUIRectangle().position;
|
|
vecDialogItems.push_back(std::make_unique<UiListItem>(_("Enter Hellfire"), static_cast<int>(StartUpGameMode::Hellfire)));
|
|
vecDialogItems.push_back(std::make_unique<UiListItem>(_("Switch to Diablo"), static_cast<int>(StartUpGameMode::Diablo)));
|
|
vecDialog.push_back(std::make_unique<UiList>(vecDialogItems, vecDialogItems.size(), uiPosition.x + 64, uiPosition.y + 240, 510, 43, UiFlags::AlignCenter | UiFlags::FontSize42 | UiFlags::ColorUiGold, 5));
|
|
|
|
UiInitList(nullptr, ItemSelected, EscPressed, vecDialog, true);
|
|
|
|
endMenu = false;
|
|
while (!endMenu) {
|
|
UiClearScreen();
|
|
UiRenderItems(vecDialog);
|
|
UiPollAndRender();
|
|
}
|
|
|
|
ArtBackground = std::nullopt;
|
|
ArtBackgroundWidescreen = std::nullopt;
|
|
vecDialogItems.clear();
|
|
vecDialog.clear();
|
|
}
|
|
|
|
} // namespace devilution
|