aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-08 18:34:49 +0000
committerMartin Kiewitz2009-10-08 18:34:49 +0000
commit03ee8c00beaab731a8e5e4347aa9711eed2523b1 (patch)
tree825b05f21ed3477144edc33124a9105951efb3a3
parentaab278974af34f218d7e3b4977ec259399feaf51 (diff)
downloadscummvm-rg350-03ee8c00beaab731a8e5e4347aa9711eed2523b1.tar.gz
scummvm-rg350-03ee8c00beaab731a8e5e4347aa9711eed2523b1.tar.bz2
scummvm-rg350-03ee8c00beaab731a8e5e4347aa9711eed2523b1.zip
SCI/newgui: remarks about _menuPort, uninitialized usage in SciGuiPalette removed, _menuPort and _mainPort get deleted in destructor
svn-id: r44790
-rw-r--r--engines/sci/gui/gui_gfx.cpp9
-rw-r--r--engines/sci/gui/gui_palette.cpp5
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 4092d364ae..6342e39d2b 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -44,6 +44,8 @@ SciGuiGfx::SciGuiGfx(EngineState *state, SciGuiScreen *screen, SciGuiPalette *pa
}
SciGuiGfx::~SciGuiGfx() {
+ delete _mainPort;
+ delete _menuPort;
}
void SciGuiGfx::init() {
@@ -51,14 +53,13 @@ void SciGuiGfx::init() {
_textFonts = NULL; _textFontsCount = 0;
_textColors = NULL; _textColorsCount = 0;
- // FIXME: _mainPort is never freed
- // FIXME: _mainPort has no id, and is not known to the WindowManager -- this could lead to problems
+ // _mainPort is not known to windowmanager, that's okay according to sierra sci
+ // its not even used currently in our engine
_mainPort = new GuiPort(0);
SetPort(_mainPort);
OpenPort(_mainPort);
- // FIXME: _menuPort is never freed
- // FIXME: _menuPort has no id, and is not known to the WindowManager -- this could lead to problems
+ // _menuPort has actually hardcoded id 0xFFFF. Its not meant to be known to windowmanager according to sierra sci
_menuPort = new GuiPort(0);
OpenPort(_menuPort);
SetFont(0);
diff --git a/engines/sci/gui/gui_palette.cpp b/engines/sci/gui/gui_palette.cpp
index 9872c659f3..e5254f30c9 100644
--- a/engines/sci/gui/gui_palette.cpp
+++ b/engines/sci/gui/gui_palette.cpp
@@ -162,8 +162,9 @@ void SciGuiPalette::setEGA() {
// Now setting colors 16-254 to the correct mix colors that occur when not doing a dithering run on
// finished pictures
for (i = 0x10; i <= 0xFE; i++) {
- _sysPalette.colors[i].used = 1;
- color ^= i << 4;
+ color = i;
+ _sysPalette.colors[color].used = 1;
+ color ^= color << 4;
color1 = i & 0x0F; color2 = i >> 4;
_sysPalette.colors[color].r = (_sysPalette.colors[color1].r >> 1) + (_sysPalette.colors[color2].r >> 1);
_sysPalette.colors[color].g = (_sysPalette.colors[color1].g >> 1) + (_sysPalette.colors[color2].g >> 1);