diff --git a/Makefile b/Makefile index 0a53b610..f8ed117e 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,7 @@ else TTFLABEL = endif -#To disable Joystick emulation of cursor, make NOTTF=1 (for input.o) +#To disable Joystick emulation of cursor, make NOJOY=1 (for input.o) #This can be necessary to test keyboard cursor code, because an existing #joystick will keep reporting a contradicting position. ifeq ($(NOJOY),1) @@ -249,9 +249,9 @@ release : $(BIN) # Create a zip archive ready for upload to the website, including binaries and sourcecode ziprelease: version $(BIN) release tar cvzf src-svn`svnversion | sed 's/:/-/'`.tgz *.c *.h Makefile Makefile.dep gfx2.ico - $(ZIP) $(ZIPOPT) grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-$(PLATFORM).$(ZIP) $(BIN) gfx2def.ini skins/base.gif gfx2.gif doc/gpl-2.0.txt fonts/8pxfont.png doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt fonts/Tuffy.ttf src-svn`svnversion | sed 's/:/-/'`.tgz $(PLATFORMFILES) + $(ZIP) $(ZIPOPT) grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-$(PLATFORM).$(ZIP) $(BIN) gfx2def.ini skins/base.gif gfx2.gif doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt fonts/8pxfont.png doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt fonts/Tuffy.ttf src-svn`svnversion | sed 's/:/-/'`.tgz $(PLATFORMFILES) $(DELCOMMAND) src-svn`svnversion | sed 's/:/-/'`.tgz - tar cvzf grafx2-svn`svnversion | sed 's/:/-/'`$(TTFLABEL)-src.tgz *.c *.h Makefile Makefile.dep gfx2def.ini skins/base.gif gfx2.ico gfx2.gif 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 gfx2def.ini skins/base.gif gfx2.ico gfx2.gif doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt fonts/8pxfont.png fonts/Tuffy.ttf $(BIN) : $(OBJ) $(OBJRES) $(CC) $(OBJ) $(OBJRES) -o $(BIN) $(LOPT) diff --git a/const.h b/const.h index e305ac03..f288368d 100644 --- a/const.h +++ b/const.h @@ -28,7 +28,7 @@ #define M_2PI 6.28318530717958647692528676656 -#define PERCENTAGE_VERSION "98.0%" // Libellé du pourcentage de la version ß +#define PERCENTAGE_VERSION "99.0%" // Libellé du pourcentage de la version ß #define VERSION1 2 // | #define VERSION2 0 // |_ Numéro de version découpé en #define BETA1 98 // | plusieurs parties => 2.0 ß95.5% @@ -123,22 +123,21 @@ enum FILE_FORMATS enum ERROR_CODES { - // 0 = Flash rouge de l'écran, erreur non critique - ERROR_GUI_MISSING=1, // Le fichier gfx2gui.gif est absent - ERROR_GUI_CORRUPTED, // Mauvais fichier gfx2gui.gif - ERROR_INI_MISSING, // Le fichier gfx2def.ini est absent - ERROR_CFG_MISSING, // Le fichier GFX2.CFG est absent - ERROR_CFG_CORRUPTED, // Mauvais fichier GFX2.CFG - ERROR_CFG_OLD, // Ancienne version du fichier GFX2.CFG - ERROR_MEMORY, // Plus de mémoire - ERROR_COMMAND_LINE, // Error sur la ligne de commande - ERROR_MOUSE_DRIVER, // Pas de driver souris installé - ERROR_FORBIDDEN_MODE, // Mode demandé sur la ligne de commande interdit (coché en noir) - ERROR_SAVING_CFG, // Error en écriture pour GFX2.CFG - ERROR_MISSING_DIRECTORY, // Le répertoire de lancement n'existe plus - ERROR_INI_CORRUPTED, // Le fichier GFX2.INI est corrompu - ERROR_SAVING_INI, // Le fichier GFX2.INI n'est pas inscriptible - ERROR_SORRY_SORRY_SORRY // On le refera plus, promis (erreur d'allocation de page qui ne devrait JAMAIS se produire) + // 0 = Red flash on screen, non-fatal error + ERROR_GUI_MISSING=1, // The graphics file is missing + ERROR_GUI_CORRUPTED, // The graphics file cannot be parsed for GUI elements + ERROR_INI_MISSING, // File gfx2def.ini is missing + ERROR_CFG_MISSING, // File gfx2.cfg is missing (non-fatal) + ERROR_CFG_CORRUPTED, // File gfx2.cfg couldn't be parsed (non-fatal) + ERROR_CFG_OLD, // Unknown version of gfx2.cfg : either VERY old or wrong file (non-fatal) + ERROR_MEMORY, // Out of memory + ERROR_COMMAND_LINE, // Error in command-line arguments (syntax, or couldn't find the file to open) + ERROR_FORBIDDEN_MODE, // Graphics mode requested is not supported + ERROR_SAVING_CFG, // Error while writing gfx2.cfg + ERROR_MISSING_DIRECTORY, // Unable to return to the original "current directory" on program exit + ERROR_INI_CORRUPTED, // File gfx2.ini couldn't be parsed + ERROR_SAVING_INI, // Error while writing gfx2.ini + ERROR_SORRY_SORRY_SORRY // (Page allocation error that shouldn't ever happen, now) }; // Les différents types de pixels diff --git a/doc/COMPILING.txt b/doc/COMPILING.txt new file mode 100644 index 00000000..05b66e5b --- /dev/null +++ b/doc/COMPILING.txt @@ -0,0 +1,112 @@ +Grafx2 compilation and installation +=================================== + +=== Requirements === + +* gcc C compiler +* GNU make +* SDL library v1.2 +* SDL_image library +* libpng (not on MacOSX) +* FreeType library (optional) +* SDL_ttf library (optional) + +Extra requirements for Windows: +* a POSIX environment: MSYS is fine, maybe Cygwin would work as well. +* use Mingw C compiler instead of gcc + +=== Instructions === + +Open a shell/Terminal, cd to the directory where you have the source code, and +type: + make +If all goes well, it should build grafx2 (the main program) in the current +directory. Voilà. + +If you don't have FreeType and SDL_ttf, compile with NOTTF=1, it will +build a version without TrueType support : the Text tool will be limited to +bitmap fonts, proportional fonts with .ttf extension won't be available. + +=== Build variants === + +The default compilation is optimized ( -O ), with debugging symbols for GDB. +Compile with OPTIM=0 to disable optimizations, if you have some real debugging +to do. +Compile with OPTIM=3 to use maximum optimizations. + +Compile with NOJOY=1 to disable joystick support. + +=== Other compilation targets === + make clean +Erases the generated files + + make depend +Re-compute the dependencies (makefile.dep). + +Other compilation targets (make version, make ziprelease) require Subversion +and are only useful to contributors to the svn repository of Grafx2. + +=== System specifics === + +== Unix/Linux == + sudo make install +This copies the executable and data files in your system, in the /usr/local/ +and /usr/share directories. You then no longer need the compilation directory. + + sudo make uninstall +Removes the copied files from your system, keeps your configuration. + +== Windows == +Here are the resources used to build the Windows version: + +4DOS + with an alias make=mingw32-make + +MSYS + installed in C:\MSYS + +Mingw + installed in C:\MSYS\mingw + +SDL: + SDL-devel-1.2.13-mingw32.tar.gz + Uncompress in temporary directory + make + make install (no effect?) + Headers are in /usr/mingw/include/SDL, copy them to /usr/include/SDL + +Zlib: + http://gnuwin32.sourceforge.net/downlinks/zlib.php + zlib-1.2.3.exe + Install in c:\msys\mingw +Libpng + Requires: Zlib + http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libpng/ + libpng-1.0.23.tar.gz + Uncompress in temporary directory + ./configure + make + make install (long) + Files created in /usr/local/include and /usr/local/lib .... + +SDL_image: + Requires: Libpng + http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libsdl/ + SDL_image-1.2.6.zip + Uncompress in temporary directory + ./configure + Check that png worked + make + make install + +FreeType: + http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/m/mi/mingw-cross/ + mingw-freetype-2.3.7-2 + Uncompress in c:/mwsys/mingw + +SDL_ttf: + No mingw package + http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libsdl/ + SDL_ttf-2.0.9-win32.zip for DLLs: libfreetype-6.dll, SDL_ttf.dll, zlib1.dll + SDL_ttf-2.0.9.tar.gz + diff --git a/doc/README.txt b/doc/README.txt index 322f71f5..4f7f47cb 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -3,6 +3,8 @@ Copyright (C)1996-2001 Sunset Design (G.Dorme & K.Maritaud) Copyright (C)2007-2009 the Grafx2 Project Team (A.Destugues & Y.Rizoud) ------------------------------------- +=== ABOUT === + GrafX2 is a drawing program dedicated to pixelart and low-color graphics. This program is dedicated to everybody who knows what a single pixel is. Its layout is not very different from the famous Deluxe Paint or Brilliance, so @@ -17,11 +19,15 @@ then released the sourcecode and we've modified it to run on your favorite platform (if we missed it, please tell us !). Check the homepage at http://code.google.com/p/grafx2 for latest news and bugfixed versions. +=== HELP === + If you are in trouble when using the program, don't forget you can always press the key inside it to get some help. You can also check the wiki at http://code.google.com/p/grafx2/wiki for some more information. If you've hidden the menu and you're stuck, press to show it again. +=== LICENSE === + 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. See doc/gpl-v2.txt for details. @@ -33,6 +39,12 @@ own licenses: - zlib: (on Windows) see doc/README-zlib1.txt The font Tuffy.ttf included as a sample in the fonts/ directory is public domain. +=== COMPILING === + +http://code.google.com/p/grafx2/wiki/Compiling + +=== AUTHORS AND SUPPORT === + To watch the full credits list, in the program, click '?' then 'Credits'. Send bugs and feature requests to our bugtracker : @@ -40,7 +52,10 @@ http://code.google.com/p/grafx2/issues/list Sends greetings and glops to pouet.net : http://pouet.net/prod.php?which=51865 +=== HISTORY === + Short revision history : + * 04/2009 99.0% Many new features and critical fixes * 01/2009 98.0% Now running Linux, Windows, Mac OS X, BeOS, Haiku, AmigaOS 3.x and 4, MorphOS, SkyOS and gp2x. * 10/2008 97.0% Our first public beta release diff --git a/install/WinInstaller.nsi b/install/WinInstaller.nsi index c04ab720..fe98d6be 100644 --- a/install/WinInstaller.nsi +++ b/install/WinInstaller.nsi @@ -11,7 +11,7 @@ ;Name and file Name "Grafx2" - OutFile "grafx2-2.00b99.0-svn722-win32.exe" + OutFile "grafx2-2.00b99.0-svn724-win32.exe" ;Default installation folder InstallDir "$PROGRAMFILES\Grafx2" @@ -60,17 +60,20 @@ Section "Grafx2" SecProgram SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... File ..\grafx2.exe - File ..\src-svn722.tgz - File ..\skins\base.gif + File ..\src-svn724.tgz File ..\gfx2.gif + File ..\gfx2def.ini File ..\SDL_image.dll File ..\SDL.dll File ..\libfreetype-6.dll File ..\SDL_ttf.dll File ..\zlib1.dll File ..\libpng13.dll + SetOutPath "$INSTDIR\skins" + File ..\skins\base.gif SetOutPath "$INSTDIR\doc" File ..\doc\README.txt + File ..\doc\COMPILING.txt File ..\doc\README-SDL_ttf.txt File ..\doc\README-SDL.txt File ..\doc\README-SDL_image.txt @@ -94,7 +97,7 @@ Section "Grafx2" SecProgram WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ "URLInfoAbout" "http://grafx2.googlecode.com" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ - "DisplayVersion" "98%" + "DisplayVersion" "99%" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ "NoModify" 1 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \ @@ -136,8 +139,9 @@ Section "un.SecProgram" ;ADD YOUR OWN FILES HERE... Delete "$INSTDIR\grafx2.exe" - Delete "$INSTDIR\src-svn722.tgz" + Delete "$INSTDIR\src-svn724.tgz" Delete "$INSTDIR\gfx2.gif" + Delete "$INSTDIR\gfx2def.ini" Delete "$INSTDIR\SDL_image.dll" Delete "$INSTDIR\SDL.dll" Delete "$INSTDIR\libfreetype-6.dll" @@ -145,6 +149,7 @@ Section "un.SecProgram" Delete "$INSTDIR\zlib1.dll" Delete "$INSTDIR\libpng13.dll" Delete "$INSTDIR\doc\README.txt" + Delete "$INSTDIR\doc\COMPILING.txt" Delete "$INSTDIR\doc\README-SDL_ttf.txt" Delete "$INSTDIR\doc\README-SDL.txt" Delete "$INSTDIR\doc\README-SDL_image.txt" @@ -155,7 +160,7 @@ Section "un.SecProgram" Delete "$INSTDIR\fonts\Tuffy.ttf" RMDir "$INSTDIR\fonts" Delete "$INSTDIR\skins\base.gif" - RMDir "$INSTDIR\skins + RMDir "$INSTDIR\skins" Delete "$INSTDIR\Uninstall.exe" MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Do you wish to keep your configuration settings ?" IDYES keepconfig IDNO deleteconfig diff --git a/main.c b/main.c index 9cbfcb36..ef798250 100644 --- a/main.c +++ b/main.c @@ -115,49 +115,37 @@ void Error_function(int error_code, const char *filename, int line_number, const { switch (error_code) { - case ERROR_GUI_MISSING : printf("Error: File gfx2gui.gif is missing!\n"); + case ERROR_GUI_MISSING : printf("Error: File containing the GUI graphics is missing!\n"); printf("This program cannot run without this file.\n"); break; - case ERROR_GUI_CORRUPTED : printf("Error: File gfx2gui.gif is corrupt!\n"); + case ERROR_GUI_CORRUPTED : printf("Error: File containing the GUI graphics couldn't be parsed!\n"); printf("This program cannot run without a correct version of this file.\n"); break; case ERROR_INI_MISSING : printf("Error: File gfx2def.ini is missing!\n"); printf("This program cannot run without this file.\n"); break; - case ERROR_CFG_MISSING : printf("Error: File GFX2.CFG is missing!\n"); - printf("Please run GFXCFG to create it.\n"); - break; - case ERROR_CFG_CORRUPTED : printf("Error: File GFX2.CFG is corrupt!\n"); - printf("Please run GFXCFG to make a valid file.\n"); - break; - case ERROR_CFG_OLD : printf("Error: File GFX2.CFG is from another version of GrafX2.\n"); - printf("Please run GFXCFG to update this file.\n"); - break; - case ERROR_MEMORY : printf("Error: Not enough memory!\n\n"); + case ERROR_MEMORY : printf("Error: Not enough memory!\n\n"); printf("You should try exiting other programs to free some bytes for Grafx2.\n\n"); break; - case ERROR_MOUSE_DRIVER : printf("Error: No mouse detected!\n"); - printf("Check if a mouse driver is installed and if your mouse is correctly connected.\n"); - break; case ERROR_FORBIDDEN_MODE : printf("Error: The requested video mode has been disabled from the resolution menu!\n"); printf("If you want to run the program in this mode, you'll have to start it with an\n"); printf("enabled mode, then enter the resolution menu and enable the mode you want.\n"); - printf("Check also if the 'Default_video_mode' parameter in GFX2.INI is correct.\n"); + printf("Check also if the 'Default_video_mode' parameter in gfx2.ini is correct.\n"); break; case ERROR_COMMAND_LINE : printf("Error: Invalid parameter or file not found.\n\n"); Display_syntax(); break; case ERROR_SAVING_CFG : printf("Error: Write error while saving settings!\n"); - printf("Settings have not been saved correctly, and the GFX2.CFG file may have been\n"); - printf("corrupt. If so, please run GFXCFG to make a new valid file.\n"); + printf("Settings have not been saved correctly, and the gfx2.cfg file may have been\n"); + printf("corrupt. If so, please delete it and Grafx2 will restore default settings.\n"); break; case ERROR_MISSING_DIRECTORY : printf("Error: Directory you ran the program from not found!\n"); break; - case ERROR_INI_CORRUPTED : printf("Error: File GFX2.INI is corrupt!\n"); + case ERROR_INI_CORRUPTED : printf("Error: File gfx2.ini is corrupt!\n"); printf("It contains bad values at line %d.\n",Line_number_in_INI_file); printf("You can re-generate it by deleting the file and running GrafX2 again.\n"); break; - case ERROR_SAVING_INI : printf("Error: Cannot rewrite file GFX2.INI!\n"); + case ERROR_SAVING_INI : printf("Error: Cannot rewrite file gfx2.ini!\n"); break; case ERROR_SORRY_SORRY_SORRY : printf("Error: Sorry! Sorry! Sorry! Please forgive me!\n"); break; @@ -646,7 +634,6 @@ void Program_shutdown(void) free(Main_screen); // On prend bien soin de passer dans le répertoire initial: - DEBUG(Initial_directory,1); if (chdir(Initial_directory)!=-1) { // On sauvegarde les données dans le .CFG et dans le .INI diff --git a/sdlscreen.c b/sdlscreen.c index c65d600b..6aa55ac9 100644 --- a/sdlscreen.c +++ b/sdlscreen.c @@ -53,14 +53,14 @@ void Set_mode_SDL(int *width, int *height, int fullscreen) // Vérification du mode obtenu (ce n'est pas toujours celui demandé) if (Screen_SDL->w != *width || Screen_SDL->h != *height) { - DEBUG("Error mode video obtenu différent de celui demandé !!",0); + DEBUG("Error: Got a different video mode than the requested one!",0); *width = Screen_SDL->w; *height = Screen_SDL->h; } Screen_pixels=Screen_SDL->pixels; } else - DEBUG("Error changement de mode video !!",0); + DEBUG("Error: Unable to change video mode!",0); SDL_ShowCursor(0); // Cache le curseur SDL, on le gère en soft }