mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 08:23:15 +00:00
STARK: Enable onScreenChanged() in Cursor and GameWindow
This commit is contained in:
parent
92184a1899
commit
a14744117b
@ -194,10 +194,16 @@ bool RenderEntry::intersectRay(const Math::Ray &ray) const {
|
||||
}
|
||||
|
||||
VisualImageXMG *RenderEntry::getImage() const {
|
||||
if (!_visual) {
|
||||
return nullptr;
|
||||
}
|
||||
return _visual->get<VisualImageXMG>();
|
||||
}
|
||||
|
||||
VisualText *RenderEntry::getText() const {
|
||||
if (!_visual) {
|
||||
return nullptr;
|
||||
}
|
||||
return _visual->get<VisualText>();
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,12 @@ void Cursor::setFading(bool fading) {
|
||||
_fading = fading;
|
||||
}
|
||||
|
||||
void Cursor::onScreenChanged() {
|
||||
if (_mouseText) {
|
||||
_mouseText->resetTexture();
|
||||
}
|
||||
}
|
||||
|
||||
void Cursor::updateFadeLevel() {
|
||||
if (_fading) {
|
||||
if (_fadeLevelIncreasing) {
|
||||
|
@ -52,6 +52,9 @@ public:
|
||||
/** Make cycle the cursor's brightness */
|
||||
void setFading(bool fading);
|
||||
|
||||
/** Update when the screen resolution has changed */
|
||||
void onScreenChanged();
|
||||
|
||||
Common::Point getMousePosition(bool unscaled = false) const;
|
||||
|
||||
enum CursorType {
|
||||
|
@ -122,8 +122,10 @@ void GameScreen::dispatchEvent(WindowHandler handler) {
|
||||
}
|
||||
|
||||
void GameScreen::onScreenChanged() {
|
||||
_cursor->onScreenChanged();
|
||||
_dialogPanel->onScreenChanged();
|
||||
_topMenu->onScreenChanged();
|
||||
_gameWindow->onScreenChanged();
|
||||
}
|
||||
|
||||
void GameScreen::notifyInventoryItemEnabled(uint16 itemIndex) {
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "engines/stark/ui/world/actionmenu.h"
|
||||
#include "engines/stark/ui/world/inventorywindow.h"
|
||||
|
||||
#include "engines/stark/visual/text.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
GameWindow::GameWindow(Gfx::Driver *gfx, Cursor *cursor, ActionMenu *actionMenu, InventoryWindow *inventory) :
|
||||
@ -238,4 +240,25 @@ void GameWindow::reset() {
|
||||
_objectRelativePosition.y = 0;
|
||||
}
|
||||
|
||||
void GameWindow::onScreenChanged() {
|
||||
// May be called when resources have not been loaded
|
||||
if (!StarkGlobal->getCurrent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Resources::Location *location = StarkGlobal->getCurrent()->getLocation();
|
||||
_renderEntries = location->listRenderEntries();
|
||||
|
||||
VisualText *text = nullptr;
|
||||
Gfx::RenderEntryArray::iterator element = _renderEntries.begin();
|
||||
while (element != _renderEntries.end()) {
|
||||
text = (*element)->getText();
|
||||
if (text) {
|
||||
text->resetTexture();
|
||||
}
|
||||
|
||||
element++;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Stark
|
||||
|
@ -45,6 +45,9 @@ public:
|
||||
/** Clear the location dependent state */
|
||||
void reset();
|
||||
|
||||
/** Update when the screen resolution has changed */
|
||||
void onScreenChanged();
|
||||
|
||||
protected:
|
||||
void onMouseMove(const Common::Point &pos) override;
|
||||
void onClick(const Common::Point &pos) override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user