- Removed status_bar_foreground and status_bar_background variables from the engine state

- Implemented clearMenuBar() in the new graphics code
- Removed the "status_bar" command, which was used to set custom colors for the status bar

svn-id: r45538
This commit is contained in:
Filippos Karapetis 2009-10-30 14:39:26 +00:00
parent 3ec76350ec
commit 57266a7cba
9 changed files with 11 additions and 51 deletions

View File

@ -124,7 +124,6 @@ Console::Console(SciEngine *vm) : GUI::Debugger() {
DCmd_Register("flush_visual", WRAP_METHOD(Console, cmdFlushPorts));
DCmd_Register("dynamic_views", WRAP_METHOD(Console, cmdDynamicViews));
DCmd_Register("dropped_views", WRAP_METHOD(Console, cmdDroppedViews));
DCmd_Register("status_bar", WRAP_METHOD(Console, cmdStatusBarColors));
#ifdef GFXW_DEBUG_WIDGETS
DCmd_Register("print_widget", WRAP_METHOD(Console, cmdPrintWidget));
#endif
@ -329,7 +328,6 @@ bool Console::cmdHelp(int argc, const char **argv) {
DebugPrintf(" flush_visual - Flushes dynamically allocated ports (for memory profiling)\n");
DebugPrintf(" dynamic_views - Lists active dynamic views\n");
DebugPrintf(" dropped_views - Lists dropped dynamic views\n");
DebugPrintf(" status_bar - Sets the colors of the status bar\n");
#ifdef GFXW_DEBUG_WIDGETS
DebugPrintf(" print_widget - Shows active widgets (no params) or information on the specified widget indices\n");
#endif
@ -1335,28 +1333,6 @@ bool Console::cmdPriorityBands(int argc, const char **argv) {
return true;
}
bool Console::cmdStatusBarColors(int argc, const char **argv) {
if (argc != 3) {
DebugPrintf("Sets the colors of the status bar\n");
DebugPrintf("Usage: %s <foreground color> <background color>\n", argv[0]);
return true;
}
#ifdef INCLUDE_OLDGFX
_vm->_gamestate->titlebar_port->_color = _vm->_gamestate->ega_colors[atoi(argv[1])];
_vm->_gamestate->titlebar_port->_bgcolor = _vm->_gamestate->ega_colors[atoi(argv[2])];
_vm->_gamestate->status_bar_foreground = atoi(argv[1]);
_vm->_gamestate->status_bar_background = atoi(argv[2]);
sciw_set_status_bar(_vm->_gamestate, _vm->_gamestate->titlebar_port, _vm->_gamestate->_statusBarText,
_vm->_gamestate->status_bar_foreground, _vm->_gamestate->status_bar_background);
gfxop_update(_vm->_gamestate->gfx_state);
#endif
return false;
}
bool Console::cmdPrintSegmentTable(int argc, const char **argv) {
DebugPrintf("Segment table:\n");

View File

@ -102,7 +102,6 @@ private:
bool cmdFlushPorts(int argc, const char **argv);
bool cmdDynamicViews(int argc, const char **argv);
bool cmdDroppedViews(int argc, const char **argv);
bool cmdStatusBarColors(int argc, const char **argv);
bool cmdPrintWidget(int argc, const char **argv);
// Segments
bool cmdPrintSegmentTable(int argc, const char **argv);

View File

@ -413,8 +413,6 @@ int game_init(EngineState *s) {
s->successor = NULL; // No successor
s->_statusBarText.clear(); // Status bar is blank
s->status_bar_foreground = 0;
s->status_bar_background = !s->resMan->isVGA() ? 15 : 255;
SystemString *str = &s->sys_strings->_strings[SYS_STRING_PARSER_BASE];
str->_name = "parser-base";

View File

@ -79,8 +79,8 @@ reg_t kGetMenu(EngineState *s, int argc, reg_t *argv) {
reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) {
reg_t textReference = argv[0];
Common::String text;
int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0; // old code was: s->status_bar_foreground;
int16 colorBack = (argc > 2) ? argv[2].toSint16() : s->resMan->isVGA() ? 255 : 15; // s->status_bar_background;
int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0;
int16 colorBack = (argc > 2) ? argv[2].toSint16() : s->resMan->isVGA() ? 255 : 15;
if (!textReference.isNull()) {
// Sometimes this is called without giving text, if thats the case dont process it
@ -215,9 +215,10 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
#ifdef INCLUDE_OLDGFX
sciw_set_menubar(s, s->titlebar_port, s->_menubar, menu_nr);
FULL_REDRAW;
#endif
FULL_REDRAW;
old_item = -1;
old_menu = -1;
@ -234,13 +235,6 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
case SCI_EVT_KEYBOARD:
switch (ev.data) {
case '`':
#ifdef INCLUDE_OLDGFX
if (ev.buckybits & SCI_EVM_CTRL)
s->visual->print(0);
#endif
break;
case SCI_K_ESC:
menu_mode = 0;
break;
@ -338,15 +332,16 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
} /* while (menu_mode) */
// Clear the menu
#ifdef INCLUDE_OLDGFX
if (port) {
delete port;
port = NULL;
sciw_set_status_bar(s, s->titlebar_port, s->_statusBarText, s->status_bar_foreground, s->status_bar_background);
gfxop_update(s->gfx_state);
}
#endif
s->_gui->clearMenuBar();
FULL_REDRAW;
}

View File

@ -305,8 +305,8 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) {
assert(_menubar);
_menubar->saveLoadWithSerializer(s);
s.syncAsSint32LE(status_bar_foreground);
s.syncAsSint32LE(status_bar_background);
s.skip(4, VER(12), VER(12)); // obsolete: used to be status_bar_foreground
s.skip(4, VER(12), VER(12)); // obsolete: used to be status_bar_background
sync_SegManagerPtr(s, resMan, _segMan);

View File

@ -43,9 +43,6 @@ EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc,
restarting_flags = 0;
status_bar_foreground = 0;
status_bar_background = 0;
#ifdef INCLUDE_OLDGFX
pic_priority_table = 0;
pic_not_valid = 0;

View File

@ -145,8 +145,6 @@ public:
/** Text on the status bar, or NULL if the title bar is blank */
Common::String _statusBarText;
int status_bar_foreground, status_bar_background;
#ifdef INCLUDE_OLDGFX
int *pic_priority_table; /**< 16 entries with priorities or NULL if not present */
byte pic_not_valid; /**< Is 0 if the background picture is "valid" */

View File

@ -301,8 +301,7 @@ void SciGui::drawMenuBar() {
}
void SciGui::clearMenuBar() {
// TODO: Implement menubar
warning("TODO: clearMenuBar()");
drawStatus("", 0, 0);
}
void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {

View File

@ -805,8 +805,6 @@ void SciGui32::drawStatus(const char *text, int16 colorPen, int16 colorBack) {
_s->titlebar_port->_bgcolor.visual = get_pic_color(_s, colorBack);
_s->titlebar_port->_bgcolor.mask = GFX_MASK_VISUAL;
_s->status_bar_foreground = colorPen;
_s->status_bar_background = colorBack;
_s->_statusBarText = text;
sciw_set_status_bar(_s, _s->titlebar_port, _s->_statusBarText, colorPen, colorBack);