From 6550e704fcb11f9a7727fa740a6e5e4429c5f033 Mon Sep 17 00:00:00 2001 From: Thomas BERNARD Date: Thu, 6 Feb 2020 23:33:38 +0100 Subject: [PATCH] SetPalette() => GFX2_SetPalette() --- src/help.c | 5 ----- src/input.c | 2 +- src/misc.c | 6 ++---- src/screen.h | 2 +- src/sdlscreen.c | 2 +- src/win32screen.c | 2 +- src/x11screen.c | 2 +- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/help.c b/src/help.c index 4856fe69..a17b2580 100644 --- a/src/help.c +++ b/src/help.c @@ -54,11 +54,6 @@ #if defined(__macosx__) #import -/* defining __QD__ is a cheat to avoid : -screen.h:58: error: conflicting types for 'SetPalette' -/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Palettes.h:150: error: previous declaration of 'SetPalette' was here -*/ -#define __QD__ #import #endif diff --git a/src/input.c b/src/input.c index bd3a102f..9a86ce52 100644 --- a/src/input.c +++ b/src/input.c @@ -2241,7 +2241,7 @@ static int Color_cycling(void) } } } - SetPalette(palette, 0, 256); + GFX2_SetPalette(palette, 0, 256); } return 0; } diff --git a/src/misc.c b/src/misc.c index 6e2cabdb..c9fe3aca 100644 --- a/src/misc.c +++ b/src/misc.c @@ -168,8 +168,6 @@ word Count_used_colors_area(dword* usage, word start_x, word start_y, // 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; const T_Components * Get_current_palette(void) @@ -188,7 +186,7 @@ void Set_palette(T_Palette palette) palette[i].G = Round_palette_component(palette[i].G); palette[i].B = Round_palette_component(palette[i].B); } - SetPalette(palette,0,256); + GFX2_SetPalette(palette, 0, 256); } void Set_color(byte color, byte red, byte green, byte blue) @@ -196,7 +194,7 @@ void Set_color(byte color, byte red, byte green, byte blue) Current_palette[color].R = red; Current_palette[color].G = green; Current_palette[color].B = blue; - SetPalette(Current_palette + color, color, 1); + GFX2_SetPalette(Current_palette + color, color, 1); } void Wait_end_of_click(void) diff --git a/src/screen.h b/src/screen.h index 9542aa81..7a33a97a 100644 --- a/src/screen.h +++ b/src/screen.h @@ -58,7 +58,7 @@ void Update_rect(short x, short y, unsigned short width, unsigned short height); void Flush_update(void); void Update_status_line(short char_pos, short width); -int SetPalette(const T_Components * colors, int firstcolor, int ncolors); +int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors); /// /// Clears the parts of screen that are outside of the editing area. diff --git a/src/sdlscreen.c b/src/sdlscreen.c index d6c1f4e0..7a4098ed 100644 --- a/src/sdlscreen.c +++ b/src/sdlscreen.c @@ -469,7 +469,7 @@ void Get_SDL_Palette(const SDL_Palette * sdl_palette, T_Palette palette) } -int SetPalette(const T_Components * colors, int firstcolor, int ncolors) +int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors) { int i; SDL_Color PaletteSDL[256]; diff --git a/src/win32screen.c b/src/win32screen.c index f02a6844..dc06200a 100644 --- a/src/win32screen.c +++ b/src/win32screen.c @@ -636,7 +636,7 @@ void Update_status_line(short char_pos, short width) width*8*Menu_factor_X, 8*Menu_factor_Y); } -int SetPalette(const T_Components * colors, int firstcolor, int ncolors) +int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors) { int i; RGBQUAD rgb[256]; diff --git a/src/x11screen.c b/src/x11screen.c index cb5aa522..8f21e042 100644 --- a/src/x11screen.c +++ b/src/x11screen.c @@ -240,7 +240,7 @@ void Screen_FillRect(int x, int y, int w, int h, byte color) } } -int SetPalette(const T_Components * colors, int firstcolor, int ncolors) +int GFX2_SetPalette(const T_Components * colors, int firstcolor, int ncolors) { if (screen == NULL) return 0; memcpy(screen->palette + firstcolor, colors, ncolors * sizeof(T_Components));