From: Holger Schemel Date: Fri, 3 Jan 2025 13:56:01 +0000 (+0100) Subject: added skipping extra colors when using reduced BD style color template X-Git-Tag: 4.4.0.1~62 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2ead7aa12a9f080d2d94b7d5c44fc798c9d143ed;p=rocksndiamonds.git added skipping extra colors when using reduced BD style color template --- diff --git a/src/editor.c b/src/editor.c index 8a480571..d3863924 100644 --- a/src/editor.c +++ b/src/editor.c @@ -11969,8 +11969,12 @@ static void DrawEngineConfigColors(void) return; } + // when using native BD engine with "classic" template colors, skip the two extra colors + int skip = (level.game_engine_type == GAME_ENGINE_TYPE_BD && + gfx.has_reduced_color_template ? 2 : 0); + // copy level colors to either C64-style color index or color text - for (i = 0; i < MAX_BD_COLORS; i++) + for (i = 0; i < MAX_BD_COLORS - skip; i++) { int bd_color_x = (level.bd_color_type == GD_COLOR_TYPE_C64 ? *bd_color[i] & 0x0f : level.bd_color_type == GD_COLOR_TYPE_RGB ? gd_color_get_rgb(*bd_color[i]) : @@ -11990,23 +11994,30 @@ static void DrawEngineConfigColors(void) if (level.bd_color_type == GD_COLOR_TYPE_C64) { // draw selectbox gadgets - for (i = ED_SELECTBOX_ID_COLORS_FIRST; i <= ED_SELECTBOX_ID_COLORS_LAST; i++) + for (i = ED_SELECTBOX_ID_COLORS_FIRST; i <= ED_SELECTBOX_ID_COLORS_LAST - skip; i++) MapSelectboxGadget(i); } else { // draw text input gadgets - for (i = ED_TEXTINPUT_ID_COLORS_FIRST; i <= ED_TEXTINPUT_ID_COLORS_LAST; i++) + for (i = ED_TEXTINPUT_ID_COLORS_FIRST; i <= ED_TEXTINPUT_ID_COLORS_LAST - skip; i++) MapTextInputGadget(i); } // draw graphic button gadgets - for (i = ED_GRAPHICBUTTON_ID_PICK_FIRST; i <= ED_GRAPHICBUTTON_ID_PICK_LAST; i++) + for (i = ED_GRAPHICBUTTON_ID_PICK_FIRST; i <= ED_GRAPHICBUTTON_ID_PICK_LAST - skip; i++) MapGraphicbuttonGadget(i); - for (i = 0; i < MAX_BD_COLORS; i++) + for (i = 0; i < MAX_BD_COLORS - skip; i++) DrawColorBox_BD(i); + if (skip > 0) + { + struct GadgetInfo *gi = level_editor_gadget[GADGET_ID_BD_SET_RANDOM_COLORS]; + + ModifyGadget(gi, GDI_Y, SY + ED_SETTINGS_Y(ED_ENGINE_SETTINGS_YPOS(7)), GDI_END); + } + MapTextbuttonGadget(ED_TEXTBUTTON_ID_BD_SET_RANDOM_COLORS); }