aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-10-07 22:50:11 +0000
committerMax Horn2009-10-07 22:50:11 +0000
commite8a13197e3958b7d8472c8519cb060407266eb14 (patch)
tree2379898ca2646fb1afca65ce183dd9005f13bfce
parent623098c393eaad1f85240c4b393b88da7f46b43f (diff)
downloadscummvm-rg350-e8a13197e3958b7d8472c8519cb060407266eb14.tar.gz
scummvm-rg350-e8a13197e3958b7d8472c8519cb060407266eb14.tar.bz2
scummvm-rg350-e8a13197e3958b7d8472c8519cb060407266eb14.zip
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
svn-id: r44765
-rw-r--r--engines/sci/gui/gui_gfx.cpp15
-rw-r--r--engines/sci/gui/gui_gfx.h1
2 files changed, 6 insertions, 10 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 81c126dbd3..1cfe3f3a5a 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -51,24 +51,21 @@ void SciGuiGfx::init() {
_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;
diff --git a/engines/sci/gui/gui_gfx.h b/engines/sci/gui/gui_gfx.h
index 05ef4d46b5..0caa317e83 100644
--- a/engines/sci/gui/gui_gfx.h
+++ b/engines/sci/gui/gui_gfx.h
@@ -46,7 +46,6 @@ public:
void init(void);
- GuiPort *mallocPort ();
byte *GetSegment(byte seg);
void ResetScreen();