Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12525) gui-win32: obscure cache bug
Home

[Freeciv-Dev] (PR#12525) gui-win32: obscure cache bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12525) gui-win32: obscure cache bug
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Wed, 16 Mar 2005 01:02:48 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12525 >

I encountered a strange bug in the bitmap cache in graphics.c, where if
a sprite's bitmap is placed in the first cache position, then freed,
then a new sprite is created, there is a chance that the new sprite will
have a bitmap created at the same address as the first sprite's, and
thus the cache will think that the bitmap is already cached.  This patch
initializes the cache ids of a new sprite to -1, to prevent such an
event from happening.

This patch also fixes canvas_put_sprite(), as it didn't crop the sprite
before placing it on the canvas.

-James Canete

Attachment: win32-cachefix.diff
Description: Binary data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12525) gui-win32: obscure cache bug, James Canete <=