Changed a lot of platform-specific code to "simplify" it:
A Unix-like system is now considered the default. The number of platform-specific blocks is down to: win32: 13, watcomc: 3, linux: 4, macosx: 16, amigaos4: 8, beos/haiku: 1 Removed linux.c, implemented the relevant functions for all platforms. (win32) In Stats screen, included free memory report (macosx) Conversion_ANSI: Fixed the __macosx__ with wrong case from my former 'fix', sorry. (macosx) readline.c : Removed a manual "Update_necessaire=1", because normally all calls to UpdateRect() will set this flag already. Don't hesitate to call Flush_Update() anywhere where it's lacking, but you shouldn't put it inside a #ifdef __macosx__ (win32) Packaging: 'make ziprelease' now includes libpng13.dll and zlib1.dll (win32) Hacked something to resolve naming conflict of MOD_SHIFT constants with windows.h (all) Resolution: Fixed the black space that appeared between button and label, the memory overwrite also caused resolutions above number 2 to disappear from list. Tested fine on Linux (without TTF) and Windows git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@345 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
b511ceafdb
commit
c4f6cf7762
7
Makefile
7
Makefile
@ -89,6 +89,7 @@ else
|
|||||||
LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT)
|
LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT)
|
||||||
CC = gcc
|
CC = gcc
|
||||||
OBJDIR = obj/unix
|
OBJDIR = obj/unix
|
||||||
|
X11LOPT = -lX11
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -103,7 +104,7 @@ ifeq ($(NOTTF),1)
|
|||||||
TTFLABEL = -nottf
|
TTFLABEL = -nottf
|
||||||
else
|
else
|
||||||
TTFCOPT =
|
TTFCOPT =
|
||||||
TTFLOPT = -L/usr/local/lib -lSDL_ttf -lX11
|
TTFLOPT = -L/usr/local/lib -lSDL_ttf $(X11LOPT)
|
||||||
TTFLIBS = libfreetype-6.dll SDL_ttf.dll
|
TTFLIBS = libfreetype-6.dll SDL_ttf.dll
|
||||||
TTFLABEL =
|
TTFLABEL =
|
||||||
endif
|
endif
|
||||||
@ -111,7 +112,7 @@ endif
|
|||||||
|
|
||||||
.PHONY : all debug release clean depend zip version force
|
.PHONY : all debug release clean depend zip version force
|
||||||
|
|
||||||
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o $(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o $(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/linux.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/texte.o $(OBJDIR)/SFont.o
|
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/divers.o $(OBJDIR)/special.o $(OBJDIR)/boutons.o $(OBJDIR)/palette.o $(OBJDIR)/aide.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/moteur.o $(OBJDIR)/files.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/texte.o $(OBJDIR)/SFont.o
|
||||||
CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o
|
CFGOBJ = $(OBJDIR)/gfxcfg.o $(OBJDIR)/SFont.o $(OBJDIR)/clavier.o $(OBJDIR)/io.o
|
||||||
|
|
||||||
all : $(BIN) $(CFGBIN)
|
all : $(BIN) $(CFGBIN)
|
||||||
@ -125,7 +126,7 @@ release : $(BIN) $(CFGBIN)
|
|||||||
# A release zip archive
|
# A release zip archive
|
||||||
ziprelease: version $(BIN) $(BINCFG) release
|
ziprelease: version $(BIN) $(BINCFG) release
|
||||||
tar cvzf src-svn`svnversion | sed 's/:/-/'`.tgz *.c *.h Makefile Makefile.dep
|
tar cvzf src-svn`svnversion | sed 's/:/-/'`.tgz *.c *.h Makefile Makefile.dep
|
||||||
zip grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-win32.zip $(BIN) $(CFGBIN) gfx2.dat gfx2.ico doc/gpl-2.0.txt SDL.dll fonts/8pxfont.png SDL_image.dll $(TTFLIBS) fonts/Tuffy.ttf src-svn`svnversion | sed 's/:/-/'`.tgz
|
zip grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-win32.zip $(BIN) $(CFGBIN) gfx2.dat gfx2.ico doc/gpl-2.0.txt SDL.dll fonts/8pxfont.png SDL_image.dll zlib1.dll libpng13.dll $(TTFLIBS) fonts/Tuffy.ttf src-svn`svnversion | sed 's/:/-/'`.tgz
|
||||||
$(DELCOMMAND) src-svn`svnversion | sed 's/:/-/'`.tgz
|
$(DELCOMMAND) src-svn`svnversion | sed 's/:/-/'`.tgz
|
||||||
tar cvzf grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-src.tgz *.c *.h Makefile Makefile.dep gfx2.dat gfx2.ico doc/gpl-2.0.txt fonts/8pxfont.png fonts/Tuffy.ttf
|
tar cvzf grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-src.tgz *.c *.h Makefile Makefile.dep gfx2.dat gfx2.ico doc/gpl-2.0.txt fonts/8pxfont.png fonts/Tuffy.ttf
|
||||||
|
|
||||||
|
|||||||
27
Makefile.dep
27
Makefile.dep
@ -1,39 +1,38 @@
|
|||||||
$(OBJDIR)/SFont.o: SFont.c SFont.h
|
$(OBJDIR)/SFont.o: SFont.c SFont.h
|
||||||
$(OBJDIR)/aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \
|
$(OBJDIR)/aide.o: aide.c const.h struct.h global.h loadsave.h divers.h graph.h \
|
||||||
moteur.h tables_aide.h aide.h sdlscreen.h
|
moteur.h tables_aide.h aide.h sdlscreen.h texte.h
|
||||||
$(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \
|
$(OBJDIR)/boutons.o: boutons.c const.h struct.h global.h loadsave.h divers.h \
|
||||||
graph.h moteur.h readline.h files.h init.h boutons.h operatio.h pages.h \
|
graph.h moteur.h readline.h files.h init.h boutons.h operatio.h pages.h \
|
||||||
erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h
|
erreurs.h readini.h saveini.h shade.h io.h aide.h texte.h sdlscreen.h
|
||||||
$(OBJDIR)/clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
$(OBJDIR)/clavier.o: clavier.c global.h struct.h const.h loadsave.h
|
||||||
$(OBJDIR)/divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \
|
$(OBJDIR)/divers.o: divers.c struct.h const.h sdlscreen.h global.h loadsave.h \
|
||||||
graph.h erreurs.h boutons.h moteur.h divers.h clavier.h
|
graph.h erreurs.h boutons.h moteur.h divers.h clavier.h
|
||||||
$(OBJDIR)/files.o: files.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
$(OBJDIR)/files.o: files.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||||
erreurs.h linux.h
|
erreurs.h io.h
|
||||||
$(OBJDIR)/gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h
|
$(OBJDIR)/gfxcfg.o: gfxcfg.c SFont.h struct.h const.h clavier.h io.h hotkeys.h
|
||||||
$(OBJDIR)/graph.o: graph.c sdlscreen.h struct.h const.h graph.h divers.h moteur.h \
|
$(OBJDIR)/graph.o: graph.c global.h struct.h const.h loadsave.h moteur.h boutons.h \
|
||||||
boutons.h pages.h global.h loadsave.h erreurs.h
|
pages.h erreurs.h sdlscreen.h graph.h divers.h
|
||||||
$(OBJDIR)/init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \
|
$(OBJDIR)/init.o: init.c const.h struct.h global.h loadsave.h graph.h boutons.h \
|
||||||
palette.h aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h
|
palette.h aide.h operatio.h divers.h erreurs.h clavier.h io.h hotkeys.h
|
||||||
$(OBJDIR)/io.o: io.c struct.h const.h io.h
|
$(OBJDIR)/io.o: io.c struct.h const.h io.h
|
||||||
$(OBJDIR)/linux.o: linux.c
|
|
||||||
$(OBJDIR)/loadsave.o: loadsave.c const.h struct.h global.h loadsave.h graph.h \
|
$(OBJDIR)/loadsave.o: loadsave.c const.h struct.h global.h loadsave.h graph.h \
|
||||||
divers.h pages.h op_c.h boutons.h erreurs.h linux.h io.h sdlscreen.h
|
divers.h pages.h op_c.h boutons.h erreurs.h io.h sdlscreen.h
|
||||||
$(OBJDIR)/main.o: main.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
$(OBJDIR)/main.o: main.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||||
init.h boutons.h moteur.h pages.h files.h sdlscreen.h erreurs.h \
|
init.h boutons.h moteur.h pages.h files.h sdlscreen.h erreurs.h \
|
||||||
readini.h saveini.h linux.h io.h
|
readini.h saveini.h io.h texte.h
|
||||||
$(OBJDIR)/moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
$(OBJDIR)/moteur.o: moteur.c const.h struct.h global.h loadsave.h graph.h divers.h \
|
||||||
special.h boutons.h operatio.h shade.h erreurs.h linux.h sdlscreen.h
|
special.h boutons.h operatio.h shade.h erreurs.h sdlscreen.h
|
||||||
$(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h erreurs.h graph.h
|
$(OBJDIR)/op_c.o: op_c.c op_c.h struct.h const.h erreurs.h graph.h
|
||||||
$(OBJDIR)/operatio.o: operatio.c const.h struct.h global.h loadsave.h divers.h \
|
$(OBJDIR)/operatio.o: operatio.c const.h struct.h global.h loadsave.h divers.h \
|
||||||
moteur.h graph.h operatio.h boutons.h pages.h erreurs.h
|
moteur.h graph.h operatio.h boutons.h pages.h erreurs.h sdlscreen.h
|
||||||
$(OBJDIR)/pages.o: pages.c global.h struct.h const.h loadsave.h pages.h graph.h \
|
$(OBJDIR)/pages.o: pages.c global.h struct.h const.h loadsave.h pages.h graph.h \
|
||||||
erreurs.h linux.h
|
erreurs.h
|
||||||
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h loadsave.h divers.h \
|
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h loadsave.h divers.h \
|
||||||
graph.h moteur.h readline.h boutons.h pages.h aide.h sdlscreen.h \
|
graph.h moteur.h readline.h boutons.h pages.h aide.h sdlscreen.h \
|
||||||
erreurs.h op_c.h
|
erreurs.h op_c.h
|
||||||
$(OBJDIR)/readini.o: readini.c const.h global.h struct.h loadsave.h graph.h
|
$(OBJDIR)/readini.o: readini.c const.h global.h struct.h loadsave.h graph.h
|
||||||
$(OBJDIR)/readline.o: readline.c const.h struct.h global.h loadsave.h graph.h \
|
$(OBJDIR)/readline.o: readline.c const.h struct.h global.h loadsave.h graph.h \
|
||||||
divers.h erreurs.h linux.h sdlscreen.h
|
divers.h erreurs.h sdlscreen.h readline.h
|
||||||
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h \
|
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h loadsave.h readini.h \
|
||||||
files.h erreurs.h graph.h
|
files.h erreurs.h graph.h
|
||||||
$(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \
|
$(OBJDIR)/sdlscreen.o: sdlscreen.c global.h struct.h const.h loadsave.h sdlscreen.h \
|
||||||
@ -42,5 +41,7 @@ $(OBJDIR)/shade.o: shade.c global.h struct.h const.h loadsave.h graph.h moteur.h
|
|||||||
divers.h readline.h aide.h sdlscreen.h
|
divers.h readline.h aide.h sdlscreen.h
|
||||||
$(OBJDIR)/special.o: special.c const.h struct.h global.h loadsave.h graph.h \
|
$(OBJDIR)/special.o: special.c const.h struct.h global.h loadsave.h graph.h \
|
||||||
moteur.h
|
moteur.h
|
||||||
$(OBJDIR)/texte.o: texte.c SFont.h sdlscreen.h struct.h const.h global.h loadsave.h
|
$(OBJDIR)/testfonts.o: testfonts.c
|
||||||
|
$(OBJDIR)/texte.o: texte.c SFont.h struct.h const.h global.h loadsave.h sdlscreen.h \
|
||||||
|
io.h files.h
|
||||||
$(OBJDIR)/version.o: version.c
|
$(OBJDIR)/version.o: version.c
|
||||||
|
|||||||
63
aide.c
63
aide.c
@ -23,6 +23,16 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if defined(__WIN32__)
|
||||||
|
#include <windows.h>
|
||||||
|
#elif defined(__macosx__)
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#elif defined (__linux__)
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "struct.h"
|
#include "struct.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
@ -34,25 +44,6 @@
|
|||||||
#include "sdlscreen.h"
|
#include "sdlscreen.h"
|
||||||
#include "texte.h"
|
#include "texte.h"
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
#ifdef __macosx__
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/mount.h>
|
|
||||||
#else
|
|
||||||
#include <sys/vfs.h>
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifndef __amigaos4__
|
|
||||||
#ifndef __BEOS__
|
|
||||||
#ifndef __HAIKU__
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char SVNRevision[];
|
extern char SVNRevision[];
|
||||||
|
|
||||||
// -- Menu d'aide -----------------------------------------------------------
|
// -- Menu d'aide -----------------------------------------------------------
|
||||||
@ -316,19 +307,7 @@ void Bouton_Stats(void)
|
|||||||
char Buffer[37];
|
char Buffer[37];
|
||||||
dword Utilisation_couleur[256];
|
dword Utilisation_couleur[256];
|
||||||
unsigned long long freeRam;
|
unsigned long long freeRam;
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
struct statfs Informations_Disque;
|
|
||||||
uint64_t Taille = 0;
|
uint64_t Taille = 0;
|
||||||
#else
|
|
||||||
#if defined(__amigaos4__)||defined(__BEOS__)||defined(__HAIKU__)
|
|
||||||
uint64_t Taille = 0;
|
|
||||||
#else
|
|
||||||
unsigned __int64 Taille;
|
|
||||||
ULARGE_INTEGER tailleU;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
Ouvrir_fenetre(310,174,"Statistics");
|
Ouvrir_fenetre(310,174,"Statistics");
|
||||||
|
|
||||||
@ -369,16 +348,22 @@ void Bouton_Stats(void)
|
|||||||
sprintf(Buffer,"Free space on %c:",Principal_Repertoire_courant[0]);
|
sprintf(Buffer,"Free space on %c:",Principal_Repertoire_courant[0]);
|
||||||
Print_dans_fenetre(10,67,Buffer,STATS_COULEUR_TITRES,CM_Noir);
|
Print_dans_fenetre(10,67,Buffer,STATS_COULEUR_TITRES,CM_Noir);
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__WIN32__)
|
||||||
statfs(Principal_Repertoire_courant,&Informations_Disque);
|
{
|
||||||
Taille=(uint64_t) Informations_Disque.f_bfree * (uint64_t) Informations_Disque.f_bsize;
|
ULARGE_INTEGER tailleU;
|
||||||
#else
|
|
||||||
#if defined(__amigaos4__)||defined(__BEOS__)||defined(__HAIKU__)
|
|
||||||
#else
|
|
||||||
GetDiskFreeSpaceEx(Principal_Repertoire_courant,&tailleU,NULL,NULL);
|
GetDiskFreeSpaceEx(Principal_Repertoire_courant,&tailleU,NULL,NULL);
|
||||||
Taille = tailleU.QuadPart;
|
Taille = tailleU.QuadPart;
|
||||||
#endif
|
}
|
||||||
#endif
|
#elif defined(__linux__) || (__macosx__)
|
||||||
|
// Note: under MacOSX, both macros are defined anyway.
|
||||||
|
{
|
||||||
|
struct statfs Informations_Disque;
|
||||||
|
statfs(Principal_Repertoire_courant,&Informations_Disque);
|
||||||
|
Taille=(uint64_t) Informations_Disque.f_bfree * (uint64_t) Informations_Disque.f_bsize;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// Free disk space is only for shows. Other platforms can display 0.
|
||||||
|
#endif
|
||||||
|
|
||||||
if(Taille > (100ULL*1024*1024*1024))
|
if(Taille > (100ULL*1024*1024*1024))
|
||||||
sprintf(Buffer,"%d Gigabytes",(unsigned int)(Taille/(1024*1024*1024)));
|
sprintf(Buffer,"%d Gigabytes",(unsigned int)(Taille/(1024*1024*1024)));
|
||||||
|
|||||||
@ -1294,9 +1294,9 @@ void Afficher_liste_modes(short Debut_liste, short Position_curseur)
|
|||||||
Num2str(Mode_video[Mode_courant].Hauteur,Chaine+5,4);
|
Num2str(Mode_video[Mode_courant].Hauteur,Chaine+5,4);
|
||||||
|
|
||||||
if(Mode_video[Mode_courant].Fullscreen == 1)
|
if(Mode_video[Mode_courant].Fullscreen == 1)
|
||||||
memcpy(Chaine+9," Fullscreen ",15);
|
memcpy(Chaine+9," Fullscreen ",13);
|
||||||
else
|
else
|
||||||
memcpy(Chaine+9," Window ",15);
|
memcpy(Chaine+9," Window ",13);
|
||||||
|
|
||||||
if (Mode_video[Mode_courant].Largeur*3 == Mode_video[Mode_courant].Hauteur*4)
|
if (Mode_video[Mode_courant].Largeur*3 == Mode_video[Mode_courant].Hauteur*4)
|
||||||
Ratio=" 4:3";
|
Ratio=" 4:3";
|
||||||
@ -1321,7 +1321,7 @@ void Afficher_liste_modes(short Debut_liste, short Position_curseur)
|
|||||||
|
|
||||||
strcat(Chaine,Ratio);
|
strcat(Chaine,Ratio);
|
||||||
|
|
||||||
Print_dans_fenetre(30,Pos_Y,Chaine,Couleur_texte,Couleur_fond);
|
Print_dans_fenetre(38,Pos_Y,Chaine,Couleur_texte,Couleur_fond);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -469,7 +469,7 @@ word Conversion_ANSI(SDL_keysym Sym)
|
|||||||
// This part was removed from the MacOSX port, but I put it back for others
|
// This part was removed from the MacOSX port, but I put it back for others
|
||||||
// as on Linux and Windows, it's what allows editing a text line with the keys
|
// as on Linux and Windows, it's what allows editing a text line with the keys
|
||||||
// SDLK_LEFT, SDLK_RIGHT, SDLK_HOME, SDLK_END etc.
|
// SDLK_LEFT, SDLK_RIGHT, SDLK_HOME, SDLK_END etc.
|
||||||
#ifndef __MACOSX__
|
#ifndef __macosx__
|
||||||
if ( Sym.unicode == 0)
|
if ( Sym.unicode == 0)
|
||||||
{
|
{
|
||||||
return Sym.sym;
|
return Sym.sym;
|
||||||
|
|||||||
33
files.c
33
files.c
@ -20,11 +20,6 @@
|
|||||||
write to the Free Software Foundation, Inc.,
|
write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#include "const.h"
|
|
||||||
#include "struct.h"
|
|
||||||
#include "global.h"
|
|
||||||
#include "graph.h"
|
|
||||||
#include "divers.h"
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -35,30 +30,30 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef __amigaos4__
|
#if defined(__amigaos4__)
|
||||||
#include <proto/dos.h>
|
#include <proto/dos.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "erreurs.h"
|
|
||||||
#include "linux.h"
|
|
||||||
#include "io.h"
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__linux__)||defined(__BEOS__)||defined(__HAIKU__)
|
|
||||||
#include <dirent.h>
|
|
||||||
#define isHidden(Enreg) ((Enreg)->d_name[0]=='.')
|
|
||||||
#elif defined(__amigaos4__)
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#define isHidden(Enreg) (0)
|
#define isHidden(Enreg) (0)
|
||||||
#elif defined(__WATCOMC__)
|
#elif defined(__WATCOMC__)
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#define isHidden(Enreg) ((Enreg)->d_attr & _A_HIDDEN)
|
#define isHidden(Enreg) ((Enreg)->d_attr & _A_HIDDEN)
|
||||||
#elif defined(__MINGW32__)
|
#elif defined(__WIN32__)
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define isHidden(Enreg) (GetFileAttributesA((Enreg)->d_name)&FILE_ATTRIBUTE_HIDDEN)
|
#define isHidden(Enreg) (GetFileAttributesA((Enreg)->d_name)&FILE_ATTRIBUTE_HIDDEN)
|
||||||
|
#else
|
||||||
|
#include <dirent.h>
|
||||||
|
#define isHidden(Enreg) ((Enreg)->d_name[0]=='.')
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "const.h"
|
||||||
|
#include "struct.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "graph.h"
|
||||||
|
#include "divers.h"
|
||||||
|
#include "erreurs.h"
|
||||||
|
#include "io.h"
|
||||||
|
|
||||||
#define COULEUR_FICHIER_NORMAL CM_Clair // Couleur du texte pour une ligne de fichier non sélectionné
|
#define COULEUR_FICHIER_NORMAL CM_Clair // Couleur du texte pour une ligne de fichier non sélectionné
|
||||||
#define COULEUR_REPERTOIRE_NORMAL CM_Fonce // Couleur du texte pour une ligne de répertoire non sélectionné
|
#define COULEUR_REPERTOIRE_NORMAL CM_Fonce // Couleur du texte pour une ligne de répertoire non sélectionné
|
||||||
#define COULEUR_FOND_NORMAL CM_Noir // Couleur du fond pour une ligne non sélectionnée
|
#define COULEUR_FOND_NORMAL CM_Noir // Couleur du fond pour une ligne non sélectionnée
|
||||||
|
|||||||
10
global.h
10
global.h
@ -117,6 +117,16 @@ GLOBAL dword Touche; // Touche tap
|
|||||||
GLOBAL dword Touche_ANSI; // Caractère tapé
|
GLOBAL dword Touche_ANSI; // Caractère tapé
|
||||||
GLOBAL Uint8* Etat_Du_Clavier; // Scancode de la touche en cours et etat des touches de ctrl
|
GLOBAL Uint8* Etat_Du_Clavier; // Scancode de la touche en cours et etat des touches de ctrl
|
||||||
// Modificateurs pour Touche
|
// Modificateurs pour Touche
|
||||||
|
// (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
|
||||||
#define MOD_SHIFT 0x1000
|
#define MOD_SHIFT 0x1000
|
||||||
#define MOD_CTRL 0x2000
|
#define MOD_CTRL 0x2000
|
||||||
#define MOD_ALT 0x4000
|
#define MOD_ALT 0x4000
|
||||||
|
|||||||
52
graph.c
52
graph.c
@ -19,35 +19,28 @@
|
|||||||
write to the Free Software Foundation, Inc.,
|
write to the Free Software Foundation, Inc.,
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#include "sdlscreen.h"
|
#if defined(__WIN32__)
|
||||||
#include "graph.h"
|
#define _WIN32_WINNT 0x0500
|
||||||
#include "divers.h"
|
#include <windows.h>
|
||||||
#include <math.h>
|
#elif defined(__macosx__)
|
||||||
#ifdef __macosx__
|
#include <sys/sysctl.h>
|
||||||
#include <sys/malloc.h>
|
|
||||||
#else
|
#else
|
||||||
#include <malloc.h>
|
#include <sys/sysinfo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
#include "struct.h"
|
||||||
#include "moteur.h"
|
#include "moteur.h"
|
||||||
#include "boutons.h"
|
#include "boutons.h"
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
#include "global.h"
|
|
||||||
#include "struct.h"
|
|
||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
|
#include "sdlscreen.h"
|
||||||
#ifdef __linux__
|
#include "graph.h"
|
||||||
#ifdef __macosx__
|
#include "divers.h"
|
||||||
#include <sys/sysctl.h>
|
|
||||||
#else
|
|
||||||
#include <sys/sysinfo.h>
|
|
||||||
#endif
|
|
||||||
#elif __WATCOMC__
|
|
||||||
#define _WIN32_WINNT 0x0500
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Fonction qui met à jour la zone de l'image donnée en paramètre sur l'écran.
|
// Fonction qui met à jour la zone de l'image donnée en paramètre sur l'écran.
|
||||||
// Tient compte du décalage X et Y et du zoom, et fait tous les controles nécessaires
|
// Tient compte du décalage X et Y et du zoom, et fait tous les controles nécessaires
|
||||||
@ -565,8 +558,15 @@ unsigned long Memoire_libre(void)
|
|||||||
A revoir, mais est-ce vraiment utile?
|
A revoir, mais est-ce vraiment utile?
|
||||||
_heapmin();
|
_heapmin();
|
||||||
*/
|
*/
|
||||||
#ifdef __linux__
|
// Memory is no longer relevant. If there is ANY problem or doubt here,
|
||||||
#ifdef __macosx__
|
// you can simply return 10*1024*1024 (10Mb), to make the "Pages"something
|
||||||
|
// memory allocation functions happy.
|
||||||
|
#if defined(__WIN32__)
|
||||||
|
MEMORYSTATUSEX mstt;
|
||||||
|
mstt.dwLength = sizeof(MEMORYSTATUSEX);
|
||||||
|
GlobalMemoryStatusEx(&mstt);
|
||||||
|
return mstt.ullAvailPhys;
|
||||||
|
#elif defined(__macosx__)
|
||||||
int mib[2];
|
int mib[2];
|
||||||
int maxmem;
|
int maxmem;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -581,14 +581,6 @@ unsigned long Memoire_libre(void)
|
|||||||
sysinfo(&info);
|
sysinfo(&info);
|
||||||
return info.freeram*info.mem_unit;
|
return info.freeram*info.mem_unit;
|
||||||
#endif
|
#endif
|
||||||
#elif __WATCOMC__
|
|
||||||
MEMORYSTATUSEX mstt;
|
|
||||||
mstt.dwLength = sizeof(MEMORYSTATUSEX);
|
|
||||||
GlobalMemoryStatusEx(&mstt);
|
|
||||||
return mstt.ullAvailPhys;
|
|
||||||
#else
|
|
||||||
return 10*1024*1024;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
44
init.c
44
init.c
@ -48,17 +48,9 @@
|
|||||||
|
|
||||||
#include "errno.h"
|
#include "errno.h"
|
||||||
|
|
||||||
#ifndef __linux__
|
#if defined(__WIN32__)
|
||||||
#ifndef __amigaos4__
|
#include <windows.h>
|
||||||
#ifndef __BEOS__
|
#elif defined(__macosx__)
|
||||||
#ifndef __HAIKU__
|
|
||||||
#include "windows.h"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __macosx__
|
|
||||||
#import <corefoundation/corefoundation.h>
|
#import <corefoundation/corefoundation.h>
|
||||||
#import <sys/param.h>
|
#import <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
@ -108,22 +100,13 @@ void Ajouter_lecteur(char Lettre, byte Type, char *Chemin)
|
|||||||
// Rechercher la liste et le type des lecteurs de la machine
|
// Rechercher la liste et le type des lecteurs de la machine
|
||||||
void Rechercher_drives(void)
|
void Rechercher_drives(void)
|
||||||
{
|
{
|
||||||
|
#if defined(__amigaos4__)
|
||||||
|
|
||||||
#if defined(__linux__)
|
|
||||||
//Sous linux, il n'y a pas de lecteurs, on va juste mettre
|
|
||||||
// un disque dur qui pointera vers la racine,
|
|
||||||
// et un autre vers le home directory de l'utilisateur.
|
|
||||||
char * Home = getenv("HOME");
|
|
||||||
Ajouter_lecteur('/', LECTEUR_HDD, "/");
|
|
||||||
Ajouter_lecteur('~', LECTEUR_HDD, Home ? Home : "");
|
|
||||||
#elif defined(__BEOS__) || defined(__HAIKU__)
|
|
||||||
char * Home = getenv("$HOME");
|
|
||||||
Ajouter_lecteur('/', LECTEUR_HDD, "/");
|
|
||||||
Ajouter_lecteur('~', LECTEUR_HDD, Home ? Home : "");
|
|
||||||
#elif defined(__amigaos4__)
|
|
||||||
// No icons by default.
|
// No icons by default.
|
||||||
// It's possible to add some here.
|
// It's possible to add some here.
|
||||||
|
|
||||||
#elif defined (__WIN32__)
|
#elif defined (__WIN32__)
|
||||||
|
|
||||||
char NomLecteur[]="A:\\";
|
char NomLecteur[]="A:\\";
|
||||||
int DriveBits = GetLogicalDrives();
|
int DriveBits = GetLogicalDrives();
|
||||||
int IndiceLecteur;
|
int IndiceLecteur;
|
||||||
@ -163,6 +146,19 @@ void Rechercher_drives(void)
|
|||||||
IndiceLecteur++;
|
IndiceLecteur++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
//Sous les différents unix, il n'y a pas de lecteurs, on va juste mettre
|
||||||
|
// un disque dur qui pointera vers la racine,
|
||||||
|
// et un autre vers le home directory de l'utilisateur.
|
||||||
|
#if defined(__BEOS__) || defined(__HAIKU__)
|
||||||
|
char * Home = getenv("$HOME");
|
||||||
|
#else
|
||||||
|
char * Home = getenv("HOME");
|
||||||
|
#endif
|
||||||
|
Ajouter_lecteur('/', LECTEUR_HDD, "/");
|
||||||
|
Ajouter_lecteur('~', LECTEUR_HDD, Home ? Home : "");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +195,7 @@ void Charger_DAT(void)
|
|||||||
case ENOENT: puts("The file path is empty or points to a non-existing directory."); break;
|
case ENOENT: puts("The file path is empty or points to a non-existing directory."); break;
|
||||||
case ENOMEM: puts("Pas assez de mémoire pour le noyau."); break;
|
case ENOMEM: puts("Pas assez de mémoire pour le noyau."); break;
|
||||||
case ENOTDIR: puts("Un composant du chemin d'accès n'est pas un répertoire."); break;
|
case ENOTDIR: puts("Un composant du chemin d'accès n'est pas un répertoire."); break;
|
||||||
#if defined(__linux__)||defined(__amigaos4__)||defined(__BEOS__)||defined(__HAIKU__)
|
#ifdef ELOOP
|
||||||
case ELOOP: puts("Trop de liens symboliques rencontrés dans le chemin d'accès."); break;
|
case ELOOP: puts("Trop de liens symboliques rencontrés dans le chemin d'accès."); break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
6
io.h
6
io.h
@ -43,8 +43,8 @@ void Extraire_chemin(char *Destination, const char *Source);
|
|||||||
|
|
||||||
char * Position_dernier_slash(const char * Chaine);
|
char * Position_dernier_slash(const char * Chaine);
|
||||||
|
|
||||||
#if defined(__linux__)||defined(__BEOS__)||defined(__HAIKU__)
|
#if defined(__amigaos4__) || defined(__WIN32__)
|
||||||
#define SEPARATEUR_CHEMIN "/"
|
|
||||||
#else
|
|
||||||
#define SEPARATEUR_CHEMIN "\\"
|
#define SEPARATEUR_CHEMIN "\\"
|
||||||
|
#else
|
||||||
|
#define SEPARATEUR_CHEMIN "/"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
41
linux.c
41
linux.c
@ -1,41 +0,0 @@
|
|||||||
/* Grafx2 - The Ultimate 256-color bitmap paint program
|
|
||||||
|
|
||||||
Copyright 2008 Peter Gordon
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
// Diverses fonctions qui existaient sous dos mais pas sous linux...
|
|
||||||
#if defined(__linux__)||defined(__amigaos4__)||defined(__BEOS__)||defined(__HAIKU__)
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
int filelength(int fichier)
|
|
||||||
{
|
|
||||||
struct stat infos_fichier;
|
|
||||||
fstat(fichier,&infos_fichier);
|
|
||||||
return infos_fichier.st_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
void itoa(int source,char* dest, int longueur)
|
|
||||||
{
|
|
||||||
snprintf(dest,longueur,"%d",source);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
38
linux.h
38
linux.h
@ -1,38 +0,0 @@
|
|||||||
/* 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.
|
|
||||||
*/
|
|
||||||
#ifndef _LINUX_H_
|
|
||||||
#define _LINUX_H_
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
|
|
||||||
struct find_t {
|
|
||||||
unsigned char attrib;
|
|
||||||
char name[256];
|
|
||||||
};
|
|
||||||
|
|
||||||
int filelength(int);
|
|
||||||
|
|
||||||
void itoa(int source,char* dest, int longueur);
|
|
||||||
/* Integer TO Ascii */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
25
loadsave.c
25
loadsave.c
@ -39,12 +39,19 @@
|
|||||||
#include "op_c.h"
|
#include "op_c.h"
|
||||||
#include "boutons.h"
|
#include "boutons.h"
|
||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
#include "linux.h"
|
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "sdlscreen.h"
|
#include "sdlscreen.h"
|
||||||
|
|
||||||
#define FILENAMESPACE 13
|
#define FILENAMESPACE 13
|
||||||
|
|
||||||
|
// Taille de fichier, en octets
|
||||||
|
int FileLength(FILE * Fichier)
|
||||||
|
{
|
||||||
|
struct stat infos_fichier;
|
||||||
|
fstat(fileno(Fichier),&infos_fichier);
|
||||||
|
return infos_fichier.st_size;
|
||||||
|
}
|
||||||
|
|
||||||
// Chargement des pixels dans l'écran principal
|
// Chargement des pixels dans l'écran principal
|
||||||
void Pixel_Chargement_dans_ecran_courant(word Pos_X,word Pos_Y,byte Couleur)
|
void Pixel_Chargement_dans_ecran_courant(word Pos_X,word Pos_Y,byte Couleur)
|
||||||
{
|
{
|
||||||
@ -4210,7 +4217,7 @@ void Test_KCF(void)
|
|||||||
Nom_fichier_complet(Nom_du_fichier,0);
|
Nom_fichier_complet(Nom_du_fichier,0);
|
||||||
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
||||||
{
|
{
|
||||||
if (filelength(fileno(Fichier))==sizeof(T_KCF_Header))
|
if (FileLength(Fichier)==sizeof(T_KCF_Header))
|
||||||
{
|
{
|
||||||
read_bytes(Fichier,&Buffer,sizeof(T_KCF_Header));
|
read_bytes(Fichier,&Buffer,sizeof(T_KCF_Header));
|
||||||
// On vérifie une propriété de la structure de palette:
|
// On vérifie une propriété de la structure de palette:
|
||||||
@ -4260,7 +4267,7 @@ void Load_KCF(void)
|
|||||||
Nom_fichier_complet(Nom_du_fichier,0);
|
Nom_fichier_complet(Nom_du_fichier,0);
|
||||||
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
||||||
{
|
{
|
||||||
Taille_du_fichier=filelength(fileno(Fichier));
|
Taille_du_fichier=FileLength(Fichier);
|
||||||
if (Taille_du_fichier==sizeof(T_KCF_Header))
|
if (Taille_du_fichier==sizeof(T_KCF_Header))
|
||||||
{
|
{
|
||||||
// Fichier KCF à l'ancien format
|
// Fichier KCF à l'ancien format
|
||||||
@ -4497,7 +4504,7 @@ void Load_SCx(void)
|
|||||||
|
|
||||||
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
||||||
{
|
{
|
||||||
Taille_du_fichier=filelength(fileno(Fichier));
|
Taille_du_fichier=FileLength(Fichier);
|
||||||
|
|
||||||
if ((read_bytes(Fichier,&SCx_Header,sizeof(T_SCx_Header))))
|
if ((read_bytes(Fichier,&SCx_Header,sizeof(T_SCx_Header))))
|
||||||
{
|
{
|
||||||
@ -4755,7 +4762,7 @@ void Test_PI1(void)
|
|||||||
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
||||||
{
|
{
|
||||||
// Vérification de la taille
|
// Vérification de la taille
|
||||||
Taille=filelength(fileno(Fichier));
|
Taille=FileLength(Fichier);
|
||||||
if ((Taille==32034) || (Taille==32066))
|
if ((Taille==32034) || (Taille==32066))
|
||||||
{
|
{
|
||||||
// Lecture et vérification de la résolution
|
// Lecture et vérification de la résolution
|
||||||
@ -4794,7 +4801,7 @@ void Load_PI1(void)
|
|||||||
if (read_bytes(Fichier,buffer,32034))
|
if (read_bytes(Fichier,buffer,32034))
|
||||||
{
|
{
|
||||||
// Initialisation de la preview
|
// Initialisation de la preview
|
||||||
Initialiser_preview(320,200,filelength(fileno(Fichier)),FORMAT_PI1);
|
Initialiser_preview(320,200,FileLength(Fichier),FORMAT_PI1);
|
||||||
if (Erreur_fichier==0)
|
if (Erreur_fichier==0)
|
||||||
{
|
{
|
||||||
// Initialisation de la palette
|
// Initialisation de la palette
|
||||||
@ -5083,7 +5090,7 @@ void Test_PC1(void)
|
|||||||
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
||||||
{
|
{
|
||||||
// Vérification de la taille
|
// Vérification de la taille
|
||||||
Taille=filelength(fileno(Fichier));
|
Taille=FileLength(Fichier);
|
||||||
if ((Taille<=32066))
|
if ((Taille<=32066))
|
||||||
{
|
{
|
||||||
// Lecture et vérification de la résolution
|
// Lecture et vérification de la résolution
|
||||||
@ -5116,7 +5123,7 @@ void Load_PC1(void)
|
|||||||
Erreur_fichier=0;
|
Erreur_fichier=0;
|
||||||
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
if ((Fichier=fopen(Nom_du_fichier, "rb")))
|
||||||
{
|
{
|
||||||
Taille=filelength(fileno(Fichier));
|
Taille=FileLength(Fichier);
|
||||||
// allocation des buffers mémoire
|
// allocation des buffers mémoire
|
||||||
buffercomp=(byte *)malloc(Taille);
|
buffercomp=(byte *)malloc(Taille);
|
||||||
bufferdecomp=(byte *)malloc(32000);
|
bufferdecomp=(byte *)malloc(32000);
|
||||||
@ -5126,7 +5133,7 @@ void Load_PC1(void)
|
|||||||
if (read_bytes(Fichier,buffercomp,Taille))
|
if (read_bytes(Fichier,buffercomp,Taille))
|
||||||
{
|
{
|
||||||
// Initialisation de la preview
|
// Initialisation de la preview
|
||||||
Initialiser_preview(320,200,filelength(fileno(Fichier)),FORMAT_PC1);
|
Initialiser_preview(320,200,FileLength(Fichier),FORMAT_PC1);
|
||||||
if (Erreur_fichier==0)
|
if (Erreur_fichier==0)
|
||||||
{
|
{
|
||||||
// Initialisation de la palette
|
// Initialisation de la palette
|
||||||
|
|||||||
32
main.c
32
main.c
@ -45,26 +45,16 @@
|
|||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
#include "readini.h"
|
#include "readini.h"
|
||||||
#include "saveini.h"
|
#include "saveini.h"
|
||||||
#include "linux.h"
|
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "texte.h"
|
#include "texte.h"
|
||||||
|
|
||||||
#ifndef __linux__
|
#if defined(__WIN32__)
|
||||||
#ifndef __amigaos4__
|
|
||||||
#ifndef __BEOS__
|
|
||||||
#ifndef __HAIKU__
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
#define chdir(dir) SetCurrentDirectory(dir)
|
#define chdir(dir) SetCurrentDirectory(dir)
|
||||||
#define M_PI 3.14159265358979323846
|
#elif defined(__macosx__)
|
||||||
#endif
|
#import <corefoundation/corefoundation.h>
|
||||||
#endif
|
#import <sys/param.h>
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __macosx__
|
|
||||||
#import <corefoundation/corefoundation.h>
|
|
||||||
#import <sys/param.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
byte Ancien_nb_lignes; // Ancien nombre de lignes de l'écran
|
byte Ancien_nb_lignes; // Ancien nombre de lignes de l'écran
|
||||||
@ -227,23 +217,17 @@ void Analyse_de_la_ligne_de_commande(int argc,char * argv[])
|
|||||||
|
|
||||||
// On récupère le chemin complet du paramètre
|
// On récupère le chemin complet du paramètre
|
||||||
// Et on découpe ce chemin en répertoire(path) + fichier(.ext)
|
// Et on découpe ce chemin en répertoire(path) + fichier(.ext)
|
||||||
#if defined(__linux__) || defined(__amigaos4__) || defined(__BEOS__) || defined(__HAIKU__)
|
#if defined(__WIN32__)
|
||||||
Buffer=realpath(argv[Indice],NULL);
|
|
||||||
#else
|
|
||||||
Buffer = malloc(TAILLE_CHEMIN_FICHIER);
|
Buffer = malloc(TAILLE_CHEMIN_FICHIER);
|
||||||
_fullpath(Buffer,argv[Indice],TAILLE_CHEMIN_FICHIER);
|
_fullpath(Buffer,argv[Indice],TAILLE_CHEMIN_FICHIER);
|
||||||
|
#else
|
||||||
|
Buffer=realpath(argv[Indice],NULL);
|
||||||
#endif
|
#endif
|
||||||
Extraire_chemin(Principal_Repertoire_fichier, Buffer);
|
Extraire_chemin(Principal_Repertoire_fichier, Buffer);
|
||||||
Extraire_nom_fichier(Principal_Nom_fichier, Buffer);
|
Extraire_nom_fichier(Principal_Nom_fichier, Buffer);
|
||||||
#ifndef __linux__
|
#if defined(__WIN32__)
|
||||||
#ifndef __amigaos4__
|
|
||||||
#ifndef __BEOS__
|
|
||||||
#ifndef __HAIKU__
|
|
||||||
free(Buffer);
|
free(Buffer);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
chdir(Principal_Repertoire_fichier);
|
chdir(Principal_Repertoire_fichier);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
1
moteur.c
1
moteur.c
@ -35,7 +35,6 @@
|
|||||||
#include "operatio.h"
|
#include "operatio.h"
|
||||||
#include "shade.h"
|
#include "shade.h"
|
||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
#include "linux.h"
|
|
||||||
#include "sdlscreen.h"
|
#include "sdlscreen.h"
|
||||||
|
|
||||||
//---------- Annuler les effets des modes de dessin (sauf la grille) ---------
|
//---------- Annuler les effets des modes de dessin (sauf la grille) ---------
|
||||||
|
|||||||
1
pages.c
1
pages.c
@ -31,7 +31,6 @@
|
|||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
#include "linux.h"
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// GESTION DES PAGES
|
/// GESTION DES PAGES
|
||||||
|
|||||||
22
readline.c
22
readline.c
@ -35,7 +35,6 @@
|
|||||||
#include "divers.h"
|
#include "divers.h"
|
||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "linux.h"
|
|
||||||
#include "sdlscreen.h"
|
#include "sdlscreen.h"
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
|
|
||||||
@ -44,8 +43,6 @@
|
|||||||
#define COULEUR_TEXTE_CURSEUR CM_Noir
|
#define COULEUR_TEXTE_CURSEUR CM_Noir
|
||||||
#define COULEUR_FOND_CURSEUR CM_Fonce
|
#define COULEUR_FOND_CURSEUR CM_Fonce
|
||||||
|
|
||||||
extern int Update_necessaire;
|
|
||||||
|
|
||||||
// Suppresion d'un caractère à une certaine POSITION dans une CHAINE.
|
// Suppresion d'un caractère à une certaine POSITION dans une CHAINE.
|
||||||
void Supprimer_caractere(char * Chaine, byte Position)
|
void Supprimer_caractere(char * Chaine, byte Position)
|
||||||
{
|
{
|
||||||
@ -78,10 +75,13 @@ int CaractereValide(int Caractere)
|
|||||||
// Sous Linux: Seul le / est strictement interdit, mais beaucoup
|
// Sous Linux: Seul le / est strictement interdit, mais beaucoup
|
||||||
// d'autres poseront des problèmes au shell, alors on évite.
|
// d'autres poseront des problèmes au shell, alors on évite.
|
||||||
// Sous Windows : c'est moins grave car le fopen() échouerait de toutes façons.
|
// Sous Windows : c'est moins grave car le fopen() échouerait de toutes façons.
|
||||||
#ifdef __linux__
|
// AmigaOS4: Pas de ':' car utilisé pour les volumes.
|
||||||
char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>'};
|
#if defined(__WIN32__)
|
||||||
#else
|
|
||||||
char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>', ':', '\\'};
|
char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>', ':', '\\'};
|
||||||
|
#elif defined (__amigaos4__)
|
||||||
|
char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>', ':'};
|
||||||
|
#else
|
||||||
|
char CaracteresInterdits[] = {'/', '|', '?', '*', '<', '>'};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (Caractere < ' ' || Caractere > 255)
|
if (Caractere < ' ' || Caractere > 255)
|
||||||
@ -154,7 +154,7 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T
|
|||||||
strcpy(Chaine_initiale,Chaine);
|
strcpy(Chaine_initiale,Chaine);
|
||||||
|
|
||||||
if (Type_saisie==1)
|
if (Type_saisie==1)
|
||||||
itoa(atoi(Chaine),Chaine,10); // On tasse la chaine à gauche
|
snprintf(Chaine,10,"%d",atoi(Chaine)); // On tasse la chaine à gauche
|
||||||
// Chaine[0]='\0'; // On efface la chaîne si c'est valeur numérique
|
// Chaine[0]='\0'; // On efface la chaîne si c'est valeur numérique
|
||||||
|
|
||||||
|
|
||||||
@ -173,11 +173,7 @@ byte Readline_ex(word Pos_X,word Pos_Y,char * Chaine,byte Taille_affichee,byte T
|
|||||||
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine_affichee,Position - Offset);
|
Rafficher_toute_la_chaine(Pos_X,Pos_Y,Chaine_affichee,Position - Offset);
|
||||||
UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3));
|
Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3));
|
||||||
|
|
||||||
#ifdef __macosx__
|
|
||||||
Update_necessaire = 1;
|
|
||||||
Flush_update();
|
Flush_update();
|
||||||
#endif
|
|
||||||
|
|
||||||
while ((Touche_lue!=SDLK_RETURN) && (Touche_lue!=SDLK_ESCAPE))
|
while ((Touche_lue!=SDLK_RETURN) && (Touche_lue!=SDLK_ESCAPE))
|
||||||
{
|
{
|
||||||
@ -319,11 +315,7 @@ affichage:
|
|||||||
UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
UpdateRect(Fenetre_Pos_X+(Pos_X*Menu_Facteur_X),Fenetre_Pos_Y+(Pos_Y*Menu_Facteur_Y),
|
||||||
Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3));
|
Taille_affichee*(Menu_Facteur_X<<3),(Menu_Facteur_Y<<3));
|
||||||
} // Fin du "switch(Touche_lue)"
|
} // Fin du "switch(Touche_lue)"
|
||||||
|
|
||||||
#ifdef __macosx__
|
|
||||||
Update_necessaire = 1;
|
|
||||||
Flush_update();
|
Flush_update();
|
||||||
#endif
|
|
||||||
|
|
||||||
} // Fin du "while"
|
} // Fin du "while"
|
||||||
|
|
||||||
|
|||||||
2
texte.c
2
texte.c
@ -199,6 +199,7 @@ void Initialisation_Texte(void)
|
|||||||
#endif
|
#endif
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
// Récupération de la liste des fonts avec fontconfig
|
// Récupération de la liste des fonts avec fontconfig
|
||||||
|
#ifndef NOTTF
|
||||||
#define USE_XLIB
|
#define USE_XLIB
|
||||||
|
|
||||||
#ifdef USE_XLIB
|
#ifdef USE_XLIB
|
||||||
@ -212,6 +213,7 @@ void Initialisation_Texte(void)
|
|||||||
XFreeFontPath(font_path_list);
|
XFreeFontPath(font_path_list);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Informe si texte.c a été compilé avec l'option de support TrueType ou pas.
|
// Informe si texte.c a été compilé avec l'option de support TrueType ou pas.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user