diff options
author | Filippos Karapetis | 2010-01-05 00:54:53 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-05 00:54:53 +0000 |
commit | f66d5a7f534ad2869aecfcacc90bf337cc33571e (patch) | |
tree | 9a163a79eca70af6f7cf9cbe0f6f53fac692f93b /engines/sci/engine | |
parent | 86cad51d0798ddad02fadc2380f39a8db2aa30fa (diff) | |
download | scummvm-rg350-f66d5a7f534ad2869aecfcacc90bf337cc33571e.tar.gz scummvm-rg350-f66d5a7f534ad2869aecfcacc90bf337cc33571e.tar.bz2 scummvm-rg350-f66d5a7f534ad2869aecfcacc90bf337cc33571e.zip |
SCI: Removed the old graphics code
svn-id: r47005
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/game.cpp | 149 | ||||
-rw-r--r-- | engines/sci/engine/kevent.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/kmenu.cpp | 5 | ||||
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 67 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 27 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 50 | ||||
-rw-r--r-- | engines/sci/engine/vm.h | 11 |
9 files changed, 0 insertions, 318 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 49652867a8..133abff3b9 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -35,10 +35,6 @@ #include "sci/engine/kernel_types.h" #include "sci/engine/message.h" #include "sci/gui/gui.h" -#ifdef INCLUDE_OLDGFX -#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxVisual -#include "sci/gfx/menubar.h" -#endif #include "sci/sfx/music.h" namespace Sci { @@ -179,133 +175,6 @@ const char *convertSierraGameId(const char *gameId, uint32 *gameFlags, ResourceM return strdup(sierraId.c_str()); } -#ifdef INCLUDE_OLDGFX -int _reset_graphics_input(EngineState *s) { - Resource *resource; - int font_nr; - gfx_color_t transparent = { PaletteEntry(), 0, -1, -1, 0 }; - debug(2, "Initializing graphics"); - - if (s->resMan->getViewType() == kViewEga) { - for (int i = 0; i < 16; i++) { - gfxop_set_color(s->gfx_state, &(s->ega_colors[i]), gfx_sci0_image_colors[sci0_palette][i].r, - gfx_sci0_image_colors[sci0_palette][i].g, gfx_sci0_image_colors[sci0_palette][i].b, 0, -1, -1); - s->gfx_state->driver->getMode()->palette->makeSystemColor(i, s->ega_colors[i].visual); - } - } else { - // Allocate SCI1 system colors - gfx_color_t black = { PaletteEntry(0, 0, 0), 0, 0, 0, GFX_MASK_VISUAL }; - s->gfx_state->driver->getMode()->palette->makeSystemColor(0, black.visual); - - // Check for Amiga palette file. - Common::File file; - if (file.open("spal")) { - s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal1_amiga(file)); - file.close(); - } else { - resource = s->resMan->findResource(ResourceId(kResourceTypePalette, 999), 1); - if (resource) { - if (s->resMan->getViewType() != kViewVga11) - s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal1(999, resource->data, resource->size)); - else - s->gfx_state->gfxResMan->setStaticPalette(gfxr_read_pal11(999, resource->data, resource->size)); - s->resMan->unlockResource(resource); - } else { - debug(2, "Couldn't find the default palette!"); - } - } - } - - gfxop_fill_box(s->gfx_state, gfx_rect(0, 0, 320, 200), s->ega_colors[0]); // Fill screen black - gfxop_update(s->gfx_state); - - s->pic_is_new = 0; - s->pic_visible_map = GFX_MASK_NONE; // Other values only make sense for debugging - s->dyn_views = NULL; // no DynViews - s->drop_views = NULL; // And, consequently, no list for dropped views - - font_nr = -1; - do { - resource = s->resMan->testResource(ResourceId(kResourceTypeFont, ++font_nr)); - } while ((!resource) && (font_nr < 65536)); - - if (!resource) { - debug(2, "No text font was found."); - return 1; - } - - s->visual = new GfxVisual(s->gfx_state, font_nr); - - s->wm_port = new GfxPort(s->visual, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent); - - s->iconbar_port = new GfxPort(s->visual, gfx_rect(0, 0, 320, 200), s->ega_colors[0], transparent); - s->iconbar_port->_flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH; - - if (s->resMan->isVGA()) { - // This bit sets the foreground and background colors in VGA SCI games - gfx_color_t fgcolor; - gfx_color_t bgcolor; - memset(&fgcolor, 0, sizeof(gfx_color_t)); - memset(&bgcolor, 0, sizeof(gfx_color_t)); - -#if 0 - fgcolor.visual = s->gfx_state->resstate->static_palette[0]; - fgcolor.mask = GFX_MASK_VISUAL; - bgcolor.visual = s->gfx_state->resstate->static_palette[255]; - bgcolor.mask = GFX_MASK_VISUAL; -#endif - s->titlebar_port = new GfxPort(s->visual, gfx_rect(0, 0, 320, 10), fgcolor, bgcolor); - } else { - s->titlebar_port = new GfxPort(s->visual, gfx_rect(0, 0, 320, 10), s->ega_colors[0], s->ega_colors[15]); - } - s->titlebar_port->_color.mask |= GFX_MASK_PRIORITY; - s->titlebar_port->_color.priority = 11; - s->titlebar_port->_bgcolor.mask |= GFX_MASK_PRIORITY; - s->titlebar_port->_bgcolor.priority = 11; - s->titlebar_port->_flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH; - - // but this is correct - s->picture_port = new GfxPort(s->visual, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent); - - s->visual->add((GfxContainer *)s->visual, s->wm_port); - s->visual->add((GfxContainer *)s->visual, s->titlebar_port); - s->visual->add((GfxContainer *)s->visual, s->picture_port); - s->visual->add((GfxContainer *)s->visual, s->iconbar_port); - // Add ports to visual - - s->port = s->picture_port; // Currently using the picture port - -#if 0 - s->titlebar_port->_bgcolor.mask |= GFX_MASK_PRIORITY; - s->titlebar_port->_bgcolor.priority = 11; // Standard priority for the titlebar port -#endif - - s->priority_first = 42; // Priority zone 0 ends here - - if (s->usesOldGfxFunctions()) - s->priority_last = 200; - else - s->priority_last = 190; - - return 0; -} - -int game_init_graphics(EngineState *s) { - return _reset_graphics_input(s); -} - -static void _free_graphics_input(EngineState *s) { - debug(2, "Freeing graphics"); - - delete s->visual; - - s->wm_port = s->titlebar_port = s->picture_port = NULL; - s->visual = NULL; - s->dyn_views = NULL; - s->port = NULL; -} -#endif - #ifdef USE_OLD_MUSIC_FUNCTIONS int game_init_sound(EngineState *s, int sound_flags, SciVersion soundVersion) { if (getSciVersion() > SCI_VERSION_0_LATE) @@ -358,10 +227,6 @@ int script_init_engine(EngineState *s) { debug(2, "Engine initialized"); -#ifdef INCLUDE_OLDGFX - s->pic_priority_table = NULL; -#endif - return 0; } @@ -401,10 +266,6 @@ int game_init(EngineState *s) { s->parserIsValid = false; // Invalidate parser s->parser_event = NULL_REG; // Invalidate parser event -#ifdef INCLUDE_OLDGFX - if (s->gfx_state && _reset_graphics_input(s)) - return 1; -#endif // Initialize menu TODO: Actually this should be another init() s->_gui->menuReset(); @@ -430,10 +291,6 @@ int game_init(EngineState *s) { debug(2, " \"%s\" at %04x:%04x", s->_gameId.c_str(), PRINT_REG(s->_gameObj)); -#ifdef INCLUDE_OLDGFX - s->_menubar = new Menubar(); // Create menu bar -#endif - #ifdef USE_OLD_MUSIC_FUNCTIONS if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND) game_init_sound(s, 0, s->detectDoSoundType()); @@ -472,12 +329,6 @@ int game_exit(EngineState *s) { // TODO Free scripts here -#ifdef INCLUDE_OLDGFX - delete s->_menubar; - - _free_graphics_input(s); -#endif - // Close all opened file handles s->_fileHandles.clear(); s->_fileHandles.resize(5); diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index 7c7bc7c084..4619f29f40 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -26,7 +26,6 @@ #include "sci/sci.h" #include "sci/engine/state.h" #include "sci/engine/kernel.h" -#include "sci/gfx/operations.h" #include "sci/console.h" #include "sci/debug.h" // for g_debug_simulated_key #include "sci/event.h" diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index f909ab5f13..ff3783db79 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -33,7 +33,6 @@ #include "sci/video/seq_decoder.h" #include "sci/engine/state.h" #include "sci/engine/kernel.h" -#include "sci/gfx/operations.h" #include "sci/gui/gui.h" #include "sci/gui/gui_animate.h" #include "sci/gui/gui_cursor.h" @@ -295,9 +294,6 @@ reg_t kGraph(EngineState *s, int argc, reg_t *argv) { warning("Unsupported kGraph() operation %04x", argv[0].toSint16()); } -#ifdef INCLUDE_OLDGFX - gfxop_update(s->gfx_state); -#endif return s->r_acc; } diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 4074e81ba0..b3ed6d03e0 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -27,11 +27,6 @@ #include "sci/resource.h" #include "sci/engine/state.h" #include "sci/engine/kernel.h" -#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/gui/gui.h" #include "sci/gui/gui_cursor.h" diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index 51fe7b887c..16ef002e66 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -168,10 +168,6 @@ reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) { victim_obj->markAsFreed(); -#ifdef INCLUDE_OLDGFX - _k_view_list_mark_free(s, victim_addr); // Free on view list, if neccessary -#endif - return s->r_acc; } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 9ec79dd2c0..cd8b738bde 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -31,10 +31,6 @@ #include "sci/sci.h" #include "sci/event.h" -#ifdef INCLUDE_OLDGFX -#include "sci/gfx/menubar.h" -#include "sci/gfx/gfx_state_internal.h" // required for GfxPort, GfxContainer -#endif #include "sci/engine/state.h" #include "sci/engine/message.h" @@ -217,39 +213,6 @@ void syncWithSerializer(Common::Serializer &s, reg_t &obj) { sync_reg_t(s, obj); } - -#ifdef INCLUDE_OLDGFX - -void MenuItem::saveLoadWithSerializer(Common::Serializer &s) { - s.syncAsSint32LE(_type); - s.syncString(_keytext); - s.skip(4, VER(9), VER(9)); // OBSOLETE: Used to be keytext_size - - s.syncAsSint32LE(_flags); - s.syncBytes(_said, MENU_SAID_SPEC_SIZE); - sync_reg_t(s, _saidPos); - s.syncString(_text); - sync_reg_t(s, _textPos); - s.syncAsSint32LE(_modifiers); - s.syncAsSint32LE(_key); - s.syncAsSint32LE(_enabled); - s.syncAsSint32LE(_tag); -} - -void Menu::saveLoadWithSerializer(Common::Serializer &s) { - s.syncString(_title); - s.syncAsSint32LE(_titleWidth); - s.syncAsSint32LE(_width); - - 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); @@ -360,16 +323,6 @@ 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 - // FIXME: This code goes out of sync when loading. Find out why - // OBSOLETE: Saved menus. Skip all of the saved data if (s.getVersion() < 14) { int totalMenus = 0; @@ -398,7 +351,6 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) { } } } -#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 @@ -416,11 +368,6 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsSint16LE(picPortRect.right); s.syncAsSint16LE(picPortTop); s.syncAsSint16LE(picPortLeft); - - #ifndef USE_OLDGFX - if (s.isLoading()) - _gui->setPortPic(picPortRect, picPortTop, picPortLeft, true); - #endif } sync_SegManagerPtr(s, resMan, _segMan); @@ -825,9 +772,6 @@ void SegManager::reconstructScripts(EngineState *s) { } } } -#ifdef INCLUDE_OLDGFX -int _reset_graphics_input(EngineState *s); -#endif #ifdef USE_OLD_MUSIC_FUNCTIONS static void reconstruct_sounds(EngineState *s) { @@ -912,7 +856,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->_event = new SciEvent(); // Copy some old data - retval->gfx_state = s->gfx_state; retval->_soundCmd = s->_soundCmd; retval->saveLoadWithSerializer(ser); // FIXME: Error handling? @@ -925,10 +868,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->execution_stack_base = 0; // Now copy all current state information -#ifdef INCLUDE_OLDGFX - // Graphics and input state: - retval->old_screen = 0; -#endif #ifdef USE_OLD_MUSIC_FUNCTIONS temp = retval->_sound._songlib; @@ -947,9 +886,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->gc_countdown = GC_INTERVAL - 1; retval->sys_strings_segment = retval->_segMan->findSegmentByType(SEG_TYPE_SYS_STRINGS); retval->sys_strings = (SystemStrings *)GET_SEGMENT(*retval->_segMan, retval->sys_strings_segment, SEG_TYPE_SYS_STRINGS); -#ifdef INCLUDE_OLDGFX - _reset_graphics_input(retval); -#endif // Time state: retval->last_wait_time = g_system->getMillis(); @@ -964,9 +900,6 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) { retval->bp_list = s->bp_list; retval->successor = NULL; -#ifdef INCLUDE_OLDGFX - retval->pic_priority_table = (int *)(retval->gfx_state->pic) ? retval->gfx_state->pic->priorityTable : NULL; -#endif retval->_gameId = s->_gameId; #ifdef USE_OLD_MUSIC_FUNCTIONS diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 98ef8715ab..0cef76836f 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -35,37 +35,10 @@ namespace Sci { EngineState::EngineState(ResourceManager *res, Kernel *kernel, Vocabulary *voc, SegManager *segMan, SciGui *gui, AudioPlayer *audio) : resMan(res), _kernel(kernel), _voc(voc), _segMan(segMan), _gui(gui), _audio(audio), _dirseeker(this) { - gfx_state = 0; - sfx_init_flags = 0; restarting_flags = 0; -#ifdef INCLUDE_OLDGFX - pic_priority_table = 0; - pic_not_valid = 0; - pic_is_new = 0; - old_screen = 0; - port = 0; - memset(ega_colors, 0, sizeof(ega_colors)); - visual = 0; - titlebar_port = 0; - wm_port = 0; - picture_port = 0; - iconbar_port = 0; - - pic_visible_map = GFX_MASK_NONE; - pic_animate = 0; - - dyn_views = 0; - drop_views = 0; - - priority_first = 0; - priority_last = 0; - - _menubar = 0; -#endif - last_wait_time = 0; _fileHandles.resize(5); diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index ddfebddf19..61f3aa68f2 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -41,7 +41,6 @@ namespace Common { #include "sci/engine/kernel.h" // for kfunct_sig_pair_t #include "sci/engine/script.h" #include "sci/engine/seg_manager.h" -#include "sci/gfx/gfx_system.h" #include "sci/sfx/audio.h" #ifdef USE_OLD_MUSIC_FUNCTIONS #include "sci/sfx/iterator/core.h" @@ -148,8 +147,6 @@ public: SciEvent *_event; // Event handling - GfxState *gfx_state; /**< Graphics state and driver */ - AudioPlayer *_audio; #ifdef USE_OLD_MUSIC_FUNCTIONS SfxState _sound; /**< sound subsystem */ @@ -159,35 +156,6 @@ public: byte restarting_flags; /**< Flags used for restarting */ -#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" */ - byte pic_is_new; /**< New pic was loaded or port was opened */ - gfx_pixmap_t *old_screen; /**< Old screen content: Stored during kDrawPic() for kAnimate() */ - - GfxPort *port; /**< The currently active port */ - - gfx_color_t ega_colors[16]; /**< The 16 EGA colors- for SCI0(1) */ - - GfxVisual *visual; /**< A visual widget, containing all ports */ - - GfxPort *titlebar_port; /**< Title bar viewport (0,0,9,319) */ - GfxPort *wm_port; /**< window manager viewport and designated &heap[0] view (10,0,199,319) */ - GfxPort *picture_port; /**< The background picture viewport (10,0,199,319) */ - GfxPort *iconbar_port; /**< Full-screen port used for non-clipped icon bar draw in SCI1 */ - - gfx_map_mask_t pic_visible_map; /**< The number of the map to display in update commands */ - int pic_animate; /**< The animation used by Animate() to display the picture */ - - GfxList *dyn_views; /**< Pointers to pic and dynamic view lists */ - GfxList *drop_views; /**< A list Animate() can dump dropped dynviews into */ - - int priority_first; /**< The line where priority zone 0 ends */ - int priority_last; /**< The line where the highest priority zone starts */ - - 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() */ @@ -310,24 +278,6 @@ private: bool _usesCdTrack; }; -#ifdef INCLUDE_OLDGFX - -/** - * Retrieves the gfx_pixmap_color_t associated with a game color index. - * @param s game state - * @param color color to look up - * @return the requested color - */ -PaletteEntry get_pic_color(EngineState *s, int color); - -/* Functions used in gui32\gui32.cpp */ -reg_t graph_save_box(EngineState *s, rect_t area); -void graph_restore_box(EngineState *s, reg_t handle); -void assert_primary_widget_lists(EngineState *s); -void reparentize_primary_widget_lists(EngineState *s, GfxPort *newport); - -#endif - } // End of namespace Sci #endif // SCI_INCLUDE_ENGINE_H diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index a90528ac16..75b2508f20 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -480,17 +480,6 @@ const char *convertSierraGameId(const char *gameId, uint32 *gameFlags, ResourceM */ int game_init(EngineState *s); -#ifdef INCLUDE_OLDGFX -/** - * Initializes the graphics part of an SCI game - * This function may only be called if game_init() did not initialize - * the graphics data. - * @param[in] s The state to initialize the graphics in - * @return 0 on success, 1 if an error occured - */ -int game_init_graphics(EngineState *s); -#endif - #ifdef USE_OLD_MUSIC_FUNCTIONS /** * Initializes the sound part of an SCI game |