From aeca7af074d9baecc5e4b15183b77d583003cb83 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sun, 21 Jan 2018 20:12:32 +0100 Subject: [PATCH] Add comment about Current_palette --- src/misc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/misc.c b/src/misc.c index 09f87562..aee4b21f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -151,6 +151,13 @@ word Count_used_colors_area(dword* usage, word start_x, word start_y, return nb_colors; } + +// Backup of the currently displayed palette. +// It is not always Main_palette ! (for example during a preview) +// external code must not modify this array but use Set_palette() / Set_color() +// Get_current_palette() offers a READ-ONLY access. +// TODO : Color cycling code use directly SDL_SetPalette() we should check +// wether it should call Set_palette() instead. static T_Palette Current_palette = {0}; const T_Components * Get_current_palette(void)