VCRUISE: Fix AD2044 fullscreen UI

This commit is contained in:
elasota 2024-01-24 22:48:08 -05:00
parent cd2e9aa37f
commit 3ccaa683cd
3 changed files with 28 additions and 4 deletions

View File

@ -1553,6 +1553,9 @@ bool Runtime::bootGame(bool newGame) {
_trayCornerGraphic = loadGraphic("Select_2", true);
}
if (_gameID == GID_AD2044)
_backgroundGraphic = loadGraphicFromPath("SCR0.BMP", true);
Common::Language lang = _defaultLanguage;
if (ConfMan.hasKey("language")) {
@ -5002,7 +5005,11 @@ void Runtime::inventoryRemoveItem(uint itemID) {
}
void Runtime::clearScreen() {
_system->fillScreen(_system->getScreenFormat().RGBToColor(0, 0, 0));
if (_gameID == GID_AD2044) {
_fullscreenMenuSection.surf->blitFrom(*_backgroundGraphic);
commitSectionToScreen(_fullscreenMenuSection, _fullscreenMenuSection.rect);
} else
_system->fillScreen(_system->getScreenFormat().RGBToColor(0, 0, 0));
}
void Runtime::redrawTray() {
@ -5018,10 +5025,17 @@ void Runtime::redrawTray() {
}
void Runtime::clearTray() {
uint32 blackColor = _traySection.surf->format.RGBToColor(0, 0, 0);
Common::Rect trayRect(0, 0, _traySection.surf->w, _traySection.surf->h);
Common::Rect trayRect;
if (_gameID == GID_AD2044) {
trayRect = _traySection.rect;
trayRect.translate(-trayRect.left, -trayRect.top);
_traySection.surf->blitFrom(*_backgroundGraphic, _traySection.rect, trayRect);
} else {
uint32 blackColor = _traySection.surf->format.RGBToColor(0, 0, 0);
trayRect = Common::Rect(0, 0, _traySection.surf->w, _traySection.surf->h);
_traySection.surf->fillRect(trayRect, blackColor);
_traySection.surf->fillRect(trayRect, blackColor);
}
this->commitSectionToScreen(_traySection, trayRect);
}
@ -5030,6 +5044,9 @@ void Runtime::drawInventory(uint slot) {
if (!isTrayVisible())
return;
if (_gameID == GID_AD2044)
return;
Common::Rect trayRect = _traySection.rect;
trayRect.translate(-trayRect.left, -trayRect.top);
@ -5196,6 +5213,10 @@ Common::SharedPtr<Graphics::Surface> Runtime::loadGraphic(const Common::String &
filePath.appendInPlace(graphicName);
filePath.appendInPlace(".bmp");
return loadGraphicFromPath(filePath, required);
}
Common::SharedPtr<Graphics::Surface> Runtime::loadGraphicFromPath(const Common::Path &filePath, bool required) {
Common::File f;
if (!f.open(filePath)) {
warning("Couldn't open BMP file '%s'", filePath.toString(Common::Path::kNativeSeparator).c_str());

View File

@ -947,6 +947,7 @@ private:
Common::String getFileNameForItemGraphic(uint itemID) const;
Common::SharedPtr<Graphics::Surface> loadGraphic(const Common::String &graphicName, bool required);
Common::SharedPtr<Graphics::Surface> loadGraphicFromPath(const Common::Path &path, bool required);
bool loadSubtitles(Common::CodePage codePage, bool guessCodePage);
@ -1186,6 +1187,7 @@ private:
Common::SharedPtr<Graphics::Surface> _trayBackgroundGraphic;
Common::SharedPtr<Graphics::Surface> _trayHighlightGraphic;
Common::SharedPtr<Graphics::Surface> _trayCornerGraphic;
Common::SharedPtr<Graphics::Surface> _backgroundGraphic;
Common::Array<Common::SharedPtr<Graphics::Surface> > _uiGraphics;

View File

@ -80,6 +80,7 @@ Common::Error VCruiseEngine::run() {
#if !defined(USE_JPEG)
if (_gameDescription->desc.flags & VCRUISE_GF_NEED_JPEG) {
.
return Common::Error(Common::kUnknownError, _s("This game requires JPEG support, which was not compiled in."));
}
#endif