diff --git a/src/app/modules/palettes.cpp b/src/app/modules/palettes.cpp index 101194359..fb73279ac 100644 --- a/src/app/modules/palettes.cpp +++ b/src/app/modules/palettes.cpp @@ -23,12 +23,10 @@ #include "app/app.h" #include "app/modules/palettes.h" #include "raster/blend.h" -#include "raster/conversion_alleg.h" #include "raster/image.h" #include "raster/palette.h" #include "raster/sprite.h" -#include #include namespace app { @@ -47,11 +45,7 @@ static Palette* ase_current_palette = NULL; int init_module_palette() { ase_default_palette = new Palette(FrameNumber(0), 256); - convert_palette_from_allegro(default_palette, ase_default_palette); - ase_current_palette = new Palette(FrameNumber(0), 256); - convert_palette_from_allegro(black_palette, ase_current_palette); - return 0; } @@ -93,11 +87,6 @@ bool set_current_palette(const Palette *_palette, bool forced) // Copy current palette palette->copyColorsTo(ase_current_palette); - // Change system color palette - PALETTE allegPal; - convert_palette_to_allegro(palette, allegPal); - set_palette(allegPal); - // Call slots in signals App::instance()->PaletteChange(); diff --git a/src/raster/CMakeLists.txt b/src/raster/CMakeLists.txt index 3da66e95a..e02b98bdf 100644 --- a/src/raster/CMakeLists.txt +++ b/src/raster/CMakeLists.txt @@ -13,7 +13,6 @@ add_library(raster-lib cel.cpp cel_io.cpp color_scales.cpp - conversion_alleg.cpp conversion_she.cpp dirty.cpp dirty_io.cpp diff --git a/src/raster/conversion_alleg.cpp b/src/raster/conversion_alleg.cpp deleted file mode 100644 index 5a0f89d84..000000000 --- a/src/raster/conversion_alleg.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* Aseprite - * Copyright (C) 2001-2013 David Capello - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "raster/conversion_alleg.h" - -#include "raster/algo.h" -#include "raster/blend.h" -#include "raster/color_scales.h" -#include "raster/palette.h" -#include "raster/rgbmap.h" - -#include - -namespace raster { - -void convert_palette_to_allegro(const Palette* palette, RGB* rgb) -{ - int i; - for (i=0; isize(); ++i) { - color_t c = palette->getEntry(i); - rgb[i].r = rgba_getr(c) / 4; - rgb[i].g = rgba_getg(c) / 4; - rgb[i].b = rgba_getb(c) / 4; - } - for (; iresize(Palette::MaxColors); - for (int i=0; isetEntry(i, rgba(scale_6bits_to_8bits(rgb[i].r), - scale_6bits_to_8bits(rgb[i].g), - scale_6bits_to_8bits(rgb[i].b), 255)); - } -} - -} // namespace raster diff --git a/src/raster/conversion_alleg.h b/src/raster/conversion_alleg.h deleted file mode 100644 index afa4c7ab9..000000000 --- a/src/raster/conversion_alleg.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Aseprite - * Copyright (C) 2001-2013 David Capello - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef RASTER_CONVERSION_ALLEG_H_INCLUDED -#define RASTER_CONVERSION_ALLEG_H_INCLUDED -#pragma once - -#include - -namespace raster { - class Palette; - - void convert_palette_to_allegro(const Palette* palette, RGB* rgb); - void convert_palette_from_allegro(const RGB* rgb, Palette* palette); - -} // namespace raster - -#endif diff --git a/src/raster/palette.cpp b/src/raster/palette.cpp index 691ca6e57..a9be7d93d 100644 --- a/src/raster/palette.cpp +++ b/src/raster/palette.cpp @@ -24,7 +24,6 @@ #include "gfx/hsv.h" #include "gfx/rgb.h" -#include "raster/conversion_alleg.h" #include "raster/image.h" #include