Implemented palette ordering (issue 112). You can activate it in the secondary palette window (shift-P), it's saved in gfx2.ini.
The skin file has 2 more icons for the arrows (Ilija, grafx2 won't load if you don't update yours) Updated contextual help for the secondary palette window. Fixed some typos in code. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@704 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
eb781b9bd6
commit
8ff9028eab
31
buttons.c
31
buttons.c
@ -234,13 +234,14 @@ void Button_Redo(void)
|
|||||||
//---------------------------- SCROLL PALETTE LEFT ---------------------------
|
//---------------------------- SCROLL PALETTE LEFT ---------------------------
|
||||||
void Button_Pal_left(void)
|
void Button_Pal_left(void)
|
||||||
{
|
{
|
||||||
short cells_y = Palette_cells_Y();
|
short cells;
|
||||||
|
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
if (First_color_in_palette)
|
if (First_color_in_palette)
|
||||||
{
|
{
|
||||||
if (First_color_in_palette>=cells_y)
|
if (First_color_in_palette>=cells)
|
||||||
First_color_in_palette-=cells_y;
|
First_color_in_palette-=cells;
|
||||||
else
|
else
|
||||||
First_color_in_palette=0;
|
First_color_in_palette=0;
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
@ -251,14 +252,14 @@ void Button_Pal_left(void)
|
|||||||
|
|
||||||
void Button_Pal_left_fast(void)
|
void Button_Pal_left_fast(void)
|
||||||
{
|
{
|
||||||
short cells_X = Palette_cells_X();
|
short cells_x = Palette_cells_X();
|
||||||
short cells_y = Palette_cells_Y();
|
short cells_y = Palette_cells_Y();
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
if (First_color_in_palette)
|
if (First_color_in_palette)
|
||||||
{
|
{
|
||||||
if (First_color_in_palette>=cells_y*cells_X)
|
if (First_color_in_palette>=cells_y*cells_x)
|
||||||
First_color_in_palette-=cells_y*cells_X;
|
First_color_in_palette-=cells_y*cells_x;
|
||||||
else
|
else
|
||||||
First_color_in_palette=0;
|
First_color_in_palette=0;
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
@ -271,30 +272,32 @@ void Button_Pal_left_fast(void)
|
|||||||
//--------------------------- SCROLL PALETTE RIGHT ---------------------------
|
//--------------------------- SCROLL PALETTE RIGHT ---------------------------
|
||||||
void Button_Pal_right(void)
|
void Button_Pal_right(void)
|
||||||
{
|
{
|
||||||
short cells_y = Palette_cells_Y();
|
short cells;
|
||||||
|
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
if ((int)First_color_in_palette+cells_y*Palette_cells_X()<256)
|
if ((int)First_color_in_palette+Palette_cells_X()*Palette_cells_Y()<256)
|
||||||
{
|
{
|
||||||
First_color_in_palette+=cells_y;
|
First_color_in_palette+=cells;
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
}
|
}
|
||||||
|
|
||||||
Unselect_bouton(BUTTON_PAL_RIGHT);
|
Unselect_bouton(BUTTON_PAL_RIGHT);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Pal_right_fast(void)
|
void Button_Pal_right_fast(void)
|
||||||
{
|
{
|
||||||
short cells_X = Palette_cells_X();
|
short cells_x = Palette_cells_X();
|
||||||
short cells_y = Palette_cells_Y();
|
short cells_y = Palette_cells_Y();
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
if ((int)First_color_in_palette+cells_y*cells_X<256)
|
if ((int)First_color_in_palette+cells_y*cells_x<256)
|
||||||
{
|
{
|
||||||
if ((int)First_color_in_palette+(cells_y)*cells_X*2<256)
|
if ((int)First_color_in_palette+(cells_y)*cells_x*2<256)
|
||||||
First_color_in_palette+=cells_X*cells_y;
|
First_color_in_palette+=cells_x*cells_y;
|
||||||
else
|
else
|
||||||
First_color_in_palette=255/cells_y*cells_y-(cells_X-1)*cells_y;
|
First_color_in_palette=255/cells_y*cells_y-(cells_x-1)*cells_y;
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
}
|
}
|
||||||
Unselect_bouton(BUTTON_PAL_RIGHT);
|
Unselect_bouton(BUTTON_PAL_RIGHT);
|
||||||
|
|||||||
68
const.h
68
const.h
@ -36,50 +36,50 @@
|
|||||||
#define ALPHA_BETA "ß" // Type de la version "Þ" ou "ß"
|
#define ALPHA_BETA "ß" // Type de la version "Þ" ou "ß"
|
||||||
#define MAX_VIDEO_MODES 100 // Nombre de modes vidéo maxi
|
#define MAX_VIDEO_MODES 100 // Nombre de modes vidéo maxi
|
||||||
#define NB_BUTTONS 38 // Nombre de boutons à gérer
|
#define NB_BUTTONS 38 // Nombre de boutons à gérer
|
||||||
#define NB_SHORTCUTS 134 // Nombre de combinaisons de touches
|
#define NB_SHORTCUTS 134 // Nombre de combinaisons de touches
|
||||||
#define NB_SPECIAL_SHORTCUTS 72 // Nombre de touches spéciales
|
#define NB_SPECIAL_SHORTCUTS 72 // Nombre de touches spéciales
|
||||||
#define NB_OPERATIONS 33 // Nombre d'opérations gérées par le moteur
|
#define NB_OPERATIONS 33 // Nombre d'opérations gérées par le moteur
|
||||||
#define NB_ZOOM_FACTORS 12 // Nombre de facteurs de zoom
|
#define NB_ZOOM_FACTORS 12 // Nombre de facteurs de zoom
|
||||||
#define MENU_WIDTH 254 // Largeur du menu en taille réelle
|
#define MENU_WIDTH 254 // Largeur du menu en taille réelle
|
||||||
#define MENU_HEIGHT 44 // Hauteur du menu en taille réelle
|
#define MENU_HEIGHT 44 // Hauteur du menu en taille réelle
|
||||||
#define NB_CURSOR_SPRITES 8 // Nombre de sprites de curseur
|
#define NB_CURSOR_SPRITES 8 // Nombre de sprites de curseur
|
||||||
#define CURSOR_SPRITE_WIDTH 15 // Largeur d'un sprite de curseur en pixels
|
#define CURSOR_SPRITE_WIDTH 15 // Largeur d'un sprite de curseur en pixels
|
||||||
#define CURSOR_SPRITE_HEIGHT 15 // Hauteur d'un sprite de curseur en pixels
|
#define CURSOR_SPRITE_HEIGHT 15 // Hauteur d'un sprite de curseur en pixels
|
||||||
#define NB_EFFECTS_SPRITES 9 // Nombre de sprites d'effets
|
#define NB_EFFECTS_SPRITES 9 // Nombre de sprites d'effets
|
||||||
#define NB_MENU_SPRITES 18 // Nombre de sprites de menu
|
#define NB_MENU_SPRITES 20 // Nombre de sprites de menu
|
||||||
#define MENU_SPRITE_WIDTH 14 // Largeur d'un sprite de menu en pixels
|
#define MENU_SPRITE_WIDTH 14 // Largeur d'un sprite de menu en pixels
|
||||||
#define MENU_SPRITE_HEIGHT 14 // Hauteur d'un sprite de menu en pixels
|
#define MENU_SPRITE_HEIGHT 14 // Hauteur d'un sprite de menu en pixels
|
||||||
#define PAINTBRUSH_WIDTH 16 // Largeur d'un sprite de pinceau prédéfini
|
#define PAINTBRUSH_WIDTH 16 // Largeur d'un sprite de pinceau prédéfini
|
||||||
#define PAINTBRUSH_HEIGHT 16 // Hauteur d'un sprite de pinceau prédéfini
|
#define PAINTBRUSH_HEIGHT 16 // Hauteur d'un sprite de pinceau prédéfini
|
||||||
#define MAX_PAINTBRUSH_SIZE 127 // Taille maxi des pinceaux
|
#define MAX_PAINTBRUSH_SIZE 127 // Taille maxi des pinceaux
|
||||||
#define NB_ICON_SPRITES 7 // Nombre de sprites de drives
|
#define NB_ICON_SPRITES 7 // Nombre de sprites de drives
|
||||||
#define ICON_SPRITE_WIDTH 8 // Largeur d'un sprite de drive en pixels
|
#define ICON_SPRITE_WIDTH 8 // Largeur d'un sprite de drive en pixels
|
||||||
#define ICON_SPRITE_HEIGHT 8 // Hauteur d'un sprite de drive en pixels
|
#define ICON_SPRITE_HEIGHT 8 // Hauteur d'un sprite de drive en pixels
|
||||||
#define NB_PAINTBRUSH_SPRITES 48 // Nombre de sprites de pinceau
|
#define NB_PAINTBRUSH_SPRITES 48 // Nombre de sprites de pinceau
|
||||||
#define NB_PRESET_SIEVE 12 // Nombre de trames prédéfinies
|
#define NB_PRESET_SIEVE 12 // Nombre de trames prédéfinies
|
||||||
#define OPERATION_STACK_SIZE 16 // Nombre maximum d'éléments utilisés par les opérations
|
#define OPERATION_STACK_SIZE 16 // Nombre maximum d'éléments utilisés par les opérations
|
||||||
#define MAX_DISPLAYABLE_PATH 37 // Taille maximum affichable du répertoire courant dans les fenêtres du fileselect
|
#define MAX_DISPLAYABLE_PATH 37 // Taille maximum affichable du répertoire courant dans les fenêtres du fileselect
|
||||||
#define COMMENT_SIZE 32 // Taille maxi des commentaires pour le PKM
|
#define COMMENT_SIZE 32 // Taille maxi des commentaires pour le PKM
|
||||||
#define NB_MAX_PAGES_UNDO 99 // Nombre maximal de pages d'undo
|
#define NB_MAX_PAGES_UNDO 99 // Nombre maximal de pages d'undo
|
||||||
#define DEFAULT_ZOOM_FACTOR 4 // Facteur de zoom initial
|
#define DEFAULT_ZOOM_FACTOR 4 // Facteur de zoom initial
|
||||||
#define MAX_PATH_CHARACTERS 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet
|
#define MAX_PATH_CHARACTERS 260 // Le nombre de caractères maxi pour un nom de fichier avec chemin complet
|
||||||
#define NB_BOOKMARKS 4 // Nombre de boutons "signet" dans l'ecran Save/Load
|
#define NB_BOOKMARKS 4 // Nombre de boutons "signet" dans l'ecran Save/Load
|
||||||
// Caractères présents dans les deux fontes
|
// Caractères présents dans les deux fontes
|
||||||
#define RIGHT_TRIANGLE_CHARACTER 16
|
#define RIGHT_TRIANGLE_CHARACTER 16
|
||||||
#define LEFT_TRIANGLE_CHARACTER 17
|
#define LEFT_TRIANGLE_CHARACTER 17
|
||||||
#define ELLIPSIS_CHARACTER '…'
|
#define ELLIPSIS_CHARACTER '…'
|
||||||
|
|
||||||
// On impose à l'allocation dynamique des pages de backups de conserver un
|
// On impose à l'allocation dynamique des pages de backups de conserver un
|
||||||
// minimum de 256 Ko pour que le reste du programme puisse continuer à
|
// minimum de 256 Ko pour que le reste du programme puisse continuer à
|
||||||
// fonctionner.
|
// fonctionner.
|
||||||
#define MINIMAL_MEMORY_TO_RESERVE (256*1024)
|
#define MINIMAL_MEMORY_TO_RESERVE (256*1024)
|
||||||
|
|
||||||
#define LEFT_SIDE 1 // Indique une direction (ou click) à gauche
|
#define LEFT_SIDE 1 // Indique une direction (ou click) à gauche
|
||||||
#define RIGHT_SIDE 2 // Indique une direction (ou click) à droite
|
#define RIGHT_SIDE 2 // Indique une direction (ou click) à droite
|
||||||
|
|
||||||
#define SEPARATOR_WIDTH 6 // [ Û±±° ]
|
#define SEPARATOR_WIDTH 6 // [ Û±±° ]
|
||||||
#define INITIAL_SEPARATOR_PROPORTION 0.3 // proportion de la zone non-zoomée en largeur par rapport à l'écran
|
#define INITIAL_SEPARATOR_PROPORTION 0.3 // proportion de la zone non-zoomée en largeur par rapport à l'écran
|
||||||
#define NB_ZOOMED_PIXELS_MIN 4 // Nombre minimal de pixels zoomés en largeur (Note: En dessous de 4, on ne peut plus scroller!)
|
#define NB_ZOOMED_PIXELS_MIN 4 // Nombre minimal de pixels zoomés en largeur (Note: En dessous de 4, on ne peut plus scroller!)
|
||||||
|
|
||||||
#if defined(__MORPHOS__) || defined(__amigaos4__) || defined(__amigaos__)
|
#if defined(__MORPHOS__) || defined(__amigaos4__) || defined(__amigaos__)
|
||||||
#define PARENT_DIR "/"
|
#define PARENT_DIR "/"
|
||||||
@ -91,13 +91,13 @@
|
|||||||
|
|
||||||
#ifndef __no_pnglib__
|
#ifndef __no_pnglib__
|
||||||
#define NB_KNOWN_FORMATS 13 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE}))
|
#define NB_KNOWN_FORMATS 13 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE}))
|
||||||
#define NB_FORMATS_LOAD 13 // Nombre de formats que l'on sait charger
|
#define NB_FORMATS_LOAD 13 // Nombre de formats que l'on sait charger
|
||||||
#define NB_FORMATS_SAVE 13 // Nombre de formats que l'on sait sauver
|
#define NB_FORMATS_SAVE 13 // Nombre de formats que l'on sait sauver
|
||||||
#else
|
#else
|
||||||
// Without pnglib
|
// Without pnglib
|
||||||
#define NB_KNOWN_FORMATS 12 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE}))
|
#define NB_KNOWN_FORMATS 12 // Nombre de formats connus (devrait être la valeur maximale de NB_FORMATS_LOAD et NB_FORMATS_SAVE, mais plus généralement: Card({NB_FORMATS_LOAD} UNION {NB_FORMATS_SAVE}))
|
||||||
#define NB_FORMATS_LOAD 12 // Nombre de formats que l'on sait charger
|
#define NB_FORMATS_LOAD 12 // Nombre de formats que l'on sait charger
|
||||||
#define NB_FORMATS_SAVE 12 // Nombre de formats que l'on sait sauver
|
#define NB_FORMATS_SAVE 12 // Nombre de formats que l'on sait sauver
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum FILE_FORMATS
|
enum FILE_FORMATS
|
||||||
|
|||||||
4
engine.c
4
engine.c
@ -139,8 +139,8 @@ char * Menu_tooltip[NB_BUTTONS]=
|
|||||||
"Kill current page ",
|
"Kill current page ",
|
||||||
"Quit ",
|
"Quit ",
|
||||||
"Palette editor ",
|
"Palette editor ",
|
||||||
"Scroll pal. left / Fast ",
|
"Scroll pal. bkwd / Fast ",
|
||||||
"Scroll pal. right / Fast",
|
"Scroll pal. fwd / Fast ",
|
||||||
"Color #" ,
|
"Color #" ,
|
||||||
"Hide tool bar "
|
"Hide tool bar "
|
||||||
};
|
};
|
||||||
|
|||||||
@ -323,4 +323,10 @@
|
|||||||
Bookmark_label =
|
Bookmark_label =
|
||||||
Bookmark_directory =
|
Bookmark_directory =
|
||||||
|
|
||||||
|
; In the classic layout, the palette in the menu has colors from left to
|
||||||
|
; right. If you prefer the colors ordered top to bottom, set this option
|
||||||
|
; to YES.
|
||||||
|
;
|
||||||
|
Palette_vertical = NO; (Default NO)
|
||||||
|
|
||||||
; end of configuration
|
; end of configuration
|
||||||
|
|||||||
BIN
gfx2gui.gif
BIN
gfx2gui.gif
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
57
helpfile.h
57
helpfile.h
@ -217,10 +217,10 @@ static const T_Help_table helptable_help[] =
|
|||||||
HELP_LINK ("Exclude colors menu: %s", SPECIAL_EXCLUDE_COLORS_MENU)
|
HELP_LINK ("Exclude colors menu: %s", SPECIAL_EXCLUDE_COLORS_MENU)
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("Scroll palette")
|
HELP_TEXT("Scroll palette")
|
||||||
HELP_LINK (" Left: %s", 0x100+BUTTON_PAL_LEFT)
|
HELP_LINK (" Back: %s", 0x100+BUTTON_PAL_LEFT)
|
||||||
HELP_LINK (" Right: %s", 0x100+BUTTON_PAL_RIGHT)
|
HELP_LINK (" Forward: %s", 0x100+BUTTON_PAL_RIGHT)
|
||||||
HELP_LINK (" Left faster: %s", 0x200+BUTTON_PAL_LEFT)
|
HELP_LINK (" Back faster: %s", 0x200+BUTTON_PAL_LEFT)
|
||||||
HELP_LINK (" Right faster: %s", 0x200+BUTTON_PAL_RIGHT)
|
HELP_LINK (" Forward faster: %s", 0x200+BUTTON_PAL_RIGHT)
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("Change brush attachement")
|
HELP_TEXT("Change brush attachement")
|
||||||
HELP_LINK (" Center : %s", SPECIAL_CENTER_ATTACHMENT)
|
HELP_LINK (" Center : %s", SPECIAL_CENTER_ATTACHMENT)
|
||||||
@ -2094,21 +2094,44 @@ static const T_Help_table helptable_palette[] =
|
|||||||
HELP_TEXT("remapped as it was just before this action.")
|
HELP_TEXT("remapped as it was just before this action.")
|
||||||
HELP_TEXT("Only Cancel will.")
|
HELP_TEXT("Only Cancel will.")
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
|
HELP_TITLE("PALETTE OPTIONS")
|
||||||
|
HELP_TEXT("")
|
||||||
HELP_BOLD ("RIGHT CLICK")
|
HELP_BOLD ("RIGHT CLICK")
|
||||||
HELP_LINK ("(Key:%s)",0x200+BUTTON_PALETTE)
|
HELP_LINK ("(Key:%s)",0x200+BUTTON_PALETTE)
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("Opens a menu from where you can access the")
|
HELP_TEXT("Opens a menu from where you have the")
|
||||||
HELP_TEXT("following menus:")
|
HELP_TEXT("following options:")
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("- A menu in which you can select the colors")
|
HELP_TEXT("- Colors for best match:")
|
||||||
HELP_TEXT("that have not to be used")
|
HELP_TEXT("A menu in which you can select the colors")
|
||||||
HELP_TEXT("for smoothing, for the transparency mode and")
|
HELP_TEXT("that have not to be used for smoothing, for")
|
||||||
HELP_TEXT("for remapping.")
|
HELP_TEXT("the transparency mode and for remapping.")
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("- A menu in which you can define color")
|
HELP_TEXT("- User's color series:")
|
||||||
HELP_TEXT("series.")
|
HELP_TEXT("A menu in which you can define color series")
|
||||||
|
HELP_TEXT("for next/previous colors.")
|
||||||
HELP_TEXT("*** Not implemented yet ***")
|
HELP_TEXT("*** Not implemented yet ***")
|
||||||
};
|
HELP_TEXT("")
|
||||||
|
HELP_TEXT("- Palette layout:")
|
||||||
|
HELP_TEXT("Lets you customize the palette that appears")
|
||||||
|
HELP_TEXT("on the right of the menu. You can choose the")
|
||||||
|
HELP_TEXT("number of lines and columns.")
|
||||||
|
HELP_TEXT("If you want the colors to run top to bottom,")
|
||||||
|
HELP_TEXT("check the 'Vertical' button, otherwise the")
|
||||||
|
HELP_TEXT("colors runs left to right.")
|
||||||
|
HELP_TEXT("")
|
||||||
|
HELP_TEXT("- RGB Scale:")
|
||||||
|
HELP_TEXT("Lets you set the scale of the R G B sliders")
|
||||||
|
HELP_TEXT("in the palette screen. You should normally")
|
||||||
|
HELP_TEXT("leave it at 256 to get the full 0-255 range,")
|
||||||
|
HELP_TEXT("but if you want to constrain the palette")
|
||||||
|
HELP_TEXT("to the capabilities of some specific")
|
||||||
|
HELP_TEXT("computers and consoles, you can choose eg:")
|
||||||
|
HELP_TEXT(" 64 : VGA")
|
||||||
|
HELP_TEXT(" 16 : Amiga")
|
||||||
|
HELP_TEXT(" 4 : MSX2")
|
||||||
|
HELP_TEXT(" 2 : Amstrad CPC")
|
||||||
|
};
|
||||||
static const T_Help_table helptable_pal_scroll[] =
|
static const T_Help_table helptable_pal_scroll[] =
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -2118,14 +2141,14 @@ static const T_Help_table helptable_pal_scroll[] =
|
|||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("Scrolls the palette window in the right of")
|
HELP_TEXT("Scrolls the palette window in the right of")
|
||||||
HELP_TEXT("the menu.")
|
HELP_TEXT("the menu.")
|
||||||
HELP_LINK ("Key for left: %s",0x100+BUTTON_PAL_LEFT)
|
HELP_LINK ("Key for back: %s", 0x100+BUTTON_PAL_LEFT)
|
||||||
HELP_LINK ("Key for right: %s",0x100+BUTTON_PAL_RIGHT)
|
HELP_LINK ("Key for forward: %s", 0x100+BUTTON_PAL_RIGHT)
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_BOLD ("RIGHT CLICK")
|
HELP_BOLD ("RIGHT CLICK")
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
HELP_TEXT("Same as above, but faster.")
|
HELP_TEXT("Same as above, but faster.")
|
||||||
HELP_LINK ("Key for left: %s",0x200+BUTTON_PAL_LEFT)
|
HELP_LINK ("Key for back: %s", 0x200+BUTTON_PAL_LEFT)
|
||||||
HELP_LINK ("Key for right: %s",0x200+BUTTON_PAL_RIGHT)
|
HELP_LINK ("Key for forward: %s", 0x200+BUTTON_PAL_RIGHT)
|
||||||
HELP_TEXT("")
|
HELP_TEXT("")
|
||||||
};
|
};
|
||||||
static const T_Help_table helptable_color_select[] =
|
static const T_Help_table helptable_color_select[] =
|
||||||
|
|||||||
2
init.c
2
init.c
@ -1055,7 +1055,7 @@ void Init_buttons(void)
|
|||||||
237,9,
|
237,9,
|
||||||
16,8,
|
16,8,
|
||||||
BUTTON_SHAPE_RECTANGLE,
|
BUTTON_SHAPE_RECTANGLE,
|
||||||
Button_Palette,Button_Pecondary_palette,
|
Button_Palette,Button_Secondary_palette,
|
||||||
Do_nothing,
|
Do_nothing,
|
||||||
FAMILY_INSTANT);
|
FAMILY_INSTANT);
|
||||||
|
|
||||||
|
|||||||
1
main.c
1
main.c
@ -587,6 +587,7 @@ int Init_program(int argc,char * argv[])
|
|||||||
// On affiche le menu:
|
// On affiche le menu:
|
||||||
Display_menu();
|
Display_menu();
|
||||||
Display_paintbrush_in_menu();
|
Display_paintbrush_in_menu();
|
||||||
|
Display_sprite_in_menu(BUTTON_PAL_LEFT,18+(Config.Palette_vertical!=0));
|
||||||
|
|
||||||
// On affiche le curseur pour débutter correctement l'état du programme:
|
// On affiche le curseur pour débutter correctement l'état du programme:
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
|
|||||||
31
palette.c
31
palette.c
@ -2074,7 +2074,7 @@ void Button_Palette(void)
|
|||||||
|
|
||||||
//---------------------- Menu de palettes secondaires ------------------------
|
//---------------------- Menu de palettes secondaires ------------------------
|
||||||
|
|
||||||
void Button_Pecondary_palette(void)
|
void Button_Secondary_palette(void)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
byte dummy;
|
byte dummy;
|
||||||
@ -2082,6 +2082,7 @@ void Button_Pecondary_palette(void)
|
|||||||
T_Scroller_button * lines_slider;
|
T_Scroller_button * lines_slider;
|
||||||
T_Scroller_button * rgb_scale_slider;
|
T_Scroller_button * rgb_scale_slider;
|
||||||
char str[4];
|
char str[4];
|
||||||
|
byte palette_vertical = Config.Palette_vertical;
|
||||||
byte palette_needs_redraw=0;
|
byte palette_needs_redraw=0;
|
||||||
|
|
||||||
Open_window(200,146,"Palettes");
|
Open_window(200,146,"Palettes");
|
||||||
@ -2090,8 +2091,8 @@ void Button_Pecondary_palette(void)
|
|||||||
Window_set_normal_button(10,37,180,14,"User's color series" ,14,0,SDLK_s); // 2
|
Window_set_normal_button(10,37,180,14,"User's color series" ,14,0,SDLK_s); // 2
|
||||||
Window_set_normal_button(139,126,53,14,"OK" , 0,1,SDLK_RETURN); // 3
|
Window_set_normal_button(139,126,53,14,"OK" , 0,1,SDLK_RETURN); // 3
|
||||||
Window_set_normal_button( 80,126,53,14,"Cancel" , 0,1,KEY_ESC); // 4
|
Window_set_normal_button( 80,126,53,14,"Cancel" , 0,1,KEY_ESC); // 4
|
||||||
Window_display_frame(10,55,122,51);
|
Window_display_frame(10,55,122,66);
|
||||||
Print_in_window(18,59,"palette layout",MC_Dark,MC_Light);
|
Print_in_window(18,59,"Palette layout",MC_Dark,MC_Light);
|
||||||
Print_in_window(35,77,"Cols",MC_Dark,MC_Light);
|
Print_in_window(35,77,"Cols",MC_Dark,MC_Light);
|
||||||
Print_in_window(84,77,"Lines",MC_Dark,MC_Light);
|
Print_in_window(84,77,"Lines",MC_Dark,MC_Light);
|
||||||
Print_in_window(157,66,"RGB",MC_Dark,MC_Light);
|
Print_in_window(157,66,"RGB",MC_Dark,MC_Light);
|
||||||
@ -2109,6 +2110,10 @@ void Button_Pecondary_palette(void)
|
|||||||
Num2str(RGB_scale,str,3);
|
Num2str(RGB_scale,str,3);
|
||||||
Print_in_window(157,89,str,MC_Black,MC_Light);
|
Print_in_window(157,89,str,MC_Black,MC_Light);
|
||||||
|
|
||||||
|
Window_set_normal_button(35,106,13,11,"",-1,1,SDLK_LAST); // 8
|
||||||
|
Print_in_window(38,108,(palette_vertical)?"X":" ",MC_Black,MC_Light);
|
||||||
|
Print_in_window(51,108,"Vertical",MC_Dark,MC_Light);
|
||||||
|
|
||||||
Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*200,Menu_factor_Y*80);
|
Update_rect(Window_pos_X,Window_pos_Y,Menu_factor_X*200,Menu_factor_Y*80);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -2119,7 +2124,7 @@ void Button_Pecondary_palette(void)
|
|||||||
if (Is_shortcut(Key,0x100+BUTTON_HELP))
|
if (Is_shortcut(Key,0x100+BUTTON_HELP))
|
||||||
{
|
{
|
||||||
Key=0;
|
Key=0;
|
||||||
Window_help(BUTTON_PALETTE, NULL);
|
Window_help(BUTTON_PALETTE, "PALETTE OPTIONS");
|
||||||
}
|
}
|
||||||
switch(clicked_button)
|
switch(clicked_button)
|
||||||
{
|
{
|
||||||
@ -2134,7 +2139,13 @@ void Button_Pecondary_palette(void)
|
|||||||
case 7:
|
case 7:
|
||||||
Num2str(256-Window_attribute2,str,3);
|
Num2str(256-Window_attribute2,str,3);
|
||||||
Print_in_window(157,89,str,MC_Black,MC_Light);
|
Print_in_window(157,89,str,MC_Black,MC_Light);
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
palette_vertical = !palette_vertical;
|
||||||
|
Hide_cursor();
|
||||||
|
Print_in_window(38,108,(palette_vertical)?"X":" ",MC_Black,MC_Light);
|
||||||
|
Display_cursor();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (clicked_button!=1 && clicked_button!=3 && clicked_button!=4);
|
while (clicked_button!=1 && clicked_button!=3 && clicked_button!=4);
|
||||||
@ -2146,12 +2157,16 @@ void Button_Pecondary_palette(void)
|
|||||||
if (clicked_button==4) // Cancel
|
if (clicked_button==4) // Cancel
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (palette_vertical != Config.Palette_vertical)
|
||||||
|
{
|
||||||
|
Config.Palette_vertical=palette_vertical;
|
||||||
|
palette_needs_redraw=1;
|
||||||
|
}
|
||||||
if (columns_slider->Position!=256-Config.Palette_cells_X ||
|
if (columns_slider->Position!=256-Config.Palette_cells_X ||
|
||||||
lines_slider->Position!=16-Config.Palette_cells_Y)
|
lines_slider->Position!=16-Config.Palette_cells_Y)
|
||||||
{
|
{
|
||||||
Config.Palette_cells_X = 256-columns_slider->Position;
|
Config.Palette_cells_X = 256-columns_slider->Position;
|
||||||
Config.Palette_cells_Y = 16-lines_slider->Position;
|
Config.Palette_cells_Y = 16-lines_slider->Position;
|
||||||
Change_palette_cells();
|
|
||||||
palette_needs_redraw=1;
|
palette_needs_redraw=1;
|
||||||
}
|
}
|
||||||
if (rgb_scale_slider->Position!=256-RGB_scale)
|
if (rgb_scale_slider->Position!=256-RGB_scale)
|
||||||
@ -2165,5 +2180,9 @@ void Button_Pecondary_palette(void)
|
|||||||
Menu_tag_colors("Tag colors to exclude",Exclude_color,&dummy,1, NULL);
|
Menu_tag_colors("Tag colors to exclude",Exclude_color,&dummy,1, NULL);
|
||||||
}
|
}
|
||||||
if (palette_needs_redraw)
|
if (palette_needs_redraw)
|
||||||
|
{
|
||||||
|
Change_palette_cells();
|
||||||
Display_menu();
|
Display_menu();
|
||||||
|
Display_sprite_in_menu(BUTTON_PAL_LEFT,18+(Config.Palette_vertical!=0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
void Button_Palette(void);
|
void Button_Palette(void);
|
||||||
void Button_Pecondary_palette(void);
|
void Button_Secondary_palette(void);
|
||||||
|
|
||||||
// Choose the number of graduations for RGB components, from 2 to 256.
|
// Choose the number of graduations for RGB components, from 2 to 256.
|
||||||
void Set_palette_RGB_scale(int);
|
void Set_palette_RGB_scale(int);
|
||||||
|
|||||||
@ -765,7 +765,14 @@ int Load_INI(T_Config * conf)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
conf->Palette_vertical=0;
|
||||||
|
// Optionnel, vertical palette option (>98.0%)
|
||||||
|
if (!Load_INI_get_values (file,buffer,"Palette_vertical",1,values))
|
||||||
|
{
|
||||||
|
if ((values[0]<0) || (values[0]>1))
|
||||||
|
goto Erreur_ERREUR_INI_CORROMPU;
|
||||||
|
conf->Palette_vertical=values[0];
|
||||||
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
free(filename);
|
free(filename);
|
||||||
|
|||||||
@ -627,6 +627,10 @@ int Save_INI(T_Config * conf)
|
|||||||
if ((return_code=Save_INI_set_strings (Ancien_fichier,Nouveau_fichier,buffer,"Bookmark_directory",conf->Bookmark_directory[index])))
|
if ((return_code=Save_INI_set_strings (Ancien_fichier,Nouveau_fichier,buffer,"Bookmark_directory",conf->Bookmark_directory[index])))
|
||||||
goto Erreur_Retour;
|
goto Erreur_Retour;
|
||||||
}
|
}
|
||||||
|
values[0]=(conf->Palette_vertical);
|
||||||
|
if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Palette_vertical",1,values,1)))
|
||||||
|
goto Erreur_Retour;
|
||||||
|
|
||||||
|
|
||||||
Save_INI_flush(Ancien_fichier,Nouveau_fichier,buffer);
|
Save_INI_flush(Ancien_fichier,Nouveau_fichier,buffer);
|
||||||
|
|
||||||
|
|||||||
1
struct.h
1
struct.h
@ -238,6 +238,7 @@ typedef struct
|
|||||||
byte Couleurs_separees;
|
byte Couleurs_separees;
|
||||||
word Palette_cells_X;
|
word Palette_cells_X;
|
||||||
word Palette_cells_Y;
|
word Palette_cells_Y;
|
||||||
|
byte Palette_vertical;
|
||||||
byte FX_Feedback;
|
byte FX_Feedback;
|
||||||
byte Safety_colors;
|
byte Safety_colors;
|
||||||
byte Opening_message;
|
byte Opening_message;
|
||||||
|
|||||||
136
windows.c
136
windows.c
@ -157,8 +157,40 @@ void Display_foreback(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- Tracer un cadre de couleur autour de la Fore_color dans le menu --
|
/*! Get the top left corner for the palette cell of a color
|
||||||
|
@param index Index of the color, starting at 0 for the top left one. Limited to Menu_cells_X/Menu_cells_Y.
|
||||||
|
*/
|
||||||
|
word Palette_cell_X(byte index)
|
||||||
|
{
|
||||||
|
if (Config.Palette_vertical)
|
||||||
|
{
|
||||||
|
return (MENU_WIDTH+1+((index-First_color_in_palette)%Menu_cells_X)*Menu_palette_cell_width)*Menu_factor_X;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (MENU_WIDTH+1+((index-First_color_in_palette)/Menu_cells_Y)*Menu_palette_cell_width)*Menu_factor_X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Get the top left corner for the palette cell of a color
|
||||||
|
@param index Index of the color, starting at 0 for the top left one. Limited to Menu_cells_X/Menu_cells_Y.
|
||||||
|
*/
|
||||||
|
word Palette_cell_Y(byte index)
|
||||||
|
{
|
||||||
|
if (Config.Palette_vertical)
|
||||||
|
{
|
||||||
|
return Menu_Y+((2+(((index-First_color_in_palette)/Menu_cells_X)*(32/Menu_cells_Y)))*Menu_factor_Y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Menu_Y+((2+(((index-First_color_in_palette)%Menu_cells_Y)*(32/Menu_cells_Y)))*Menu_factor_Y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Redraw the cell in the menu palette for ::Fore_color.
|
||||||
|
/// This function checks bounds, it won't draw anything if Fore_color is not visible.
|
||||||
|
/// @param color: Pass MC_White to mark the color with a frame, MC_Black to unmark it.
|
||||||
void Frame_menu_color(byte color)
|
void Frame_menu_color(byte color)
|
||||||
{
|
{
|
||||||
word start_x,start_y,end_x,end_y;
|
word start_x,start_y,end_x,end_y;
|
||||||
@ -169,8 +201,8 @@ void Frame_menu_color(byte color)
|
|||||||
{
|
{
|
||||||
if (Config.Couleurs_separees)
|
if (Config.Couleurs_separees)
|
||||||
{
|
{
|
||||||
start_x=(MENU_WIDTH+((Fore_color-First_color_in_palette)/Menu_cells_Y)*Menu_palette_cell_width)*Menu_factor_X;
|
start_x=Palette_cell_X(Fore_color)-1*Menu_factor_X;
|
||||||
start_y=Menu_Y+((1+(((Fore_color-First_color_in_palette)%Menu_cells_Y)*cell_height))*Menu_factor_Y);
|
start_y=Palette_cell_Y(Fore_color)-1*Menu_factor_Y;
|
||||||
|
|
||||||
Block(start_x,start_y,(Menu_palette_cell_width+1)*Menu_factor_X,Menu_factor_Y,color);
|
Block(start_x,start_y,(Menu_palette_cell_width+1)*Menu_factor_X,Menu_factor_Y,color);
|
||||||
Block(start_x,start_y+(Menu_factor_Y*cell_height),(Menu_palette_cell_width+1)*Menu_factor_X,Menu_factor_Y,color);
|
Block(start_x,start_y+(Menu_factor_Y*cell_height),(Menu_palette_cell_width+1)*Menu_factor_X,Menu_factor_Y,color);
|
||||||
@ -184,39 +216,40 @@ void Frame_menu_color(byte color)
|
|||||||
{
|
{
|
||||||
if (color==MC_Black)
|
if (color==MC_Black)
|
||||||
{
|
{
|
||||||
start_x=(MENU_WIDTH+1+((Fore_color-First_color_in_palette)/Menu_cells_Y)*Menu_palette_cell_width)*Menu_factor_X;
|
start_x=Palette_cell_X(Fore_color);
|
||||||
start_y=Menu_Y+((2+(((Fore_color-First_color_in_palette)%Menu_cells_Y)*cell_height))*Menu_factor_Y);
|
start_y=Palette_cell_Y(Fore_color);
|
||||||
|
|
||||||
Block(start_x,start_y,Menu_palette_cell_width*Menu_factor_X,
|
Block(start_x,start_y,Menu_palette_cell_width*Menu_factor_X,
|
||||||
Menu_factor_Y*cell_height,Fore_color);
|
cell_height*Menu_factor_Y,Fore_color);
|
||||||
|
|
||||||
Update_rect(start_x,start_y,Menu_palette_cell_width*Menu_factor_X,Menu_factor_Y*cell_height);
|
Update_rect(start_x,start_y,Menu_palette_cell_width*Menu_factor_X,cell_height*Menu_factor_Y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
start_x=MENU_WIDTH+1+((Fore_color-First_color_in_palette)/Menu_cells_Y)*Menu_palette_cell_width;
|
start_x=Palette_cell_X(Fore_color);
|
||||||
start_y=2+(((Fore_color-First_color_in_palette)%Menu_cells_Y)*cell_height);
|
start_y=Palette_cell_Y(Fore_color);
|
||||||
|
|
||||||
end_x=start_x+Menu_palette_cell_width-1;
|
end_x=Menu_palette_cell_width-1;
|
||||||
end_y=start_y+cell_height-1;
|
end_y=cell_height-1;
|
||||||
|
|
||||||
for (index=start_x; index<=end_x; index++)
|
// Top line
|
||||||
Block(index*Menu_factor_X,Menu_Y+(start_y*Menu_factor_Y),
|
for (index=0; index<=end_x; index++)
|
||||||
|
Block(start_x+index*Menu_factor_X,start_y,
|
||||||
Menu_factor_X,Menu_factor_Y,
|
Menu_factor_X,Menu_factor_Y,
|
||||||
((index+start_y)&1)?MC_White:MC_Black);
|
((index)&1)?MC_White:MC_Black);
|
||||||
|
// Left line
|
||||||
for (index=start_y+1; index<end_y; index++)
|
for (index=1; index<end_y; index++)
|
||||||
Block(start_x*Menu_factor_X,Menu_Y+(index*Menu_factor_Y),
|
Block(start_x,start_y+index*Menu_factor_Y,
|
||||||
Menu_factor_X,Menu_factor_Y,
|
Menu_factor_X,Menu_factor_Y,
|
||||||
((index+start_x)&1)?MC_White:MC_Black);
|
((index)&1)?MC_White:MC_Black);
|
||||||
|
// Right line
|
||||||
for (index=start_y+1; index<end_y; index++)
|
for (index=1; index<end_y; index++)
|
||||||
Block(end_x*Menu_factor_X,Menu_Y+(index*Menu_factor_Y),
|
Block(start_x+end_x*Menu_factor_Y,start_y+index*Menu_factor_Y,
|
||||||
Menu_factor_X,Menu_factor_Y,
|
Menu_factor_X,Menu_factor_Y,
|
||||||
((index+end_x)&1)?MC_White:MC_Black);
|
((index+end_x)&1)?MC_White:MC_Black);
|
||||||
|
// Bottom line
|
||||||
for (index=start_x; index<=end_x; index++)
|
for (index=0; index<=end_x; index++)
|
||||||
Block(index*Menu_factor_X,Menu_Y+(end_y*Menu_factor_Y),
|
Block(start_x+index*Menu_factor_X,start_y+end_y*Menu_factor_Y,
|
||||||
Menu_factor_X,Menu_factor_Y,
|
Menu_factor_X,Menu_factor_Y,
|
||||||
((index+end_y)&1)?MC_White:MC_Black);
|
((index+end_y)&1)?MC_White:MC_Black);
|
||||||
|
|
||||||
@ -239,19 +272,19 @@ void Display_menu_palette(void)
|
|||||||
Block(MENU_WIDTH*Menu_factor_X,Menu_Y,Screen_width-(MENU_WIDTH*Menu_factor_X),(MENU_HEIGHT-9)*Menu_factor_Y,MC_Black);
|
Block(MENU_WIDTH*Menu_factor_X,Menu_Y,Screen_width-(MENU_WIDTH*Menu_factor_X),(MENU_HEIGHT-9)*Menu_factor_Y,MC_Black);
|
||||||
|
|
||||||
if (Config.Couleurs_separees)
|
if (Config.Couleurs_separees)
|
||||||
for (color=0;First_color_in_palette+color<256&&color<Menu_cells_X*Menu_cells_Y;color++)
|
for (color=First_color_in_palette;color<256&&(color-First_color_in_palette)<Menu_cells_X*Menu_cells_Y;color++)
|
||||||
Block((MENU_WIDTH+1+(color/Menu_cells_Y)*Menu_palette_cell_width)*Menu_factor_X,
|
Block(Palette_cell_X(color),
|
||||||
Menu_Y+((2+((color%Menu_cells_Y)*cell_height))*Menu_factor_Y),
|
Palette_cell_Y(color),
|
||||||
(Menu_palette_cell_width-1)*Menu_factor_X,
|
(Menu_palette_cell_width-1)*Menu_factor_X,
|
||||||
Menu_factor_Y*(cell_height-1),
|
(cell_height-1)*Menu_factor_Y,
|
||||||
First_color_in_palette+color);
|
color);
|
||||||
else
|
else
|
||||||
for (color=0;First_color_in_palette+color<256&&color<Menu_cells_X*Menu_cells_Y;color++)
|
for (color=First_color_in_palette;color<256&&color-First_color_in_palette<Menu_cells_X*Menu_cells_Y;color++)
|
||||||
Block((MENU_WIDTH+1+(color/Menu_cells_Y)*Menu_palette_cell_width)*Menu_factor_X,
|
Block(Palette_cell_X(color),
|
||||||
Menu_Y+((2+((color%Menu_cells_Y)*cell_height))*Menu_factor_Y),
|
Palette_cell_Y(color),
|
||||||
Menu_palette_cell_width*Menu_factor_X,
|
Menu_palette_cell_width*Menu_factor_X,
|
||||||
Menu_factor_Y*cell_height,
|
cell_height*Menu_factor_Y,
|
||||||
First_color_in_palette+color);
|
color);
|
||||||
|
|
||||||
Frame_menu_color(MC_White);
|
Frame_menu_color(MC_White);
|
||||||
Update_rect(MENU_WIDTH*Menu_factor_X,Menu_Y,Screen_width-(MENU_WIDTH*Menu_factor_X),(MENU_HEIGHT-9)*Menu_factor_Y);
|
Update_rect(MENU_WIDTH*Menu_factor_X,Menu_Y,Screen_width-(MENU_WIDTH*Menu_factor_X),(MENU_HEIGHT-9)*Menu_factor_Y);
|
||||||
@ -264,16 +297,22 @@ void Display_menu_palette(void)
|
|||||||
void Reposition_palette(void)
|
void Reposition_palette(void)
|
||||||
{
|
{
|
||||||
byte old_color=First_color_in_palette;
|
byte old_color=First_color_in_palette;
|
||||||
|
short cells;
|
||||||
|
if (Config.Palette_vertical)
|
||||||
|
cells=Menu_cells_X;
|
||||||
|
else
|
||||||
|
cells=Menu_cells_Y;
|
||||||
|
|
||||||
|
|
||||||
if (Fore_color<First_color_in_palette)
|
if (Fore_color<First_color_in_palette)
|
||||||
{
|
{
|
||||||
while (Fore_color<First_color_in_palette)
|
while (Fore_color<First_color_in_palette)
|
||||||
First_color_in_palette-=Menu_cells_Y;
|
First_color_in_palette-=cells;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (Fore_color>=First_color_in_palette+Menu_cells_X*Menu_cells_Y)
|
while (Fore_color>=First_color_in_palette+Menu_cells_X*Menu_cells_Y)
|
||||||
First_color_in_palette+=Menu_cells_Y;
|
First_color_in_palette+=cells;
|
||||||
}
|
}
|
||||||
if (old_color!=First_color_in_palette)
|
if (old_color!=First_color_in_palette)
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
@ -300,8 +339,11 @@ void Change_palette_cells()
|
|||||||
Menu_cells_X--;
|
Menu_cells_X--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cale First_color_in_palette sur un multiple de cells_y (arrondi inférieur)
|
// Cale First_color_in_palette sur un multiple du nombre de cellules (arrondi inférieur)
|
||||||
First_color_in_palette=First_color_in_palette/Menu_cells_Y*Menu_cells_Y;
|
if (Config.Palette_vertical)
|
||||||
|
First_color_in_palette=First_color_in_palette/Menu_cells_X*Menu_cells_X;
|
||||||
|
else
|
||||||
|
First_color_in_palette=First_color_in_palette/Menu_cells_Y*Menu_cells_Y;
|
||||||
|
|
||||||
// Si le nombre de cellules a beaucoup augmenté et qu'on était près de
|
// Si le nombre de cellules a beaucoup augmenté et qu'on était près de
|
||||||
// la fin, il faut reculer First_color_in_palette pour montrer plein
|
// la fin, il faut reculer First_color_in_palette pour montrer plein
|
||||||
@ -325,10 +367,18 @@ int Pick_color_in_palette()
|
|||||||
{
|
{
|
||||||
int color;
|
int color;
|
||||||
int line;
|
int line;
|
||||||
|
int column;
|
||||||
|
|
||||||
line=(((Mouse_Y-Menu_Y)/Menu_factor_Y)-2)/(32/Menu_cells_Y);
|
line=(((Mouse_Y-Menu_Y)/Menu_factor_Y)-2)/(32/Menu_cells_Y);
|
||||||
|
column=(((Mouse_X/Menu_factor_X)-(MENU_WIDTH+1))/Menu_palette_cell_width);
|
||||||
color=First_color_in_palette+line+
|
if (Config.Palette_vertical)
|
||||||
((((Mouse_X/Menu_factor_X)-(MENU_WIDTH+1))/Menu_palette_cell_width)*Menu_cells_Y);
|
{
|
||||||
|
color=First_color_in_palette+line*Menu_cells_X+column;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color=First_color_in_palette+line+column*Menu_cells_Y;
|
||||||
|
}
|
||||||
if (color<0 || color>255)
|
if (color<0 || color>255)
|
||||||
return -1;
|
return -1;
|
||||||
return color;
|
return color;
|
||||||
@ -1025,8 +1075,8 @@ void Display_menu_palette_avoiding_window(byte * table)
|
|||||||
{
|
{
|
||||||
if (table[real_color]!=real_color)
|
if (table[real_color]!=real_color)
|
||||||
{
|
{
|
||||||
start_x=(MENU_WIDTH+1+(color/Menu_cells_Y)*Menu_palette_cell_width)*Menu_factor_X;
|
start_x=Palette_cell_X(real_color);
|
||||||
start_y=Menu_Y_before_window+((2+((color%Menu_cells_Y)*(32/Menu_cells_Y)))*Menu_factor_Y);
|
start_y=Palette_cell_Y(real_color); //Menu_Y_before_window ??!
|
||||||
end_x=start_x+width;
|
end_x=start_x+width;
|
||||||
end_y=start_y+height;
|
end_y=start_y+height;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user