From b4e9c3f20d059321c2188d18fd8c667008cea1ad Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 11 Apr 2020 18:19:50 +0200 Subject: [PATCH] - missed two things that need to be 'common'. --- src/common/engine/palettecontainer.cpp | 19 ++++++++++++++++--- src/r_data/r_translate.cpp | 15 --------------- src/r_data/v_palette.cpp | 2 -- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/common/engine/palettecontainer.cpp b/src/common/engine/palettecontainer.cpp index b45bfc70d..33214f223 100644 --- a/src/common/engine/palettecontainer.cpp +++ b/src/common/engine/palettecontainer.cpp @@ -40,10 +40,8 @@ #include "templates.h" #include "palettecontainer.h" -#include "v_palette.h" - - PaletteContainer GPalette; +FColorMatcher ColorMatcher; //---------------------------------------------------------------------------- // @@ -235,6 +233,21 @@ static bool IndexOutOfRange(const int start1, const int end1, const int start2, // //---------------------------------------------------------------------------- +bool FRemapTable::operator==(const FRemapTable& o) +{ + // Two translations are identical when they have the same amount of colors + // and the palette values for both are identical. + if (&o == this) return true; + if (o.NumEntries != NumEntries) return false; + return !memcmp(o.Palette, Palette, NumEntries * sizeof(*Palette)); +} + +//---------------------------------------------------------------------------- +// +// +// +//---------------------------------------------------------------------------- + void FRemapTable::MakeIdentity() { int i; diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 8c6d6e7b0..945940c00 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -80,21 +80,6 @@ const uint8_t IcePalette[16][3] = // //---------------------------------------------------------------------------- -bool FRemapTable::operator==(const FRemapTable &o) -{ - // Two translations are identical when they have the same amount of colors - // and the palette values for both are identical. - if (&o == this) return true; - if (o.NumEntries != NumEntries) return false; - return !memcmp(o.Palette, Palette, NumEntries * sizeof(*Palette)); -} - -//---------------------------------------------------------------------------- -// -// -// -//---------------------------------------------------------------------------- - static void SerializeRemap(FSerializer &arc, FRemapTable &remap) { arc("numentries", remap.NumEntries); diff --git a/src/r_data/v_palette.cpp b/src/r_data/v_palette.cpp index 54606899c..2d9ae90b1 100644 --- a/src/r_data/v_palette.cpp +++ b/src/r_data/v_palette.cpp @@ -57,8 +57,6 @@ uint32_t Col2RGB8_2[63][256]; // this array's second dimension is called up by p ColorTable32k RGB32k; ColorTable256k RGB256k; -FColorMatcher ColorMatcher; - /* Current color blending values */ int BlendR, BlendG, BlendB, BlendA;