The menu bar code is no longer used in the new graphics code, and the menu state is no longer stored in saved games

svn-id: r45854
This commit is contained in:
Filippos Karapetis 2009-11-12 09:24:46 +00:00
parent c8f1afd24c
commit 226f0bd23d
7 changed files with 51 additions and 12 deletions

View File

@ -35,8 +35,8 @@
#include "sci/engine/message.h"
#ifdef INCLUDE_OLDGFX
#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual
#endif
#include "sci/gfx/menubar.h"
#endif
namespace Sci {
@ -411,7 +411,9 @@ int game_init(EngineState *s) {
debug(2, " \"%s\" at %04x:%04x", s->_gameName.c_str(), PRINT_REG(s->_gameObj));
#ifdef INCLUDE_OLDGFX
s->_menubar = new Menubar(); // Create menu bar
#endif
if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND)
game_init_sound(s, 0);
@ -441,9 +443,9 @@ int game_exit(EngineState *s) {
// TODO Free scripts here
#ifdef INCLUDE_OLDGFX
delete s->_menubar;
#ifdef INCLUDE_OLDGFX
_free_graphics_input(s);
#endif

View File

@ -30,8 +30,8 @@
#ifdef INCLUDE_OLDGFX
#include "sci/gfx/gfx_gui.h"
#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual
#endif
#include "sci/gfx/menubar.h"
#endif
#include "sci/gui/gui.h"
#include "sci/gui/gui_cursor.h"

View File

@ -30,17 +30,19 @@
#include "graphics/thumbnail.h"
#include "sci/sci.h"
#include "sci/gfx/menubar.h"
#ifdef INCLUDE_OLDGFX
#include "sci/gfx/menubar.h"
#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxContainer
#endif
#include "sci/sfx/audio.h"
#include "sci/sfx/core.h"
#include "sci/sfx/iterator.h"
#include "sci/engine/state.h"
#include "sci/engine/message.h"
#include "sci/engine/savegame.h"
#include "sci/engine/vm_types.h"
#include "sci/gui/gui.h"
#include "sci/sfx/audio.h"
#include "sci/sfx/core.h"
#include "sci/sfx/iterator.h"
namespace Sci {
@ -53,6 +55,7 @@ const uint32 INTMAPPER_MAGIC_KEY = 0xDEADBEEF;
// from ksound.cpp:
//SongIterator *build_iterator(ResourceManager *resMan, int song_nr, SongIteratorType type, songit_id_t id);
SongIterator *build_iterator(EngineState *s, int song_nr, SongIteratorType type, songit_id_t id);
#pragma mark -
@ -150,6 +153,7 @@ void syncWithSerializer(Common::Serializer &s, reg_t &obj) {
}
#ifdef INCLUDE_OLDGFX
void MenuItem::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint32LE(_type);
@ -175,11 +179,12 @@ void Menu::saveLoadWithSerializer(Common::Serializer &s) {
syncArray<MenuItem>(s, _items);
}
void Menubar::saveLoadWithSerializer(Common::Serializer &s) {
syncArray<Menu>(s, _menus);
}
#endif
void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
s.skip(4, VER(9), VER(9)); // OBSOLETE: Used to be reserved_id
s.syncAsSint32LE(_exportsAreWide);
@ -294,12 +299,35 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) {
s.syncString(tmp); // OBSOLETE: Used to be game_version
s.skip(4, VER(9), VER(9)); // OBSOLETE: Used to be version
#ifdef INCLUDE_OLDGFX
if (s.isLoading()) {
//free(menubar);
_menubar = new Menubar();
} else
assert(_menubar);
_menubar->saveLoadWithSerializer(s);
#else
// OBSOLETE: Saved menus. Skip all of the saved data
int menuLength = 0;
s.syncAsUint32LE(menuLength);
s.syncString(tmp); // OBSOLETE: Used to be _title
s.skip(4, VER(12), VER(12)); // OBSOLETE: Used to be _titleWidth
s.skip(4, VER(12), VER(12)); // OBSOLETE: Used to be _width
// Now iterate through the obsolete saved menu data
for (int i = 0; i < menuLength; i++) {
s.skip(4, VER(12), VER(12)); // OBSOLETE: Used to be _type
s.syncString(tmp); // OBSOLETE: Used to be _keytext
s.skip(4, VER(9), VER(9)); // OBSOLETE: Used to be keytext_size
s.skip(4, VER(12), VER(12)); // OBSOLETE: Used to be _flags
s.skip(64, VER(12), VER(12)); // OBSOLETE: Used to be MENU_SAID_SPEC_SIZE
s.skip(4, VER(12), VER(12)); // OBSOLETE: Used to be _saidPos
s.syncString(tmp); // OBSOLETE: Used to be _text
s.skip(4, VER(12), VER(12)); // OBSOLETE: Used to be _textPos
s.skip(4 * 4, VER(12), VER(12)); // OBSOLETE: Used to be _modifiers, _key, _enabled and _tag
}
#endif
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
@ -672,6 +700,7 @@ static void reconstruct_sounds(EngineState *s) {
int oldstatus;
SongIterator::Message msg;
//base = ff = build_iterator(s->resMan, seeker->_resourceNum, it_type, seeker->_handle);
base = ff = build_iterator(s, seeker->_resourceNum, it_type, seeker->_handle);
if (seeker->_restoreBehavior == RESTORE_BEHAVIOR_CONTINUE)
ff = new_fast_forward_iterator(base, seeker->_restoreTime);

View File

@ -62,9 +62,9 @@ EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc,
priority_first = 0;
priority_last = 0;
#endif
_menubar = 0;
#endif
last_wait_time = 0;

View File

@ -166,9 +166,9 @@ public:
int priority_first; /**< The line where priority zone 0 ends */
int priority_last; /**< The line where the highest priority zone starts */
#endif
Menubar *_menubar; /**< The menu bar */
#endif
uint32 game_start_time; /**< The time at which the interpreter was started */
uint32 last_wait_time; /**< The last time the game invoked Wait() */

View File

@ -28,7 +28,9 @@
** used for any actual actions on behalf of the interpreter.
*/
#include "sci/sci.h"
#include "sci/sci.h" // for INCLUDE_OLDGFX
#ifdef INCLUDE_OLDGFX
#include "sci/engine/state.h"
#include "sci/gfx/menubar.h"
#include "sci/gui/gui.h"
@ -434,3 +436,5 @@ bool Menubar::mapPointer(const Common::Point &pointerPos, int &menu_nr, int &ite
}
} // End of namespace Sci
#endif

View File

@ -25,10 +25,12 @@
/* Header for SCI0 menu bar management */
#include "sci/sci.h" // for INCLUDE_OLDGFX
#ifdef INCLUDE_OLDGFX
#ifndef SCI_GFX_SCI_MENUBAR_H
#define SCI_GFX_SCI_MENUBAR_H
#include "sci/sci.h" // for INCLUDE_OLDGFX
#include "sci/engine/vm_types.h"
#include "sci/gfx/operations.h"
@ -225,3 +227,5 @@ public:
} // End of namespace Sci
#endif // SCI_GFX_SCI_MENUBAR_H
#endif