[Scummvm-cvs-logs] SF.net SVN: scummvm:[44765] scummvm/trunk/engines/sci/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Oct 8 00:50:11 CEST 2009
Revision: 44765
http://scummvm.svn.sourceforge.net/scummvm/?rev=44765&view=rev
Author: fingolfin
Date: 2009-10-07 22:50:11 +0000 (Wed, 07 Oct 2009)
Log Message:
-----------
SCI: Replace SciGuiGfx::mallocPort by 'new GuiPort'; also add FIXMES about ports which are not freed, have no valid ID and are not known to the window mgr
Modified Paths:
--------------
scummvm/trunk/engines/sci/gui/gui_gfx.cpp
scummvm/trunk/engines/sci/gui/gui_gfx.h
Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-07 22:45:50 UTC (rev 44764)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2009-10-07 22:50:11 UTC (rev 44765)
@@ -51,24 +51,21 @@
_textFonts = NULL; _textFontsCount = 0;
_textColors = NULL; _textColorsCount = 0;
- _mainPort = mallocPort();
+ // FIXME: _mainPort is never freed
+ // FIXME: _mainPort has no id, and is not known to the WindowManager -- this could lead to problems
+ _mainPort = new GuiPort(0);
SetPort(_mainPort);
OpenPort(_mainPort);
- _menuPort = mallocPort();
+ // FIXME: _menuPort is never freed
+ // FIXME: _menuPort has no id, and is not known to the WindowManager -- this could lead to problems
+ _menuPort = new GuiPort(0);
OpenPort(_menuPort);
SetFont(0);
_menuPort->rect = Common::Rect(0, 0, _screen->_width, _screen->_height);
_menuRect = Common::Rect(0, 0, _screen->_width, 9);
}
-GuiPort *SciGuiGfx::mallocPort() {
- GuiPort *newPort = (GuiPort *)malloc(sizeof(GuiPort));
- assert(newPort);
- memset(newPort, 0, sizeof(GuiPort));
- return newPort;
-}
-
GuiPort *SciGuiGfx::SetPort(GuiPort *newPort) {
GuiPort *oldPort = _curPort;
_curPort = newPort;
Modified: scummvm/trunk/engines/sci/gui/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h 2009-10-07 22:45:50 UTC (rev 44764)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.h 2009-10-07 22:50:11 UTC (rev 44765)
@@ -46,7 +46,6 @@
void init(void);
- GuiPort *mallocPort ();
byte *GetSegment(byte seg);
void ResetScreen();
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