Skip to content

Commit

Permalink
ResourceSystem|Client: Observe ColorPalette::ColorTableChange
Browse files Browse the repository at this point in the history
When the color table changes we need to schedule texture updates.
  • Loading branch information
danij-deng committed Nov 17, 2013
1 parent d8cfa8d commit e351b4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doomsday/client/include/resource/resourcesystem.h
Expand Up @@ -61,7 +61,7 @@ class ResourceSystem : public de::System
/// An unknown resource class identifier was specified. @ingroup errors
DENG2_ERROR(UnknownResourceClassError);

/// The referenced color paletted could not be found. @ingroup errors
/// The referenced color palette could not be found. @ingroup errors
DENG2_ERROR(MissingColorPaletteError);

public:
Expand Down
5 changes: 5 additions & 0 deletions doomsday/client/src/resource/resourcesystem.cpp
Expand Up @@ -1309,6 +1309,11 @@ void ResourceSystem::addColorPalette(ColorPalette &newPalette, String const &nam

d->colorPalettes.insert(newPalette.id(), &newPalette);

#ifdef __CLIENT__
// Observe changes to the color table so we can schedule texture updates.
newPalette.audienceForColorTableChange += d;
#endif

if(!name.isEmpty())
{
d->colorPaletteNames.insert(name, &newPalette);
Expand Down

0 comments on commit e351b4f

Please sign in to comment.