diff options
author | Willem Jan Palenstijn | 2009-02-28 16:12:52 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-02-28 16:12:52 +0000 |
commit | c388d6c4555ae11e46421ec9f56067306079492d (patch) | |
tree | 0aa8791755bcdab6e4ade1c843d86beb201f9d32 /engines/sci | |
parent | 2d1a6309f85321e7333bc651299b2a70b1f8c44e (diff) | |
download | scummvm-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.cpp | 4 |
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; |