[Freeciv-Dev] Re: (PR#3746) explosion sprites are loaded twice
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dnia 2003.03.21 09:17 Jason Short napisa³(a):
>
> [jdorje - Tue Mar 18 06:32:36 2003]:
>
> > One thing I just noticed about the new sprite loading code is that
> the
> > unit explosion sprites are loaded twice - once when counting how
> many
> > explosion sprites there are, and a second time when putting them
> into an
> > array. This just means there is an extra reference to the sprite,
> which
> > means if unload_sprite were ever called (outside of
> free_all_sprites) on
> > these sprites we probably wouldn't end up releasing the pixmap
> immediately.
> >
> > The attached patch is a poor solution to this problem.
>
> The attached patch is a better solution.
It's better that my code but I think real solution should be make in
"hash" code.
but we can make this "bool check_sprite(const char *tag_name)" simpler :
/**************************************************************************
Return TRUE iff the specified sprite exists in the tileset (whether
or not it is currently loaded).
**************************************************************************/
bool check_sprite(const char *tag_name)
{
/* Lookup information about where the sprite is found. */
return (hash_lookup_data(sprite_hash, tag_name) != NULL);
}
Secundo :
What do you think about server citizens code ?
Rafal
----------------------------------------------------------------------
Szukam kochanki... >>> http://link.interia.pl/f16f4
PS. Jest nas tu wiecej takich.
|
|