Merge the "CPC Mode 5" branch to trunk.

Note this alsoincludes the "oldies" branch.

This has the following consequences :
[C64]
 * Loading and saving of screen-only, and color-only C64 picture is removed
 * Loading and saving in FLI mode is now possible
 * FLI constraint checker : tries to convert your image to FLI format, and put all the areas where it couldn't find a solution in a separate layer for you to fixup
 * This is currently accessible only with a shortcut. Menu will come next.
[Amstrad CPC]
 * Loading and saving of pictures in "Mode 5" is now possible. This custom format allows overscan mode 1 with rasters on 2 inks and split rasters on a 3rd one.
 * Mode 5 constraint enforcer : will ensure you can only draw pictures that are valid in mode 5. Each ink is seen as a layer.
 * This is accessible from a new button in the FX menu.
[Generic]
 * Added patch as I saw it : platform that don't support reporting "free space" on disk will not display anything (instead of "0 bytesÃ" as before)
 * For other platforms, when the free space is 0, we now have a disk full message.

The merge was not straight forward. I hope I didn't break too much things.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1810 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2011-06-19 20:15:22 +00:00
24 changed files with 1401 additions and 175 deletions

View File

@@ -32,7 +32,7 @@
#include <sys/mount.h>
#elif defined (__linux__)
#include <sys/vfs.h>
#elif defined(__HAIKU__)
#elif defined (__HAIKU__)
#include "haiku.h"
#elif defined (__MINT__)
#include <mint/sysbind.h>
@@ -69,7 +69,7 @@ word * Shortcut(word shortcut_number)
return &(Config_Key[shortcut_number & 0xFF][0]);
}
// Nom de la touche actuallement assignée à un raccourci d'après son numéro
// Nom de la touche actuallement assignée à un raccourci d'après son numéro
// de type 0x100+BOUTON_* ou SPECIAL_*
const char * Keyboard_shortcut_value(word shortcut_number)
{
@@ -707,7 +707,7 @@ void Button_Stats(void)
Print_in_window(146,35,TrueType_is_supported()?"TTF fonts":"no TTF fonts",STATS_DATA_COLOR,MC_Black);
#if defined (__MINT__)
// Affichage de la mémoire restante
// Display free TT/ST RAM
Print_in_window(10,43,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
freeRam=0;
@@ -751,7 +751,7 @@ void Button_Stats(void)
Print_in_window(18,51,buffer,STATS_DATA_COLOR,MC_Black);
#else
// Affichage de la mémoire restante
// Display free RAM (generic)
Print_in_window(10,51,"Free memory: ",STATS_TITLE_COLOR,MC_Black);
freeRam = Memory_free();
@@ -780,10 +780,6 @@ void Button_Stats(void)
sprintf(buffer,"%ld (%lld Kb)",Stats_pages_number, Stats_pages_memory/1024);
Print_in_window(162,59,buffer,STATS_DATA_COLOR,MC_Black);
// Affichage de l'espace disque libre
sprintf(buffer,"Free space on %c:",Main_current_directory[0]);
Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black);
#if defined(__WIN32__)
{
ULARGE_INTEGER tailleU;
@@ -791,7 +787,6 @@ void Button_Stats(void)
mem_size = tailleU.QuadPart;
}
#elif defined(__linux__) || defined(__macosx__) || defined(__FreeBSD__)
// Note: under MacOSX, both macros are defined anyway.
{
struct statfs disk_info;
statfs(Main_current_directory,&disk_info);
@@ -808,10 +803,18 @@ void Button_Stats(void)
mem_size=drvInfo.b_free*drvInfo.b_clsiz*drvInfo.b_secsiz;
#else
#define NODISKSPACESUPPORT
// Free disk space is only for shows. Other platforms can display 0.
#warning "Missing code for your platform !!! Check and correct please :)"
mem_size=0;
#endif
// Display free space
if (mem_size != 0)
{
sprintf(buffer,"Free space on %c:",Main_current_directory[0]);
Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black);
if(mem_size > (100ULL*1024*1024*1024))
sprintf(buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024)));
@@ -822,6 +825,12 @@ void Button_Stats(void)
else
sprintf(buffer,"%u bytes",(unsigned int)mem_size);
Print_in_window(146,67,buffer,STATS_DATA_COLOR,MC_Black);
} else {
#ifndef NODISKSPACESUPPORT
Print_in_window(10,67,"Disk full!",STATS_TITLE_COLOR,MC_Black);
#endif
#undef NODISKSPACESUPPORT
}
// Affichage des informations sur l'image
Print_in_window(10,83,"Picture info.:",STATS_TITLE_COLOR,MC_Black);