[Scummvm-cvs-logs] SF.net SVN: scummvm:[45854] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Nov 12 10:24:47 CET 2009
Revision: 45854
http://scummvm.svn.sourceforge.net/scummvm/?rev=45854&view=rev
Author: thebluegr
Date: 2009-11-12 09:24:46 +0000 (Thu, 12 Nov 2009)
Log Message:
-----------
The menu bar code is no longer used in the new graphics code, and the menu state is no longer stored in saved games
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/kmenu.cpp
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/engine/state.cpp
scummvm/trunk/engines/sci/engine/state.h
scummvm/trunk/engines/sci/gfx/menubar.cpp
scummvm/trunk/engines/sci/gfx/menubar.h
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-11-12 09:24:46 UTC (rev 45854)
@@ -35,8 +35,8 @@
#include "sci/engine/message.h"
#ifdef INCLUDE_OLDGFX
#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual
+#include "sci/gfx/menubar.h"
#endif
-#include "sci/gfx/menubar.h"
namespace Sci {
@@ -411,7 +411,9 @@
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 @@
// TODO Free scripts here
+#ifdef INCLUDE_OLDGFX
delete s->_menubar;
-#ifdef INCLUDE_OLDGFX
_free_graphics_input(s);
#endif
Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp 2009-11-12 09:24:46 UTC (rev 45854)
@@ -30,8 +30,8 @@
#ifdef INCLUDE_OLDGFX
#include "sci/gfx/gfx_gui.h"
#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual
+#include "sci/gfx/menubar.h"
#endif
-#include "sci/gfx/menubar.h"
#include "sci/gui/gui.h"
#include "sci/gui/gui_cursor.h"
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2009-11-12 09:24:46 UTC (rev 45854)
@@ -30,17 +30,19 @@
#include "graphics/thumbnail.h"
#include "sci/sci.h"
+#ifdef INCLUDE_OLDGFX
#include "sci/gfx/menubar.h"
-#ifdef INCLUDE_OLDGFX
#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 @@
// 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 @@
}
+#ifdef INCLUDE_OLDGFX
void MenuItem::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint32LE(_type);
@@ -175,11 +179,12 @@
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,13 +299,36 @@
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 @@
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);
Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/engine/state.cpp 2009-11-12 09:24:46 UTC (rev 45854)
@@ -62,9 +62,9 @@
priority_first = 0;
priority_last = 0;
-#endif
_menubar = 0;
+#endif
last_wait_time = 0;
Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/engine/state.h 2009-11-12 09:24:46 UTC (rev 45854)
@@ -166,9 +166,9 @@
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() */
Modified: scummvm/trunk/engines/sci/gfx/menubar.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/menubar.cpp 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/gfx/menubar.cpp 2009-11-12 09:24:46 UTC (rev 45854)
@@ -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 @@
}
} // End of namespace Sci
+
+#endif
Modified: scummvm/trunk/engines/sci/gfx/menubar.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/menubar.h 2009-11-12 08:28:59 UTC (rev 45853)
+++ scummvm/trunk/engines/sci/gfx/menubar.h 2009-11-12 09:24:46 UTC (rev 45854)
@@ -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 @@
} // End of namespace Sci
#endif // SCI_GFX_SCI_MENUBAR_H
+
+#endif
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list