aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-02-28 16:12:52 +0000
committerWillem Jan Palenstijn2009-02-28 16:12:52 +0000
commitc388d6c4555ae11e46421ec9f56067306079492d (patch)
tree0aa8791755bcdab6e4ade1c843d86beb201f9d32 /engines/sci
parent2d1a6309f85321e7333bc651299b2a70b1f8c44e (diff)
downloadscummvm-rg350-c388d6c4555ae11e46421ec9f56067306079492d.tar.gz
scummvm-rg350-c388d6c4555ae11e46421ec9f56067306079492d.tar.bz2
scummvm-rg350-c388d6c4555ae11e46421ec9f56067306079492d.zip
Increase colour refcount when allocating colour
svn-id: r38974
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/gfx/gfx_tools.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp
index 86229372ee..d500edacb0 100644
--- a/engines/sci/gfx/gfx_tools.cpp
+++ b/engines/sci/gfx/gfx_tools.cpp
@@ -292,6 +292,8 @@ int gfx_alloc_color(gfx_palette_t *pal, gfx_pixmap_color_t *color) {
if (dr == 0 && dg == 0 && db == 0) {
color->global_index = i;
+ if (pal->colors[i].lockers != GFX_COLOR_SYSTEM)
+ pal->colors[i].lockers++;
return GFX_OK;
}
@@ -316,6 +318,8 @@ int gfx_alloc_color(gfx_palette_t *pal, gfx_pixmap_color_t *color) {
}
color->global_index = bestcolor;
+ if (pal->colors[bestcolor].lockers != GFX_COLOR_SYSTEM)
+ pal->colors[bestcolor].lockers++;
//GFXWARN("Out of palette colors- doing approximated mapping");
return GFX_OK;