Load/Save: Fixed display of mount points and drives ("Select drive" button)
Started documenting global variables
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@698 416bcca6-2ee7-4201-b75f-2eb2f807beb1
721 lines
32 KiB
C
721 lines
32 KiB
C
/* Grafx2 - The Ultimate 256-color bitmap paint program
|
||
|
||
Copyright 2007 Adrien Destugues
|
||
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
|
||
|
||
Grafx2 is free software; you can redistribute it and/or
|
||
modify it under the terms of the GNU General Public License
|
||
as published by the Free Software Foundation; version 2
|
||
of the License.
|
||
|
||
Grafx2 is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
|
||
You should have received a copy of the GNU General Public License
|
||
along with Grafx2; if not, see <http://www.gnu.org/licenses/> or
|
||
write to the Free Software Foundation, Inc.,
|
||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
*/
|
||
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
///@file global.h
|
||
/// This file contains all global variables.
|
||
/// They are prefixed by ::GFX2_GLOBAL so they are extern when needed.
|
||
//////////////////////////////////////////////////////////////////////////////
|
||
#ifndef _GLOBAL_H_
|
||
#define _GLOBAL_H_
|
||
|
||
#include <SDL.h>
|
||
#include "struct.h"
|
||
|
||
// MAIN declares the variables,
|
||
// other files only have an extern definition.
|
||
#ifdef GLOBAL_VARIABLES
|
||
/// Magic prefix to make all declarations extern, except when included by main.c.
|
||
#define GFX2_GLOBAL
|
||
#else
|
||
#define GFX2_GLOBAL extern
|
||
#endif
|
||
|
||
// -- CONFIGURATION variables
|
||
|
||
/// Current configuration.
|
||
GFX2_GLOBAL T_Config Config;
|
||
|
||
/// Array of special keys.
|
||
GFX2_GLOBAL word Config_Key[NB_SPECIAL_SHORTCUTS][2];
|
||
|
||
/// A video mode (resolution) usable by Grafx2.
|
||
typedef struct
|
||
{
|
||
short Width; ///< Screen width
|
||
short Height; ///< Screen height
|
||
byte Mode; ///< Unused (used to be Mode-X, SVGA, etc)
|
||
word Fullscreen; ///< 0 for window, 1 for fullscreen
|
||
byte State; /// How good is the mode supported. 0:Good (white) 1:OK (light) 2:So-so (dark) 4:User-disabled (black); +128 => System doesn't support it at all.
|
||
} T_Video_mode;
|
||
|
||
/// Array of all video modes supported by your platform. Actually filled up to ::Nb_video_modes, excluded.
|
||
GFX2_GLOBAL T_Video_mode Video_mode[MAX_VIDEO_MODES];
|
||
|
||
/// Actual number of video modes in ::Video_mode.
|
||
GFX2_GLOBAL int Nb_video_modes;
|
||
|
||
/// A default 256-color palette.
|
||
GFX2_GLOBAL T_Palette Default_palette;
|
||
|
||
// Menu colors
|
||
|
||
GFX2_GLOBAL byte MC_Black; /// Index of color to use as "black" in the GUI menus.
|
||
GFX2_GLOBAL byte MC_Dark; /// Index of color to use as "dark grey" in the GUI menus.
|
||
GFX2_GLOBAL byte MC_Light; /// Index of color to use as "light grey" in the GUI menus.
|
||
GFX2_GLOBAL byte MC_White; /// Index of color to use as "white" in the GUI menus.
|
||
GFX2_GLOBAL byte MC_Trans; /// Index of color to use as "transparent" while loading the GUI file.
|
||
|
||
/// Favorite menu colors (RGB values).
|
||
GFX2_GLOBAL T_Components Fav_menu_colors[4];
|
||
|
||
// Input state
|
||
GFX2_GLOBAL word Mouse_X; /// Current mouse cursor position.
|
||
GFX2_GLOBAL word Mouse_Y; /// Current mouse cursor position.
|
||
GFX2_GLOBAL byte Mouse_K; /// Current mouse buttons state. Bitfield: 1 for RMB, 2 for LMB.
|
||
|
||
/// Helper macro to take only one button when both are pressed (LMB has priority)
|
||
#define Mouse_K_unique (Mouse_K==0?0:(Mouse_K&1?1:(Mouse_K&2?2:0))) // State des boutons de la souris (un seul bouton <20> la fois, on regarde d'abord le 1, puis le 2, ...)
|
||
|
||
/// Last key pressed, 0 if none. Set by the latest call to ::Get_input()
|
||
GFX2_GLOBAL dword Key;
|
||
|
||
///
|
||
/// Last character typed, converted to ANSI character set (Windows-1252).
|
||
/// This is mostly used when the user enters text (filename, etc).
|
||
GFX2_GLOBAL dword Key_ANSI;
|
||
|
||
// Keyboard modifiers
|
||
// (Name conflict with windows.h)
|
||
#ifdef MOD_SHIFT
|
||
#undef MOD_SHIFT
|
||
#endif
|
||
#ifdef MOD_CTRL
|
||
#undef MOD_CTRL
|
||
#endif
|
||
#ifdef MOD_ALT
|
||
#undef MOD_ALT
|
||
#endif
|
||
/// Key modifier for SHIFT key. Used as mask in ::Key, for example.
|
||
#define MOD_SHIFT 0x1000
|
||
/// Key modifier for CONTROL key. Used as mask in ::Key, for example.
|
||
#define MOD_CTRL 0x2000
|
||
/// Key modifier for ALT key. Used as mask in ::Key, for example.
|
||
#define MOD_ALT 0x4000
|
||
|
||
/// Boolean set to true when the OS/window manager requests the application to close. ie: [X] button
|
||
GFX2_GLOBAL byte Quit_is_required;
|
||
|
||
/// Divisor for the mouse coordinates recieved. No target currently needs it, should be left at 1.
|
||
GFX2_GLOBAL byte Mouse_fix_factor_X;
|
||
/// Divisor for the mouse coordinates recieved. No target currently needs it, should be left at 1.
|
||
GFX2_GLOBAL byte Mouse_fix_factor_Y;
|
||
|
||
///
|
||
/// This boolean is true when the current operation allows changing the
|
||
/// foreground or background color.
|
||
GFX2_GLOBAL byte Allow_color_change_during_operation;
|
||
|
||
// Mouse cursor data
|
||
|
||
/// Current mouse cursor. Value is in enum ::CURSOR_SHAPES
|
||
GFX2_GLOBAL byte Cursor_shape;
|
||
/// Backup of ::Cursor_shape, used while a window is open (and needs a different cursor)
|
||
GFX2_GLOBAL byte Cursor_shape_before_window;
|
||
/// Boolean, means the cursor should not be drawn. It's togglable by the user.
|
||
GFX2_GLOBAL byte Cursor_hidden;
|
||
/// Boolean, means the cursor is currently hovering over a menu GUI element.
|
||
GFX2_GLOBAL byte Cursor_in_menu;
|
||
/// Boolean, means the cursor was hovering over a menu GUI element.
|
||
GFX2_GLOBAL byte Cursor_in_menu_previous;
|
||
/// X coordinate of the mouse cursor's "hot spot". It is < ::CURSOR_SPRITE_WIDTH
|
||
GFX2_GLOBAL word Cursor_offset_X[NB_CURSOR_SPRITES];
|
||
/// Y coordinate of the mouse cursor's "hot spot". It is < ::CURSOR_SPRITE_HEIGHT
|
||
GFX2_GLOBAL word Cursor_offset_Y[NB_CURSOR_SPRITES];
|
||
/// Graphic resources for the mouse cursor.
|
||
GFX2_GLOBAL byte GFX_cursor_sprite[NB_CURSOR_SPRITES][CURSOR_SPRITE_HEIGHT][CURSOR_SPRITE_WIDTH];
|
||
/// Storage for the graphics under the mouse cursor. Used by ::Hide_cursor and ::Display_cursor
|
||
GFX2_GLOBAL byte CURSOR_BACKGROUND[CURSOR_SPRITE_HEIGHT][CURSOR_SPRITE_WIDTH];
|
||
|
||
// Paintbrush data
|
||
|
||
/// Active paintbrush. It's an index in enum ::PAINTBRUSH_SHAPES
|
||
GFX2_GLOBAL byte Paintbrush_shape;
|
||
/// Backup of ::Paintbrush_shape, before fill operation
|
||
GFX2_GLOBAL byte Paintbrush_shape_before_fill;
|
||
/// Backup of ::Paintbrush_shape, before color picker operation
|
||
GFX2_GLOBAL byte Paintbrush_shape_before_colorpicker;
|
||
/// Backup of ::Paintbrush_shaper, before lasso operation
|
||
GFX2_GLOBAL byte Paintbrush_shape_before_lasso;
|
||
/// Boolean, true when the preview paintbrush shouldn't be drawn.
|
||
GFX2_GLOBAL byte Paintbrush_hidden;
|
||
/// Cordinate of the preview paintbrush in image space.
|
||
GFX2_GLOBAL short Paintbrush_X;
|
||
/// Cordinate of the preview paintbrush in image space.
|
||
GFX2_GLOBAL short Paintbrush_Y;
|
||
/// Graphic resources for the preset paintbrushes.
|
||
GFX2_GLOBAL byte GFX_paintbrush_sprite [NB_PAINTBRUSH_SPRITES][PAINTBRUSH_HEIGHT][PAINTBRUSH_WIDTH];
|
||
/// Width of the preset paintbrushes.
|
||
GFX2_GLOBAL word Preset_paintbrush_width[NB_PAINTBRUSH_SPRITES];
|
||
/// Height of the preset paintbrushes.
|
||
GFX2_GLOBAL word Preset_paintbrush_height[NB_PAINTBRUSH_SPRITES];
|
||
/// Type of the preset paintbrush: index in enum PAINTBRUSH_SHAPES
|
||
GFX2_GLOBAL byte Paintbrush_type[NB_PAINTBRUSH_SPRITES];
|
||
/// Brush handle for the preset brushes. Generally ::Preset_paintbrush_width[]/2
|
||
GFX2_GLOBAL word Preset_paintbrush_offset_X[NB_PAINTBRUSH_SPRITES];
|
||
/// Brush handle for the preset brushes. Generally ::Preset_paintbrush_height[]/2
|
||
GFX2_GLOBAL word Preset_paintbrush_offset_Y[NB_PAINTBRUSH_SPRITES];
|
||
/// Pixel data of the current brush
|
||
GFX2_GLOBAL byte * Paintbrush_sprite;
|
||
/// Current paintbrush's width
|
||
GFX2_GLOBAL short Paintbrush_width;
|
||
/// Current paintbrush's height
|
||
GFX2_GLOBAL short Paintbrush_height;
|
||
/// Position of current paintbrush's handle
|
||
GFX2_GLOBAL short Paintbrush_offset_X;
|
||
/// Position of current paintbrush's handle
|
||
GFX2_GLOBAL short Paintbrush_offset_Y;
|
||
|
||
/// Current pixel ratio. Index in enum ::PIXEL_RATIO
|
||
GFX2_GLOBAL int Pixel_ratio;
|
||
/// Current width of pixels, according to ::Pixel_ratio
|
||
GFX2_GLOBAL int Pixel_width;
|
||
/// Current height of pixels, according to ::Pixel_ratio
|
||
GFX2_GLOBAL int Pixel_height;
|
||
|
||
// Graphic commands
|
||
|
||
/// On the screen, draw a point.
|
||
GFX2_GLOBAL Func_pixel Pixel;
|
||
/// On screen, draw a point in the menu (do nothing is menu is hidden).
|
||
GFX2_GLOBAL Func_pixel Pixel_in_menu;
|
||
/// Test a pixel color from screen.
|
||
GFX2_GLOBAL Func_read Read_pixel;
|
||
/// Redraw all screen, without overwriting the menu.
|
||
GFX2_GLOBAL Func_display Display_screen;
|
||
/// Draw a rectangle on screen.
|
||
GFX2_GLOBAL Func_block Block;
|
||
/// Draw a point from the image to screen (no zoom).
|
||
GFX2_GLOBAL Func_pixel Pixel_preview_normal;
|
||
/// Draw a point from the image to screen (magnified part).
|
||
GFX2_GLOBAL Func_pixel Pixel_preview_magnifier;
|
||
/// Draw a point from the image to screen (zoomed if needed).
|
||
GFX2_GLOBAL Func_pixel Pixel_preview;
|
||
/// Draw a horizontal XOR line on screen.
|
||
GFX2_GLOBAL Func_line_XOR Horizontal_XOR_line;
|
||
/// Draw a vertical XOR line on screen.
|
||
GFX2_GLOBAL Func_line_XOR Vertical_XOR_line;
|
||
/// Display part of the brush on screen, color mode.
|
||
GFX2_GLOBAL Func_display_brush_color Display_brush_color;
|
||
/// Display part of the brush on screen, monochrome mode.
|
||
GFX2_GLOBAL Func_display_brush_mono Display_brush_mono;
|
||
/// Clear the brush currently displayed on screen, redrawing the image instead.
|
||
GFX2_GLOBAL Func_display_brush_color Clear_brush;
|
||
/// Remap part of the screen after the menu colors have changed.
|
||
GFX2_GLOBAL Func_remap Remap_screen;
|
||
/// Draw a line on screen.
|
||
GFX2_GLOBAL Func_procsline Display_line;
|
||
/// Draw a line on screen, without doubling it if using wide pixels. (to be used when the line is already doubled in the input buffer)
|
||
GFX2_GLOBAL Func_procsline Display_line_fast;
|
||
/// Read a line of pixels from screen.
|
||
GFX2_GLOBAL Func_procsline Read_line;
|
||
/// Redraw all magnified part on screen, without overwriting the menu.
|
||
GFX2_GLOBAL Func_display_zoom Display_zoomed_screen;
|
||
/// Display part of the brush on the magnified part of screen, color mode.
|
||
GFX2_GLOBAL Func_display_brush_color_zoom Display_brush_color_zoom;
|
||
/// Display part of the brush on the magnified part of screen, monochrome mode.
|
||
GFX2_GLOBAL Func_display_brush_mono_zoom Display_brush_mono_zoom;
|
||
/// Clear the brush currently displayed on the magnified part of screen, redrawing the image instead.
|
||
GFX2_GLOBAL Func_display_brush_color_zoom Clear_brush_scaled;
|
||
/// Draw an arbitrary brush on screen (not the current brush)
|
||
GFX2_GLOBAL Func_draw_brush Display_brush;
|
||
|
||
// Screen data
|
||
|
||
GFX2_GLOBAL int Resize_width; // \__ Positionn<6E>es lorsque l'utilisateur tire
|
||
GFX2_GLOBAL int Resize_height; // / un bord de la fen<65>tre.
|
||
GFX2_GLOBAL int Current_resolution; // R<>solution graphique courante
|
||
GFX2_GLOBAL short Original_screen_X; // |_ Dimensions de l'<27>cran d'origine de
|
||
GFX2_GLOBAL short Original_screen_Y; // | l'image qui vient d'<27>tre charg<72>e.
|
||
GFX2_GLOBAL short Screen_width; // Largeur de l'<27>cran
|
||
GFX2_GLOBAL short Screen_height; // Hauteur de l'<27>cran
|
||
GFX2_GLOBAL short Limit_top; // |
|
||
GFX2_GLOBAL short Limit_bottom; // |_ Limites dans lesquelles
|
||
GFX2_GLOBAL short Limit_left; // | on peut <20>crire
|
||
GFX2_GLOBAL short Limit_right; // |
|
||
GFX2_GLOBAL short Limit_visible_bottom; // |_ Derniers points visibles
|
||
GFX2_GLOBAL short Limit_visible_right; // | "<22> l'image"
|
||
|
||
GFX2_GLOBAL short Limit_top_zoom; // |
|
||
GFX2_GLOBAL short Limit_bottom_zoom; // |_ Limites dans lesquelles on peut
|
||
GFX2_GLOBAL short Limit_left_zoom; // | <20>crire dans la partie zoom<6F>e
|
||
GFX2_GLOBAL short Limit_right_zoom; // |
|
||
GFX2_GLOBAL short Limit_visible_bottom_zoom; // |_ Derniers points visibles "<22>
|
||
GFX2_GLOBAL short Limit_visible_right_zoom; // | l'image" dans la partie zoom<6F>e
|
||
|
||
GFX2_GLOBAL byte * Horizontal_line_buffer; // buffer d'affichage de lignes
|
||
|
||
// Donn<6E>es sur l'image actuelle:
|
||
|
||
GFX2_GLOBAL byte * Main_screen; // Screen virtuel courant
|
||
GFX2_GLOBAL T_Palette Main_palette; // Palette de l'<27>cran en cours
|
||
|
||
GFX2_GLOBAL byte Main_image_is_modified; // L'image courante a <20>t<EFBFBD> modifi<66>e
|
||
GFX2_GLOBAL short Main_image_width; // Largeur de l'image dans laquelle l'utilisateur d<>sire travailler
|
||
GFX2_GLOBAL short Main_image_height; // Hauteur de l'image dans laquelle l'utilisateur d<>sire travailler
|
||
GFX2_GLOBAL short Main_offset_X; // D<>calage en X de l'<27>cran par rapport au d<>but de l'image
|
||
GFX2_GLOBAL short Main_offset_Y; // D<>calage en Y de l'<27>cran par rapport au d<>but de l'image
|
||
GFX2_GLOBAL short Old_main_offset_X;
|
||
GFX2_GLOBAL short Old_main_offset_Y;
|
||
|
||
GFX2_GLOBAL char Main_file_directory[1024]; // |_ Nom complet =
|
||
GFX2_GLOBAL char Main_filename[256]; // | File_directory+"\"+Filename
|
||
GFX2_GLOBAL byte Main_fileformat; // Format auquel il faut lire et <20>crire le fichier
|
||
GFX2_GLOBAL byte Main_format; // Format du fileselect
|
||
GFX2_GLOBAL short Main_fileselector_position; // D<>but de la partie affich<63>e dans la liste de fichiers
|
||
GFX2_GLOBAL short Main_fileselector_offset; // D<>calage de la barre de s<>lection dans le fileselector
|
||
GFX2_GLOBAL char Main_current_directory[1024]; // R<>pertoire actuel sur disque
|
||
GFX2_GLOBAL char Main_comment[COMMENT_SIZE+1]; // Commentaire de l'image
|
||
|
||
GFX2_GLOBAL short Main_separator_position; // Position en X du bord gauche du split de la loupe
|
||
GFX2_GLOBAL short Main_X_zoom; // (Menu_factor_X) + Position en X du bord droit du split de la loupe
|
||
GFX2_GLOBAL float Main_separator_proportion; // Proportion de la zone non-zoom<6F>e par rapport <20> l'<27>cran
|
||
|
||
// Donn<6E>es sur le brouillon:
|
||
|
||
GFX2_GLOBAL byte * Spare_screen; // Screen virtuel brouillon
|
||
GFX2_GLOBAL T_Palette Spare_palette; // Palette de l'<27>cran de brouillon
|
||
|
||
GFX2_GLOBAL byte Spare_image_is_modified; // Le brouillon a <20>t<EFBFBD> modifi<66>
|
||
GFX2_GLOBAL short Spare_image_width; // Largeur du brouillon dans laquelle l'utilisateur d<>sire travailler
|
||
GFX2_GLOBAL short Spare_image_height; // Hauteur du brouillon dans laquelle l'utilisateur d<>sire travailler
|
||
GFX2_GLOBAL short Spare_offset_X; // D<>calage en X du brouillon par rapport au d<>but de l'image
|
||
GFX2_GLOBAL short Spare_offset_Y; // D<>calage en Y du brouillon par rapport au d<>but de l'image
|
||
GFX2_GLOBAL short Old_spare_offset_X;
|
||
GFX2_GLOBAL short Old_spare_offset_Y;
|
||
|
||
GFX2_GLOBAL char Spare_file_directory[MAX_PATH_CHARACTERS]; // |_ Nom complet =
|
||
GFX2_GLOBAL char Spare_filename[MAX_PATH_CHARACTERS]; // | File_directory+"\"+Filename
|
||
GFX2_GLOBAL byte Spare_fileformat; // Format auquel il faut lire et <20>crire le fichier
|
||
GFX2_GLOBAL byte Spare_format; // Format du fileselect
|
||
GFX2_GLOBAL short Spare_fileselector_position; // D<>but de la partie affich<63>e dans la liste de fichiers
|
||
GFX2_GLOBAL short Spare_fileselector_offset; // D<>calage de la barre de s<>lection dans le fileselector
|
||
GFX2_GLOBAL char Spare_current_directory[MAX_PATH_CHARACTERS]; // R<>pertoire actuel sur disque
|
||
GFX2_GLOBAL char Spare_comment[COMMENT_SIZE+1]; // Commentaire de l'image
|
||
|
||
GFX2_GLOBAL short Spare_separator_position; // Position en X du bord gauche du split de la loupe
|
||
GFX2_GLOBAL short Spare_X_zoom; // (Menu_factor_X) + Position en X du bord droit du split de la loupe
|
||
GFX2_GLOBAL float Spare_separator_proportion; // Proportion de la zone non-zoom<6F>e par rapport <20> l'<27>cran
|
||
|
||
GFX2_GLOBAL byte Spare_magnifier_mode; // On est en mode loupe dans le brouillon
|
||
GFX2_GLOBAL word Spare_magnifier_factor; // Facteur de zoom dans le brouillon
|
||
GFX2_GLOBAL word Spare_magnifier_height; // Largeur de la fen<65>tre de zoom dans le brouillon
|
||
GFX2_GLOBAL word Spare_magnifier_width; // Hauteur de la fen<65>tre de zoom dans le brouillon
|
||
GFX2_GLOBAL short Spare_magnifier_offset_X;// Offset horizontal de la fen<65>tre de zoom dans le brouillon
|
||
GFX2_GLOBAL short Spare_magnifier_offset_Y;// Offset vertical de la fen<65>tre de zoom dans le brouillon
|
||
|
||
GFX2_GLOBAL byte Mask_color_to_copy[256]; // Tableau des couleurs <20> copier vers le brouillon
|
||
|
||
// Sauvegarde de l'image:
|
||
|
||
GFX2_GLOBAL byte * Screen_backup; // Sauvegarde de l'<27>cran virtuel courant
|
||
GFX2_GLOBAL T_List_of_pages * Main_backups; // Liste des pages de backup de la page principale
|
||
GFX2_GLOBAL T_List_of_pages * Spare_backups; // Liste des pages de backup de la page de brouillon
|
||
|
||
|
||
// Donn<6E>es sur la brosse:
|
||
|
||
GFX2_GLOBAL byte * Brush; // Sprite de la brosse
|
||
GFX2_GLOBAL word Brush_offset_X; // Centre horizontal de la brosse
|
||
GFX2_GLOBAL word Brush_offset_Y; // Centre vertical de la brosse
|
||
GFX2_GLOBAL word Brush_width; // Largeur de la brosse
|
||
GFX2_GLOBAL word Brush_height; // Hauteur de la brosse
|
||
|
||
GFX2_GLOBAL char Brush_file_directory[MAX_PATH_CHARACTERS];// |
|
||
GFX2_GLOBAL char Brush_filename[MAX_PATH_CHARACTERS]; // |
|
||
GFX2_GLOBAL byte Brush_fileformat; // | Infos sur le
|
||
GFX2_GLOBAL byte Brush_format; // |_ s<>lecteur de
|
||
GFX2_GLOBAL short Brush_fileselector_position; // | fichiers de la
|
||
GFX2_GLOBAL short Brush_fileselector_offset; // | brosse.
|
||
GFX2_GLOBAL char Brush_current_directory[256]; // |
|
||
GFX2_GLOBAL char Brush_comment[COMMENT_SIZE+1]; // |
|
||
|
||
GFX2_GLOBAL byte Brush_rotation_center_is_defined; // | Infos sur le
|
||
GFX2_GLOBAL short Brush_rotation_center_X; // |- centre de rotation
|
||
GFX2_GLOBAL short Brush_rotation_center_Y; // | de la brosse
|
||
|
||
// Donn<6E>es sur le menu
|
||
|
||
GFX2_GLOBAL byte Menu_is_visible; // Le menu est actif <20> l'<27>cran
|
||
GFX2_GLOBAL word Menu_Y; // Ordonn<6E>e o<> commence le menu
|
||
GFX2_GLOBAL word Menu_status_Y; // Ordonn<6E>e o<> commence le texte dans le menu
|
||
GFX2_GLOBAL byte Menu_factor_X; // Facteur de grossissement du menu en X
|
||
GFX2_GLOBAL byte Menu_factor_Y; // Facteur de grossissement du menu en Y
|
||
GFX2_GLOBAL word Menu_palette_cell_width; // Taille d'une couleur de la palette du menu
|
||
|
||
|
||
// Donn<6E>es sur la fen<65>tre de menu
|
||
|
||
GFX2_GLOBAL byte Windows_open; // Nombre de fenetres empil<69>es. 0 si pas de fenetre ouverte.
|
||
|
||
GFX2_GLOBAL byte Menu_is_visible_before_window; // Le menu <20>tait visible avant d'ouvir une fen<65>tre
|
||
GFX2_GLOBAL word Menu_Y_before_window; // Ordonn<6E>e du menu avant d'ouvrir une fen<65>tre
|
||
GFX2_GLOBAL byte Paintbrush_hidden_before_window;// Le pinceau <20>tatit d<>j<EFBFBD> cach<63> avant l'ouverture de la fenetre?
|
||
|
||
GFX2_GLOBAL word Window_stack_pos_X[8]; // Position du bord gauche de la fen<65>tre dans l'<27>cran
|
||
#define Window_pos_X Window_stack_pos_X[Windows_open-1]
|
||
|
||
GFX2_GLOBAL word Window_stack_pos_Y[8]; // Position du bord haut de la fen<65>tre dans l'<27>cran
|
||
#define Window_pos_Y Window_stack_pos_Y[Windows_open-1]
|
||
|
||
GFX2_GLOBAL word Window_stack_width[8]; // Largeur de la fen<65>tre
|
||
#define Window_width Window_stack_width[Windows_open-1]
|
||
|
||
GFX2_GLOBAL word Window_stack_height[8]; // Hauteur de la fen<65>tre
|
||
#define Window_height Window_stack_height[Windows_open-1]
|
||
|
||
GFX2_GLOBAL word Window_stack_nb_buttons[8];
|
||
#define Window_nb_buttons Window_stack_nb_buttons[Windows_open-1]
|
||
|
||
GFX2_GLOBAL T_Normal_button * Window_stack_normal_button_list[8];
|
||
#define Window_normal_button_list Window_stack_normal_button_list[Windows_open-1]
|
||
|
||
GFX2_GLOBAL T_Palette_button * Window_stack_palette_button_list[8];
|
||
#define Window_palette_button_list Window_stack_palette_button_list[Windows_open-1]
|
||
|
||
GFX2_GLOBAL T_Scroller_button * Window_stack_scroller_button_list[8];
|
||
#define Window_scroller_button_list Window_stack_scroller_button_list[Windows_open-1]
|
||
|
||
GFX2_GLOBAL T_Special_button * Window_stack_special_button_list[8];
|
||
#define Window_special_button_list Window_stack_special_button_list[Windows_open-1]
|
||
|
||
GFX2_GLOBAL T_Dropdown_button * Window_stack_dropdown_button_list[8];
|
||
#define Window_dropdown_button_list Window_stack_dropdown_button_list[Windows_open-1]
|
||
|
||
|
||
GFX2_GLOBAL int Window_stack_attribute1[8];
|
||
#define Window_attribute1 Window_stack_attribute1[Windows_open-1]
|
||
|
||
// Cette variable sert <20> stocker 2 informations:
|
||
// - Sur le click d'un scroller, la position active (0-n)
|
||
// - Sur le click d'une palette, le numero de couleur (0-255).
|
||
GFX2_GLOBAL int Window_stack_attribute2[8];
|
||
#define Window_attribute2 Window_stack_attribute2[Windows_open-1]
|
||
|
||
|
||
|
||
|
||
// D<>finition des boutons ////////////////////////////////////////////////////
|
||
|
||
GFX2_GLOBAL struct
|
||
{
|
||
// Informations sur l'aspect du bouton (graphisme):
|
||
word X_offset; // D<>calage par rapport <20> la gauche du menu
|
||
word Y_offset; // D<>calage par rapport au haut du menu
|
||
word Width; // Largeur du bouton
|
||
word Height; // Hauteur du bouton
|
||
byte Pressed; // Le bouton est enfonc<6E>
|
||
byte Shape; // Forme du bouton
|
||
|
||
// Information sur les clicks de la souris:
|
||
Func_action Gauche; // Action d<>clench<63>e par un click gauche sur le bouton
|
||
Func_action Droite; // Action d<>clench<63>e par un click droit sur le bouton
|
||
word Left_shortcut[2]; // Shortcut clavier <20>quivalent <20> un click gauche sur le bouton
|
||
word Right_shortcut[2]; // Shortcut clavier <20>quivalent <20> un click droit sur le bouton
|
||
|
||
// Informations sur le d<>senclenchement du bouton g<>r<EFBFBD> par le moteur:
|
||
Func_action Desenclencher; // Action appel<65>e lors du d<>senclenchement du bouton
|
||
byte Famille; // Ensemble de boutons auquel celui-ci appartient
|
||
|
||
} Button[NB_BUTTONS];
|
||
|
||
|
||
|
||
// Informations sur les diff<66>rents modes de dessin
|
||
|
||
GFX2_GLOBAL Func_effect Effect_function;
|
||
|
||
GFX2_GLOBAL byte * FX_feedback_screen;
|
||
|
||
GFX2_GLOBAL byte Exclude_color[256]; // Couleurs <20> exclure pour Best_color
|
||
|
||
// Mode smear:
|
||
|
||
GFX2_GLOBAL byte Smear_mode; // Le mode smear est enclench<63>
|
||
GFX2_GLOBAL byte Smear_start; // On vient juste de commencer une op<6F>ration en Smear
|
||
GFX2_GLOBAL byte * Smear_brush; // Sprite de la brosse de Smear
|
||
GFX2_GLOBAL word Smear_brush_width; // Largeur de la brosse de Smear
|
||
GFX2_GLOBAL word Smear_brush_height; // Hauteur de la brosse de Smear
|
||
GFX2_GLOBAL short Smear_min_X,Smear_max_X,Smear_min_Y,Smear_max_Y; // Bornes de la Brush du smear
|
||
|
||
// Mode shade:
|
||
|
||
GFX2_GLOBAL T_Shade Shade_list[8]; // Listes de shade
|
||
GFX2_GLOBAL byte Shade_current; // Num<75>ro du shade en cours
|
||
GFX2_GLOBAL byte * Shade_table; // Table de conversion de shade en cours
|
||
GFX2_GLOBAL byte Shade_table_left[256]; // Table de conversion de shade pour un clic gauche
|
||
GFX2_GLOBAL byte Shade_table_right[256]; // Table de conversion de shade pour un clic droit
|
||
GFX2_GLOBAL byte Shade_mode; // Le mode shade est enclench<63>
|
||
|
||
GFX2_GLOBAL byte Quick_shade_mode; // Le mode quick-shade est enclench<63>
|
||
GFX2_GLOBAL byte Quick_shade_step; // Pas du mode quick-shade
|
||
GFX2_GLOBAL byte Quick_shade_loop; // Normal / Loop / No sat.
|
||
|
||
// Mode stencil:
|
||
|
||
GFX2_GLOBAL byte Stencil_mode; // Le mode stencil est enclench<63>
|
||
GFX2_GLOBAL byte Stencil[256]; // Tableau des couleurs prot<6F>g<EFBFBD>es
|
||
|
||
// Mode grille:
|
||
|
||
GFX2_GLOBAL byte Snap_mode; // Le mode grille est enclench<63>
|
||
GFX2_GLOBAL word Snap_width; // Largeur entre 2 points de la grille
|
||
GFX2_GLOBAL word Snap_height; // Hauteur entre 2 points de la grille
|
||
GFX2_GLOBAL word Snap_offset_X; // Position en X du point le + <20> gauche
|
||
GFX2_GLOBAL word Snap_offset_Y; // Position en Y du point le + en haut
|
||
|
||
// Mode trame:
|
||
|
||
GFX2_GLOBAL byte Sieve_mode; // Le mode Sieve est enclench<63>
|
||
GFX2_GLOBAL byte Sieve[16][16]; // Sprite de la trame
|
||
GFX2_GLOBAL word GFX_sieve_pattern[12][16]; // Trames pr<70>s<EFBFBD>finies (compact<63>es sur 16*16 bits)
|
||
GFX2_GLOBAL short Sieve_width; // Largeur de la trame
|
||
GFX2_GLOBAL short Sieve_height; // Hauteur de la trame
|
||
|
||
// Mode colorize:
|
||
|
||
GFX2_GLOBAL byte Colorize_mode; // Le mode Colorize est enclench<63>
|
||
GFX2_GLOBAL byte Colorize_opacity; // Intensit<69> du Colorize
|
||
GFX2_GLOBAL byte Colorize_current_mode; // Le type de Colorize en cours (0-2)
|
||
GFX2_GLOBAL word Facteur_A_table[256];
|
||
GFX2_GLOBAL word Facteur_B_table[256];
|
||
|
||
// Mode smooth:
|
||
|
||
GFX2_GLOBAL byte Smooth_mode; // Le mode Smooth est enclench<63>
|
||
GFX2_GLOBAL byte Smooth_matrix[3][3]; // La matrice du Smooth actuel
|
||
|
||
// Mode Tiling:
|
||
|
||
GFX2_GLOBAL byte Tiling_mode; // Le mode Tiling est enclench<63>
|
||
GFX2_GLOBAL short Tiling_offset_X; // D<>calage du tiling en X
|
||
GFX2_GLOBAL short Tiling_offset_Y; // D<>calage du tiling en Y
|
||
|
||
// Mode Mask
|
||
|
||
GFX2_GLOBAL byte Mask_mode; // Le mode Masque est enclench<63>
|
||
GFX2_GLOBAL byte Mask_table[256]; // Tableau des couleurs constituant le masque
|
||
|
||
// Mode loupe:
|
||
|
||
GFX2_GLOBAL byte Main_magnifier_mode;
|
||
GFX2_GLOBAL word Main_magnifier_factor;
|
||
GFX2_GLOBAL word Main_magnifier_height;
|
||
GFX2_GLOBAL word Main_magnifier_width;
|
||
GFX2_GLOBAL short Main_magnifier_offset_X;
|
||
GFX2_GLOBAL short Main_magnifier_offset_Y;
|
||
GFX2_GLOBAL word * Zoom_factor_table;
|
||
GFX2_GLOBAL word Magnify_table[NB_ZOOM_FACTORS][512];
|
||
|
||
#ifdef GLOBAL_VARIABLES
|
||
word ZOOM_FACTOR[NB_ZOOM_FACTORS]={2,3,4,5,6,8,10,12,14,16,18,20};
|
||
#else
|
||
extern word ZOOM_FACTOR[NB_ZOOM_FACTORS];
|
||
#endif
|
||
|
||
// Donn<6E>es sur les ellipses et les cercles:
|
||
|
||
GFX2_GLOBAL long Ellipse_cursor_X;
|
||
GFX2_GLOBAL long Ellipse_cursor_Y;
|
||
GFX2_GLOBAL long Ellipse_vertical_radius_squared;
|
||
GFX2_GLOBAL long Ellipse_horizontal_radius_squared;
|
||
GFX2_GLOBAL qword Ellipse_limit;
|
||
GFX2_GLOBAL long Circle_cursor_X;
|
||
GFX2_GLOBAL long Circle_cursor_Y;
|
||
GFX2_GLOBAL long Circle_limit;
|
||
|
||
// Donn<6E>es sur les d<>grad<61>s:
|
||
|
||
GFX2_GLOBAL short Gradient_lower_bound; // Plus petite couleur englob<6F>e par le d<>grad<61>
|
||
GFX2_GLOBAL short Gradient_upper_bound; // Plus grande couleur englob<6F>e par le d<>grad<61>
|
||
GFX2_GLOBAL int Gradient_is_inverted; // Bool<6F>en "Le d<>grad<61> est en r<>alit<69> invers<72>"
|
||
GFX2_GLOBAL long Gradient_bounds_range; // = Abs(Gradient_lower_bound-Gradient_upper_bound)+1
|
||
GFX2_GLOBAL long Gradient_total_range; // Valeur maximum des indices pass<73>s <20> la fonction de d<>grad<61> (!!! >0 !!!)
|
||
GFX2_GLOBAL long Gradient_random_factor; // Facteur de m<>lange (1-256+) du d<>grad<61>
|
||
GFX2_GLOBAL Func_gradient Gradient_function; // Fonction de traitement du d<>grad<61>, varie selon la m<>thode choisie par l'utilisateur.
|
||
GFX2_GLOBAL Func_pixel Gradient_pixel; // Redirection de l'affichage
|
||
|
||
GFX2_GLOBAL T_Gradient_array Gradient_array[16]; // Donn<6E>es de tous les d<>grad<61>s
|
||
GFX2_GLOBAL byte Current_gradient; // index du tableau correspondant au d<>grad<61> courant
|
||
|
||
|
||
|
||
// Donn<6E>es sur le Spray:
|
||
|
||
GFX2_GLOBAL byte Airbrush_mode; // Mode Mono(1) ou Multicolore(0)
|
||
GFX2_GLOBAL short Airbrush_size; // Diam<61>tre du spray en pixels
|
||
GFX2_GLOBAL byte Airbrush_delay; // D<>lai en VBLs entre 2 "pschiitt"
|
||
GFX2_GLOBAL byte Airbrush_mono_flow; // Nombre de pixels qui sortent en m<>me temps en mono
|
||
GFX2_GLOBAL byte Airbrush_multi_flow[256]; // Idem pour chaque couleur
|
||
|
||
|
||
// Donn<6E>es diverses sur le programme:
|
||
|
||
GFX2_GLOBAL byte Quitting;
|
||
GFX2_GLOBAL char Initial_directory[256]; // R<>pertoire <20> partir duquel <20> <20>t<EFBFBD> lanc<6E> le programme
|
||
GFX2_GLOBAL char Repertoire_des_donnees[256]; // R<>pertoire contenant les fichiers lus (interface graphique, etc)
|
||
GFX2_GLOBAL char Config_directory[256]; // R<>pertoire contenant les fichiers .ini et .cfg
|
||
GFX2_GLOBAL byte Fore_color;
|
||
GFX2_GLOBAL byte Back_color;
|
||
GFX2_GLOBAL byte Selected_operation;
|
||
GFX2_GLOBAL byte Selected_curve_mode;
|
||
GFX2_GLOBAL byte Selected_line_mode;
|
||
GFX2_GLOBAL byte First_color_in_palette;
|
||
GFX2_GLOBAL byte File_in_command_line;
|
||
GFX2_GLOBAL byte Resolution_in_command_line; // utilis<69>e uniquement si la variable pr<70>c<EFBFBD>dente est <20> 1
|
||
|
||
// Les diff<66>rents sprites:
|
||
|
||
GFX2_GLOBAL byte GFX_menu_block[MENU_HEIGHT][MENU_WIDTH];
|
||
GFX2_GLOBAL byte GFX_menu_sprite[NB_MENU_SPRITES][MENU_SPRITE_HEIGHT][MENU_SPRITE_WIDTH];
|
||
GFX2_GLOBAL byte GFX_effect_sprite[NB_EFFECTS_SPRITES][MENU_SPRITE_HEIGHT][MENU_SPRITE_WIDTH];
|
||
|
||
GFX2_GLOBAL byte * GFX_logo_grafx2;
|
||
|
||
GFX2_GLOBAL byte GFX_system_font[256*8*8];
|
||
GFX2_GLOBAL byte GFX_fun_font [256*8*8];
|
||
GFX2_GLOBAL byte GFX_help_font_norm [256][6][8];
|
||
GFX2_GLOBAL byte GFX_bold_font [256][6][8];
|
||
// 12
|
||
// 34
|
||
GFX2_GLOBAL byte GFX_help_font_t1 [64][6][8];
|
||
GFX2_GLOBAL byte GFX_help_font_t2 [64][6][8];
|
||
GFX2_GLOBAL byte GFX_help_font_t3 [64][6][8];
|
||
GFX2_GLOBAL byte GFX_help_font_t4 [64][6][8];
|
||
GFX2_GLOBAL byte * Menu_font;
|
||
|
||
// Les donn<6E>es de l'aide:
|
||
|
||
GFX2_GLOBAL byte Current_help_section; // index de la table d'aide en cours de consultation
|
||
GFX2_GLOBAL word Help_position; // Num<75>ro de la ligne d'aide en cours de consultation
|
||
|
||
// Donn<6E>es sur les op<6F>rations
|
||
|
||
GFX2_GLOBAL word Operation_before_interrupt; // N<> de l'op<6F>ration en cours avant l'utilisation d'une interruption
|
||
GFX2_GLOBAL word Current_operation; // N<> de l'op<6F>ration en cours
|
||
GFX2_GLOBAL word Operation_stack[OPERATION_STACK_SIZE]; // Pile simplifi<66>e
|
||
GFX2_GLOBAL byte Operation_stack_size; // Taille effective de la pile (0=vide)
|
||
GFX2_GLOBAL byte Operation_in_magnifier; // Indique si l'op<6F>ration a commenc<6E> dans la partie Zoom<6F>e ou non
|
||
|
||
GFX2_GLOBAL short Colorpicker_color;
|
||
GFX2_GLOBAL short Colorpicker_X;
|
||
GFX2_GLOBAL short Colorpicker_Y;
|
||
|
||
|
||
#ifdef GLOBAL_VARIABLES
|
||
byte CURSOR_FOR_OPERATION[NB_OPERATIONS]=
|
||
{
|
||
CURSOR_SHAPE_TARGET , // Dessin <20> la main continu
|
||
CURSOR_SHAPE_TARGET , // Dessin <20> la main discontinu
|
||
CURSOR_SHAPE_TARGET , // Dessin <20> la main point par point
|
||
CURSOR_SHAPE_TARGET , // Contour fill
|
||
CURSOR_SHAPE_TARGET , // Lignes
|
||
CURSOR_SHAPE_TARGET , // Lignes reli<6C>es
|
||
CURSOR_SHAPE_TARGET , // Lignes centr<74>es
|
||
CURSOR_SHAPE_XOR_TARGET , // Rectangle vide
|
||
CURSOR_SHAPE_XOR_TARGET , // Rectangle plein
|
||
CURSOR_SHAPE_TARGET , // Cercles vides
|
||
CURSOR_SHAPE_TARGET , // Cercles pleins
|
||
CURSOR_SHAPE_TARGET , // Ellipses vides
|
||
CURSOR_SHAPE_TARGET , // Ellipses pleines
|
||
CURSOR_SHAPE_TARGET , // Fill
|
||
CURSOR_SHAPE_TARGET , // Replace
|
||
CURSOR_SHAPE_XOR_TARGET , // Prise de brosse rectangulaire
|
||
CURSOR_SHAPE_TARGET , // Prise d'une brosse multiforme
|
||
CURSOR_SHAPE_COLORPICKER , // R<>cup<75>ration d'une couleur
|
||
CURSOR_SHAPE_XOR_RECTANGLE , // Positionnement de la fen<65>tre de loupe
|
||
CURSOR_SHAPE_TARGET , // Courbe <20> 3 points
|
||
CURSOR_SHAPE_TARGET , // Courbe <20> 4 points
|
||
CURSOR_SHAPE_TARGET , // Spray
|
||
CURSOR_SHAPE_TARGET , // Polygone
|
||
CURSOR_SHAPE_TARGET , // Polyforme
|
||
CURSOR_SHAPE_TARGET , // Polyfill
|
||
CURSOR_SHAPE_TARGET , // Polyforme rempli
|
||
CURSOR_SHAPE_MULTIDIRECTIONNAL, // Scroll
|
||
CURSOR_SHAPE_TARGET , // Cercles d<>grad<61>s
|
||
CURSOR_SHAPE_TARGET , // Ellipses d<>grad<61>es
|
||
CURSOR_SHAPE_XOR_ROTATION , // Faire tourner brosse
|
||
CURSOR_SHAPE_XOR_TARGET , // Etirer brosse
|
||
CURSOR_SHAPE_TARGET , // Deformer brosse
|
||
CURSOR_SHAPE_XOR_TARGET , // Rectangle degrade
|
||
};
|
||
#else
|
||
extern byte CURSOR_FOR_OPERATION[NB_OPERATIONS];
|
||
#endif
|
||
|
||
|
||
// Proc<6F>dures <20> appeler: Op<4F>ration,Mouse_K,State de la pile
|
||
|
||
GFX2_GLOBAL struct
|
||
{
|
||
byte Hide_cursor; // Bool<6F>en "il faut effacer le curseur pour l'op<6F>ra."
|
||
Func_action Action; // Action appel<65>e
|
||
} Operation[NB_OPERATIONS][3][OPERATION_STACK_SIZE];
|
||
|
||
|
||
|
||
// Informations sur les lecteurs et autres images
|
||
GFX2_GLOBAL byte GFX_icon_sprite[NB_ICON_SPRITES][ICON_SPRITE_HEIGHT][ICON_SPRITE_WIDTH];
|
||
|
||
|
||
// -- Section des informations sur les formats de fichiers ------------------
|
||
|
||
// Comptage du nb d'<27>l<EFBFBD>ments dans la liste:
|
||
GFX2_GLOBAL short Filelist_nb_elements;
|
||
GFX2_GLOBAL short Filelist_nb_files;
|
||
GFX2_GLOBAL short Filelist_nb_directories;
|
||
// T<>te de la liste cha<68>n<EFBFBD>e:
|
||
GFX2_GLOBAL T_Fileselector_item * Filelist;
|
||
|
||
// ------------------- Inititialisation des formats connus -------------------
|
||
|
||
void Do_nothing(void);
|
||
|
||
GFX2_GLOBAL signed char File_error; // 0: op<6F>ration I/O OK
|
||
// 1: Error d<>s le d<>but de l'op<6F>ration
|
||
// 2: Error durant l'op<6F>ration => donn<6E>es modifi<66>es
|
||
//-1: Interruption du chargement d'une preview
|
||
|
||
GFX2_GLOBAL int Line_number_in_INI_file;
|
||
|
||
GFX2_GLOBAL Func_pixel Pixel_load_function;
|
||
GFX2_GLOBAL Func_read Read_pixel_old;
|
||
|
||
/********************
|
||
* Sp<53>cifique <20> SDL *
|
||
********************/
|
||
GFX2_GLOBAL SDL_Surface * Screen_SDL;
|
||
GFX2_GLOBAL SDL_Joystick* Joystick;
|
||
|
||
#define KEY_NONE 0
|
||
#define KEY_MOUSEMIDDLE (SDLK_LAST+1)
|
||
#define KEY_MOUSEWHEELUP (SDLK_LAST+2)
|
||
#define KEY_MOUSEWHEELDOWN (SDLK_LAST+3)
|
||
#define KEY_JOYBUTTON (SDLK_LAST+4)
|
||
|
||
#ifdef __gp2x__
|
||
#define KEY_ESC (KEY_JOYBUTTON+GP2X_BUTTON_X)
|
||
#else
|
||
#define KEY_ESC SDLK_ESCAPE
|
||
#endif
|
||
|
||
#endif
|