22 #ifndef SCI_GRAPHICS_PALETTE_H 23 #define SCI_GRAPHICS_PALETTE_H 25 #include "common/array.h" 26 #include "sci/graphics/helpers.h" 31 class ResourceManager;
35 #define SCI_PALETTE_MATCH_PERFECT 0x8000 36 #define SCI_PALETTE_MATCH_COLORMASK 0xFF 47 bool isUsing16bitColorMatch();
54 void set(
Palette *sciPal,
bool force,
bool forceRealMerge =
false,
bool includeFirstColor =
true);
55 bool insert(
Palette *newPalette,
Palette *destPalette,
bool includeFirstColor =
false);
56 bool merge(
Palette *pFrom,
bool force,
bool forceRealMerge);
57 uint16 matchColor(byte r, byte g, byte b,
bool force16BitColorMatch =
false);
58 uint16 getTotalColorCount()
const {
return _totalScreenColors; }
62 void setOnScreen(
bool update=
true);
63 void copySysPaletteToScreen(
bool update);
65 void drewPicture(GuiResourceId pictureId);
67 bool kernelSetFromResource(GuiResourceId resourceId,
bool force);
68 void kernelSetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
69 void kernelUnsetFlag(uint16 fromColor, uint16 toColor, uint16 flag);
70 void kernelSetIntensity(uint16 fromColor, uint16 toColor, uint16 intensity,
bool setPalette);
71 int16 kernelFindColor(uint16 r, uint16 g, uint16 b,
bool force16BitColorMatch =
false);
72 bool kernelAnimate(byte fromColor, byte toColor,
int speed);
73 void kernelAnimateSet();
75 void kernelRestore(
reg_t memoryHandle);
76 void kernelAssertPalette(GuiResourceId resourceId);
78 void kernelSyncScreenPalette();
80 bool kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stepStop, uint16 direction);
81 int16 kernelPalVaryReverse(int16 ticks, uint16 stepStop, int16 direction);
82 int16 kernelPalVaryGetCurrentStep();
83 int16 kernelPalVaryChangeTarget(GuiResourceId resourceId);
84 void kernelPalVaryChangeTicks(uint16 ticks);
85 void kernelPalVaryPause(
bool pause);
86 void kernelPalVaryDeinit();
88 void palVaryPrepareForTransition();
89 void palVaryProcess(
int signal,
bool setPalette);
91 void delayForPalVaryWorkaround();
98 byte findMacIconBarColor(byte r, byte g, byte b);
99 bool colorIsFromMacClut(byte index);
103 void palVaryInstallTimer();
104 void palVaryRemoveTimer();
105 bool palVaryLoadTargetPalette(GuiResourceId resourceId);
106 static void palVaryCallback(
void *refCon);
107 void palVaryIncreaseSignal();
112 bool _sysPaletteChanged;
114 bool _use16bitColorMatch;
118 GuiResourceId _palVaryResourceId;
122 int16 _palVaryStepStop;
123 int16 _palVaryDirection;
124 uint16 _palVaryTicks;
127 bool _palVaryZeroTick;
128 uint16 _totalScreenColors;
130 void loadMacIconBarPalette();
136 #endif // SCI_GRAPHICS_PALETTE_H
Definition: serializer.h:79
Definition: resource.h:327
Definition: serializer.h:308
Definition: helpers.h:246
Definition: vm_types.h:39