mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
SCI: use reanimate instead of BitsShow() when removing menus
svn-id: r47386
This commit is contained in:
parent
e7c1a34b3f
commit
7b5a55a6a2
@ -57,7 +57,7 @@ SciGui::SciGui(EngineState *state, Screen *screen, SciPalette *palette, Cursor *
|
||||
_text = new Text(_s->resMan, _gfx, _screen);
|
||||
_windowMgr = new WindowMgr(this, _screen, _gfx, _text);
|
||||
_controls = new Controls(_s->_segMan, _gfx, _text);
|
||||
_menu = new Menu(_s->_event, _s->_segMan, _gfx, _text, _screen, _cursor);
|
||||
_menu = new Menu(_s->_event, _s->_segMan, this, _gfx, _text, _screen, _cursor);
|
||||
}
|
||||
|
||||
SciGui::SciGui() {
|
||||
@ -337,7 +337,7 @@ void SciGui::drawMenuBar(bool clear) {
|
||||
|
||||
void SciGui::menuReset() {
|
||||
delete _menu;
|
||||
_menu = new Menu(_s->_event, _s->_segMan, _gfx, _text, _screen, _cursor);
|
||||
_menu = new Menu(_s->_event, _s->_segMan, this, _gfx, _text, _screen, _cursor);
|
||||
}
|
||||
|
||||
void SciGui::menuAdd(Common::String title, Common::String content, reg_t contentVmPtr) {
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "sci/engine/state.h"
|
||||
#include "sci/graphics/helpers.h"
|
||||
#include "sci/graphics/gfx.h"
|
||||
#include "sci/graphics/animate.h"
|
||||
#include "sci/graphics/cursor.h"
|
||||
#include "sci/graphics/font.h"
|
||||
#include "sci/graphics/text.h"
|
||||
@ -40,8 +41,8 @@
|
||||
|
||||
namespace Sci {
|
||||
|
||||
Menu::Menu(SciEvent *event, SegManager *segMan, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor)
|
||||
: _event(event), _segMan(segMan), _gfx(gfx), _text(text), _screen(screen), _cursor(cursor) {
|
||||
Menu::Menu(SciEvent *event, SegManager *segMan, SciGui *gui, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor)
|
||||
: _event(event), _segMan(segMan), _gui(gui), _gfx(gfx), _text(text), _screen(screen), _cursor(cursor) {
|
||||
|
||||
_listCount = 0;
|
||||
// We actually set active item in here and remember last selection of the user
|
||||
@ -408,9 +409,8 @@ reg_t Menu::select(reg_t eventObject) {
|
||||
|
||||
if (!_menuSaveHandle.isNull()) {
|
||||
_gfx->BitsRestore(_menuSaveHandle);
|
||||
_gfx->BitsShow(_menuRect);
|
||||
_gui->graphRedrawBox(_menuRect);
|
||||
_menuSaveHandle = NULL_REG;
|
||||
// TODO: Change to ReAnimate()
|
||||
}
|
||||
if (!_barSaveHandle.isNull()) {
|
||||
_gfx->BitsRestore(_barSaveHandle);
|
||||
@ -472,8 +472,7 @@ void Menu::drawMenu(uint16 oldMenuId, uint16 newMenuId) {
|
||||
// Remove menu, if one is displayed
|
||||
if (!_menuSaveHandle.isNull()) {
|
||||
_gfx->BitsRestore(_menuSaveHandle);
|
||||
_gfx->BitsShow(_menuRect);
|
||||
// TODO: Change to ReAnimate()
|
||||
_gui->graphRedrawBox(_menuRect);
|
||||
}
|
||||
|
||||
// First calculate rect of menu and also invert old and new menu text
|
||||
|
@ -78,7 +78,7 @@ typedef Common::List<GuiMenuItemEntry *> GuiMenuItemList;
|
||||
|
||||
class Menu {
|
||||
public:
|
||||
Menu(SciEvent *event, SegManager *segMan, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor);
|
||||
Menu(SciEvent *event, SegManager *segMan, SciGui *gui, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor);
|
||||
~Menu();
|
||||
|
||||
void reset();
|
||||
@ -104,6 +104,7 @@ private:
|
||||
|
||||
SciEvent *_event;
|
||||
SegManager *_segMan;
|
||||
SciGui *_gui;
|
||||
Gfx *_gfx;
|
||||
Text *_text;
|
||||
Screen *_screen;
|
||||
|
Loading…
Reference in New Issue
Block a user