From bbb6b83905e769fd283a150c7ca7aba550a1f019 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 10 Apr 2020 08:58:59 -0300 Subject: [PATCH] Make doc::RgbMap a regular object (don't need to be an doc::Object) --- src/doc/object_type.h | 35 ++++++++++++++++++++--------------- src/doc/rgbmap.cpp | 4 ++-- src/doc/rgbmap.h | 3 ++- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/doc/object_type.h b/src/doc/object_type.h index 31f897375..d09084500 100644 --- a/src/doc/object_type.h +++ b/src/doc/object_type.h @@ -1,5 +1,5 @@ // Aseprite Document Library -// Copyright (C) 2019 Igara Studio S.A. +// Copyright (C) 2019-2020 Igara Studio S.A. // Copyright (C) 2001-2017 David Capello // // This file is released under the terms of the MIT license. @@ -12,20 +12,25 @@ namespace doc { enum class ObjectType { - Unknown, - Image, - Palette, - RgbMap, - Path, - Mask, - Cel, - CelData, - LayerImage, - LayerGroup, - Sprite, - Document, - Tag, - Slice, + Unknown = 0, + Image = 1, + Palette = 2, + + // Deprecated values, we cannot re-use these indexes because + // backup sessions use them (check readLayer() function in + // src/app/crash/read_document.cpp). + //RgbMap = 3, + //Path = 4, + + Mask = 5, + Cel = 6, + CelData = 7, + LayerImage = 8, + LayerGroup = 9, + Sprite = 10, + Document = 11, + Tag = 12, + Slice = 13, }; } // namespace doc diff --git a/src/doc/rgbmap.cpp b/src/doc/rgbmap.cpp index 4a39dffb7..1d56fba18 100644 --- a/src/doc/rgbmap.cpp +++ b/src/doc/rgbmap.cpp @@ -1,4 +1,5 @@ // Aseprite Document Library +// Copyright (c) 2020 Igara Studio S.A. // Copyright (c) 2001-2015 David Capello // // This file is released under the terms of the MIT license. @@ -22,8 +23,7 @@ namespace doc { #define MAPSIZE (RSIZE*GSIZE*BSIZE*ASIZE) RgbMap::RgbMap() - : Object(ObjectType::RgbMap) - , m_map(MAPSIZE) + : m_map(MAPSIZE) , m_palette(NULL) , m_modifications(0) , m_maskIndex(0) diff --git a/src/doc/rgbmap.h b/src/doc/rgbmap.h index 6fa7bcd79..30ab666a3 100644 --- a/src/doc/rgbmap.h +++ b/src/doc/rgbmap.h @@ -1,4 +1,5 @@ // Aseprite Document Library +// Copyright (c) 2020 Igara Studio S.A. // Copyright (c) 2001-2016 David Capello // // This file is released under the terms of the MIT license. @@ -19,7 +20,7 @@ namespace doc { class Palette; // It acts like a cache for Palette:findBestfit() calls. - class RgbMap : public Object { + class RgbMap { // Bit activated on m_map entries that aren't yet calculated. const int INVALID = 256;