[Scummvm-cvs-logs] SF.net SVN: scummvm:[45337] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Oct 22 17:12:55 CEST 2009


Revision: 45337
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45337&view=rev
Author:   thebluegr
Date:     2009-10-22 15:12:54 +0000 (Thu, 22 Oct 2009)

Log Message:
-----------
Cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/operations.h
    scummvm/trunk/engines/sci/gui32/gui32.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-10-22 15:12:54 UTC (rev 45337)
@@ -432,7 +432,7 @@
 	int view = GET_SEL32V(segMan, obj, view);
 	int cel = 0xffff;
 
-	gfxop_check_cel(s->gfx_state, view, &loop, &cel);
+	s->gfx_state->gfxResMan->getView(view, &loop, &cel, 0);
 
 	debugC(2, kDebugLevelGraphics, "NumCels(view.%d, %d) = %d\n", view, loop, cel + 1);
 

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-10-22 15:12:54 UTC (rev 45337)
@@ -781,7 +781,7 @@
 	retval->bp_list = s->bp_list;
 
 	retval->successor = NULL;
-	retval->pic_priority_table = (int *)gfxop_get_pic_metainfo(retval->gfx_state);
+	retval->pic_priority_table = (int *)(retval->gfx_state->pic) ? retval->gfx_state->pic->priorityTable : NULL;
 	retval->_gameName = s->_gameName;
 
 	retval->_sound._it = NULL;

Modified: scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-10-22 15:12:54 UTC (rev 45337)
@@ -345,7 +345,7 @@
 	GfxText *text_handle;
 
 	GfxList *list;
-	int cursor_height = gfxop_get_font_height(port->_visual->_gfxState, font);
+	int cursor_height = port->_visual->_gfxState->gfxResMan->getFont(font)->line_height;
 
 	zone.x--;
 	zone.y--;
@@ -453,7 +453,7 @@
 
 	list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0);
 
-	font_height = gfxop_get_font_height(port->_visual->_gfxState, font_nr);
+	font_height = port->_visual->_gfxState->gfxResMan->getFont(font_nr)->line_height;
 	columns = (zone.height - 20);
 
 	columns /= font_height;

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-10-22 15:12:54 UTC (rev 45337)
@@ -776,7 +776,7 @@
 		if (!state) {
 			error("Attempt to free text without supplying mode to free it from!\n");
 		} else {
-			gfxop_free_text(state, _textHandle);
+			delete _textHandle;
 			_textHandle = NULL;
 		}
 	}

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-10-22 15:12:54 UTC (rev 45337)
@@ -1316,13 +1316,6 @@
 	return view->loops[real_loop].cels_nr;
 }
 
-void gfxop_check_cel(GfxState *state, int nr, int *loop, int *cel) {
-	gfxr_view_t *testView = state->gfxResMan->getView(nr, loop, cel, 0);
-
-	if (!testView)
-		error("[GFX] Attempt to verify loop/cel values for invalid view %d", nr);
-}
-
 void gfxop_get_cel_parameters(GfxState *state, int nr, int loop, int cel, int *width, int *height, Common::Point *offset) {
 	gfxr_view_t *view = NULL;
 	gfx_pixmap_t *pxm = NULL;
@@ -1409,10 +1402,6 @@
 	state->driver->setStaticBuffer(state->pic->visual_map, state->pic->priority_map);
 }
 
-int *gfxop_get_pic_metainfo(GfxState *state) {
-	return (state->pic) ? state->pic->priorityTable : NULL;
-}
-
 void gfxop_new_pic(GfxState *state, int nr, int flags, int default_palette) {
 	state->gfxResMan->tagResources();
 	state->tag_mode = 1;
@@ -1460,17 +1449,6 @@
 
 // Text operations
 
-// FIXME: only the resstate member of state is used -- inline the reference by:
-// replacing GfxState* state parameter with gfx_resstate_t* gfxResourceState and adjust callers accordingly
-int gfxop_get_font_height(GfxState *state, int font_nr) {
-	gfx_bitmap_font_t *font = state->gfxResMan->getFont(font_nr);
-
-	if (!font)
-		error("gfxop_get_font_height(): Font number %d not found", font_nr);
-
-	return font->line_height;
-}
-
 void gfxop_get_text_params(GfxState *state, int font_nr, const char *text, int maxwidth, int *width, int *height, int text_flags,
 						  int *lines_nr, int *lineheight, int *lastline_width) {
 	Common::Array<TextFragment> fragments;
@@ -1566,10 +1544,6 @@
 	return handle;
 }
 
-void gfxop_free_text(GfxState *state, TextHandle *handle) {
-	delete handle;
-}
-
 TextHandle::TextHandle() {
 	line_height = 0;
 	font = 0;
@@ -1686,8 +1660,4 @@
 	                                   200*state->driver->getMode()->scaleFactor), 0, NULL, NULL);
 }
 
-void gfxop_free_pixmap(GfxState *state, gfx_pixmap_t *pxm) {
-	gfx_free_pixmap(pxm);
-}
-
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gfx/operations.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.h	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/gfx/operations.h	2009-10-22 15:12:54 UTC (rev 45337)
@@ -371,19 +371,6 @@
 int gfxop_lookup_view_get_cels(GfxState *state, int nr, int loop);
 
 /**
- * Clips the view/loop/cel position of a cel.
- *
- * *loop is clipped first, then *cel. The resulting setup will be a valid view
- * configuration.
- *
- * @param[in] state	The state to use
- * @param[in] nr	Number of the view to use
- * @param[in] loop	Pointer to the variable storing the loop number to verify
- * @param[in] cel	Pointer to the variable storing the cel number to check
- */
-void gfxop_check_cel(GfxState *state, int nr, int *loop, int *cel);
-
-/**
  * Retrieves the width and height of a cel.
  *
  * @param[in] state		The state to use
@@ -465,16 +452,6 @@
 void gfxop_new_pic(GfxState *state, int nr, int flags, int default_palette);
 
 /**
- * Retrieves all meta-information assigned to the current pic.
- *
- * @param[in] state	The state affected
- * @return			NULL if the pic doesn't exist or has no meta-information,
- * 					the meta-info otherwise. This meta-information is referred
- * 					to as 'internal data' in the pic code
- */
-int *gfxop_get_pic_metainfo(GfxState *state);
-
-/**
  * Adds a pic to the static buffer.
  *
  * @param[in] state				The state affected
@@ -487,18 +464,8 @@
 
 
 /** @name Text operations */
-/** @{ */
 
 /**
- * Returns the fixed line height for one specified font.
- *
- * @param[in] state		The state to work on
- * @param[in] font_nr	Number of the font to inspect
- * @return				The font line height
- */
-int gfxop_get_font_height(GfxState *state, int font_nr);
-
-/**
  * Calculates the width and height of a specified text in a specified
  * font.
  *
@@ -546,14 +513,6 @@
 	gfx_color_t bg_color, int flags);
 
 /**
- * Frees a previously allocated text handle and all related resources.
- *
- * @param[in] state		The state to use
- * @param[in] handle	The handle to free
- */
-void gfxop_free_text(GfxState *state, TextHandle *handle);
-
-/**
  * Draws text stored in a text handle.
  *
  * @param[in] state		The target state
@@ -591,13 +550,6 @@
 void gfxop_draw_pixmap(GfxState *state, gfx_pixmap_t *pxm, rect_t zone,
 	Common::Point pos);
 
-/**
- * Frees a pixmap returned by gfxop_grab_pixmap().
- *
- * @param[in] state	The affected state
- * @param[in] pxm	The pixmap to free
- */
-void gfxop_free_pixmap(GfxState *state, gfx_pixmap_t *pxm);
 /** @} */
 
 

Modified: scummvm/trunk/engines/sci/gui32/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-22 12:04:56 UTC (rev 45336)
+++ scummvm/trunk/engines/sci/gui32/gui32.cpp	2009-10-22 15:12:54 UTC (rev 45337)
@@ -896,7 +896,7 @@
 	gfxop_disable_dirty_frames(_s->gfx_state);
 
 	if (NULL != _s->old_screen) {
-		gfxop_free_pixmap(_s->gfx_state, _s->old_screen);
+		gfx_free_pixmap(_s->old_screen);
 	}
 
 	_s->old_screen = gfxop_grab_pixmap(_s->gfx_state, gfx_rect(0, 10, 320, 190));
@@ -924,7 +924,7 @@
 
 	_s->port = _s->picture_port;
 
-	_s->pic_priority_table = gfxop_get_pic_metainfo(_s->gfx_state);
+	_s->pic_priority_table = (_s->gfx_state->pic) ? _s->gfx_state->pic->priorityTable : NULL;
 
 	_s->pic_animate = animationNr; // The animation used during kAnimate() later on
 
@@ -947,8 +947,7 @@
 	int cel = celNo;
 	GfxView *new_view;
 
-	gfxop_check_cel(_s->gfx_state, viewId, &loop, &cel);
-
+	_s->gfx_state->gfxResMan->getView(viewId, &loop, &cel, 0);
 	debugC(2, kDebugLevelGraphics, "DrawCel((%d,%d), (view.%d, %d, %d), p=%d)\n", leftPos, topPos, viewId, loop, cel, priority);
 
 	new_view = gfxw_new_view(_s->gfx_state, Common::Point(leftPos, topPos), viewId, loop, cel, 0, priority, -1,
@@ -1416,7 +1415,7 @@
 		gfxop_sleep(_s->gfx_state, 50);
 	}
 
-	gfxop_free_pixmap(_s->gfx_state, screen);
+	gfx_free_pixmap(screen);
 	gfxop_update(_s->gfx_state);
 }
 
@@ -1485,7 +1484,7 @@
 		palette = 0;
 
 	// Clip loop and cel, write back if neccessary
-	gfxop_check_cel(_s->gfx_state, view_nr, &loop, &cel);
+	_s->gfx_state->gfxResMan->getView(view_nr, &loop, &cel, 0);
 
 	if (loop != oldloop)
 		loop = 0;
@@ -2449,8 +2448,8 @@
 
 	}
 
-	gfxop_free_pixmap(_s->gfx_state, _s->old_screen);
-	gfxop_free_pixmap(_s->gfx_state, newscreen);
+	gfx_free_pixmap(_s->old_screen);
+	gfx_free_pixmap(newscreen);
 	_s->old_screen = NULL;
 }
 


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