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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 2 16:16:59 CEST 2009


Revision: 41125
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41125&view=rev
Author:   thebluegr
Date:     2009-06-02 14:16:59 +0000 (Tue, 02 Jun 2009)

Log Message:
-----------
Removed the gfxw_new_visual and gfxw_new_port wrappers, moved _kfuncTable inside the Kernel class and moved gfxw_find_port inside the GfxVisual struct

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kernel.h
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kmisc.cpp
    scummvm/trunk/engines/sci/engine/savegame.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/engine/vm.h
    scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
    scummvm/trunk/engines/sci/gfx/gfx_state_internal.h
    scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
    scummvm/trunk/engines/sci/gfx/gfx_widgets.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/console.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -34,7 +34,7 @@
 #include "sci/engine/gc.h"
 #include "sci/gfx/gfx_gui.h"	// for sciw_set_status_bar
 #include "sci/gfx/gfx_state_internal.h"
-#include "sci/gfx/gfx_widgets.h"	// for gfxw_find_port
+#include "sci/gfx/gfx_widgets.h"	// for getPort
 #include "sci/sfx/songlib.h"	// for songlib_t
 #include "sci/vocabulary.h"
 
@@ -647,7 +647,7 @@
 		if (!g_EngineState->visual) {
 			DebugPrintf("Visual is uninitialized\n");
 		} else {
-			port = gfxw_find_port(g_EngineState->visual, atoi(argv[1]));
+			port = g_EngineState->visual->getPort(atoi(argv[1]));
 			if (!port)
 				DebugPrintf("No such port\n");
 			else

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -104,11 +104,11 @@
 		return 1;
 	}
 
-	s->visual = gfxw_new_visual(s->gfx_state, font_nr);
+	s->visual = new GfxVisual(s->gfx_state, font_nr);
 
-	s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
+	s->wm_port = new GfxPort(s->visual, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
 
-	s->iconbar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 200), 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->resmgr->_sciVersion >= SCI_VERSION_01_VGA) {
@@ -124,9 +124,9 @@
 		bgcolor.visual = s->gfx_state->resstate->static_palette[255];
 		bgcolor.mask = GFX_MASK_VISUAL;
 #endif
-		s->titlebar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 10), fgcolor, bgcolor);
+		s->titlebar_port = new GfxPort(s->visual, gfx_rect(0, 0, 320, 10), fgcolor, bgcolor);
 	} else {
-		s->titlebar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 10), s->ega_colors[0], s->ega_colors[15]);
+		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;
@@ -135,7 +135,7 @@
 	s->titlebar_port->_flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH;
 
 	// but this is correct
-	s->picture_port = gfxw_new_port(s->visual, NULL, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
+	s->picture_port = new GfxPort(s->visual, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
 
 	s->_pics.clear();
 
@@ -373,9 +373,6 @@
 	s->_kernel = new Kernel(s->resmgr, (s->flags & GF_SCI0_OLD));
 	s->_vocabulary = new Vocabulary(s->resmgr);
 
-	script_map_kernel(s);
-	// Maps the kernel functions
-
 	s->restarting_flags = SCI_GAME_IS_NOT_RESTARTING;
 
 	s->bp_list = NULL; // No breakpoints defined
@@ -419,8 +416,6 @@
 
 	debug(2, "Freeing state-dependant data");
 
-	s->_kfuncTable.clear();
-
 	delete s->_vocabulary;
 	s->_vocabulary = 0;
 	delete s->_kernel;

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -482,6 +482,9 @@
 		error("Kernel: Could not retrieve selector names");
 	}
 
+	// Map the kernel functions
+	mapFunctions();
+
 	// Map a few special selectors for later use
 	mapSelectors();
 }
@@ -490,6 +493,7 @@
 	_selectorNames.clear();
 	_opcodes.clear();
 	_kernelNames.clear();
+	_kfuncTable.clear();
 }
 
 bool Kernel::loadSelectorNames(bool isOldSci0) {
@@ -652,11 +656,11 @@
 	*s = result; // Write back
 }
 
-int script_map_kernel(EngineState *s) {
+void Kernel::mapFunctions() {
 	int mapped = 0;
 	int ignored = 0;
-	uint functions_nr = s->_kernel->getKernelNamesSize();
-	uint max_functions_nr = (s->resmgr->_sciVersion == SCI_VERSION_0) ? 0x72 : 0x7b;
+	uint functions_nr = getKernelNamesSize();
+	uint max_functions_nr = (_resmgr->_sciVersion == SCI_VERSION_0) ? 0x72 : 0x7b;
 
 	if (functions_nr < max_functions_nr) {
 		warning("SCI version believed to have %d kernel"
@@ -666,14 +670,14 @@
 		functions_nr = max_functions_nr;
 	}
 
-	s->_kfuncTable.resize(functions_nr);
+	_kfuncTable.resize(functions_nr);
 
 	for (uint functnr = 0; functnr < functions_nr; functnr++) {
 		int seeker, found = -1;
 		Common::String sought_name;
 
-		if (functnr < s->_kernel->getKernelNamesSize())
-			sought_name = s->_kernel->getKernelName(functnr);
+		if (functnr < getKernelNamesSize())
+			sought_name = getKernelName(functnr);
 
 		if (!sought_name.empty())
 			for (seeker = 0; (found == -1) && kfunct_mappers[seeker].type != KF_TERMINATOR; seeker++)
@@ -682,27 +686,27 @@
 
 		if (found == -1) {
 			if (!sought_name.empty()) {
-				warning("Kernel function %s[%x] unmapped", s->_kernel->getKernelName(functnr).c_str(), functnr);
-				s->_kfuncTable[functnr].fun = kNOP;
+				warning("Kernel function %s[%x] unmapped", getKernelName(functnr).c_str(), functnr);
+				_kfuncTable[functnr].fun = kNOP;
 			} else {
 				warning("Flagging kernel function %x as unknown", functnr);
-				s->_kfuncTable[functnr].fun = k_Unknown;
+				_kfuncTable[functnr].fun = k_Unknown;
 			}
 
-			s->_kfuncTable[functnr].signature = NULL;
-			s->_kfuncTable[functnr].orig_name = sought_name;
+			_kfuncTable[functnr].signature = NULL;
+			_kfuncTable[functnr].orig_name = sought_name;
 		} else
 			switch (kfunct_mappers[found].type) {
 			case KF_NONE:
-				s->_kfuncTable[functnr].signature = NULL;
+				_kfuncTable[functnr].signature = NULL;
 				++ignored;
 				break;
 
 			case KF_NEW:
-				s->_kfuncTable[functnr].fun = kfunct_mappers[found].fun;
-				s->_kfuncTable[functnr].signature = kfunct_mappers[found].signature;
-				s->_kfuncTable[functnr].orig_name.clear();
-				kernel_compile_signature(&(s->_kfuncTable[functnr].signature));
+				_kfuncTable[functnr].fun = kfunct_mappers[found].fun;
+				_kfuncTable[functnr].signature = kfunct_mappers[found].signature;
+				_kfuncTable[functnr].orig_name.clear();
+				kernel_compile_signature(&(_kfuncTable[functnr].signature));
 				++mapped;
 				break;
 			case KF_TERMINATOR:
@@ -712,12 +716,12 @@
 
 	} // for all functions requesting to be mapped
 
-	sciprintf("Handled %d/%d kernel functions, mapping %d", mapped + ignored, s->_kernel->getKernelNamesSize(), mapped);
+	sciprintf("Handled %d/%d kernel functions, mapping %d", mapped + ignored, getKernelNamesSize(), mapped);
 	if (ignored)
 		sciprintf(" and ignoring %d", ignored);
 	sciprintf(".\n");
 
-	return 0;
+	return;
 }
 
 int determine_reg_type(EngineState *s, reg_t reg, int allow_invalid) {

Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/kernel.h	2009-06-02 14:16:59 UTC (rev 41125)
@@ -51,6 +51,15 @@
 	Common::String name;
 };
 
+/* Generic description: */
+typedef reg_t kfunct(EngineState *s, int funct_nr, int argc, reg_t *argv);
+
+struct kfunct_sig_pair_t {
+	kfunct *fun; /* The actual function */
+	const char *signature;  /* kfunct signature */
+	Common::String orig_name; /* Original name, in case we couldn't map it */
+};
+
 class Kernel {
 public:
 	Kernel(ResourceManager *resmgr, bool isOldSci0);
@@ -84,6 +93,8 @@
 	void dumpScriptClass(char *data, int seeker, int objsize);
 
 	selector_map_t _selectorMap; /**< Shortcut list for important selectors */
+	Common::Array<kfunct_sig_pair_t> _kfuncTable; /**< Table of kernel functions */
+
 private:
 	/**
 	 * Loads the kernel function names.
@@ -107,6 +118,11 @@
 	*/
 	void mapSelectors();
 
+	/* Maps kernel functions
+	** Returns   : (void)
+	*/
+	void mapFunctions();
+
 	/**
 	 * Loads the opcode names (only used for debugging).
 	 * @return true on success, false on failure
@@ -341,18 +357,6 @@
 
 /******************** Kernel functions ********************/
 
-/* Generic description: */
-typedef reg_t kfunct(EngineState *s, int funct_nr, int argc, reg_t *argv);
-
-struct kfunct_sig_pair_t {
-	kfunct *fun; /* The actual function */
-	const char *signature;  /* kfunct signature */
-	Common::String orig_name; /* Original name, in case we couldn't map it */
-};
-
-
-
-
 // New kernel functions
 reg_t kStrLen(EngineState *s, int funct_nr, int argc, reg_t *argv);
 reg_t kGetFarText(EngineState *s, int funct_nr, int argc, reg_t *argv);

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -232,7 +232,7 @@
 
 	while (port_nr > 2 && !(s->port->_flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (gfxw_widget_matches_snapshot(*ptr, s->port))) {
 		// This shouldn't ever happen, actually, since windows (ports w/ ID > 2) should all be immune
-		GfxPort *newport = gfxw_find_port(s->visual, port_nr);
+		GfxPort *newport = s->visual->getPort(port_nr);
 		error("Port %d is not immune against snapshots", s->port->_ID);
 		port_nr--;
 		if (newport)
@@ -1031,10 +1031,10 @@
 	delete s->picture_port;
 	delete s->iconbar_port;
 
-	s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
-	s->picture_port = gfxw_new_port(s->visual, NULL, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
+	s->wm_port = new GfxPort(s->visual, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
+	s->picture_port = new GfxPort(s->visual, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
 
-	s->iconbar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 200), 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;
 
 	s->visual->add((GfxContainer *)s->visual, s->picture_port);
@@ -2345,7 +2345,7 @@
 		   iconbar_port that does not exist in SSCI. */
 		if (port_nr == (unsigned int) - 1) port_nr = s->iconbar_port->_ID;
 
-		new_port = gfxw_find_port(s->visual, port_nr);
+		new_port = s->visual->getPort(port_nr);
 
 		if (!new_port) {
 			error("Invalid port %04x requested", port_nr);
@@ -2431,7 +2431,7 @@
 	GfxPort *goner;
 	GfxPort *pred;
 
-	goner = gfxw_find_port(s->visual, goner_nr);
+	goner = s->visual->getPort(goner_nr);
 	if ((goner_nr < 3) || (goner == NULL)) {
 		error("Removal of invalid window %04x requested", goner_nr);
 		return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -248,7 +248,7 @@
 }
 
 reg_t kNOP(EngineState *s, int funct_nr, int argc, reg_t *argv) {
-	warning("Kernel function 0x%02x (%s) invoked: unmapped", funct_nr, s->_kfuncTable[funct_nr].orig_name.c_str());
+	warning("Kernel function 0x%02x (%s) invoked: unmapped", funct_nr, s->_kernel->_kfuncTable[funct_nr].orig_name.c_str());
 	return NULL_REG;
 }
 

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -837,7 +837,6 @@
 //	s->_kernel = 0;	// FIXME: We should set s->_kernel to 0 here,
 // else it could be freed when the old EngineState is freed. Luckily, this freeing currently
 // never happens, so we don't need to. 
-	retval->_kfuncTable = s->_kfuncTable;
 
 	// Copy breakpoint information from current game instance
 	retval->have_bp = s->have_bp;

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -857,7 +857,7 @@
 			}
 
 			if (opcode == op_callk)
-				sciprintf(" %s[%x]", (param_value < s->_kfuncTable.size()) ?
+				sciprintf(" %s[%x]", (param_value < s->_kernel->_kfuncTable.size()) ?
 							((param_value < s->_kernel->getKernelNamesSize()) ? s->_kernel->getKernelName(param_value).c_str() : "[Unknown(postulated)]")
 							: "<invalid>", param_value);
 			else

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/state.h	2009-06-02 14:16:59 UTC (rev 41125)
@@ -234,8 +234,6 @@
 	SegManager *seg_manager;
 	int gc_countdown; /**< Number of kernel calls until next gc */
 
-	Common::Array<kfunct_sig_pair_t> _kfuncTable; /**< Table of kernel functions */
-
 	MessageState _msgState;
 
 	Vocabulary *_vocabulary;

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -972,7 +972,7 @@
 				s->r_amp_rest = 0; // We just used up the restadjust, remember?
 			}
 
-			if (opparams[0] >= (int)s->_kfuncTable.size()) {
+			if (opparams[0] >= (int)s->_kernel->_kfuncTable.size()) {
 				error("Invalid kernel function 0x%x requested\n", opparams[0]);
 			} else {
 				int argc = ASSERT_ARITHMETIC(xs->sp[0]);
@@ -980,11 +980,11 @@
 				if (!(s->flags & GF_SCI0_OLD))
 					argc += restadjust;
 
-				if (s->_kfuncTable[opparams[0]].signature
-				        && !kernel_matches_signature(s, s->_kfuncTable[opparams[0]].signature, argc, xs->sp + 1)) {
+				if (s->_kernel->_kfuncTable[opparams[0]].signature
+				        && !kernel_matches_signature(s, s->_kernel->_kfuncTable[opparams[0]].signature, argc, xs->sp + 1)) {
 					error("[VM] Invalid arguments to kernel call %x\n", opparams[0]);
 				} else {
-					s->r_acc = s->_kfuncTable[opparams[0]].fun(s, opparams[0], argc, xs->sp + 1);
+					s->r_acc = s->_kernel->_kfuncTable[opparams[0]].fun(s, opparams[0], argc, xs->sp + 1);
 				}
 				// Call kernel function
 

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/engine/vm.h	2009-06-02 14:16:59 UTC (rev 41125)
@@ -1069,13 +1069,6 @@
 ** Returns   : (void)
 */
 
-int script_map_kernel(EngineState *s);
-/* Maps kernel functions
-** Parameters: (EngineState *) s: The state which the _kernelNames are retrieved from
-** Returns   : (void)
-** This function reads from and writes to s. It is called by script_run().
-*/
-
 reg_t kalloc(EngineState *s, const char *type, int space);
 /* Allocates "kernel" memory and returns a handle suitable to be passed on to SCI scripts
 ** Parameters: (EngineState *) s: Pointer to the EngineState to operate on

Modified: scummvm/trunk/engines/sci/gfx/gfx_gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/gfx/gfx_gui.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -171,7 +171,7 @@
 		area.height -= 1; // Normal windows are drawn one pixel too small.
 
 	sciw_make_window_fit(&area, s->wm_port);
-	win = gfxw_new_port(visual, s->wm_port, area, color, bgcolor);
+	win = new GfxPort(visual, area, color, bgcolor);
 
 	win->_font = font;
 	win->title_text = title;

Modified: scummvm/trunk/engines/sci/gfx/gfx_state_internal.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_state_internal.h	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/gfx/gfx_state_internal.h	2009-06-02 14:16:59 UTC (rev 41125)
@@ -345,6 +345,10 @@
 	virtual int draw(const Common::Point &pos);
 	virtual void print(int indentation) const;
 	virtual int setVisual(GfxVisual *);
+
+	GfxPort *getPort(int portId) {
+		return (portId < 0 || portId >= (int)_portRefs.size()) ? NULL : _portRefs[portId];
+	}
 };
 
 #define GFXW_IS_PORT(widget) ((widget)->_type == GFXW_PORT)
@@ -361,6 +365,16 @@
 	byte gray_text; /**< Whether text is 'grayed out' (dithered) */
 
 public:
+	/* Creates a new port widget with the default settings
+	** Paramaters: (GfxVisual *) visual: The visual the port is added to
+	**             (GfxPort *) predecessor: The port's predecessor
+	**             (rect_t) area: The screen area covered by the port (absolute position)
+	**             (gfx_color_t) fgcolor: Foreground drawing color
+	**             (gfx_color_t) bgcolor: Background color
+	** A port differentiates itself from a list in that it contains additional information,
+	** and an optional title (stored in a display list).
+	** Ports are assigned implicit IDs identifying their position within the port stack.
+	*/
 	GfxPort(GfxVisual *visual, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor);
 	~GfxPort();
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.cpp	2009-06-02 14:16:59 UTC (rev 41125)
@@ -1440,10 +1440,6 @@
 	                        _gfxwop_container_add_dirty, _gfxwop_container_add);
 }
 
-GfxVisual *gfxw_new_visual(GfxState *state, int font) {
-	return new GfxVisual(state, font);
-}
-
 GfxVisual::GfxVisual(GfxState *state, int font)
 	: GfxContainer(gfx_rect(0, 0, 320, 200), GFXW_VISUAL) {
 
@@ -1609,10 +1605,6 @@
 	                        _gfxwop_port_add_dirty, _gfxwop_port_add);
 }
 
-GfxPort *gfxw_new_port(GfxVisual *visual, GfxPort *predecessor, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor) {
-	return new GfxPort(visual, area, fgcolor, bgcolor);
-}
-
 GfxPort::GfxPort(GfxVisual *visual_, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor_)
 	: GfxContainer(area, GFXW_PORT) {
 	VERIFY_WIDGET(visual_);
@@ -1659,13 +1651,6 @@
 	return parent;
 }
 
-GfxPort *gfxw_find_port(GfxVisual *visual, int ID) {
-	if (ID < 0 || ID >= (int)visual->_portRefs.size())
-		return NULL;
-
-	return visual->_portRefs[ID];
-}
-
 GfxPort *gfxw_find_default_port(GfxVisual *visual) {
 	int id = visual->_portRefs.size();
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_widgets.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_widgets.h	2009-06-02 11:58:30 UTC (rev 41124)
+++ scummvm/trunk/engines/sci/gfx/gfx_widgets.h	2009-06-02 14:16:59 UTC (rev 41125)
@@ -311,36 +311,6 @@
 ** List widgets are also referred to as Display Lists.
 */
 
-GfxVisual *gfxw_new_visual(GfxState *state, int font);
-/* Creates a new visual widget
-** Parameters: (GfxState *) state: The graphics state
-**             (int) font: The default font number for contained ports
-** Returns   : (GfxList *) A newly allocated visual widget
-** Visual widgets are containers for port widgets.
-*/
-
-
-GfxPort *gfxw_new_port(GfxVisual *visual, GfxPort *predecessor, rect_t area, gfx_color_t fgcolor, gfx_color_t bgcolor);
-/* Creates a new port widget with the default settings
-** Paramaters: (GfxVisual *) visual: The visual the port is added to
-**             (GfxPort *) predecessor: The port's predecessor
-**             (rect_t) area: The screen area covered by the port (absolute position)
-**             (gfx_color_t) fgcolor: Foreground drawing color
-**             (gfx_color_t) bgcolor: Background color
-** Returns   : (GfxPort *) A newly allocated port widget
-** A port differentiates itself from a list in that it contains additional information,
-** and an optional title (stored in a display list).
-** Ports are assigned implicit IDs identifying their position within the port stack.
-*/
-
-GfxPort *gfxw_find_port(GfxVisual *visual, int ID);
-/* Retrieves a port with the specified ID
-** Parameters: (GfxVisual *) visual: The visual the port is to be retrieved from
-**             (int) ID: The port's ID
-** Returns   : (GfxPort *) The requested port, or NULL if it didn't exist
-** This function is O(1).
-*/
-
 GfxPort *gfxw_find_default_port(GfxVisual *visual);
 /* Retrieves the default port from a visual
 ** Parameters: (GfxVisual *) visual: The visual the port should be retrieved from


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