aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2009-11-12 09:24:46 +0000
committerFilippos Karapetis2009-11-12 09:24:46 +0000
commit226f0bd23d40f4c807c33ee32f77d449a4f06837 (patch)
tree45bf79c9f7349a68b3ec71bb48d897cdb421bddc
parentc8f1afd24cfbb53b7e96c8ad376672092b9fa42f (diff)
downloadscummvm-rg350-226f0bd23d40f4c807c33ee32f77d449a4f06837.tar.gz
scummvm-rg350-226f0bd23d40f4c807c33ee32f77d449a4f06837.tar.bz2
scummvm-rg350-226f0bd23d40f4c807c33ee32f77d449a4f06837.zip
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
-rw-r--r--engines/sci/engine/game.cpp6
-rw-r--r--engines/sci/engine/kmenu.cpp2
-rw-r--r--engines/sci/engine/savegame.cpp39
-rw-r--r--engines/sci/engine/state.cpp2
-rw-r--r--engines/sci/engine/state.h2
-rw-r--r--engines/sci/gfx/menubar.cpp6
-rw-r--r--engines/sci/gfx/menubar.h6
7 files changed, 51 insertions, 12 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 11df3e55f7..0f5226c33e 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -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
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index b0af284305..d78eb585b8 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -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"
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 4b34fd07e7..35f478a010 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -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);
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 927fa672de..5f325cd794 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -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;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 039b65a5b2..e2368a505d 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -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() */
diff --git a/engines/sci/gfx/menubar.cpp b/engines/sci/gfx/menubar.cpp
index 417172ccb0..d86979137b 100644
--- a/engines/sci/gfx/menubar.cpp
+++ b/engines/sci/gfx/menubar.cpp
@@ -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
diff --git a/engines/sci/gfx/menubar.h b/engines/sci/gfx/menubar.h
index 3343e5f05e..4826824493 100644
--- a/engines/sci/gfx/menubar.h
+++ b/engines/sci/gfx/menubar.h
@@ -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 \ No newline at end of file