FINALLY fixed the load/save bugs in OS4. It was just a stupid mistake in

io.h... wrong seperator!


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@446 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Pete Gordon 2008-12-31 11:04:35 +00:00
parent 761f872ee2
commit be5422f7ad
2 changed files with 113 additions and 59 deletions

167
io.h
View File

@ -1,57 +1,112 @@
/* Grafx2 - The Ultimate 256-color bitmap paint program
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2008 Yves Rizoud
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.
*/
word endian_magic16(word x);
dword endian_magic32(dword x);
int read_byte(FILE *Fichier, byte *Dest);
int write_byte(FILE *Fichier, byte Byte);
int read_bytes(FILE *Fichier, void *Dest, size_t Taille);
int write_bytes(FILE *Fichier, void *Dest, size_t Taille);
int read_word_le(FILE *Fichier, word *Dest);
int write_word_le(FILE *Fichier, word Mot);
int read_dword_le(FILE *Fichier, dword *Dest);
int write_dword_le(FILE *Fichier, dword Mot);
int read_word_be(FILE *Fichier, word *Dest);
int write_word_be(FILE *Fichier, word Mot);
int read_dword_be(FILE *Fichier, dword *Dest);
int write_dword_be(FILE *Fichier, dword Mot);
void Extraire_nom_fichier(char *Destination, const char *Source);
void Extraire_chemin(char *Destination, const char *Source);
char * Position_dernier_slash(const char * Chaine);
Copyright 2008 Yves Rizoud
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.
*/
word endian_magic16(word x);
dword endian_magic32(dword x);
int read_byte(FILE *Fichier, byte *Dest);
int write_byte(FILE *Fichier, byte Byte);
int read_bytes(FILE *Fichier, void *Dest, size_t Taille);
int write_bytes(FILE *Fichier, void *Dest, size_t Taille);
int read_word_le(FILE *Fichier, word *Dest);
int write_word_le(FILE *Fichier, word Mot);
int read_dword_le(FILE *Fichier, dword *Dest);
int write_dword_le(FILE *Fichier, dword Mot);
int read_word_be(FILE *Fichier, word *Dest);
int write_word_be(FILE *Fichier, word Mot);
int read_dword_be(FILE *Fichier, dword *Dest);
int write_dword_be(FILE *Fichier, dword Mot);
void Extraire_nom_fichier(char *Destination, const char *Source);
void Extraire_chemin(char *Destination, const char *Source);
char * Position_dernier_slash(const char * Chaine);
#if defined(__amigaos4__) || defined(__WIN32__)
#define SEPARATEUR_CHEMIN "\\"
#else
#define SEPARATEUR_CHEMIN "/"
#endif
// Détermine si un fichier passé en paramètre existe ou non dans le
// répertoire courant.
int Fichier_existe(char * Fichier);
// Détermine si un répertoire passé en paramètre existe ou non dans le
// répertoire courant.
int Repertoire_existe(char * Repertoire);
#if defined(__WIN32__)
#define SEPARATEUR_CHEMIN "\\"
#else
#define SEPARATEUR_CHEMIN "/"
#endif
// Détermine si un fichier passé en paramètre existe ou non dans le
// répertoire courant.
int Fichier_existe(char * Fichier);
// Détermine si un répertoire passé en paramètre existe ou non dans le
// répertoire courant.
int Repertoire_existe(char * Repertoire);

View File

@ -487,7 +487,6 @@ void Charger_image(byte Image)
// Si on a su déterminer avec succès le format du fichier:
if (!Erreur_fichier)
{
// On peut charger le fichier:
Image_24b=0;
Format_Load[Format]();
@ -896,7 +895,7 @@ void Test_PKM(void)
Nom_fichier_complet(Nom_du_fichier,0);
Erreur_fichier=1;
// Ouverture du fichier
@ -937,7 +936,7 @@ void Load_PKM(void)
Nom_fichier_complet(Nom_du_fichier,0);
Erreur_fichier=0;
if ((Fichier=fopen(Nom_du_fichier, "rb")))
{
stat(Nom_du_fichier,&Informations_Fichier);