mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
MM: MM1: Introduced focused view display
This commit is contained in:
parent
2aaceda632
commit
3718284f6f
@ -65,6 +65,7 @@ public:
|
||||
class Events : public UIElement {
|
||||
private:
|
||||
Graphics::Screen *_screen = nullptr;
|
||||
UIElement *_focusedElement;
|
||||
protected:
|
||||
/**
|
||||
* Process an event
|
||||
@ -79,9 +80,26 @@ public:
|
||||
*/
|
||||
void runGame();
|
||||
|
||||
/**
|
||||
* Sets the focus to a new view
|
||||
*/
|
||||
void focusElement(UIElement *ui) {
|
||||
_focusedElement = ui;
|
||||
}
|
||||
|
||||
Graphics::Screen *getScreen() const override {
|
||||
return _screen;
|
||||
}
|
||||
|
||||
|
||||
void draw() override {
|
||||
if (_focusedElement)
|
||||
_focusedElement->draw();
|
||||
}
|
||||
|
||||
bool tick() override {
|
||||
return _focusedElement ? _focusedElement->tick() : false;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace MM1
|
||||
|
@ -51,8 +51,7 @@ void GFX::setEgaPalette(int palNum) {
|
||||
g_system->getPaletteManager()->setPalette(pal, 0, 16);
|
||||
|
||||
uint32 c = 0xffffffff;
|
||||
for (int i = 1; i < 256; ++i)
|
||||
g_system->getPaletteManager()->setPalette((const byte *)&c, i, 1);
|
||||
g_system->getPaletteManager()->setPalette((const byte *)&c, 255, 1);
|
||||
}
|
||||
|
||||
} // namespace Gfx
|
||||
|
@ -54,8 +54,9 @@ Common::Error MM1Engine::run() {
|
||||
return Common::kNoError;
|
||||
|
||||
// Run the game
|
||||
// Views::TitleView view1(this);
|
||||
Views::AreYouReady view1(this);
|
||||
Views::TitleView view1(this);
|
||||
Views::AreYouReady view2(this);
|
||||
focusElement(&view2);
|
||||
|
||||
runGame();
|
||||
return Common::kNoError;
|
||||
|
Loading…
Reference in New Issue
Block a user