From c388d6c4555ae11e46421ec9f56067306079492d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 28 Feb 2009 16:12:52 +0000 Subject: [PATCH] Increase colour refcount when allocating colour svn-id: r38974 --- engines/sci/gfx/gfx_tools.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp index 86229372eef..d500edacb00 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;