Merge trunk to the cpcmode5 branch. This gets us a more recent grafx2 with the cpcmode5 drawing. Now to make this mode optional so users can still work in regular mode :)

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1719 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2011-02-13 21:49:31 +00:00
parent 4e60f5ad74
commit eba26aaa96
65 changed files with 8669 additions and 3286 deletions

View File

@@ -37,6 +37,14 @@ enum CONTEXT_TYPE {
CONTEXT_SURFACE,
};
/// Data for a cycling color series. Heavily cloned from T_Gradient_array.
typedef struct
{
byte Start; ///< First color
byte End; ///< Last color
byte Inverse; ///< Boolean, true if the gradient goes in descending order
byte Speed; ///< Frequency of cycling, from 1 (slow) to 64 (fast)
} T_Color_cycle;
typedef struct
{
@@ -71,6 +79,9 @@ typedef struct
/// Original file directory, stored in GIF file
char * Original_file_directory;
byte Color_cycles;
T_Color_cycle Cycle_range[16];
/// Internal: during load, marks which layer is being loaded.
short Current_layer;
@@ -87,12 +98,17 @@ typedef struct
short Preview_factor_Y;
short Preview_pos_X;
short Preview_pos_Y;
byte *Preview_bitmap;
byte Preview_usage[256];
// Internal: returned surface for SDL_Surface case
SDL_Surface * Surface;
} T_IO_Context;
#define PREVIEW_WIDTH 120
#define PREVIEW_HEIGHT 80
/// Type of a function that can be called for a T_IO_Context. Kind of a method.
typedef void (* Func_IO) (T_IO_Context *);
@@ -165,8 +181,10 @@ extern T_Format File_formats[];
/// is too high.
void Image_emergency_backup(void);
///
/// Load an arbitrary SDL_Surface.
SDL_Surface * Load_surface(char *full_name);
/// @param gradients Pass the address of a target T_Gradient_array if you want the gradients, NULL otherwise
SDL_Surface * Load_surface(char *full_name, T_Gradient_array *gradients);
/*
@@ -178,12 +196,8 @@ T_Format * Get_fileformat(byte format);
// -- File formats
#ifndef __no_pnglib__
#define NB_KNOWN_FORMATS 19 ///< Total number of known file formats.
#else
// Without pnglib
#define NB_KNOWN_FORMATS 18 ///< Total number of known file formats.
#endif
/// Total number of known file formats
unsigned int Nb_known_formats(void);
// Internal use
@@ -210,7 +224,6 @@ void Set_layer(T_IO_Context *context, byte layer);
// =================================================================
// This is here and not in fileformats.c because the emergency save uses it...
#pragma pack(1)
typedef struct
{
byte Filler1[6];
@@ -219,7 +232,6 @@ typedef struct
byte Filler2[118];
T_Palette Palette;
} T_IMG_Header;
#pragma pack()
// Data for 24bit loading