Remove dependency to modules/palettes.h in sprite.cpp.

This commit is contained in:
David Capello 2010-09-19 15:09:39 -03:00
parent 1094328cc7
commit 752ffa6444
2 changed files with 5 additions and 3 deletions

View File

@ -31,8 +31,10 @@
#include "app/color.h"
#include "modules/editors.h"
#include "modules/gui.h"
#include "modules/palettes.h"
#include "raster/image.h"
#include "raster/layer.h"
#include "raster/palette.h"
#include "raster/sprite.h"
#include "raster/undo.h"
#include "util/misc.h"
@ -191,7 +193,9 @@ static Sprite* new_sprite(Context* context, int imgtype, int w, int h, int ncolo
ASSERT(w >= 1 && w <= 9999);
ASSERT(h >= 1 && h <= 9999);
return Sprite::createWithLayer(imgtype, w, h, ncolors);
Sprite* sprite = Sprite::createWithLayer(imgtype, w, h, ncolors);
get_default_palette()->copyColorsTo(sprite->getCurrentPalette());
return sprite;
}
//////////////////////////////////////////////////////////////////////

View File

@ -26,7 +26,6 @@
#include "Vaca/ScopedLock.h"
#include "file/format_options.h"
#include "modules/palettes.h"
#include "raster/raster.h"
#include "util/boundary.h"
@ -487,7 +486,6 @@ SpriteImpl::SpriteImpl(Sprite* sprite, int imgtype, int width, int height, int n
// For colored images
case IMAGE_RGB:
case IMAGE_INDEXED:
get_default_palette()->copyColorsTo(&pal);
pal.resize(ncolors);
break;