diff options
author | Max Horn | 2009-04-27 12:29:51 +0000 |
---|---|---|
committer | Max Horn | 2009-04-27 12:29:51 +0000 |
commit | 5881abb213449ad8ac169c4dea729b7e7bca535f (patch) | |
tree | 9bd588749495607dbfe4168328834d19dbcf2e82 /engines | |
parent | 3817fbf7d05b7f4f79640681a7a3b01b0e338343 (diff) | |
download | scummvm-rg350-5881abb213449ad8ac169c4dea729b7e7bca535f.tar.gz scummvm-rg350-5881abb213449ad8ac169c4dea729b7e7bca535f.tar.bz2 scummvm-rg350-5881abb213449ad8ac169c4dea729b7e7bca535f.zip |
SCI: Removed unused vars; doxygenified some comments; cleanup
svn-id: r40159
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 20 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/state.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/state.h | 202 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_state_internal.h | 73 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_widgets.cpp | 15 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 1 |
7 files changed, 153 insertions, 164 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 076ddbf3c0..9c7da403ac 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -797,7 +797,7 @@ reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) { if ((illegal_bits & 0x8000) // If we are vulnerable to those views at all... && s->dyn_views) { // ...check against all stop-updated dynviews - GfxDynView *widget = (GfxDynView *) s->dyn_views->_contents; + GfxDynView *widget = (GfxDynView *)s->dyn_views->_contents; SCIkdebug(SCIkBRESEN, "Checking vs dynviews:\n"); @@ -808,7 +808,7 @@ reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) { if (collides_with(s, abs_zone, make_reg(widget->_ID, widget->_subID), 1, GASEOUS_VIEW_MASK_ACTIVE, funct_nr, argc, argv)) return not_register(s, NULL_REG); - widget = (GfxDynView *) widget->_next; + widget = (GfxDynView *)widget->_next; } } @@ -1767,7 +1767,7 @@ static void _k_view_list_do_postdraw(EngineState *s, GfxList *list) { *((reg_t *)(widget->signalp)) = make_reg(0, widget->signal & 0xffff); /* Write back signal */ } - widget = (GfxDynView *) widget->_next; + widget = (GfxDynView *)widget->_next; } } @@ -1800,7 +1800,7 @@ int _k_view_list_dispose_loop(EngineState *s, List *list, GfxDynView *widget, in if (widget) { int retval; // Recurse: - retval = _k_view_list_dispose_loop(s, list, (GfxDynView *) widget->_next, funct_nr, argc, argv); + retval = _k_view_list_dispose_loop(s, list, (GfxDynView *)widget->_next, funct_nr, argc, argv); if (retval == -1) // Bail out on annihilation, rely on re-start from Animate() return -1; @@ -2014,7 +2014,7 @@ static void _k_make_view_list(EngineState *s, GfxList **widget_list, List *list, if (widget->signalp) widget->signal = ((reg_t *)(widget->signalp))->offset; - widget = (GfxDynView *) widget->_next; + widget = (GfxDynView *)widget->_next; } } @@ -2098,7 +2098,7 @@ static void _k_prepare_view_list(EngineState *s, GfxList *list, int options) { fprintf(stderr, "Unsetting magic StopUpd for view "PREG"\n", PRINT_REG(obj)); } */ - view = (GfxDynView *) view->_next; + view = (GfxDynView *)view->_next; } } @@ -2118,7 +2118,7 @@ static void _k_update_signals_in_view_list(GfxList *old_list, GfxList *new_list) while (new_widget && (new_widget->_ID != old_widget->_ID || new_widget->_subID != old_widget->_subID)) - new_widget = (GfxDynView *) new_widget->_next; + new_widget = (GfxDynView *)new_widget->_next; if (new_widget) { int carry = old_widget->signal & _K_VIEW_SIG_FLAG_STOPUPD; @@ -2137,7 +2137,7 @@ static void _k_update_signals_in_view_list(GfxList *old_list, GfxList *new_list) old_widget->signal = new_widget->signal |= carry; } - old_widget = (GfxDynView *) old_widget->_next; + old_widget = (GfxDynView *)old_widget->_next; } } @@ -2212,7 +2212,7 @@ static void _k_redraw_view_list(EngineState *s, GfxList *list) { SCIkdebug(SCIkGRAPHICS, " -> signal %04x\n", view->signal); - view = (GfxDynView *) view->_next; + view = (GfxDynView *)view->_next; } } @@ -2265,7 +2265,7 @@ void _k_draw_view_list(EngineState *s, GfxList *list, int flags) { // disposeables and this one isn't disposeable } - widget = (GfxDynView *) widget->_next; + widget = (GfxDynView *)widget->_next; } // while (widget) } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index e912c4ab4d..1396f448c8 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -510,9 +510,6 @@ int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename meta.savegame_time = ((curTime.tm_hour & 0xFF) << 16) | (((curTime.tm_min) & 0xFF) << 8) | ((curTime.tm_sec) & 0xFF); s->savegame_version = CURRENT_SAVEGAME_VERSION; - s->dyn_views_list_serial = (s->dyn_views)? s->dyn_views->_serial : -2; - s->drop_views_list_serial = (s->drop_views)? s->drop_views->_serial : -2; - s->port_serial = (s->port)? s->port->_serial : -2; if (s->execution_stack_base) { sciprintf("Cannot save from below kernel function\n"); diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp index 9c7d2f78bb..2112d070c1 100644 --- a/engines/sci/engine/state.cpp +++ b/engines/sci/engine/state.cpp @@ -70,7 +70,6 @@ EngineState::EngineState() : _dirseeker(this) { save_mouse_pointer_loop = 0; save_mouse_pointer_cel = 0; - port_serial = 0; port = 0; memset(ega_colors, 0, sizeof(ega_colors)); @@ -85,10 +84,8 @@ EngineState::EngineState() : _dirseeker(this) { memset(&pic_visible_map, 0, sizeof(pic_visible_map)); // FIXME: Remove this once/if we C++ify gfx_map_mask_t pic_animate = 0; - dyn_views_list_serial = 0; dyn_views = 0; - drop_views_list_serial = 0; drop_views = 0; animation_delay = 0; diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index fd37c2832b..d37f107c25 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -77,15 +77,17 @@ public: #define CURRENT_SAVEGAME_VERSION 8 #define MINIMUM_SAVEGAME_VERSION 8 -#define MAX_SAVEGAME_NR 20 /* Maximum number of savegames */ +#define MAX_SAVEGAME_NR 20 /**< Maximum number of savegames */ #define MAX_SAVE_DIR_SIZE MAXPATHLEN -/* values for EngineState.restarting_flag */ -#define SCI_GAME_IS_NOT_RESTARTING 0 -#define SCI_GAME_WAS_RESTARTED 1 -#define SCI_GAME_IS_RESTARTING_NOW 2 -#define SCI_GAME_WAS_RESTARTED_AT_LEAST_ONCE 4 +/** values for EngineState.restarting_flag */ +enum { + SCI_GAME_IS_NOT_RESTARTING = 0, + SCI_GAME_WAS_RESTARTED = 1, + SCI_GAME_IS_RESTARTING_NOW = 2, + SCI_GAME_WAS_RESTARTED_AT_LEAST_ONCE = 4 +}; struct drawn_pic_t { int nr; @@ -115,133 +117,128 @@ public: public: int savegame_version; - int widget_serial_counter; /* Used for savegames */ + int widget_serial_counter; /**< Used for savegames */ - ResourceManager *resmgr; /* The resource manager */ + ResourceManager *resmgr; /**< The resource manager */ - Common::String _gameName; /* Designation of the primary object (which inherits from Game) */ + Common::String _gameName; /**< Designation of the primary object (which inherits from Game) */ char *game_version; /* Non-VM information */ - GfxState *gfx_state; /* Graphics state and driver */ - gfx_pixmap_t *old_screen; /* Old screen content: Stored during kDrawPic() for kAnimate() */ + GfxState *gfx_state; /**< Graphics state and driver */ + gfx_pixmap_t *old_screen; /**< Old screen content: Stored during kDrawPic() for kAnimate() */ - sfx_state_t sound; /* sound subsystem */ - int sfx_init_flags; /* flags the sfx subsystem was initialised with */ - unsigned int sound_volume; /* 0x0 -> 0xf Current volume of sound system */ - unsigned int sound_mute; /* 0 = not, else == saved value */ + sfx_state_t sound; /**< sound subsystem */ + int sfx_init_flags; /**< flags the sfx subsystem was initialised with */ + unsigned int sound_volume; /**< 0x0 -> 0xf Current volume of sound system */ + unsigned int sound_mute; /**< 0 = not, else == saved value */ - byte restarting_flags; /* Flags used for restarting */ - byte have_mouse_flag; /* Do we have a hardware pointing device? */ + byte restarting_flags; /**< Flags used for restarting */ + byte have_mouse_flag; /**< Do we have a hardware pointing device? */ - byte pic_not_valid; /* Is 0 if the background picture is "valid" */ - byte pic_is_new; /* New pic was loaded or port was opened */ - byte onscreen_console; /* Use the onscreen console for debugging */ - byte *osc_backup; /* Backup of the pre-onscreen console screen data */ + byte pic_not_valid; /**< Is 0 if the background picture is "valid" */ + byte pic_is_new; /**< New pic was loaded or port was opened */ + byte onscreen_console; /**< Use the onscreen console for debugging */ + byte *osc_backup; /**< Backup of the pre-onscreen console screen data */ - int *pic_priority_table; /* 16 entries with priorities or NULL if not present */ + int *pic_priority_table; /**< 16 entries with priorities or NULL if not present */ /** Text on the status bar, or NULL if the title bar is blank */ Common::String _statusBarText; int status_bar_foreground, status_bar_background; - long game_time; /* Counted at 60 ticks per second, reset during start time */ + long game_time; /**< Counted at 60 ticks per second, reset during start time */ - reg_t save_dir_copy; /* Last copy of the save dir */ - int save_dir_edit_offset; /* For kEdit(): Display offset for editing the savedir */ - char *save_dir_copy_buf; /* Temp savedir buffer for kEdit() */ + reg_t save_dir_copy; /**< Last copy of the save dir */ + int save_dir_edit_offset; /**< For kEdit(): Display offset for editing the savedir */ + char *save_dir_copy_buf; /**< Temp savedir buffer for kEdit() */ - int mouse_pointer_view; /* Mouse pointer resource, or -1 if disabled */ - int mouse_pointer_loop; /* Mouse pointer resource, or -1 if disabled */ - int mouse_pointer_cel; /* Mouse pointer resource, or -1 if disabled */ - int save_mouse_pointer_view; /* Temporary storage for mouse pointer resource, when the pointer is hidden */ - int save_mouse_pointer_loop; /* Temporary storage for mouse pointer resource, when the pointer is hidden */ - int save_mouse_pointer_cel; /* Temporary storage for mouse pointer resource, when the pointer is hidden */ + int mouse_pointer_view; /**< Mouse pointer resource, or -1 if disabled */ + int mouse_pointer_loop; /**< Mouse pointer resource, or -1 if disabled */ + int mouse_pointer_cel; /**< Mouse pointer resource, or -1 if disabled */ + int save_mouse_pointer_view; /**< Temporary storage for mouse pointer resource, when the pointer is hidden */ + int save_mouse_pointer_loop; /**< Temporary storage for mouse pointer resource, when the pointer is hidden */ + int save_mouse_pointer_cel; /**< Temporary storage for mouse pointer resource, when the pointer is hidden */ - int port_serial; /* Port serial number, for save/restore */ - GfxPort *port; /* The currently active port */ + GfxPort *port; /**< The currently active port */ - gfx_color_t ega_colors[16]; /* The 16 EGA colors- for SCI0(1) */ + gfx_color_t ega_colors[16]; /**< The 16 EGA colors- for SCI0(1) */ - GfxVisual *visual; /* A visual widget, containing all ports */ + 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 */ + 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 */ + 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 */ - int dyn_views_list_serial; /* Used for save/restore */ - GfxList *dyn_views; /* Pointers to pic and dynamic view lists */ + GfxList *dyn_views; /**< Pointers to pic and dynamic view lists */ - int drop_views_list_serial; /* Used for save/restore */ - GfxList *drop_views; /* A list Animate() can dump dropped dynviews into */ + GfxList *drop_views; /**< A list Animate() can dump dropped dynviews into */ - long animation_delay; /* A delay factor for pic opening animations. Defaults to 500. */ - int animation_granularity; /* Number of animation steps to perform betwen updates for transition animations */ + long animation_delay; /**< A delay factor for pic opening animations. Defaults to 500. */ + int animation_granularity; /**< Number of animation steps to perform betwen updates for transition animations */ - Menubar *_menubar; /* The menu bar */ + Menubar *_menubar; /**< The menu bar */ - int priority_first; /* The line where priority zone 0 ends */ - int priority_last; /* The line where the highest priority zone starts */ + int priority_first; /**< The line where priority zone 0 ends */ + int priority_last; /**< The line where the highest priority zone starts */ int pics_drawn_nr; int pics_nr; drawn_pic_t *pics; - uint32 game_start_time; /* The time at which the interpreter was started */ - uint32 last_wait_time; /* The last time the game invoked Wait() */ + uint32 game_start_time; /**< The time at which the interpreter was started */ + uint32 last_wait_time; /**< The last time the game invoked Wait() */ - byte version_lock_flag; /* Set to 1 to disable any autodetection mechanisms */ - sci_version_t version; /* The approximated patchlevel of the version to emulate */ + byte version_lock_flag; /**< Set to 1 to disable any autodetection mechanisms */ + sci_version_t version; /**< The approximated patchlevel of the version to emulate */ sci_version_t max_version, min_version; /* Used for autodetect sanity checks */ - unsigned int kernel_opt_flags; /* Kernel optimization flags- used for performance tweaking */ + unsigned int kernel_opt_flags; /**< Kernel optimization flags- used for performance tweaking */ /* Kernel File IO stuff */ - Common::Array<FileHandle> _fileHandles; /* Array of file handles. Dynamically increased if required. */ + Common::Array<FileHandle> _fileHandles; /**< Array of file handles. Dynamically increased if required. */ DirSeeker _dirseeker; /* VM Information */ - ExecStack *execution_stack; /* The execution stack */ - int execution_stack_size; /* Number of stack frames allocated */ - int execution_stack_pos; /* Position on the execution stack */ - int execution_stack_base; /* When called from kernel functions, the vm - ** is re-started recursively on the same stack. - ** This variable contains the stack base for the - ** current vm. - */ - int execution_stack_pos_changed; /* Set to 1 if the execution stack position - ** should be re-evaluated by the vm - */ - - reg_t r_acc; /* Accumulator */ - unsigned int r_amp_rest; /* &rest register (only used for save games) */ - reg_t r_prev; /* previous comparison result */ - - SegmentId stack_segment; /* Heap area for the stack to use */ - StackPtr stack_base; /* Pointer to the least stack element */ - StackPtr stack_top; /* First invalid stack element */ - - SegmentId parser_segment; /* A heap area used by the parser for error reporting */ - reg_t parser_base; /* Base address for the parser error reporting mechanism */ - reg_t parser_event; /* The event passed to Parse() and later used by Said() */ + ExecStack *execution_stack; /**< The execution stack */ + int execution_stack_size; /**< Number of stack frames allocated */ + int execution_stack_pos; /**< Position on the execution stack */ + /** + * When called from kernel functions, the vm is re-started recursively on + * the same stack. This variable contains the stack base for the current vm. + */ + int execution_stack_base; + int execution_stack_pos_changed; /**< Set to 1 if the execution stack position should be re-evaluated by the vm */ + + reg_t r_acc; /**< Accumulator */ + unsigned int r_amp_rest; /**< &rest register (only used for save games) */ + reg_t r_prev; /**< previous comparison result */ + + SegmentId stack_segment; /**< Heap area for the stack to use */ + StackPtr stack_base; /**< Pointer to the least stack element */ + StackPtr stack_top; /**< First invalid stack element */ + + SegmentId parser_segment; /**< A heap area used by the parser for error reporting */ + reg_t parser_base; /**< Base address for the parser error reporting mechanism */ + reg_t parser_event; /**< The event passed to Parse() and later used by Said() */ SegmentId script_000_segment; - Script *script_000; /* script 000, e.g. for globals */ + Script *script_000; /**< script 000, e.g. for globals */ - int parser_lastmatch_word; /* Position of the input word the parser last matched on, or SAID_NO_MATCH */ + int parser_lastmatch_word; /**< Position of the input word the parser last matched on, or SAID_NO_MATCH */ /* Debugger data: */ - Breakpoint *bp_list; /* List of breakpoints */ - int have_bp; /* Bit mask specifying which types of breakpoints are used in bp_list */ - unsigned int debug_mode; /* Contains flags for the various debug modes */ + Breakpoint *bp_list; /**< List of breakpoints */ + int have_bp; /**< Bit mask specifying which types of breakpoints are used in bp_list */ + unsigned int debug_mode; /**< Contains flags for the various debug modes */ /* System strings */ SegmentId sys_strings_segment; @@ -253,39 +250,40 @@ public: WordMap _parserWords; SuffixList _parserSuffixes; Common::Array<parse_tree_branch_t> _parserBranches; - parse_rule_list_t *parser_rules; /* GNF rules used in the parser algorithm */ - parse_tree_node_t parser_nodes[VOCAB_TREE_NODES]; /* The parse tree */ + parse_rule_list_t *parser_rules; /**< GNF rules used in the parser algorithm */ + parse_tree_node_t parser_nodes[VOCAB_TREE_NODES]; /**< The parse tree */ - int parser_valid; /* If something has been correctly parsed */ + int parser_valid; /**< If something has been correctly parsed */ - SynonymList _synonyms; /* The list of synonyms */ + SynonymList _synonyms; /**< The list of synonyms */ - reg_t game_obj; /* Pointer to the game object */ + reg_t game_obj; /**< Pointer to the game object */ - int classtable_size; /* Number of classes in the table- for debugging */ - Class *classtable; /* Table of all classes */ + int classtable_size; /**< Number of classes in the table- for debugging */ + Class *classtable; /**< Table of all classes */ SegManager *seg_manager; - int gc_countdown; /* Number of kernel calls until next gc */ + int gc_countdown; /**< Number of kernel calls until next gc */ Common::StringList _selectorNames; - Common::StringList _kernelNames; /* List of kernel names */ + Common::StringList _kernelNames; /**< List of kernel names */ - Common::Array<kfunct_sig_pair_t> _kfuncTable; /* Table of kernel functions */ + Common::Array<kfunct_sig_pair_t> _kfuncTable; /**< Table of kernel functions */ opcode *opcodes; - selector_map_t selector_map; /* Shortcut list for important selectors */ + selector_map_t selector_map; /**< Shortcut list for important selectors */ - EngineState *successor; /* Successor of this state: Used for restoring */ + EngineState *successor; /**< Successor of this state: Used for restoring */ }; +/** + * 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); -/* Retrieves the gfx_pixmap_color_t associated with a game color index -** Parameters: (EngineState *) s: The game state -** (int) color: The color to look up -** Returns : (gfx_pixmap_color_t *) The requested color. -*/ static inline reg_t not_register(EngineState *s, reg_t r) { if (s->version >= SCI_VERSION_FTU_INVERSE_CANBEHERE) diff --git a/engines/sci/gfx/gfx_state_internal.h b/engines/sci/gfx/gfx_state_internal.h index ab4ad0ab68..22a8e7f97b 100644 --- a/engines/sci/gfx/gfx_state_internal.h +++ b/engines/sci/gfx/gfx_state_internal.h @@ -39,17 +39,17 @@ namespace Sci { #define GFXW_FLAG_CONTAINER (1<<2) #define GFXW_FLAG_DIRTY (1<<3) #define GFXW_FLAG_TAGGED (1<<4) -#define GFXW_FLAG_MULTI_ID (1<<5) /* Means that the ID used herein may be used more than once, i.e. is not unique */ -#define GFXW_FLAG_IMMUNE_TO_SNAPSHOTS (1<<6) /* Snapshot restoring doesn't kill this widget, and +5 bonus to saving throws vs. Death Magic */ -#define GFXW_FLAG_NO_IMPLICIT_SWITCH (1<<7) /* Ports: Don't implicitly switch to this port when disposing windows */ +#define GFXW_FLAG_MULTI_ID (1<<5) /**< Means that the ID used herein may be used more than once, i.e. is not unique */ +#define GFXW_FLAG_IMMUNE_TO_SNAPSHOTS (1<<6) /**< Snapshot restoring doesn't kill this widget, and +5 bonus to saving throws vs. Death Magic */ +#define GFXW_FLAG_NO_IMPLICIT_SWITCH (1<<7) /**< Ports: Don't implicitly switch to this port when disposing windows */ struct gfxw_snapshot_t { - int serial; /* The first serial number to kill */ + int serial; /**< The first serial number to kill */ rect_t area; }; enum gfxw_widget_type_t { - GFXW_, /* Base widget */ + GFXW_, /**< Base widget */ GFXW_BOX, GFXW_RECT, @@ -84,17 +84,17 @@ typedef int gfxw_bin_op(GfxWidget *, GfxWidget *); struct GfxWidget { public: - int _magic; /* Extra check after typecasting */ - int _serial; /* Serial number */ - int _flags; /* Widget flags */ + int _magic; /**< Extra check after typecasting */ + int _serial; /**< Serial number */ + int _flags; /**< Widget flags */ gfxw_widget_type_t _type; - rect_t _bounds; /* Boundaries */ - GfxWidget *_next; /* Next widget in widget list */ - int _ID; /* Unique ID or GFXW_NO_ID */ - int _subID; /* A 'sub-ID', or GFXW_NO_ID */ - GfxContainer *_parent; /* The parent widget, or NULL if not owned */ - GfxVisual *_visual; /* The owner visual */ - int _widgetPriority; /* Drawing priority, or -1 */ + rect_t _bounds; /**< Boundaries */ + GfxWidget *_next; /**< Next widget in widget list */ + int _ID; /**< Unique ID or GFXW_NO_ID */ + int _subID; /**< A 'sub-ID', or GFXW_NO_ID */ + GfxContainer *_parent; /**< The parent widget, or NULL if not owned */ + GfxVisual *_visual; /**< The owner visual */ + int _widgetPriority; /**< Drawing priority, or -1 */ public: GfxWidget(gfxw_widget_type_t type); @@ -228,7 +228,7 @@ public: #define GFXW_IS_VIEW(widget) ((widget)->_type == GFXW_VIEW || (widget)->_type == GFXW_STATIC_VIEW \ || (widget)->_type == GFXW_DYN_VIEW || (widget)->_type == GFXW_PIC_VIEW) struct GfxView : public GfxWidget { - Common::Point _pos; /* Implies the value of 'bounds' in GfxWidget */ + Common::Point _pos; /**< Implies the value of 'bounds' in GfxWidget */ gfx_color_t _color; int _view, _loop, _cel; int _palette; @@ -247,9 +247,9 @@ struct GfxDynView : public GfxView { rect_t draw_bounds; /* The correct position to draw to */ void *under_bitsp, *signalp; int under_bits, signal; - int _z; /* The z coordinate: Added to y, but used for sorting */ - int sequence; /* Sequence number: For sorting */ - int force_precedence; /* Precedence enforcement variable for sorting- defaults to 0 */ + int _z; /**< The z coordinate: Added to y, but used for sorting */ + int sequence; /**< Sequence number: For sorting */ + int force_precedence; /**< Precedence enforcement variable for sorting- defaults to 0 */ bool _isDrawn; // FIXME: This is specific to GFXW_PIC_VIEW @@ -271,7 +271,8 @@ struct GfxText : public GfxWidget { gfx_alignment_t halign, valign; gfx_color_t _color1, _color2, _bgcolor; int _textFlags; - int width, height; /* Real text width and height */ + int width; /**< Real text width */ + int height; /**< Real text height */ gfx_text_handle_t *_textHandle; public: @@ -293,18 +294,18 @@ typedef int gfxw_rect_op(GfxContainer *, rect_t, int); struct GfxContainer : public GfxWidget { - rect_t zone; /* The writeable zone (absolute) for contained objects */ - DirtyRectList _dirtyRects; /* List of dirty rectangles */ + rect_t zone; /**< The writeable zone (absolute) for contained objects */ + DirtyRectList _dirtyRects; /**< List of dirty rectangles */ GfxWidget *_contents; - GfxWidget **_nextpp; /* Pointer to the 'next' pointer in the last entry in contents */ + GfxWidget **_nextpp; /**< Pointer to the 'next' pointer in the last entry in contents */ public: // TODO: Replace the following with virtual methods - gfxw_unary_container_op *free_tagged; /* Free all tagged contained widgets */ - gfxw_unary_container_op *free_contents; /* Free all contained widgets */ - gfxw_rect_op *add_dirty_abs; /* Add an absolute dirty rectangle */ - gfxw_rect_op *add_dirty_rel; /* Add a relative dirty rectangle */ - gfxw_container_op *add; /* Append widget to an appropriate position (for view and control lists) */ + gfxw_unary_container_op *free_tagged; /**< Free all tagged contained widgets */ + gfxw_unary_container_op *free_contents; /**< Free all contained widgets */ + gfxw_rect_op *add_dirty_abs; /**< Add an absolute dirty rectangle */ + gfxw_rect_op *add_dirty_rel; /**< Add a relative dirty rectangle */ + gfxw_container_op *add; /**< Append widget to an appropriate position (for view and control lists) */ public: // FIXME: This should be a virtual base class, mark it so somehow? @@ -333,8 +334,8 @@ public: #define GFXW_IS_VISUAL(widget) ((widget)->_type == GFXW_VISUAL) struct GfxVisual : public GfxContainer { - Common::Array<GfxPort *> _portRefs; /* References to ports */ - int _font; /* Default font */ + Common::Array<GfxPort *> _portRefs; /**< References to ports */ + int _font; /**< Default font */ GfxState *_gfxState; public: @@ -347,16 +348,16 @@ public: #define GFXW_IS_PORT(widget) ((widget)->_type == GFXW_PORT) struct GfxPort : public GfxContainer { - GfxList *_decorations; /* optional window decorations- drawn before the contents */ - GfxWidget *port_bg; /* Port background widget or NULL */ + GfxList *_decorations; /**< optional window decorations - drawn before the contents */ + GfxWidget *port_bg; /**< Port background widget or NULL */ gfx_color_t _color, _bgcolor; int _font; - Common::Point draw_pos; /* Drawing position */ - gfxw_snapshot_t *restore_snap; /* Snapshot to be restored automagically, + Common::Point draw_pos; /**< Drawing position */ + gfxw_snapshot_t *restore_snap; /**< Snapshot to be restored automagically, experimental feature used in the PQ3 interpreter */ - int port_flags; /* interpreter-dependant flags */ + int port_flags; /**< interpreter-dependant flags */ const char *title_text; - byte gray_text; /* Whether text is 'grayed out' (dithered) */ + byte gray_text; /**< Whether text is 'grayed out' (dithered) */ public: GfxPort(GfxVisual *visual, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor); diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp index f7fcc189e9..d90414b622 100644 --- a/engines/sci/gfx/gfx_widgets.cpp +++ b/engines/sci/gfx/gfx_widgets.cpp @@ -1138,16 +1138,13 @@ int GfxContainer::setVisual(GfxVisual *visual) { } static int _gfxwop_container_free_tagged(GfxContainer *container) { - GfxWidget *seekerp = container->_contents; - - while (seekerp) { - GfxWidget *redshirt = seekerp; + GfxWidget *seeker = container->_contents; - if (redshirt->_flags & GFXW_FLAG_TAGGED) { - seekerp = (redshirt->_next); - delete redshirt; - } else - seekerp = seekerp->_next; + while (seeker) { + GfxWidget *next = seeker->_next; + if (seeker->_flags & GFXW_FLAG_TAGGED) + delete seeker; + seeker = next; } return 0; diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 2ba95b1937..4fb814e198 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -240,7 +240,6 @@ Common::Error SciEngine::run() { GfxState gfx_state; gfx_state.driver = &gfx_driver_scummvm; - gamestate->port_serial = 0; gamestate->have_mouse_flag = 1; gamestate->animation_delay = 5; gamestate->animation_granularity = 4; |