Merged trunk into branches/mode5 (=update mode5 branch to latest)

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1785 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2011-04-25 15:17:18 +00:00
commit 1f10338f60
98 changed files with 4545 additions and 2979 deletions

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>Grafx2</string> <string>Grafx2</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string></string> <string>Grafx2.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.googlecode.grafx2</string> <string>com.googlecode.grafx2</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>

View File

@ -77,6 +77,7 @@ Sends greetings and glops to pouet.net : http://pouet.net/prod.php?which=51865
=== HISTORY === === HISTORY ===
Short revision history : Short revision history :
* 04/2011 2.3 Further improvements
* 03/2010 2.2 Layers, Lua scripting * 03/2010 2.2 Layers, Lua scripting
* 09/2009 2.1 GUI improvements and some new features. * 09/2009 2.1 GUI improvements and some new features.
* 06/2009 2.0 Completed the features planned by Sunset Design. * 06/2009 2.0 Completed the features planned by Sunset Design.

338
install/WinInstaller_23.nsi Normal file
View File

@ -0,0 +1,338 @@
;NSIS Modern User Interface
;Based on the Example Script written by Joost Verburg
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;--------------------------------
;General
;Name and file
Name "Grafx2"
OutFile "grafx2-2.3.1771.win32.exe"
;Default installation folder
InstallDir "$PROGRAMFILES\Grafx2"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\Grafx2" ""
;Request application privileges for Windows Vista
RequestExecutionLevel user
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!define MUI_WELCOMEFINISHPAGE_BITMAP vector.bmp
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!insertmacro MUI_PAGE_WELCOME
;!define MUI_HEADERIMAGE_BITMAP logo_scenish.bmp
;!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!insertmacro MUI_PAGE_LICENSE "..\doc\gpl-2.0.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Functions
Function .onInstSuccess
MessageBox MB_YESNO "Run GrafX2 now ?" IDNO norun
Exec $INSTDIR\bin\grafx2.exe
norun:
FunctionEnd
;--------------------------------
;Installer Sections
Section "Grafx2" SecProgram
SectionIn RO
SetOutPath "$INSTDIR"
;ADD YOUR OWN FILES HERE...
File ..\src-2.3.1771.tgz
SetOutPath "$INSTDIR\bin"
File ..\bin\grafx2.exe
File ..\bin\SDL_image.dll
File ..\bin\SDL.dll
File ..\bin\libfreetype-6.dll
File ..\bin\SDL_ttf.dll
File ..\bin\zlib1.dll
File ..\bin\libpng14-14.dll
SetOutPath "$INSTDIR\share\grafx2"
File ..\share\grafx2\gfx2.gif
File ..\share\grafx2\gfx2def.ini
SetOutPath "$INSTDIR\share\grafx2\skins"
File ..\share\grafx2\skins\font_Classic.png
File ..\share\grafx2\skins\font_DPaint.png
File ..\share\grafx2\skins\font_Fairlight.png
File ..\share\grafx2\skins\font_Fun.png
File ..\share\grafx2\skins\font_Melon.png
File ..\share\grafx2\skins\font_Seen.png
File ..\share\grafx2\skins\skin_Aurora.png
File ..\share\grafx2\skins\skin_classic.png
File ..\share\grafx2\skins\skin_DPaint.png
File ..\share\grafx2\skins\skin_modern.png
File ..\share\grafx2\skins\skin_scenish.png
SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\brush"
File ..\share\grafx2\scripts\samples_2.3\brush\ApplyColor.lua
File ..\share\grafx2\scripts\samples_2.3\brush\Fisheye.lua
File ..\share\grafx2\scripts\samples_2.3\brush\GrayscaleAvg.lua
File ..\share\grafx2\scripts\samples_2.3\brush\GrayscaleDesat.lua
File ..\share\grafx2\scripts\samples_2.3\brush\Halfsmooth.lua
File ..\share\grafx2\scripts\samples_2.3\brush\Waves.lua
SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\demo"
File ..\share\grafx2\scripts\samples_2.3\demo\3DPalette.lua
File ..\share\grafx2\scripts\samples_2.3\demo\Ellipse.lua
File ..\share\grafx2\scripts\samples_2.3\demo\FlipPicture.lua
File ..\share\grafx2\scripts\samples_2.3\demo\SierpinskyCarpet.lua
File ..\share\grafx2\scripts\samples_2.3\demo\SierpinskyTriangle.lua
File ..\share\grafx2\scripts\samples_2.3\demo\Spritesheet.lua
SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush"
File ..\share\grafx2\scripts\samples_2.3\demo\brush\Amigaball.lua
File ..\share\grafx2\scripts\samples_2.3\demo\brush\ColorSphere.lua
File ..\share\grafx2\scripts\samples_2.3\demo\brush\FindAA.lua
File ..\share\grafx2\scripts\samples_2.3\demo\brush\Mandelbrot.lua
SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\libs"
File ..\share\grafx2\scripts\samples_2.3\libs\dawnbringer_lib.lua
File ..\share\grafx2\scripts\samples_2.3\libs\memory.lua
SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\palette"
File ..\share\grafx2\scripts\samples_2.3\palette\Desaturate.lua
File ..\share\grafx2\scripts\samples_2.3\palette\ExpandColors.lua
File ..\share\grafx2\scripts\samples_2.3\palette\FillColorCube.lua
File ..\share\grafx2\scripts\samples_2.3\palette\InvertedRGB.lua
File ..\share\grafx2\scripts\samples_2.3\palette\Set3bit.lua
File ..\share\grafx2\scripts\samples_2.3\palette\Set6bit.lua
File ..\share\grafx2\scripts\samples_2.3\palette\SetC64Palette.lua
File ..\share\grafx2\scripts\samples_2.3\palette\ShiftHue.lua
SetOutPath "$INSTDIR\share\grafx2\scripts\samples_2.3\picture"
File ..\share\grafx2\scripts\samples_2.3\picture\CellColourReducer.lua
File ..\share\grafx2\scripts\samples_2.3\picture\DrawGridIsometric.lua
File ..\share\grafx2\scripts\samples_2.3\picture\DrawgridOrthogonal_Index.lua
File ..\share\grafx2\scripts\samples_2.3\picture\DrawGridOrthogonal_RGB.lua
File ..\share\grafx2\scripts\samples_2.3\picture\GlassGridFilter.lua
File ..\share\grafx2\scripts\samples_2.3\picture\PaletteToPicture.lua
File ..\share\grafx2\scripts\samples_2.3\picture\Pic2isometric.lua
File ..\share\grafx2\scripts\samples_2.3\picture\Rainbow-Dark2Bright.lua
File ..\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB.lua
File ..\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB_ed.lua
File ..\share\grafx2\scripts\samples_2.3\picture\RemapImageTo3bitPal.lua
File ..\share\grafx2\scripts\samples_2.3\picture\XBitColourXpaceFromPalette.lua
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
File ..\doc\README-zlib1.txt
File ..\doc\README-lua.txt
File ..\doc\gpl-2.0.txt
SetOutPath "$INSTDIR\share\grafx2\fonts"
File ..\share\grafx2\fonts\8pxfont.png
File ..\share\grafx2\fonts\Tuffy.ttf
File ..\share\grafx2\fonts\PF_Arma_5__.png
File ..\share\grafx2\fonts\PF_Easta_7_.png
File ..\share\grafx2\fonts\PF_Easta_7__.png
File ..\share\grafx2\fonts\PF_Ronda_7__.png
File ..\share\grafx2\fonts\PF_Tempesta_5.png
File ..\share\grafx2\fonts\PF_Tempesta_5_.png
File ..\share\grafx2\fonts\PF_Tempesta_5__.png
File ..\share\grafx2\fonts\PF_Tempesta_5___.png
File ..\share\grafx2\fonts\PF_Tempesta_7.png
File ..\share\grafx2\fonts\PF_Tempesta_7_.png
File ..\share\grafx2\fonts\PF_Tempesta_7__.png
File ..\share\grafx2\fonts\PF_Tempesta_7___.png
File ..\share\grafx2\fonts\PF_Westa_7_.png
File ..\share\grafx2\fonts\PF_Westa_7__.png
; Register in Add/Remove programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"DisplayName" "GrafX2 (GNU GPL)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"InstalledProductName" "GrafX2"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"InstalledLocation" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"DisplayIcon" "$INSTDIR\gfx2.ico"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"URLInfoAbout" "http://grafx2.googlecode.com"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"DisplayVersion" "2.3.1771"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"NoModify" 1
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL" \
"NoRepair" 1
;Store installation folder
WriteRegStr HKLM "Software\Grafx2" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
Section "Desktop shortcut" SecShortcut
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\Grafx2.lnk" "$INSTDIR\bin\grafx2.exe" "" "" "" SW_SHOWNORMAL
SectionEnd
;--------------------------------
;Descriptions
;Language strings
LangString DESC_SecProgram ${LANG_ENGLISH} "Grafx2 application and runtime data."
LangString DESC_SecShortcut ${LANG_ENGLISH} "Desktop shortcut."
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecProgram} $(DESC_SecProgram)
!insertmacro MUI_DESCRIPTION_TEXT ${SecShortcut} $(DESC_SecShortcut)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "un.SecProgram"
;ADD YOUR OWN FILES HERE...
Delete "$INSTDIR\bin\grafx2.exe"
Delete "$INSTDIR\src-2.3.1771.tgz"
Delete "$INSTDIR\share\grafx2\gfx2.gif"
Delete "$INSTDIR\share\grafx2\gfx2def.ini"
Delete "$INSTDIR\bin\SDL_image.dll"
Delete "$INSTDIR\bin\SDL.dll"
Delete "$INSTDIR\bin\libfreetype-6.dll"
Delete "$INSTDIR\bin\SDL_ttf.dll"
Delete "$INSTDIR\bin\zlib1.dll"
Delete "$INSTDIR\bin\libpng14-14.dll"
Delete "$INSTDIR\bin\stdout.txt"
Delete "$INSTDIR\bin\stderr.txt"
RMDir "$INSTDIR\bin"
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"
Delete "$INSTDIR\doc\README-zlib1.txt"
Delete "$INSTDIR\doc\README-lua.txt"
Delete "$INSTDIR\doc\gpl-2.0.txt"
RMDir "$INSTDIR\doc"
Delete "$INSTDIR\share\grafx2\fonts\8pxfont.png"
Delete "$INSTDIR\share\grafx2\fonts\Tuffy.ttf"
Delete "$INSTDIR\share\grafx2\fonts\PF_Arma_5__.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Easta_7_.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Easta_7__.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Ronda_7__.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5_.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5__.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_5___.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7_.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7__.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Tempesta_7___.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Westa_7_.png"
Delete "$INSTDIR\share\grafx2\fonts\PF_Westa_7__.png"
RMDir "$INSTDIR\share\grafx2\fonts"
Delete "$INSTDIR\share\grafx2\skins\font_Classic.png"
Delete "$INSTDIR\share\grafx2\skins\font_Fun.png"
Delete "$INSTDIR\share\grafx2\skins\font_Fairlight.png"
Delete "$INSTDIR\share\grafx2\skins\font_Melon.png"
Delete "$INSTDIR\share\grafx2\skins\font_DPaint.png"
Delete "$INSTDIR\share\grafx2\skins\font_Seen.png"
Delete "$INSTDIR\share\grafx2\skins\skin_classic.png"
Delete "$INSTDIR\share\grafx2\skins\skin_Aurora.png"
Delete "$INSTDIR\share\grafx2\skins\skin_modern.png"
Delete "$INSTDIR\share\grafx2\skins\skin_DPaint.png"
Delete "$INSTDIR\share\grafx2\skins\skin_scenish.png"
RMDir "$INSTDIR\share\grafx2\skins"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\ApplyColor.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\Fisheye.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\GrayscaleAvg.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\GrayscaleDesat.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\Halfsmooth.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\brush\Waves.lua"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\brush"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\Amigaball.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\ColorSphere.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\FindAA.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush\Mandelbrot.lua"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\brush"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\3DPalette.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\Ellipse.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\FlipPicture.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\SierpinskyCarpet.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\SierpinskyTriangle.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\demo\Spritesheet.lua"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\demo"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\libs\dawnbringer_lib.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\libs\memory.lua"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\libs"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\Desaturate.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\ExpandColors.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\FillColorCube.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\InvertedRGB.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\Set3bit.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\Set6bit.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\SetC64Palette.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\palette\ShiftHue.lua"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\palette"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\CellColourReducer.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\DrawGridIsometric.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\DrawgridOrthogonal_Index.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\DrawGridOrthogonal_RGB.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\GlassGridFilter.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\PaletteToPicture.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\Pic2isometric.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\Rainbow-Dark2Bright.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\RemapImage2RGB_ed.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\RemapImageTo3bitPal.lua"
Delete "$INSTDIR\share\grafx2\scripts\samples_2.3\picture\XBitColourXpaceFromPalette.lua"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3\picture"
RMDir "$INSTDIR\share\grafx2\scripts\samples_2.3"
RMDir "$INSTDIR\share\grafx2\scripts"
RMDir "$INSTDIR\share\grafx2"
RMDir "$INSTDIR\share"
Delete "$INSTDIR\Uninstall.exe"
MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Do you wish to keep your configuration settings ?" IDYES keepconfig IDNO deleteconfig
deleteconfig:
Delete "$INSTDIR\gfx2.cfg"
Delete "$INSTDIR\gfx2.ini"
Delete "$APPDATA\Grafx2\gfx2.cfg"
Delete "$APPDATA\Grafx2\gfx2.ini"
RMDir "$APPDATA\Grafx2"
keepconfig:
RMDir "$INSTDIR"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Grafx2-SDL"
DeleteRegKey /ifempty HKLM "Software\Grafx2"
SectionEnd
Section "un.SecShortcut"
Delete "$DESKTOP\Grafx2.lnk"
SectionEnd

BIN
install/vector.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

View File

@ -1,4 +1,4 @@
.TH GRAFX2 1 "February 23, 2009" .TH GRAFX2 1 "April 14, 2011"
.SH NAME .SH NAME
grafx2 \- Ultimate 256-color bitmap paint program grafx2 \- Ultimate 256-color bitmap paint program
.SH SYNOPSIS .SH SYNOPSIS
@ -23,24 +23,40 @@ little more difficult for you, but you should give it a try (or more, because
most of the power of this program won't show up on the first try). most of the power of this program won't show up on the first try).
.SH OPTIONS .SH OPTIONS
A summary of options is included below. A summary of options is included below.
They can be prefixed by either / - or --
.TP .TP
.B /?, /h, /help .B -?, -h, -help
Show summary of options. Show summary of options.
.TP .TP
.B /wide .B -wide
To emulate a video mode with wide pixels (2 x 1). To emulate a video mode with wide pixels (2 x 1).
.TP .TP
.B /tall .B -tall
To emulate a video mode with tall pixels (1 x 2). To emulate a video mode with tall pixels (1 x 2).
.TP .TP
.B /double .B -double
To emulate a video mode with double pixels (2 x 2). To emulate a video mode with double pixels (2 x 2).
.TP .TP
.B /skin <filename> .B -wide2
To emulate a video mode with double wide pixels (4 x 2).
.TP
.B -tall2
To emulate a video mode with double tall pixels (2 x 4).
.TP
.B -triple
To emulate a video mode with triple pixels (3 x 3).
.TP
.B -quadruple
To emulate a video mode with quadruple pixels (4 x 4).
.TP
.B -rgb <n>
To reduce RGB precision from 256 to n levels.
.TP
.B -skin <filename>
Use an alternate file for the menu graphics. Use an alternate file for the menu graphics.
.TP .TP
.B /mode <videomode> .B -mode <videomode>
To set a video mode listed with the /help parameter. To set a video mode listed with the -help parameter.
.SH FILES .SH FILES
User settings are stored in ~/.grafx2/gfx2.ini. This file is really meant to User settings are stored in ~/.grafx2/gfx2.ini. This file is really meant to
be edited by the user and allows to tweak many aspects of the program. be edited by the user and allows to tweak many aspects of the program.

View File

@ -364,6 +364,7 @@
; When this mode is active, scrolling the view (and the magnifier view) ; When this mode is active, scrolling the view (and the magnifier view)
; affects both the main image and the spare page - as long as they have ; affects both the main image and the spare page - as long as they have
; the same dimensions. ; the same dimensions.
;
Sync_views = YES; (Default YES) Sync_views = YES; (Default YES)
; This setting determines which key inverts the mouse buttons ; This setting determines which key inverts the mouse buttons
@ -371,7 +372,19 @@
; It's especially useful for one-button controllers, ; It's especially useful for one-button controllers,
; such as touchscreens and tablets. ; such as touchscreens and tablets.
; Possible values are 0 (none), 1 (control), 2 (alt) ; Possible values are 0 (none), 1 (control), 2 (alt)
;
Swap_buttons = 1; (Default 1) Swap_buttons = 1; (Default 1)
; Last directory browsed with the script selector.
; Leave blank to initially start in (data directory)/scripts
;
Scripts_directory =
; When this setting is disabled, and you create a shortcut with a key that
; is already associated to another shortcut, Grafx2 will unset the latter.
; If you enable this mode, Grafx2 will not make such check, so you can design
; shortcuts that trigger several actions at once.
;
Allow_multi_shortcuts = no; (Default no)
; end of configuration ; end of configuration

View File

@ -0,0 +1,124 @@
--BRUSH Remap: Apply PenColor
--by Richard Fhager
--http://hem.fyristorg.com/dawnbringer/
-- Copyright 2010 Richard Fhager
--
-- This program 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 <http://www.gnu.org/licenses/>
dofile("../libs/dawnbringer_lib.lua")
OK,tin,clz,fade,amt,brikeep,falloff,nobg,briweight = inputbox("Apply PenColor 2 Brush",
"1. Tint", 1, 0,1,-1,
"2. Colorize", 0, 0,1,-1,
"BG->FG color Fade", 0, 0,1,0,
"AMOUNT % (0-100)", 100, 0,100,0,
"Preserve Brightness", 1, 0,1,0,
"Bri/Dark FallOff", 1, 0,1,0,
"Exclude Background", 1,0,1,0,
"ColMatch Bri-Weight %", 25, 0,100,0
);
if OK == true then
function cap(v) return math.min(255,math.max(v,0)); end
w, h = getbrushsize()
fg = getforecolor()
bg = getbackcolor()
fR,fG,fB = getcolor(fg)
bR,bG,bB = getcolor(bg)
pal = db.fixPalette(db.makePalList(256))
if nobg == 1 then
pal = db.stripIndexFromPalList(pal,bg) -- Remove background color from pallist
end
amtA = amt / 100
amtR = 1 - amtA
-- Normalize Pen Color
lev = (fR+fG+fB)/3
fR = fR - lev
fG = fG - lev
fB = fB - lev
---------------------------------------------------
-- Colorize (Colourant) (just apply colorbalance)
-- Tint (make grayscale and apply colorbalance)
--
-- I think it should be the other way around since colorize is the process of adding color to B&W film...
-- But this is the what Brilliance and others call it
--
if clz == 1 or tin == 1 then
cols = {}
for n = 0, 255, 1 do
r,g,b = getcolor(n)
a = db.getBrightness(r,g,b)
mR,mG,mB = fR,fG,fB
-- Fade between bg & fg pencolor across dark-bright
if fade == 1 then
lf = a / 255
lr = 1 - lf
mR = bR*lr + fR*lf
mG = bG*lr + fG*lf
mB = bB*lr + fB*lf
lev = (mR+mG+mB)/3
mR = mR - lev
mG = mG - lev
mB = mB - lev
end
fr,fg,fb = mR,mG,mB
if brikeep == 1 then
-- Loose Brightness preservation (ex: applying full red to dark colors)
brin = db.getBrightness(cap(r+mR),cap(g+mG),cap(b+mB))
itot = brin - a
fr = mR - itot
fg = mG - itot
fb = mB - itot
end
-- Falloff (Effect weakens at dark and bright colors)
if falloff == 1 then
fo = 1 - math.abs((a - 127.5)/127.5)^2
fr = fr * fo
fg = fg * fo
fb = fb * fo
end
if tin == 1 then
--cols[n+1] = matchcolor((a+fr)*amtA + r*amtR, (a+fg)*amtA + g*amtR, (a+fb)*amtA + b*amtR)
cols[n+1] = db.getBestPalMatchHYBRID({(a+fr)*amtA+r*amtR, (a+fg)*amtA + g*amtR, (a+fb)*amtA + b*amtR},pal,briweight / 100,true)
end
if clz == 1 then
--cols[n+1] = matchcolor((r+fr)*amtA + r*amtR, (g+fg)*amtA + g*amtR, (b+fb)*amtA + b*amtR)
cols[n+1] = db.getBestPalMatchHYBRID({(r+fr)*amtA+r*amtR, (g+fg)*amtA + g*amtR, (b+fb)*amtA + b*amtR},pal,briweight / 100,true)
end
end
if nobg == 1 then cols[getbackcolor()+1] = getbackcolor(); end
for x = 0, w - 1, 1 do
for y = 0, h - 1, 1 do
putbrushpixel(x, y, cols[getbrushpixel(x,y) + 1]);
end
end
end;
-- eof Colorize & Tint
--------------------------------------------------------
end -- OK

View File

@ -0,0 +1,431 @@
--3D-Palette viwer V0.7 (HSL-models added, 3D-World added, Pen-color only cycles thru unique colors, InputBox)
--by Richard 'Dawnbringer' Fhager
-- Mouse: Rotate Cube (Stops animation)
-- Arrow-keys: Move Cube (in 3D world)
-- F1: Start/Stop animation
-- F2: Reset
-- F3: Increase Color-Size
-- F4: Decrease Color-Size
-- F5: (Wip) Cycle thru selected PenColor (Note that only unique colors are displayed)
-- F9: RGB-space model
--F10: HSL-space model
--F11: HSLcubic-space model
-- "+" (Num): Zoom In
-- "-" (Num): Zoom Out
-- Esc: Exit script
dofile("../libs/dawnbringer_lib.lua")
BRIDIAG_SHOW = 1 -- Show brightness/Grayscale diagonal (1 = on, 0 = off)
ANIM = 1 -- Animation (1 = on, 0 = off)
BOX_DRK = 8 -- Darkest color used for box (0-255)
BOX_BRI = 112 -- Brightest color used for box (0-255)
COLSIZE_BASE = 26 -- Colors base size (value to adjusted by palette-size, with 2 cols maxsize is v / 1.23)
--
OK,RGB,HSL,HSLC,BOX_BRI,COLSIZE_BASE,SET800x600 = inputbox("3D-Palette Viever Settings",
"1. RGB space [F9]", 1, 0,1,-1,
"2. HSL space [F10]", 0, 0,1,-1,
"3. HSL-cubic space [F11]",0, 0,1,-1,
"Box Brightness (16-255)", BOX_BRI, 16,255,0,
"Col Size (1-100) [F3/F4]", COLSIZE_BASE, 1,100,0,
"Set Screen to 800x600", 1,0,1,0
);
--
if OK then
if SET800x600 == 1 then setpicturesize(800,600); end
SPACE = "rgb"
FORM = "cube"
if HSL == 1 then
SPACE = "hsl"
FORM = "cylinder"
end
if HSLC == 1 then
SPACE = "hsl_cubic"
FORM = "cube"
end
pal = db.fixPalette(db.makePalList(256))
FG = getforecolor()
BG = getbackcolor()
palcol = FG
--
function initColors(space)
for n = 1, #pal, 1 do
c = pal[n];
if space == "rgb" then
cols[n] = {c[1]/128-1,c[2]/128-1,c[3]/128-1,c[4]};
end
if space == "hsl_cubic" then
cols[n] = {}
cols[n][1] = (db.getHUE(c[1],c[2],c[3],0) / 6.0 * 255) / 128 - 1
cols[n][2] = (db.getSaturation(c[1],c[2],c[3])) / 128 - 1
cols[n][3] = (db.getLightness(c[1],c[2],c[3])) / 128 - 1
cols[n][4] = c[4]
end
if space == "hsl" then
cols[n] = {}
hue = db.getHUE(c[1],c[2],c[3],0) / 6.0 * math.pi*2
rad = db.getSaturation(c[1],c[2],c[3]) / 256
cols[n][1] = math.cos(hue) * rad
cols[n][2] = math.sin(hue) * rad
cols[n][3] = (db.getLightness(c[1],c[2],c[3])) / 128 - 1
cols[n][4] = c[4]
end
end
end
--
cols = {} -- Make points of palette colors
colz = {} -- To hold calculated points
initColors(SPACE)
function initPointsAndLines(form,bridiag)
if form == "cube" then
pts = {{-1,1,-1},{1,1,-1},{1,-1,-1},{-1,-1,-1}, -- The box
{-1,1, 1},{1,1, 1},{1,-1, 1},{-1,-1, 1}}
lin = {{1,2},{2,3},{3,4},{4,1},{5,6},{6,7},{7,8},{8,5},{1,5},{2,6},{3,7},{4,8}} -- Box Lines
if bridiag == 1 then lin[13] = {4,6}; end
end
if form == "cylinder" then
p = 28
pts = {}
lin = {}
for n = 1, p, 1 do
x = math.cos(math.pi*2 / p * (n-1))
y = math.sin(math.pi*2 / p * (n-1))
pts[n] = {x,y,-1}
lin[n] = {n,1 + (n%p)}
pts[n + p] = {x,y,1}
lin[n + p] = {n+p,p + 1 + (n%p)}
end
lin[p*2+1] = {1,p+1} -- Red (0 degrees)
lin[p*2+2] = {p+1,p+1+math.ceil(p/2)} -- Lightness end (needs an even # of points to work)
end
end
boxp = {} -- To hold the calculated points
initPointsAndLines(FORM,BRIDIAG_SHOW)
w,h = getpicturesize()
CX,CY = w/2, h/2
function initAndReset()
XANG, YANG, ZANG, ZOOM, COLSIZE_ADJ, XD, YD, WORLD_X, WORLD_Y = 0,0,0,0,0,0,0,0,0
end
initAndReset()
SIZE = math.min(w,h)/4
DIST = 5 -- Distance perspective modifier, ~5 is nominal, more means "less 3D"
CMAXSIZE = math.floor(COLSIZE_BASE / ((#pal)^0.3))
--CMAXSIZE = 8
CMINSIZE = 1 -- Negative values are ok. Color are never smaller than 1 pix
BOX_LINE_DIV = 20 -- Number of colors/segments that a box-line can be divided into (depth)
BOX_DIV_MULT = BOX_LINE_DIV / (math.sqrt(3)*2)
-- Box depth colors
box_div = {}
for n = 0, BOX_LINE_DIV-1, 1 do
c = BOX_DRK + (BOX_BRI / (BOX_LINE_DIV - 1)) * n
--box_div[BOX_LINE_DIV - n] = matchcolor(c,c,c)
box_div[BOX_LINE_DIV - n] = db.getBestPalMatchHYBRID({c,c,c},pal,0.5,true)
end
--BOX_COL = matchcolor(80,80,80)
BKG_COL = matchcolor(0,0,0)
--CUR_COL = matchcolor(112,112,112)
function rotate3D(x,y,z,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos) -- PrecCalced cos&sin for speed
local x1,x2,x3,y1,y2,y3,f,xp,yp
x1 = x
y1 = y * Xcos + z * Xsin
z1 = z * Xcos - y * Xsin
x2 = x1 * Ycos - z1 * Ysin
y2 = y1
z2 = x1 * Ysin + z1 * Ycos
x3 = x2 * Zcos - y2 * Zsin
y3 = x2 * Zsin + y2 * Zcos
z3 = z2
return x3,y3,z3
end
function do3D(x,y,z,zoom,dist,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos) -- PrecCalced cos&sin for speed
local x1,x2,x3,y1,y2,y3,f,xp,yp
x1 = x
y1 = y * Xcos + z * Xsin
z1 = z * Xcos - y * Xsin
x2 = x1 * Ycos - z1 * Ysin
y2 = y1
z2 = x1 * Ysin + z1 * Ycos
x3 = x2 * Zcos - y2 * Zsin
y3 = x2 * Zsin + y2 * Zcos
z3 = z2
f = dist/(z3 + dist + zoom)
xp = x3 * f
yp = y3 * f
return xp,yp,z3
end
function draw3Dline(x1,y1,z1,x2,y2,z2,div,mult,depthlist)
local s,xt,yt,xd,yd,zd,xf,yf
xd = (x2 - x1) / div
yd = (y2 - y1) / div
zd = (z2 - z1) / div
xf,yf = x1,y1
for s = 1, div, 1 do
-- Depth assumes a 1-Box (z ranges from -sq(3) to sq(3))
depth = math.floor(1 + (z1+zd*s + 1.732) * mult)
xt = x1 + xd*s -- + math.random()*8
yt = y1 + yd*s -- + math.random()*8
c = depthlist[depth]
if c == null then c = 1; end -- Something isn't perfect, error is super rare but this controls it
drawline(xf,yf,xt,yt,c)
xf = xt
yf = yt
end
end
function killinertia()
XD = 0
YD = 0
end
-- If using 1-box, z is -sq(3) to sq(3)
minz = math.sqrt(3)
totz = minz * 2
maxrad = CMAXSIZE - CMINSIZE
q = 0
delay = 4
move = 0.03
while 1 < 2 do
-- Time-for-space-wiggle...or somekindof attempt
--WORLD_X = -move
--q = (q + 1) % delay
--if q < delay/2 then WORLD_X = move; end
clearpicture(BKG_COL)
Xsin = math.sin(XANG); Xcos = math.cos(XANG)
Ysin = math.sin(YANG); Ycos = math.cos(YANG)
Zsin = math.sin(ZANG); Zcos = math.cos(ZANG)
-- Rotate Box points
for n = 1, #pts, 1 do
p = pts[n]
x,y,z = p[1],p[2],p[3]
XP,YP,zp = rotate3D(x,y,z,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos)
boxp[n] = {XP,YP,zp}
end
-- Rotate Colors in palette
for n = 1, #cols, 1 do
p = cols[n]
x,y,z,c = p[1],p[2],p[3],p[4]
XP,YP,zp = rotate3D(x,y,z,Xsin,Ysin,Zsin,Xcos,Ycos,Zcos)
colz[n] = {XP,YP,zp,c}
end
------------------------------------
-- Control world
------------------------------------
-- Calculate points anew
-- Worldize Box points
for n = 1, #boxp, 1 do
s = SIZE
v = boxp[n]
x = v[1] + WORLD_X
y = v[2] + WORLD_Y
z = v[3]
f = DIST/(z + DIST + ZOOM)
XP = CX + x * f * s
YP = CY + y * f * s
boxp[n] = {XP,YP,z}
end
-- Worldize Colors in palette
for n = 1, #colz, 1 do
s = SIZE
v = colz[n]
x = v[1] + WORLD_X
y = v[2] + WORLD_Y
z = v[3]
c = v[4]
f = DIST/(z + DIST + ZOOM)
XP = CX + x * f * s
YP = CY + y * f * s
colz[n] = {XP,YP,z,c}
end
-------------------------------------
-------------------------------------
-- Brightness Diagonal
--if BRIDIAG_SHOW == 1 then
-- p1 = boxp[4]
-- p2 = boxp[6]
-- x1,y1,z1 = p1[1],p1[2],p1[3]
-- x2,y2,z2 = p2[1],p2[2],p2[3]
-- draw3Dline(x1,y1,z1,x2,y2,z2,BOX_LINE_DIV,BOX_DIV_MULT,box_div)
--end
-- sort on z
db.sorti(colz,3)
-- Draw colors
for n = #colz, 1, -1 do
p = colz[n]
XP,YP,zp,c = p[1],p[2],p[3],p[4]
radius = CMINSIZE + maxrad - (zp+minz) / totz * maxrad
dorad = math.floor(radius - ZOOM*2 + COLSIZE_ADJ)
if dorad >= 1 then
drawdisk(XP,YP,dorad,c)
--db.drawRectangle(XP,YP,dorad,dorad,c)
else putpicturepixel(XP,YP,c)
end
if c == FG or c == BG then
sz = math.max(3,dorad + 3)
if c == BKG_COL then v = (c+128) % 255; c = matchcolor(v,v,v); end
db.drawRectangleLine(XP-sz,YP-sz,sz*2,sz*2,c)
end
end -- colz
-- Draw box
for n = 1, #lin, 1 do
l = lin[n]
p1 = boxp[l[1]]
p2 = boxp[l[2]]
x1,y1,z1 = p1[1],p1[2],p1[3]
x2,y2,z2 = p2[1],p2[2],p2[3]
draw3Dline(x1,y1,z1,x2,y2,z2,BOX_LINE_DIV,BOX_DIV_MULT,box_div)
end -- eof box
--updatescreen(); if (waitbreak(0.00)==1) then return; end
repeat
old_key = key;
old_mouse_x = mouse_x;
old_mouse_y = mouse_y;
old_mouse_b = mouse_b;
updatescreen()
moved, key, mouse_x, mouse_y, mouse_b = waitinput(0)
if mouse_b == 1 then ANIM = 0; end
if (key==27) then
return;
end
if (key==282) then ANIM = (ANIM+1) % 2; end -- F1: Stop/Start Animation
if (key==283) then initAndReset(); end -- F2: Reset all values
if (key==284) then COLSIZE_ADJ = COLSIZE_ADJ + 0.5; end -- F3
if (key==285) then COLSIZE_ADJ = COLSIZE_ADJ - 0.5; end -- F4
if (key==286) then
--FG = (FG + 1) % 255;
palcol = (palcol + 1) % #pal
FG = pal[palcol+1][4]
setforecolor(FG);
setcolor(0,getcolor(0)) -- Force update of palette until setforecolor() is fixed
end -- F5
if (key==290) then -- F9
initColors("rgb")
initPointsAndLines("cube",BRIDIAG_SHOW)
end
if (key==291) then -- F10
initColors("hsl")
initPointsAndLines("cylinder", 0) -- Bridiag won't show even if turned on, it's only for cube
end
if (key==292) then -- F11
initColors("hsl_cubic")
initPointsAndLines("cube",BRIDIAG_SHOW)
end
if (key==269) then ZOOM = ZOOM + 0.1; end
if (key==270) then ZOOM = ZOOM - 0.1; end
SPEED = math.pi / 100
if (key==273) then WORLD_Y = WORLD_Y - 0.05; killinertia(); end
if (key==274) then WORLD_Y = WORLD_Y + 0.05; killinertia(); end
if (key==276) then WORLD_X = WORLD_X - 0.05; killinertia(); end
if (key==275) then WORLD_X = WORLD_X + 0.05; killinertia(); end
until ((mouse_b == 1 and (old_mouse_x~=mouse_x or old_mouse_y~=mouse_y)) or key~=0 or ANIM==1 or math.abs(XD)>0.01 or math.abs(YD)>0.01);
if ANIM == 0 then
if (mouse_b==1 and (old_mouse_x~=mouse_x or old_mouse_y~=mouse_y)) then -- Inertia
XD = (mouse_y - old_mouse_y)*0.005
YD = (mouse_x - old_mouse_x)*0.005
else
XD = XD*0.92
YD = YD*0.92
end
XANG = ((XANG - XD) % (math.pi*2));
YANG = ((YANG + YD) % (math.pi*2));
ZANG = 0
end
if ANIM == 1 then
XANG = (XANG + math.pi/300) % (math.pi*2)
YANG = (YANG + math.pi/500) % (math.pi*2)
ZANG = (ZANG + math.pi/1000) % (math.pi*2)
end
--XANG = ((CY-mouse_y) / 200 % (math.pi*2));
--YANG = ((mouse_x - CX) / 200 % (math.pi*2));
--ZANG = 0
statusmessage("X: "..math.floor(XANG*57.3).."°, Y: "..math.floor(YANG*57.3).."°, Z: "..math.floor(ZANG*57.3).."°, Zoom: "..math.floor(-ZOOM*10).." ")
end
end -- OK

View File

@ -23,18 +23,7 @@ function ellipse2(x,y,a,b,stp,rot,col)
sa = m.sin(ast*n) * b; ca = m.cos(ast*n) * a sa = m.sin(ast*n) * b; ca = m.cos(ast*n) * a
x1 = x + ca * cb - sa * sb x1 = x + ca * cb - sa * sb
y1 = y + ca * sb + sa * cb y1 = y + ca * sb + sa * cb
if (n > 0) then line(ox,oy,x1,y1,col); end if (n > 0) then drawline(ox,oy,x1,y1,col); end
end
end
--
--
function line(x1,y1,x2,y2,c)
local n,st,m; m = math
st = m.max(1,m.abs(x2-x1),m.abs(y2-y1));
for n = 0, st, 1 do
putpicturepixel(m.floor(x1+n*(x2-x1)/st), m.floor(y1+n*(y2-y1)/st),
c );
end end
end end
-- --

View File

@ -2,12 +2,11 @@
--Spare page holds data - Plays on current --Spare page holds data - Plays on current
--by Richard Fhager --by Richard Fhager
require("memory") dofile("../libs/memory.lua")
arg=memory.load({XS=16,YS=16,SPACE=1,FRAMES=8,XOFF=0,YOFF=0,FPS=10}) arg=memory.load({XS=16,YS=16,SPACE=1,FRAMES=8,XOFF=0,YOFF=0,FPS=10})
OK, XS, YS, SPACE, FRAMES, XOFF, YOFF, FPS = inputbox("Sprite-Sheet OK, XS, YS, SPACE, FRAMES, XOFF, YOFF, FPS = inputbox("Sprite-Sheet Animator",
Animator",
"Sprite X-size", arg.XS, 1, 256,0, "Sprite X-size", arg.XS, 1, 256,0,
"Sprite Y-size", arg.YS, 1, 256,0, "Sprite Y-size", arg.YS, 1, 256,0,
"Spacing", arg.SPACE, 0, 32,0, "Spacing", arg.SPACE, 0, 32,0,

View File

@ -1,4 +1,7 @@
--BRUSH Scene: Amigaball 1.0 --BRUSH Scene: Amigaball 1.0
--
--Draws the famous 'Amiga ball' in the brush.
--
--by Richard Fhager --by Richard Fhager
--http://hem.fyristorg.com/dawnbringer/ --http://hem.fyristorg.com/dawnbringer/
@ -15,6 +18,11 @@
w, h = getbrushsize() w, h = getbrushsize()
if (w<64 or h<64) then
setbrushsize(64,64)
w=64
h=64
end
for y = 0, h - 1, 1 do for y = 0, h - 1, 1 do
for x = 0, w - 1, 1 do for x = 0, w - 1, 1 do

View File

@ -1,4 +1,7 @@
--BRUSH Scene: Mandelbrot fractal v0.5 --BRUSH Scene: Mandelbrot fractal v0.5
--
--Draws a Mandelbrot fractal in the current brush.
--
--by Richard Fhager --by Richard Fhager
--http://hem.fyristorg.com/dawnbringer/ --http://hem.fyristorg.com/dawnbringer/

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
-- memory.save(tab) and tab=memory.load() -- memory.save(tab) and tab=memory.load()
-- --
-- The data will be stored in file called -- The data will be stored in file called
-- ZZZ<calling_function_name>.dat -- <calling_function_name>.dat
-- in the lua directory -- in the lua directory
-- --
-- Example 1: -- Example 1:
@ -74,12 +74,18 @@ memory =
-- Get part after directory name -- Get part after directory name
last_slash=0 last_slash=0
while true do while true do
local pos = string.find(info.short_src, "/", last_slash+1) local pos = string.find(info.source, "/", last_slash+1)
if (pos==nil) then break end if (pos==nil) then break end
last_slash=pos last_slash=pos
end end
caller=string.sub(info.short_src, last_slash+1) while true do
local pos = string.find(info.source, "\\", last_slash+1)
if (pos==nil) then break end
last_slash=pos
end
caller=string.sub(info.source, last_slash+1)
-- Remove file extension -- Remove file extension
if (string.sub(caller,-4, -1)==".lua") then if (string.sub(caller,-4, -1)==".lua") then
caller=string.sub(caller, 1, -5) caller=string.sub(caller, 1, -5)
@ -94,7 +100,7 @@ memory =
-- messagebox(tostring(k)) -- messagebox(tostring(k))
-- messagebox(tostring(v)) -- messagebox(tostring(v))
--end --end
local f, e = io.open("ZZZ"..caller..".dat", "w"); local f, e = io.open(caller..".dat", "w");
if (f ~= nil) then if (f ~= nil) then
f:write("Entry {\n") f:write("Entry {\n")
for k, v in pairs(o) do for k, v in pairs(o) do
@ -119,7 +125,7 @@ memory =
o[k]=v o[k]=v
end end
end end
local f = (loadfile("ZZZ"..caller..".dat")) local f = (loadfile(caller..".dat"))
if (f ~= nil) then if (f ~= nil) then
f() f()
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/.DS_Store vendored

Binary file not shown.

Binary file not shown.

BIN
src/Grafx2.icns Executable file

Binary file not shown.

View File

@ -1,754 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
002F39FA09D0881F10EBEB88 /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F10EBEB88 /* SDL_image.framework */; };
002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
40D82CA110ECAF13005D27B5 /* miscfileformats.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CA010ECAF13005D27B5 /* miscfileformats.c */; };
40D82CA610ECAF58005D27B5 /* brush_ops.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CA510ECAF58005D27B5 /* brush_ops.c */; };
40D82CAA10ECAFC5005D27B5 /* buttons_effects.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CA910ECAFC5005D27B5 /* buttons_effects.c */; };
40D82CAE10ECAFDC005D27B5 /* layers.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CAD10ECAFDC005D27B5 /* layers.c */; };
40D82CB210ECB02B005D27B5 /* fileformats.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CB110ECB02B005D27B5 /* fileformats.c */; };
40D82CBF10ECB089005D27B5 /* libraw2crtc.c in Sources */ = {isa = PBXBuildFile; fileRef = 40D82CBE10ECB089005D27B5 /* libraw2crtc.c */; };
40D82D3A10ECC4CA005D27B5 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
40D82D4310ECC536005D27B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4110ECC536005D27B5 /* Info.plist */; };
40D82D4410ECC536005D27B5 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4210ECC536005D27B5 /* SDLMain.nib */; };
40D82D5010ECC609005D27B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4E10ECC609005D27B5 /* Info.plist */; };
40D82D5110ECC609005D27B5 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D4F10ECC609005D27B5 /* SDLMain.nib */; };
40D82D5710ECC67A005D27B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D5510ECC67A005D27B5 /* Info.plist */; };
40D82D5810ECC67A005D27B5 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 40D82D5610ECC67A005D27B5 /* SDLMain.nib */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
F5142653101F6CC5006CF3C4 /* font_Classic.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F514264D101F6CB8006CF3C4 /* font_Classic.png */; };
F5142654101F6CC5006CF3C4 /* font_Fairlight.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F514264E101F6CB8006CF3C4 /* font_Fairlight.png */; };
F5142655101F6CC5006CF3C4 /* font_Fun.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F514264F101F6CB9006CF3C4 /* font_Fun.png */; };
F5142656101F6CC5006CF3C4 /* font_Melon.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F5142650101F6CB9006CF3C4 /* font_Melon.png */; };
F5142657101F6CC5006CF3C4 /* skin_classic.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F5142651101F6CB9006CF3C4 /* skin_classic.png */; };
F5142658101F6CC5006CF3C4 /* skin_modern.png in Copy skins */ = {isa = PBXBuildFile; fileRef = F5142652101F6CB9006CF3C4 /* skin_modern.png */; };
F51CBD2E0EC8A3E1005C06AC /* 5pxtinyfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */; };
F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */; };
F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */ = {isa = PBXBuildFile; fileRef = F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */; };
F539315E0FE171C3003CB103 /* pversion.c in Sources */ = {isa = PBXBuildFile; fileRef = F539315D0FE171C3003CB103 /* pversion.c */; };
F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5A33E690EC893F800F8052D /* 8pxfont.png */; };
F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405A0FBC406D00B7577C /* pxquad.c */; };
F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405B0FBC406D00B7577C /* pxtall2.c */; };
F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405C0FBC406D00B7577C /* pxtriple.c */; };
F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405D0FBC406D00B7577C /* pxwide2.c */; };
F5AA40630FBC406D00B7577C /* transform.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AA405E0FBC406D00B7577C /* transform.c */; };
F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28B90F4873C700455509 /* hotkeys.c */; };
F5AC28BD0F4873C700455509 /* input.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BA0F4873C700455509 /* input.c */; };
F5AC28BE0F4873C700455509 /* realpath.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AC28BB0F4873C700455509 /* realpath.c */; };
F5AD4B1F0EA8CCF0009CCAC4 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AD4B1E0EA8CCF0009CCAC4 /* version.c */; };
F5AE6F990EDA119D000CE0EF /* GrafX2_Classic.gif in Copy fonts */ = {isa = PBXBuildFile; fileRef = F5AE6F980EDA119D000CE0EF /* GrafX2_Classic.gif */; };
F5AE83FD0ECF8FD300200704 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */; };
F5AED03E0F1989E00090A93F /* mountlist.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AED03C0F1989E00090A93F /* mountlist.c */; };
F5AFA00D0EFAC7D300663B43 /* brush.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA0070EFAC7D300663B43 /* brush.c */; };
F5AFA00E0EFAC7D300663B43 /* pxsimple.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA0080EFAC7D300663B43 /* pxsimple.c */; };
F5AFA00F0EFAC7D300663B43 /* pxtall.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA0090EFAC7D300663B43 /* pxtall.c */; };
F5AFA0100EFAC7D300663B43 /* pxwide.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA00A0EFAC7D300663B43 /* pxwide.c */; };
F5AFA0110EFAC7D300663B43 /* setup.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA00B0EFAC7D300663B43 /* setup.c */; };
F5AFA0120EFAC7D300663B43 /* windows.c in Sources */ = {isa = PBXBuildFile; fileRef = F5AFA00C0EFAC7D300663B43 /* windows.c */; };
F5B138C30EB71D28000B83CC /* SDL_ttf in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B138C20EB71D28000B83CC /* SDL_ttf */; };
F5B19B930EA4BE3E003F4BA4 /* graph.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7B0EA4BE3E003F4BA4 /* graph.c */; };
F5B19B940EA4BE3E003F4BA4 /* init.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7C0EA4BE3E003F4BA4 /* init.c */; };
F5B19B950EA4BE3E003F4BA4 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7D0EA4BE3E003F4BA4 /* io.c */; };
F5B19B970EA4BE3E003F4BA4 /* loadsave.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */; };
F5B19B9A0EA4BE3E003F4BA4 /* op_c.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B820EA4BE3E003F4BA4 /* op_c.c */; };
F5B19B9B0EA4BE3E003F4BA4 /* operatio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B830EA4BE3E003F4BA4 /* operatio.c */; };
F5B19B9C0EA4BE3E003F4BA4 /* pages.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B840EA4BE3E003F4BA4 /* pages.c */; };
F5B19B9D0EA4BE3E003F4BA4 /* palette.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B850EA4BE3E003F4BA4 /* palette.c */; };
F5B19B9E0EA4BE3E003F4BA4 /* readini.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B860EA4BE3E003F4BA4 /* readini.c */; };
F5B19B9F0EA4BE3E003F4BA4 /* readline.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B870EA4BE3E003F4BA4 /* readline.c */; };
F5B19BA00EA4BE3E003F4BA4 /* saveini.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B880EA4BE3E003F4BA4 /* saveini.c */; };
F5B19BA10EA4BE3E003F4BA4 /* sdlscreen.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */; };
F5B19BA20EA4BE3E003F4BA4 /* SFont.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B8A0EA4BE3E003F4BA4 /* SFont.c */; };
F5B19BA30EA4BE3E003F4BA4 /* shade.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B8B0EA4BE3E003F4BA4 /* shade.c */; };
F5B19BA40EA4BE3E003F4BA4 /* special.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B19B8C0EA4BE3E003F4BA4 /* special.c */; };
F5B19C1D0EA4D71C003F4BA4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B19C1C0EA4D71C003F4BA4 /* CoreFoundation.framework */; };
F5B19C3D0EA4DC91003F4BA4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F5B19C3B0EA4DC91003F4BA4 /* InfoPlist.strings */; };
F5B1EE850EAD0F4E00B087B5 /* gfx2def.ini in Resources */ = {isa = PBXBuildFile; fileRef = F5B1EE840EAD0F4E00B087B5 /* gfx2def.ini */; };
F5B310B40F949A9C008197E2 /* buttons.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310AD0F949A9C008197E2 /* buttons.c */; };
F5B310B50F949A9C008197E2 /* engine.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310AE0F949A9C008197E2 /* engine.c */; };
F5B310B60F949A9C008197E2 /* filesel.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310AF0F949A9C008197E2 /* filesel.c */; };
F5B310B70F949A9C008197E2 /* help.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B00F949A9C008197E2 /* help.c */; };
F5B310B80F949A9C008197E2 /* keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B10F949A9C008197E2 /* keyboard.c */; };
F5B310B90F949A9C008197E2 /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B20F949A9C008197E2 /* misc.c */; };
F5B310BA0F949A9C008197E2 /* text.c in Sources */ = {isa = PBXBuildFile; fileRef = F5B310B30F949A9C008197E2 /* text.c */; };
F5CDCE320F6EA6D600B31F63 /* pxdouble.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CDCE310F6EA6D600B31F63 /* pxdouble.c */; };
F5DCE2BC0EA5116A0065B0EF /* SDL_ttf in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = F5DCE2BE0EA5118F0065B0EF /* SDL_ttf */; };
F5DCE2BC0EA5116B0065B0EF /* SDL_image in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = F5DCE2BB0EA5116B0065B0EF /* SDL_image */; };
F5DCE2BE0EA5118E0065B0EF /* SDL in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = F5DCE2BD0EA5118E0065B0EF /* SDL */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = SDL_image.framework/Versions/A;
dstSubfolderSpec = 10;
files = (
F5DCE2BC0EA5116B0065B0EF /* SDL_image in Copy Frameworks into .app bundle */,
);
name = "Copy Frameworks into .app bundle";
runOnlyForDeploymentPostprocessing = 0;
};
002F39FD09D0883400EBEB89 /* Copy Frameworks into .app bundle */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = SDL.framework/Versions/A;
dstSubfolderSpec = 10;
files = (
F5DCE2BE0EA5118E0065B0EF /* SDL in Copy Frameworks into .app bundle */,
);
name = "Copy Frameworks into .app bundle";
runOnlyForDeploymentPostprocessing = 0;
};
002F39FD09D0883400EBEB8A /* Copy Frameworks into .app bundle */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = SDL_ttf.framework/Versions/A;
dstSubfolderSpec = 10;
files = (
F5DCE2BC0EA5116A0065B0EF /* SDL_ttf in Copy Frameworks into .app bundle */,
);
name = "Copy Frameworks into .app bundle";
runOnlyForDeploymentPostprocessing = 0;
};
40D82D4C10ECC5A4005D27B5 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = Library/Frameworks/SDL.framework/Resources;
dstSubfolderSpec = 7;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
40D82D5310ECC659005D27B5 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 7;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
F514264B101F6C5B006CF3C4 /* Copy skins */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = skins;
dstSubfolderSpec = 7;
files = (
F5142653101F6CC5006CF3C4 /* font_Classic.png in Copy skins */,
F5142654101F6CC5006CF3C4 /* font_Fairlight.png in Copy skins */,
F5142655101F6CC5006CF3C4 /* font_Fun.png in Copy skins */,
F5142656101F6CC5006CF3C4 /* font_Melon.png in Copy skins */,
F5142657101F6CC5006CF3C4 /* skin_classic.png in Copy skins */,
F5142658101F6CC5006CF3C4 /* skin_modern.png in Copy skins */,
);
name = "Copy skins";
runOnlyForDeploymentPostprocessing = 0;
};
F5A33F1D0EC8A26C00F8052D /* Copy fonts */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = fonts;
dstSubfolderSpec = 7;
files = (
F5AE6F990EDA119D000CE0EF /* GrafX2_Classic.gif in Copy fonts */,
F51CBD300EC8A3E1005C06AC /* Tuffy.ttf in Copy fonts */,
F51CBD2F0EC8A3E1005C06AC /* colorfont.pcx in Copy fonts */,
F51CBD2E0EC8A3E1005C06AC /* 5pxtinyfont.png in Copy fonts */,
F5A33E6A0EC893F800F8052D /* 8pxfont.png in Copy fonts */,
);
name = "Copy fonts";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
002F39F909D0881F10EBEB88 /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = /Library/Frameworks/SDL_image.framework; sourceTree = "<absolute>"; };
002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Grafx2_Prefix.pch; sourceTree = "<group>"; };
40D82CA010ECAF13005D27B5 /* miscfileformats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = miscfileformats.c; sourceTree = "<group>"; };
40D82CA510ECAF58005D27B5 /* brush_ops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = brush_ops.c; sourceTree = "<group>"; };
40D82CA910ECAFC5005D27B5 /* buttons_effects.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = buttons_effects.c; sourceTree = "<group>"; };
40D82CAD10ECAFDC005D27B5 /* layers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = layers.c; sourceTree = "<group>"; };
40D82CB110ECB02B005D27B5 /* fileformats.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fileformats.c; sourceTree = "<group>"; };
40D82CBE10ECB089005D27B5 /* libraw2crtc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libraw2crtc.c; sourceTree = "<group>"; };
40D82D4110ECC536005D27B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Library/Frameworks/SDL.framework/Resources/Info.plist; sourceTree = "<absolute>"; };
40D82D4210ECC536005D27B5 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = /Library/Frameworks/SDL.framework/Resources/SDLMain.nib; sourceTree = "<absolute>"; };
40D82D4E10ECC609005D27B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/Info.plist; sourceTree = "<absolute>"; };
40D82D4F10ECC609005D27B5 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/SDLMain.nib; sourceTree = "<absolute>"; };
40D82D5510ECC67A005D27B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/Info.plist; sourceTree = "<absolute>"; };
40D82D5610ECC67A005D27B5 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = /Library/Frameworks/SDL.framework/Versions/A/Resources/SDLMain.nib; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Grafx2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Grafx2.app; sourceTree = BUILT_PRODUCTS_DIR; };
F514264D101F6CB8006CF3C4 /* font_Classic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Classic.png; path = skins/font_Classic.png; sourceTree = "<group>"; };
F514264E101F6CB8006CF3C4 /* font_Fairlight.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Fairlight.png; path = skins/font_Fairlight.png; sourceTree = "<group>"; };
F514264F101F6CB9006CF3C4 /* font_Fun.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Fun.png; path = skins/font_Fun.png; sourceTree = "<group>"; };
F5142650101F6CB9006CF3C4 /* font_Melon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = font_Melon.png; path = skins/font_Melon.png; sourceTree = "<group>"; };
F5142651101F6CB9006CF3C4 /* skin_classic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = skin_classic.png; path = skins/skin_classic.png; sourceTree = "<group>"; };
F5142652101F6CB9006CF3C4 /* skin_modern.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = skin_modern.png; path = skins/skin_modern.png; sourceTree = "<group>"; };
F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 5pxtinyfont.png; path = fonts/5pxtinyfont.png; sourceTree = "<group>"; };
F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */ = {isa = PBXFileReference; lastKnownFileType = file; name = colorfont.pcx; path = fonts/colorfont.pcx; sourceTree = "<group>"; };
F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Tuffy.ttf; path = fonts/Tuffy.ttf; sourceTree = "<group>"; };
F539315D0FE171C3003CB103 /* pversion.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pversion.c; sourceTree = "<group>"; };
F5A33E690EC893F800F8052D /* 8pxfont.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 8pxfont.png; path = fonts/8pxfont.png; sourceTree = "<group>"; };
F5AA405A0FBC406D00B7577C /* pxquad.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxquad.c; sourceTree = "<group>"; };
F5AA405B0FBC406D00B7577C /* pxtall2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtall2.c; sourceTree = "<group>"; };
F5AA405C0FBC406D00B7577C /* pxtriple.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtriple.c; sourceTree = "<group>"; };
F5AA405D0FBC406D00B7577C /* pxwide2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxwide2.c; sourceTree = "<group>"; };
F5AA405E0FBC406D00B7577C /* transform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = transform.c; sourceTree = "<group>"; };
F5AC28B90F4873C700455509 /* hotkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = hotkeys.c; sourceTree = "<group>"; };
F5AC28BA0F4873C700455509 /* input.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = input.c; sourceTree = "<group>"; };
F5AC28BB0F4873C700455509 /* realpath.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = realpath.c; sourceTree = "<group>"; };
F5AD4B1E0EA8CCF0009CCAC4 /* version.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = version.c; sourceTree = "<group>"; };
F5AE6F980EDA119D000CE0EF /* GrafX2_Classic.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = GrafX2_Classic.gif; path = fonts/GrafX2_Classic.gif; sourceTree = "<group>"; };
F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; };
F5AED03C0F1989E00090A93F /* mountlist.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mountlist.c; sourceTree = "<group>"; };
F5AFA0070EFAC7D300663B43 /* brush.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = brush.c; sourceTree = "<group>"; };
F5AFA0080EFAC7D300663B43 /* pxsimple.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxsimple.c; sourceTree = "<group>"; };
F5AFA0090EFAC7D300663B43 /* pxtall.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxtall.c; sourceTree = "<group>"; };
F5AFA00A0EFAC7D300663B43 /* pxwide.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxwide.c; sourceTree = "<group>"; };
F5AFA00B0EFAC7D300663B43 /* setup.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = setup.c; sourceTree = "<group>"; };
F5AFA00C0EFAC7D300663B43 /* windows.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = windows.c; sourceTree = "<group>"; };
F5B138C20EB71D28000B83CC /* SDL_ttf */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_ttf; path = /Library/Frameworks/SDL_ttf.framework/SDL_ttf; sourceTree = "<absolute>"; };
F5B19B6C0EA4BDA8003F4BA4 /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = /Library/Frameworks/SDL_image.framework; sourceTree = "<absolute>"; };
F5B19B7B0EA4BE3E003F4BA4 /* graph.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = graph.c; sourceTree = "<group>"; };
F5B19B7C0EA4BE3E003F4BA4 /* init.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = "<group>"; };
F5B19B7D0EA4BE3E003F4BA4 /* io.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = "<group>"; };
F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = loadsave.c; sourceTree = "<group>"; };
F5B19B820EA4BE3E003F4BA4 /* op_c.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = op_c.c; sourceTree = "<group>"; };
F5B19B830EA4BE3E003F4BA4 /* operatio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = operatio.c; sourceTree = "<group>"; };
F5B19B840EA4BE3E003F4BA4 /* pages.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pages.c; sourceTree = "<group>"; };
F5B19B850EA4BE3E003F4BA4 /* palette.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = palette.c; sourceTree = "<group>"; };
F5B19B860EA4BE3E003F4BA4 /* readini.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readini.c; sourceTree = "<group>"; };
F5B19B870EA4BE3E003F4BA4 /* readline.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = readline.c; sourceTree = "<group>"; };
F5B19B880EA4BE3E003F4BA4 /* saveini.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = saveini.c; sourceTree = "<group>"; };
F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = sdlscreen.c; sourceTree = "<group>"; };
F5B19B8A0EA4BE3E003F4BA4 /* SFont.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SFont.c; sourceTree = "<group>"; };
F5B19B8B0EA4BE3E003F4BA4 /* shade.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = shade.c; sourceTree = "<group>"; };
F5B19B8C0EA4BE3E003F4BA4 /* special.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = special.c; sourceTree = "<group>"; };
F5B19C1C0EA4D71C003F4BA4 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
F5B19C3C0EA4DC91003F4BA4 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F5B1EE840EAD0F4E00B087B5 /* gfx2def.ini */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = gfx2def.ini; sourceTree = "<group>"; };
F5B310AD0F949A9C008197E2 /* buttons.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = buttons.c; sourceTree = "<group>"; };
F5B310AE0F949A9C008197E2 /* engine.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = engine.c; sourceTree = "<group>"; };
F5B310AF0F949A9C008197E2 /* filesel.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = filesel.c; sourceTree = "<group>"; };
F5B310B00F949A9C008197E2 /* help.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = help.c; sourceTree = "<group>"; };
F5B310B10F949A9C008197E2 /* keyboard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = keyboard.c; sourceTree = "<group>"; };
F5B310B20F949A9C008197E2 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = "<group>"; };
F5B310B30F949A9C008197E2 /* text.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = text.c; sourceTree = "<group>"; };
F5CDCE310F6EA6D600B31F63 /* pxdouble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = pxdouble.c; sourceTree = "<group>"; };
F5DCE2BB0EA5116B0065B0EF /* SDL_image */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_image; path = /Library/Frameworks/SDL_image.framework/Versions/A/SDL_image; sourceTree = "<absolute>"; };
F5DCE2BD0EA5118E0065B0EF /* SDL */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL; path = /Library/Frameworks/SDL.framework/Versions/A/SDL; sourceTree = "<absolute>"; };
F5DCE2BE0EA5118F0065B0EF /* SDL_ttf */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = SDL_ttf; path = /Library/Frameworks/SDL_ttf.framework/Versions/A/SDL_ttf; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
002F39FA09D0881F10EBEB88 /* SDL_image.framework in Frameworks */,
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
F5B19C1D0EA4D71C003F4BA4 /* CoreFoundation.framework in Frameworks */,
F5B138C30EB71D28000B83CC /* SDL_ttf in Frameworks */,
F5AE83FD0ECF8FD300200704 /* ApplicationServices.framework in Frameworks */,
40D82D3A10ECC4CA005D27B5 /* SDL.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
002F3A2B09D0888800EBEB88 /* SDLMain.h */,
002F3A2C09D0888800EBEB88 /* SDLMain.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
002F39F909D0881F00EBEB88 /* SDL.framework */,
002F39F909D0881F10EBEB88 /* SDL_image.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* Grafx2.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* Grafx2 */ = {
isa = PBXGroup;
children = (
40D82D5410ECC67A005D27B5 /* Resources */,
40D82D4D10ECC609005D27B5 /* Resources */,
40D82D4010ECC536005D27B5 /* Resources */,
40D82CBE10ECB089005D27B5 /* libraw2crtc.c */,
40D82CB110ECB02B005D27B5 /* fileformats.c */,
40D82CAD10ECAFDC005D27B5 /* layers.c */,
40D82CA910ECAFC5005D27B5 /* buttons_effects.c */,
40D82CA510ECAF58005D27B5 /* brush_ops.c */,
40D82CA010ECAF13005D27B5 /* miscfileformats.c */,
F514264D101F6CB8006CF3C4 /* font_Classic.png */,
F514264E101F6CB8006CF3C4 /* font_Fairlight.png */,
F514264F101F6CB9006CF3C4 /* font_Fun.png */,
F5142650101F6CB9006CF3C4 /* font_Melon.png */,
F5142651101F6CB9006CF3C4 /* skin_classic.png */,
F5142652101F6CB9006CF3C4 /* skin_modern.png */,
F539315D0FE171C3003CB103 /* pversion.c */,
F5CDCE310F6EA6D600B31F63 /* pxdouble.c */,
F5AC28B90F4873C700455509 /* hotkeys.c */,
F5AC28BA0F4873C700455509 /* input.c */,
F5AC28BB0F4873C700455509 /* realpath.c */,
F5AED03C0F1989E00090A93F /* mountlist.c */,
F5AFA0070EFAC7D300663B43 /* brush.c */,
F5AFA0080EFAC7D300663B43 /* pxsimple.c */,
F5AFA0090EFAC7D300663B43 /* pxtall.c */,
F5AFA00A0EFAC7D300663B43 /* pxwide.c */,
F5AFA00B0EFAC7D300663B43 /* setup.c */,
F5AFA00C0EFAC7D300663B43 /* windows.c */,
F5AE6F980EDA119D000CE0EF /* GrafX2_Classic.gif */,
F5AE83FC0ECF8FD300200704 /* ApplicationServices.framework */,
F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */,
F51CBD2C0EC8A3E1005C06AC /* colorfont.pcx */,
F51CBD2D0EC8A3E1005C06AC /* Tuffy.ttf */,
F5A33E690EC893F800F8052D /* 8pxfont.png */,
F5B138C20EB71D28000B83CC /* SDL_ttf */,
F5B1EE840EAD0F4E00B087B5 /* gfx2def.ini */,
F5B310AD0F949A9C008197E2 /* buttons.c */,
F5B310AE0F949A9C008197E2 /* engine.c */,
F5B310AF0F949A9C008197E2 /* filesel.c */,
F5B310B00F949A9C008197E2 /* help.c */,
F5B310B10F949A9C008197E2 /* keyboard.c */,
F5B310B20F949A9C008197E2 /* misc.c */,
F5B310B30F949A9C008197E2 /* text.c */,
F5AD4B1E0EA8CCF0009CCAC4 /* version.c */,
F5DCE2BD0EA5118E0065B0EF /* SDL */,
F5DCE2BB0EA5116B0065B0EF /* SDL_image */,
F5DCE2BE0EA5118F0065B0EF /* SDL_ttf */,
F5B19C3B0EA4DC91003F4BA4 /* InfoPlist.strings */,
F5B19C1C0EA4D71C003F4BA4 /* CoreFoundation.framework */,
F5B19B7B0EA4BE3E003F4BA4 /* graph.c */,
F5B19B7C0EA4BE3E003F4BA4 /* init.c */,
F5B19B7D0EA4BE3E003F4BA4 /* io.c */,
F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */,
F5B19B820EA4BE3E003F4BA4 /* op_c.c */,
F5B19B830EA4BE3E003F4BA4 /* operatio.c */,
F5B19B840EA4BE3E003F4BA4 /* pages.c */,
F5B19B850EA4BE3E003F4BA4 /* palette.c */,
F5B19B860EA4BE3E003F4BA4 /* readini.c */,
F5B19B870EA4BE3E003F4BA4 /* readline.c */,
F5B19B880EA4BE3E003F4BA4 /* saveini.c */,
F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */,
F5B19B8A0EA4BE3E003F4BA4 /* SFont.c */,
F5B19B8B0EA4BE3E003F4BA4 /* shade.c */,
F5B19B8C0EA4BE3E003F4BA4 /* special.c */,
F5B19B6C0EA4BDA8003F4BA4 /* SDL_image.framework */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = Grafx2;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */,
002F3A3E09D088BA00EBEB88 /* main.c */,
F5AA405A0FBC406D00B7577C /* pxquad.c */,
F5AA405B0FBC406D00B7577C /* pxtall2.c */,
F5AA405C0FBC406D00B7577C /* pxtriple.c */,
F5AA405D0FBC406D00B7577C /* pxwide2.c */,
F5AA405E0FBC406D00B7577C /* transform.c */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
40D82D4010ECC536005D27B5 /* Resources */ = {
isa = PBXGroup;
children = (
40D82D4110ECC536005D27B5 /* Info.plist */,
40D82D4210ECC536005D27B5 /* SDLMain.nib */,
);
name = Resources;
path = /Library/Frameworks/SDL.framework/Resources;
sourceTree = "<absolute>";
};
40D82D4D10ECC609005D27B5 /* Resources */ = {
isa = PBXGroup;
children = (
40D82D4E10ECC609005D27B5 /* Info.plist */,
40D82D4F10ECC609005D27B5 /* SDLMain.nib */,
);
name = Resources;
path = /Library/Frameworks/SDL.framework/Versions/A/Resources;
sourceTree = "<absolute>";
};
40D82D5410ECC67A005D27B5 /* Resources */ = {
isa = PBXGroup;
children = (
40D82D5510ECC67A005D27B5 /* Info.plist */,
40D82D5610ECC67A005D27B5 /* SDLMain.nib */,
);
name = Resources;
path = /Library/Frameworks/SDL.framework/Versions/A/Resources;
sourceTree = "<absolute>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* Grafx2 */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Grafx2" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
002F39FD09D0883400EBEB89 /* Copy Frameworks into .app bundle */,
002F39FD09D0883400EBEB8A /* Copy Frameworks into .app bundle */,
F5A33F1D0EC8A26C00F8052D /* Copy fonts */,
F514264B101F6C5B006CF3C4 /* Copy skins */,
40D82D4C10ECC5A4005D27B5 /* CopyFiles */,
40D82D5310ECC659005D27B5 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = Grafx2;
productInstallPath = "$(HOME)/Applications";
productName = Grafx2;
productReference = 8D1107320486CEB800E47090 /* Grafx2.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Grafx2" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* Grafx2 */;
projectDirPath = "";
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* Grafx2 */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F5B19C3D0EA4DC91003F4BA4 /* InfoPlist.strings in Resources */,
F5B1EE850EAD0F4E00B087B5 /* gfx2def.ini in Resources */,
40D82D4310ECC536005D27B5 /* Info.plist in Resources */,
40D82D4410ECC536005D27B5 /* SDLMain.nib in Resources */,
40D82D5010ECC609005D27B5 /* Info.plist in Resources */,
40D82D5110ECC609005D27B5 /* SDLMain.nib in Resources */,
40D82D5710ECC67A005D27B5 /* Info.plist in Resources */,
40D82D5810ECC67A005D27B5 /* SDLMain.nib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
F5B19B930EA4BE3E003F4BA4 /* graph.c in Sources */,
F5B19B940EA4BE3E003F4BA4 /* init.c in Sources */,
F5B19B950EA4BE3E003F4BA4 /* io.c in Sources */,
F5B19B970EA4BE3E003F4BA4 /* loadsave.c in Sources */,
F5B19B9A0EA4BE3E003F4BA4 /* op_c.c in Sources */,
F5B19B9B0EA4BE3E003F4BA4 /* operatio.c in Sources */,
F5B19B9C0EA4BE3E003F4BA4 /* pages.c in Sources */,
F5B19B9D0EA4BE3E003F4BA4 /* palette.c in Sources */,
F5B19B9E0EA4BE3E003F4BA4 /* readini.c in Sources */,
F5B19B9F0EA4BE3E003F4BA4 /* readline.c in Sources */,
F5B19BA00EA4BE3E003F4BA4 /* saveini.c in Sources */,
F5B19BA10EA4BE3E003F4BA4 /* sdlscreen.c in Sources */,
F5B19BA20EA4BE3E003F4BA4 /* SFont.c in Sources */,
F5B19BA30EA4BE3E003F4BA4 /* shade.c in Sources */,
F5B19BA40EA4BE3E003F4BA4 /* special.c in Sources */,
F5AD4B1F0EA8CCF0009CCAC4 /* version.c in Sources */,
F5AFA00D0EFAC7D300663B43 /* brush.c in Sources */,
F5AFA00E0EFAC7D300663B43 /* pxsimple.c in Sources */,
F5AFA00F0EFAC7D300663B43 /* pxtall.c in Sources */,
F5AFA0100EFAC7D300663B43 /* pxwide.c in Sources */,
F5AFA0110EFAC7D300663B43 /* setup.c in Sources */,
F5AFA0120EFAC7D300663B43 /* windows.c in Sources */,
F5AED03E0F1989E00090A93F /* mountlist.c in Sources */,
F5AC28BC0F4873C700455509 /* hotkeys.c in Sources */,
F5AC28BD0F4873C700455509 /* input.c in Sources */,
F5AC28BE0F4873C700455509 /* realpath.c in Sources */,
F5CDCE320F6EA6D600B31F63 /* pxdouble.c in Sources */,
F5B310B40F949A9C008197E2 /* buttons.c in Sources */,
F5B310B50F949A9C008197E2 /* engine.c in Sources */,
F5B310B60F949A9C008197E2 /* filesel.c in Sources */,
F5B310B70F949A9C008197E2 /* help.c in Sources */,
F5B310B80F949A9C008197E2 /* keyboard.c in Sources */,
F5B310B90F949A9C008197E2 /* misc.c in Sources */,
F5B310BA0F949A9C008197E2 /* text.c in Sources */,
F5AA405F0FBC406D00B7577C /* pxquad.c in Sources */,
F5AA40600FBC406D00B7577C /* pxtall2.c in Sources */,
F5AA40610FBC406D00B7577C /* pxtriple.c in Sources */,
F5AA40620FBC406D00B7577C /* pxwide2.c in Sources */,
F5AA40630FBC406D00B7577C /* transform.c in Sources */,
F539315E0FE171C3003CB103 /* pversion.c in Sources */,
40D82CA110ECAF13005D27B5 /* miscfileformats.c in Sources */,
40D82CA610ECAF58005D27B5 /* brush_ops.c in Sources */,
40D82CAA10ECAFC5005D27B5 /* buttons_effects.c in Sources */,
40D82CAE10ECAFDC005D27B5 /* layers.c in Sources */,
40D82CB210ECB02B005D27B5 /* fileformats.c in Sources */,
40D82CBF10ECB089005D27B5 /* libraw2crtc.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
F5B19C3B0EA4DC91003F4BA4 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
F5B19C3C0EA4DC91003F4BA4 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks\"";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
__macosx__,
__linux__,
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)",
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_image.framework\"";
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework\"";
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_ttf.framework\"";
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework\"";
PRODUCT_NAME = Grafx2;
REZ_SEARCH_PATHS = "";
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
);
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(DEVELOPER_DIR)/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks\"";
FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks\"";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
__macosx__,
__linux__,
);
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)",
"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)",
);
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_image.framework\"";
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL.framework\"";
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(LOCAL_LIBRARY_DIR)/Frameworks/SDL_ttf.framework\"";
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework\"";
PRODUCT_NAME = Grafx2;
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
/Library/Frameworks,
"$(FRAMEWORK_SEARCH_PATHS)",
);
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
__macosx__,
__linux__,
);
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
/usr/X11/include,
/Library/Frameworks/SDL_image.framework/Headers,
"$(HOME)/Library/Frameworks/SDL.framework/Headers",
/Library/Frameworks/SDL.framework/Headers,
/Library/SDL_ttf.framework/Headers,
/usr/local/include,
"$(HEADER_SEARCH_PATHS)",
);
LIBRARY_SEARCH_PATHS = (
/usr/X11/lib,
/usr/local/lib,
);
OTHER_LDFLAGS = (
"-lpng",
"-lz",
);
PREBINDING = NO;
PRELINK_LIBS = SDL_Image;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
ZERO_LINK = YES;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = (
/Library/Frameworks,
"$(FRAMEWORK_SEARCH_PATHS)",
);
GCC_PREPROCESSOR_DEFINITIONS = (
__macosx__,
__linux__,
);
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(HOME)/Library/Frameworks/SDL.framework/Headers",
/Library/Frameworks/SDL.framework/Headers,
/usr/local/include,
"$(HEADER_SEARCH_PATHS)",
);
LIBRARY_SEARCH_PATHS = /usr/local/lib;
OTHER_LDFLAGS = (
"-lpng",
"-lz",
);
PREBINDING = NO;
PRELINK_LIBS = SDL_Image;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Grafx2" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Grafx2" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

View File

@ -1,319 +0,0 @@
// !$*UTF8*$!
{
002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {867, 536}}";
sepNavSelRange = "{302, 0}";
sepNavVisRect = "{{0, 0}, {867, 536}}";
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1084, 7296}}";
sepNavSelRange = "{1567, 12}";
sepNavVisRect = "{{0, 718}, {867, 536}}";
sepNavWindowFrame = "{{38, 55}, {906, 665}}";
};
};
002F3A3E09D088BA00EBEB88 /* main.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1044, 15086}}";
sepNavSelRange = "{19535, 0}";
sepNavVisRect = "{{0, 10961}, {867, 536}}";
sepNavWindowFrame = "{{14, 76}, {906, 665}}";
};
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Release;
activeExecutable = F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */;
activeTarget = 8D1107260486CEB800E47090 /* Grafx2 */;
addToTargets = (
);
breakpointsGroup = F5B19B700EA4BDA9003F4BA4 /* XCBreakpointsBucket */;
codeSenseManager = F5B19B6A0EA4BD79003F4BA4 /* Code sense */;
executables = (
F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */,
);
perUserDictionary = {
PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
453,
58,
);
PBXFileTableDataSourceColumnsKey = (
PBXErrorsWarningsDataSource_TypeID,
PBXErrorsWarningsDataSource_MessageID,
PBXErrorsWarningsDataSource_LocationID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID;
PBXFileTableDataSourceColumnWidthsKey = (
22,
300,
209,
);
PBXFileTableDataSourceColumnsKey = (
PBXExecutablesDataSource_ActiveFlagID,
PBXExecutablesDataSource_NameID,
PBXExecutablesDataSource_CommentsID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = 1;
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Built_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
99,
20,
48,
43,
43,
20,
264,
10,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
PBXFileDataSource_Path_ColumnID,
PBXFileDataSource_Comments_ColumnID,
PBXFileDataSource_SCM_ColumnID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID;
PBXFileTableDataSourceColumnWidthsKey = (
200,
413.2085,
);
PBXFileTableDataSourceColumnsKey = (
PBXFindDataSource_MessageID,
PBXFindDataSource_LocationID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXSymbolsDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXSymbolsDataSource_SymbolNameID;
PBXFileTableDataSourceColumnWidthsKey = (
16,
200,
50,
325.2085,
);
PBXFileTableDataSourceColumnsKey = (
PBXSymbolsDataSource_SymbolTypeIconID,
PBXSymbolsDataSource_SymbolNameID,
PBXSymbolsDataSource_SymbolTypeID,
PBXSymbolsDataSource_ReferenceNameID,
);
};
PBXConfiguration.PBXFileTableDataSource3.XCSCMDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
20,
262,
20,
48.1626,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_SCM_ColumnID,
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXTargetDataSource_PrimaryAttribute;
PBXFileTableDataSourceColumnWidthsKey = (
20,
200,
106,
20,
48,
43,
43,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXTargetDataSource_PrimaryAttribute,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 270495112;
PBXWorkspaceStateSaveDate = 270495112;
};
sourceControlManager = F5B19B690EA4BD79003F4BA4 /* Source Control */;
userBuildSettings = {
OBJROOT = "$(SYMROOT)";
};
};
32CA4F630368D1EE00C91783 /* Grafx2_Prefix.pch */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {932, 587}}";
sepNavSelRange = "{0, 0}";
sepNavVisRect = "{{0, 0}, {932, 587}}";
sepNavWindowFrame = "{{15, 25}, {971, 716}}";
};
};
8D1107260486CEB800E47090 /* Grafx2 */ = {
activeExec = 0;
executables = (
F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */,
);
};
F51CBD2B0EC8A3E1005C06AC /* 5pxtinyfont.png */ = {
uiCtxt = {
sepNavWindowFrame = "{{15, 25}, {971, 716}}";
};
};
F5A33E690EC893F800F8052D /* 8pxfont.png */ = {
uiCtxt = {
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
F5AD4B1E0EA8CCF0009CCAC4 /* version.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {932, 587}}";
sepNavSelRange = "{26, 0}";
sepNavVisRect = "{{0, 0}, {932, 587}}";
sepNavWindowFrame = "{{7, 5}, {971, 716}}";
};
};
F5AED03C0F1989E00090A93F /* mountlist.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {867, 17252}}";
sepNavSelRange = "{4702, 50}";
sepNavVisRect = "{{0, 2973}, {867, 536}}";
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
F5B19B5D0EA4BD57003F4BA4 /* Grafx2 */ = {
isa = PBXExecutable;
activeArgIndex = 2147483647;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
configStateDict = {
};
customDataFormattersEnabled = 1;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = Grafx2;
savedGlobals = {
};
sourceDirectories = (
);
variableFormatDictionary = {
};
};
F5B19B690EA4BD79003F4BA4 /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
};
scmType = scm.subversion;
};
F5B19B6A0EA4BD79003F4BA4 /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
F5B19B700EA4BDA9003F4BA4 /* XCBreakpointsBucket */ = {
isa = XCBreakpointsBucket;
name = "Project Breakpoints";
objects = (
);
};
F5B19B7B0EA4BE3E003F4BA4 /* graph.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1140, 52782}}";
sepNavSelRange = "{6769, 0}";
sepNavVisRect = "{{0, 0}, {867, 536}}";
sepNavWindowFrame = "{{14, 76}, {906, 665}}";
};
};
F5B19B7C0EA4BE3E003F4BA4 /* init.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1660, 46018}}";
sepNavSelRange = "{81112, 1}";
sepNavVisRect = "{{0, 44925}, {867, 536}}";
sepNavWindowFrame = "{{12, 46}, {906, 665}}";
};
};
F5B19B7F0EA4BE3E003F4BA4 /* loadsave.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1700, 112651}}";
sepNavSelRange = "{1098, 24}";
sepNavVisRect = "{{0, 331}, {867, 536}}";
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
F5B19B850EA4BE3E003F4BA4 /* palette.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1268, 37031}}";
sepNavSelRange = "{75128, 0}";
sepNavVisRect = "{{0, 0}, {0, 0}}";
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
F5B19B880EA4BE3E003F4BA4 /* saveini.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1156, 12084}}";
sepNavSelRange = "{19568, 0}";
sepNavVisRect = "{{0, 0}, {0, 0}}";
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
F5B19B890EA4BE3E003F4BA4 /* sdlscreen.c */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1396, 4351}}";
sepNavSelRange = "{2375, 0}";
sepNavVisRect = "{{0, 1072}, {867, 536}}";
sepNavWindowFrame = "{{35, 15}, {906, 665}}";
};
};
F5B19C3C0EA4DC91003F4BA4 /* English */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1692, 536}}";
sepNavSelRange = "{0, 0}";
sepNavVisRect = "{{825, 0}, {867, 536}}";
sepNavWindowFrame = "{{15, 76}, {906, 665}}";
};
};
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
# Grafx2 - The Ultimate 256-color bitmap paint program # Grafx2 - The Ultimate 256-color bitmap paint program
# #
# Copyright 2011 Franck Charlet
# Copyright 2011 Pawel Góralski # Copyright 2011 Pawel Góralski
# Copyright 2009 Per Olofsson # Copyright 2009 Per Olofsson
# Copyright 2008 Peter Gordon # Copyright 2008 Peter Gordon
@ -31,6 +32,11 @@
# Compile with OPTIM=0 to disable gcc optimizations, to enable debug. # Compile with OPTIM=0 to disable gcc optimizations, to enable debug.
STRIP = strip STRIP = strip
### Specific to build MAC OS X universal binaries on Tiger ###
### (may need to be changed or removed depedning on the OSX version) ###
MACOSX_SYSROOT = /Developer/SDKs/MacOSX10.4u.sdk
MACOSX_ARCH = -arch ppc -arch i386
### PLATFORM DETECTION AND CONFIGURATION ### ### PLATFORM DETECTION AND CONFIGURATION ###
@ -41,7 +47,7 @@ PLATFORMOBJ =
ifdef COMSPEC ifdef COMSPEC
DELCOMMAND = rm -f DELCOMMAND = rm -f
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2.exe BIN = ../bin/grafx2.exe
COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb `sdl-config --cflags` $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT) COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb `sdl-config --cflags` $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT)
@ -61,11 +67,11 @@ else
#For all other platforms, we can rely on uname #For all other platforms, we can rely on uname
PLATFORM = $(shell uname) PLATFORM = $(shell uname)
#AmigaOS (3 or 4) specific
ifeq ($(PLATFORM),AmigaOS) # 1 ifeq ($(PLATFORM),AmigaOS) # 1
#AmigaOS (3 or 4) specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -Wall -c -gstabs `sdl-config --cflags` $(TTFCOPT) COPT = -Wall -c -gstabs `sdl-config --cflags` $(TTFCOPT)
@ -78,34 +84,39 @@ else
else else
ifeq ($(PLATFORM),Darwin) # 2 ifeq ($(PLATFORM),Darwin) # 2
#Mac OS X specific #Mac OS X specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp # Force it
ZIP = zip OPTIM = 3
PLATFORMFILES = gfx2.png CP = cp
BIN = ../bin/grafx2 ZIP = zip
# Where the SDL frameworks are located PLATFORMFILES = gfx2.png
FWDIR = /Library/Frameworks # Where the SDL frameworks are located
SDLCOPT = -arch i386 -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE FWDIR = /Library/Frameworks
SDLLOPT = -arch i386 -L/usr/lib -framework SDL -framework SDL_image -framework SDL_ttf -framework Cocoa -framework Carbon -framework OpenGL BIN = ../bin/grafx2
COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include SVN_REVISION = $(shell svnversion | cut -f2 -d ":" - | tr -d "M")
LOPT = $(SDLLOPT) -L/usr/X11/lib -R/usr/X11/lib -lpng SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE
# Use gcc for compiling. Use ncc to build a callgraph and analyze the code. #-framework SDL_ttf
CC = gcc SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL
#CC = nccgen -ncgcc -ncld -ncfabs COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(SDLCOPT) $(TTFCOPT) -I/usr/X11/include
OBJDIR = ../obj/macosx LOPT = $(SDLLOPT) -llua -lpng -lz
PLATFORMOBJ = $(OBJDIR)/SDLMain.o # Use gcc for compiling. Use ncc to build a callgraph and analyze the code.
X11LOPT = CC = gcc
MACAPPEXE = Grafx2.app/Contents/MacOS/Grafx2 #CC = nccgen -ncgcc -ncld -ncfabs
OBJDIR = ../obj/macosx
PLATFORMOBJ = $(OBJDIR)/SDLMain.o
X11LOPT =
MACAPPEXE = Grafx2.app/Contents/MacOS/Grafx2
NOTTF = 1
else else
ifeq ($(PLATFORM),AROS) # 3 ifeq ($(PLATFORM),AROS) # 3
#AROS specific #AROS specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -Wall -g `sdl-config --cflags` $(TTFCOPT) COPT = -Wall -g `sdl-config --cflags` $(TTFCOPT)
@ -118,10 +129,10 @@ else
else else
ifeq ($(PLATFORM),MorphOS) # 4 ifeq ($(PLATFORM),MorphOS) # 4
#MorphOS specific #MorphOS specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT) COPT = -Wall -gstabs -c `sdl-config --cflags` $(TTFCOPT)
@ -134,10 +145,10 @@ else
else else
ifeq ($(PLATFORM),BeOS) # 6 ifeq ($(PLATFORM),BeOS) # 6
#BeOS specific #BeOS specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/home/config/include COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/home/config/include
@ -148,18 +159,18 @@ else
else else
ifeq ($(PLATFORM),Haiku) # 7 ifeq ($(PLATFORM),Haiku) # 7
#Haiku specific #Haiku specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
ifeq ($(NOLUA),1) ifeq ($(NOLUA),1)
LUACOPT = LUACOPT =
LUALOPT = LUALOPT =
else else
LUACOPT = -D__ENABLE_LUA__ LUACOPT = -D__ENABLE_LUA__
LUALOPT = -llua LUALOPT = -llua
endif endif
COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/common/include $(LUACOPT) COPT = -W -Wall -c -g `sdl-config --cflags` $(TTFCOPT) -I/boot/common/include $(LUACOPT)
LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT) LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT)
@ -169,10 +180,10 @@ else
else else
ifeq ($(PLATFORM),skyos) # 8 ifeq ($(PLATFORM),skyos) # 8
#SkyOS specific #SkyOS specific
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -W -Wall -Wdeclaration-after-statement -c -g `sdl-config --cflags` $(TTFCOPT) COPT = -W -Wall -Wdeclaration-after-statement -c -g `sdl-config --cflags` $(TTFCOPT)
@ -183,50 +194,50 @@ else
else else
ifeq ($(PLATFORM),OSF1) #9 ifeq ($(PLATFORM),OSF1) #9
#OSF1 / tru64 alpha #OSF1 / tru64 alpha
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
ZIP = zip ZIP = zip
PLATFORMFILES = gfx2.png PLATFORMFILES = gfx2.png
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -W -Wall -std=c99 -c -g -gstabs -D__TRU64__ `sdl-config --cflags` $(TTFCOPT) $(LUACOPT) COPT = -W -Wall -std=c99 -c -g -gstabs -D__TRU64__ `sdl-config --cflags` $(TTFCOPT) $(LUACOPT)
LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm
OBJDIR = ../obj/unix OBJDIR = ../obj/unix
X11LOPT = -lX11 X11LOPT = -lX11
CC = gcc CC = gcc
else else
# Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested. # Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested.
# Linux and FreeBSD specific (default rules) # Linux and FreeBSD specific (default rules)
DELCOMMAND = rm -rf DELCOMMAND = rm -rf
MKDIR = mkdir -p MKDIR = mkdir -p
RMDIR = rmdir RMDIR = rmdir --ignore-fail-on-non-empty
CP = cp CP = cp
ZIP = zip ZIP = zip
PLATFORMFILES = gfx2.png PLATFORMFILES = gfx2.png
ifneq ($(ATARICROSS),1) ifneq ($(ATARICROSS),1)
ifeq ($(NOLUA),1) ifeq ($(NOLUA),1)
LUACOPT = LUACOPT =
LUALOPT = LUALOPT =
else else
LUACOPT = `pkg-config lua --cflags --silence-errors ||pkg-config lua5.1 --cflags --silence-errors ||pkg-config lua-5.1 --cflags` LUACOPT = `pkg-config lua --cflags --silence-errors ||pkg-config lua5.1 --cflags --silence-errors ||pkg-config lua-5.1 --cflags`
LUALOPT = `pkg-config lua --libs --silence-errors ||pkg-config lua5.1 --libs --silence-errors ||pkg-config lua-5.1 --libs` LUALOPT = `pkg-config lua --libs --silence-errors ||pkg-config lua5.1 --libs --silence-errors ||pkg-config lua-5.1 --libs`
endif endif
endif endif
# These can only be used under linux and maybe freebsd. They allow to compile for the gp2x or to create a windows binary
ifdef WIN32CROSS # These can only be used under linux and maybe freebsd. They allow to compile for the gp2x or to create a windows binary
#cross compile a Win32 executable ifdef WIN32CROSS
CC = i586-mingw32msvc-gcc #cross compile a Win32 executable
BIN = ../bin/grafx2.exe CC = i586-mingw32msvc-gcc
COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags` $(TTFCOPT) BIN = ../bin/grafx2.exe
LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs` -lSDL_image $(TTFLOPT) COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags` $(TTFCOPT)
OBJDIR = ../obj/win32 LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs` -lSDL_image $(TTFLOPT)
PLATFORM = win32 OBJDIR = ../obj/win32
else PLATFORM = win32
else
ifdef GP2XCROSS ifdef GP2XCROSS
#cross compile an exec for the gp2x #cross compile an exec for the gp2x
CC = /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc CC = /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-gcc
BIN = ../bin/grafx2.gpe BIN = ../bin/grafx2.gpe
@ -238,28 +249,30 @@ else
STRIP = /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-strip STRIP = /opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin/arm-open2x-linux-strip
JOYCOPT = -DUSE_JOYSTICK JOYCOPT = -DUSE_JOYSTICK
else ifdef AROS32CROSS else
#cross compile an Aros 32 bit executable ifdef AROS32CROSS
#cross compile an Aros 32 bit executable
BIN = ../bin/grafx2 BIN = ../bin/grafx2
COPT = -Wall -g `i386-linux-aros-sdl-config --cflags` $(TTFCOPT) COPT = -Wall -g `i386-linux-aros-sdl-config --cflags` $(TTFCOPT)
LOPT = -lSDL_image `i386-linux-aros-sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared LOPT = -lSDL_image `i386-linux-aros-sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared
CC = i386-aros-gcc CC = i386-aros-gcc
OBJDIR = ../obj/aros OBJDIR = ../obj/aros
STRIP = strip --strip-unneeded --remove-section .comment STRIP = strip --strip-unneeded --remove-section .comment
PLATFORM = AROS PLATFORM = AROS
ZIP = lha ZIP = lha
ZIPOPT = a ZIPOPT = a
else ifdef ATARICROSS else
ifdef ATARICROSS
#cross compile an exec for atari TOS/MiNT machine #cross compile an exec for atari TOS/MiNT machine
CC = m68k-atari-mint-gcc CC = m68k-atari-mint-gcc
BIN = ../bin/grafx2.ttp BIN = ../bin/grafx2.ttp
LUALOPT = -llua LUALOPT = -llua
OBJDIR = ../obj/m68k-atari-mint OBJDIR = ../obj/m68k-atari-mint
PLATFORM = m68k-atari-mint PLATFORM = m68k-atari-mint
STRIP = m68k-atari-mint-strip -s STRIP = m68k-atari-mint-strip -s
X11LOPT = X11LOPT =
COPT = -W -Wall -m68020-60 -fomit-frame-pointer -pedantic -std=c99 -Wdeclaration-after-statement -D__MINT__ -DNO_INLINE_MATH -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $() $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) COPT = -W -Wall -m68020-60 -fomit-frame-pointer -pedantic -std=c99 -Wdeclaration-after-statement -D__MINT__ -DNO_INLINE_MATH -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $() $(JOYCOPT) $(LAYERCOPT) $(LUACOPT)
LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) $(LAYERLOPT) LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) $(LAYERLOPT)
else else
# Compiles a regular linux executable for the native platform # Compiles a regular linux executable for the native platform
@ -273,6 +286,9 @@ else
X11LOPT = -lX11 X11LOPT = -lX11
endif endif
endif endif
endif
endif
endif endif
endif endif
endif endif
@ -283,33 +299,34 @@ else
endif endif
endif endif
### BUILD SETTINGS are set according to vars set in the platform selection, the "overridable defaults", and environment variables set before launching make ### BUILD SETTINGS are set according to vars set in the platform selection,
### the "overridable defaults", and environment variables set before launching make
#TrueType is optional: make NOTTF=1 to disable support and dependencies. #TrueType is optional: make NOTTF=1 to disable support and dependencies.
ifndef ($(ATARICROSS,1)) ifndef ($(ATARICROSS,1))
ifeq ($(NOTTF),1) ifeq ($(NOTTF),1)
TTFCOPT = -DNOTTF=1 TTFCOPT = -DNOTTF=1
TTFLOPT = TTFLOPT =
TTFLIBS = TTFLIBS =
TTFLABEL = -nottf TTFLABEL = -nottf
else
TTFCOPT =
TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT)
TTFLIBS = bin/libfreetype-6.dll bin/SDL_ttf.dll
TTFLABEL =
endif
else else
TTFCOPT = ifeq ($(NOTTF),1)
TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT) TTFCOPT = -DNOTTF=1
TTFLIBS = bin/libfreetype-6.dll bin/SDL_ttf.dll TTFLOPT =
TTFLABEL = TTFLIBS =
endif TTFLABEL = -nottf
else else
ifeq ($(NOTTF),1) TTFCOPT =
TTFCOPT = -DNOTTF=1 TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT)
TTFLOPT = TTFLIBS =
TTFLIBS = TTFLABEL =
TTFLABEL = -nottf endif
else
TTFCOPT =
TTFLOPT = -L$(prefix)/lib -lSDL_ttf $(X11LOPT)
TTFLIBS =
TTFLABEL =
endif
endif endif
#Lua scripting is optional too #Lua scripting is optional too
@ -354,13 +371,13 @@ endif
# This is the list of the objects we want to build. Dependancies are built by "make depend" automatically. # This is the list of the objects we want to build. Dependancies are built by "make depend" automatically.
OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/misc.o $(OBJDIR)/special.o $(OBJDIR)/buttons.o $(OBJDIR)/palette.o $(OBJDIR)/help.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/engine.o $(OBJDIR)/filesel.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/keyboard.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/text.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/pxdouble.o $(OBJDIR)/pxtriple.o $(OBJDIR)/pxtall2.o $(OBJDIR)/pxwide2.o $(OBJDIR)/pxquad.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o $(OBJDIR)/hotkeys.o $(OBJDIR)/transform.o $(OBJDIR)/pversion.o $(OBJDIR)/factory.o $(PLATFORMOBJ) $(OBJDIR)/fileformats.o $(OBJDIR)/miscfileformats.o $(OBJDIR)/libraw2crtc.o $(OBJDIR)/brush_ops.o $(OBJDIR)/buttons_effects.o $(OBJDIR)/layers.o $(OBJDIR)/oldies.o OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.o $(OBJDIR)/misc.o $(OBJDIR)/special.o $(OBJDIR)/buttons.o $(OBJDIR)/palette.o $(OBJDIR)/help.o $(OBJDIR)/operatio.o $(OBJDIR)/pages.o $(OBJDIR)/loadsave.o $(OBJDIR)/readline.o $(OBJDIR)/engine.o $(OBJDIR)/filesel.o $(OBJDIR)/op_c.o $(OBJDIR)/readini.o $(OBJDIR)/saveini.o $(OBJDIR)/shade.o $(OBJDIR)/keyboard.o $(OBJDIR)/io.o $(OBJDIR)/version.o $(OBJDIR)/text.o $(OBJDIR)/SFont.o $(OBJDIR)/setup.o $(OBJDIR)/pxsimple.o $(OBJDIR)/pxtall.o $(OBJDIR)/pxwide.o $(OBJDIR)/pxdouble.o $(OBJDIR)/pxtriple.o $(OBJDIR)/pxtall2.o $(OBJDIR)/pxwide2.o $(OBJDIR)/pxquad.o $(OBJDIR)/windows.o $(OBJDIR)/brush.o $(OBJDIR)/realpath.o $(OBJDIR)/mountlist.o $(OBJDIR)/input.o $(OBJDIR)/hotkeys.o $(OBJDIR)/transform.o $(OBJDIR)/pversion.o $(OBJDIR)/factory.o $(PLATFORMOBJ) $(OBJDIR)/fileformats.o $(OBJDIR)/miscfileformats.o $(OBJDIR)/libraw2crtc.o $(OBJDIR)/brush_ops.o $(OBJDIR)/buttons_effects.o $(OBJDIR)/layers.o $(OBJDIR)/oldies.o
SKIN_FILES = ../share/grafx2/skins/skin_classic.png ../share/grafx2/skins/skin_modern.png ../share/grafx2/skins/skin_DPaint.png ../share/grafx2/skins/font_Classic.png ../share/grafx2/skins/font_Fun.png ../share/grafx2/skins/font_Fairlight.png ../share/grafx2/skins/font_Melon.png ../share/grafx2/skins/font_DPaint.png ../share/grafx2/skins/skin_scenish.png ../share/grafx2/skins/font_Seen.png ../share/grafx2/skins/skin_Aurora.png ../share/grafx2/skins/skin_Clax3.gif ../share/grafx2/skins/skin_Clax2.gif ../share/grafx2/skins/skin_Clax4.gif SKIN_FILES = ../share/grafx2/skins/skin_classic.png ../share/grafx2/skins/skin_modern.png ../share/grafx2/skins/skin_DPaint.png ../share/grafx2/skins/font_Classic.png ../share/grafx2/skins/font_Fun.png ../share/grafx2/skins/font_Fairlight.png ../share/grafx2/skins/font_Melon.png ../share/grafx2/skins/font_DPaint.png ../share/grafx2/skins/skin_scenish.png ../share/grafx2/skins/font_Seen.png ../share/grafx2/skins/skin_Aurora.png
SCRIPT_FILES1 = ../share/grafx2/scripts/bru_db_Amigaball.lua ../share/grafx2/scripts/bru_db_ColorSphere.lua ../share/grafx2/scripts/bru_db_FindAA.lua ../share/grafx2/scripts/bru_db_Fisheye.lua ../share/grafx2/scripts/bru_db_GrayscaleAvg.lua ../share/grafx2/scripts/bru_db_GrayscaleDesat.lua ../share/grafx2/scripts/bru_db_Halfsmooth.lua ../share/grafx2/scripts/bru_db_Mandelbrot.lua ../share/grafx2/scripts/bru_db_Waves.lua ../share/grafx2/scripts/pal_db_Desaturate.lua ../share/grafx2/scripts/pal_db_ExpandColors.lua ../share/grafx2/scripts/pal_db_FillColorCube.lua ../share/grafx2/scripts/pal_db_InvertedRGB.lua ../share/grafx2/scripts/pal_db_Set3bit.lua ../share/grafx2/scripts/pal_db_Set6bit.lua ../share/grafx2/scripts/pal_db_SetC64Palette.lua ../share/grafx2/scripts/pal_db_ShiftHue.lua ../share/grafx2/scripts/pic_db_Pic2isometric.lua ../share/grafx2/scripts/pic_db_Rainbow-Dark2Bright.lua ../share/grafx2/scripts/pic_db_SierpinskyCarpet.lua SCRIPT_FILES = ../share/grafx2/scripts/samples_2.3/brush/ApplyColor.lua ../share/grafx2/scripts/samples_2.3/brush/Fisheye.lua ../share/grafx2/scripts/samples_2.3/brush/GrayscaleAvg.lua ../share/grafx2/scripts/samples_2.3/brush/GrayscaleDesat.lua ../share/grafx2/scripts/samples_2.3/brush/Halfsmooth.lua ../share/grafx2/scripts/samples_2.3/brush/Waves.lua ../share/grafx2/scripts/samples_2.3/demo/3DPalette.lua ../share/grafx2/scripts/samples_2.3/demo/Ellipse.lua ../share/grafx2/scripts/samples_2.3/demo/FlipPicture.lua \
SCRIPT_FILES2 = ../share/grafx2/scripts/pic_db_SierpinskyTriangle.lua ../share/grafx2/scripts/pic_ni_GlassGridFilter.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB.lua ../share/grafx2/scripts/scn_db_RemapImage2RGB_ed.lua ../share/grafx2/scripts/scn_db_RemapImageTo3bitPal.lua ../share/grafx2/scripts/samples_2.3/demo/SierpinskyCarpet.lua ../share/grafx2/scripts/samples_2.3/demo/SierpinskyTriangle.lua ../share/grafx2/scripts/samples_2.3/demo/Spritesheet.lua ../share/grafx2/scripts/samples_2.3/demo/brush/Amigaball.lua ../share/grafx2/scripts/samples_2.3/demo/brush/ColorSphere.lua ../share/grafx2/scripts/samples_2.3/demo/brush/FindAA.lua ../share/grafx2/scripts/samples_2.3/demo/brush/Mandelbrot.lua ../share/grafx2/scripts/samples_2.3/libs/dawnbringer_lib.lua ../share/grafx2/scripts/samples_2.3/libs/memory.lua \
SCRIPT_FILES= $(SCRIPT_FILES1) $(SCRIPT_FILES2) ../share/grafx2/scripts/samples_2.3/palette/Desaturate.lua ../share/grafx2/scripts/samples_2.3/palette/ExpandColors.lua ../share/grafx2/scripts/samples_2.3/palette/FillColorCube.lua ../share/grafx2/scripts/samples_2.3/palette/InvertedRGB.lua ../share/grafx2/scripts/samples_2.3/palette/Set3bit.lua ../share/grafx2/scripts/samples_2.3/palette/Set6bit.lua ../share/grafx2/scripts/samples_2.3/palette/SetC64Palette.lua ../share/grafx2/scripts/samples_2.3/palette/ShiftHue.lua ../share/grafx2/scripts/samples_2.3/picture/CellColourReducer.lua \
../share/grafx2/scripts/samples_2.3/picture/DrawGridIsometric.lua ../share/grafx2/scripts/samples_2.3/picture/DrawgridOrthogonal_Index.lua ../share/grafx2/scripts/samples_2.3/picture/DrawGridOrthogonal_RGB.lua ../share/grafx2/scripts/samples_2.3/picture/GlassGridFilter.lua ../share/grafx2/scripts/samples_2.3/picture/PaletteToPicture.lua ../share/grafx2/scripts/samples_2.3/picture/Pic2isometric.lua ../share/grafx2/scripts/samples_2.3/picture/Rainbow-Dark2Bright.lua ../share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB.lua \
SCRIPTLIB_FILES = ../share/grafx2/scripts/libs/memory.lua ../share/grafx2/scripts/samples_2.3/picture/RemapImage2RGB_ed.lua ../share/grafx2/scripts/samples_2.3/picture/RemapImageTo3bitPal.lua ../share/grafx2/scripts/samples_2.3/picture/XBitColourXpaceFromPalette.lua
FONT_FILES = ../share/grafx2/fonts/8pxfont.png ../share/grafx2/fonts/Tuffy.ttf ../share/grafx2/fonts/PF_Arma_5__.png ../share/grafx2/fonts/PF_Easta_7_.png ../share/grafx2/fonts/PF_Easta_7__.png ../share/grafx2/fonts/PF_Ronda_7__.png ../share/grafx2/fonts/PF_Tempesta_5.png ../share/grafx2/fonts/PF_Tempesta_5_.png ../share/grafx2/fonts/PF_Tempesta_5__.png ../share/grafx2/fonts/PF_Tempesta_5___.png ../share/grafx2/fonts/PF_Tempesta_7.png ../share/grafx2/fonts/PF_Tempesta_7_.png ../share/grafx2/fonts/PF_Tempesta_7__.png ../share/grafx2/fonts/PF_Tempesta_7___.png ../share/grafx2/fonts/PF_Westa_7_.png ../share/grafx2/fonts/PF_Westa_7__.png FONT_FILES = ../share/grafx2/fonts/8pxfont.png ../share/grafx2/fonts/Tuffy.ttf ../share/grafx2/fonts/PF_Arma_5__.png ../share/grafx2/fonts/PF_Easta_7_.png ../share/grafx2/fonts/PF_Easta_7__.png ../share/grafx2/fonts/PF_Ronda_7__.png ../share/grafx2/fonts/PF_Tempesta_5.png ../share/grafx2/fonts/PF_Tempesta_5_.png ../share/grafx2/fonts/PF_Tempesta_5__.png ../share/grafx2/fonts/PF_Tempesta_5___.png ../share/grafx2/fonts/PF_Tempesta_7.png ../share/grafx2/fonts/PF_Tempesta_7_.png ../share/grafx2/fonts/PF_Tempesta_7__.png ../share/grafx2/fonts/PF_Tempesta_7___.png ../share/grafx2/fonts/PF_Westa_7_.png ../share/grafx2/fonts/PF_Westa_7__.png
@ -369,17 +386,30 @@ ifeq ($(PLATFORM),Darwin)
all : $(MACAPPEXE) all : $(MACAPPEXE)
$(MACAPPEXE) : $(BIN) $(MACAPPEXE) : $(BIN)
rm -rf Grafx2.app rm -rf Grafx2.app
mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts
echo 'APPL????' > Grafx2.app/Contents/PkgInfo echo 'APPL????' > Grafx2.app/Contents/PkgInfo
cp ../Info.plist Grafx2.app/Contents cp ../Info.plist Grafx2.app/Contents
cp -r Grafx2.icns Grafx2.app/Contents/Resources
cp -r English.lproj Grafx2.app/Contents/Resources cp -r English.lproj Grafx2.app/Contents/Resources
cp -r ../share/grafx2/fonts Grafx2.app/Contents/Resources cp -r ../share/grafx2/fonts Grafx2.app/Contents/Resources
cp -r ../share/grafx2/skins Grafx2.app/Contents/Resources cp -r ../share/grafx2/skins Grafx2.app/Contents/Resources
cp -r ../share/grafx2/gfx2def.ini Grafx2.app/Contents/Resources cp -r ../share/grafx2/gfx2def.ini Grafx2.app/Contents/Resources
cp -Rp $(FWDIR)/SDL.framework Grafx2.app/Contents/Frameworks cp -r $(SCRIPT_FILES) Grafx2.app/Contents/Resources/scripts
cp -Rp $(FWDIR)/SDL_image.framework Grafx2.app/Contents/Frameworks mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions
cp -Rp $(FWDIR)/SDL_ttf.framework Grafx2.app/Contents/Frameworks mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions
# mkdir -p Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
cp -Rp $(FWDIR)/SDL.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL.framework/Versions
cp -Rp $(FWDIR)/SDL_image.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions
# cp -Rp $(FWDIR)/SDL_ttf.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Headers
rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Resources
rm -fr Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions/A/Headers
rm -fr Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions/A/Resources
# rm -fr Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
cp $(BIN) $(MACAPPEXE) cp $(BIN) $(MACAPPEXE)
$(STRIP) -x -X -S $(MACAPPEXE)
chmod +x $(MACAPPEXE)
tar cvzf grafx2-svn$(SVN_REVISION)-macosx.tgz --exclude '*svn*' --exclude '*DS_Store*' Grafx2.app/*
else else
all : $(BIN) all : $(BIN)
endif endif
@ -394,15 +424,12 @@ release : version $(BIN)
# Create a zip archive ready for upload to the website, including binaries and sourcecode # Create a zip archive ready for upload to the website, including binaries and sourcecode
ziprelease: version $(BIN) release ziprelease: version $(BIN) release
echo `sed "s/.*=\"\(.*\)\";/\1/" pversion.c`.`svnversion` | tr " :" "_-" | sed -e "s/\(wip\)\\./\1/I" > $(OBJDIR)/versiontag echo `sed "s/.*=\"\(.*\)\";/\1/" pversion.c`.`svnversion` | tr " :" "_-" | sed -e "s/\(wip\)\\./\1/I" > $(OBJDIR)/versiontag
tar cvzf "../src-`cat $(OBJDIR)/versiontag`.tgz" --strip=1 ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../src/gfx2.ico tar cvzf "../src-`cat $(OBJDIR)/versiontag`.tgz" --strip=1 ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../src/gfx2.ico
cd .. && $(ZIP) $(ZIPOPT) "grafx2-`cat $(OBJDIR:../%=%)/versiontag`$(TTFLABEL)-$(PLATFORM).$(ZIP)" $(BIN:../%=%) share/grafx2/gfx2def.ini $(SCRIPT_FILES:../%=%) $(SCRIPTLIB_FILES:../%=%) $(SKIN_FILES:../%=%) share/grafx2/gfx2.gif share/icons/grafx2.svg doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt doc/PF_fonts.txt $(FONT_FILES:../%=%) doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt doc/README-lua.txt src-`cat $(OBJDIR:../%=%)/versiontag`.tgz $(PLATFORMFILES:../%=%) cd .. && $(ZIP) $(ZIPOPT) "grafx2-`cat $(OBJDIR:../%=%)/versiontag`$(TTFLABEL)-$(PLATFORM).$(ZIP)" $(BIN:../%=%) share/grafx2/gfx2def.ini $(SCRIPT_FILES:../%=%) $(SKIN_FILES:../%=%) share/grafx2/gfx2.gif share/icons/grafx2.svg doc/README.txt doc/COMPILING.txt doc/gpl-2.0.txt doc/PF_fonts.txt $(FONT_FILES:../%=%) doc/README-zlib1.txt doc/README-SDL.txt doc/README-SDL_image.txt doc/README-SDL_ttf.txt doc/README-lua.txt src-`cat $(OBJDIR:../%=%)/versiontag`.tgz $(PLATFORMFILES:../%=%)
$(DELCOMMAND) "../src-`cat $(OBJDIR)/versiontag`.tgz" $(DELCOMMAND) "../src-`cat $(OBJDIR)/versiontag`.tgz"
tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SCRIPTLIB_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop $(FONT_FILES) tar cvzf "../grafx2-`cat $(OBJDIR)/versiontag`$(TTFLABEL)-src.tgz" --strip=1 --transform 's,^,grafx2/,g' ../src/*.c ../src/*.h ../src/Makefile ../src/Makefile.dep ../share/grafx2/gfx2def.ini $(SCRIPT_FILES) $(SKIN_FILES) ../src/gfx2.ico ../share/grafx2/gfx2.gif ../share/icons/grafx2.svg ../doc/README.txt ../doc/COMPILING.txt ../doc/gpl-2.0.txt ../doc/PF_fonts.txt ../misc/unix/grafx2.1 ../misc/unix/grafx2.xpm ../misc/unix/grafx2.desktop $(FONT_FILES)
$(DELCOMMAND) "$(OBJDIR)/versiontag" $(DELCOMMAND) "$(OBJDIR)/versiontag"
testsed :
$(BIN) : $(OBJ) $(BIN) : $(OBJ)
test -d ../bin || $(MKDIR) ../bin test -d ../bin || $(MKDIR) ../bin
$(CC) $(OBJ) -o $(BIN) $(LOPT) $(LFLAGS) $(CC) $(OBJ) -o $(BIN) $(LOPT) $(LFLAGS)
@ -456,6 +483,13 @@ install : $(BIN)
test -d $(DESTDIR)$(datadir)/grafx2/skins || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/skins test -d $(DESTDIR)$(datadir)/grafx2/skins || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/skins
test -d $(DESTDIR)$(datadir)/grafx2/scripts || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts test -d $(DESTDIR)$(datadir)/grafx2/scripts || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts
test -d $(DESTDIR)$(datadir)/grafx2/scripts/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs test -d $(DESTDIR)$(datadir)/grafx2/scripts/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3 || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture
test -d $(DESTDIR)$(datadir)/applications || $(MKDIR) $(DESTDIR)$(datadir)/applications test -d $(DESTDIR)$(datadir)/applications || $(MKDIR) $(DESTDIR)$(datadir)/applications
test -d $(DESTDIR)$(pixmapdir) || $(MKDIR) $(DESTDIR)$(pixmapdir) test -d $(DESTDIR)$(pixmapdir) || $(MKDIR) $(DESTDIR)$(pixmapdir)
# Copy files # Copy files
@ -464,8 +498,7 @@ install : $(BIN)
$(CP) ../share/grafx2/gfx2.gif $(DESTDIR)$(datadir)/grafx2/ $(CP) ../share/grafx2/gfx2.gif $(DESTDIR)$(datadir)/grafx2/
$(CP) ../share/grafx2/fonts/* $(DESTDIR)$(datadir)/grafx2/fonts/ $(CP) ../share/grafx2/fonts/* $(DESTDIR)$(datadir)/grafx2/fonts/
$(CP) $(SKIN_FILES) $(DESTDIR)$(datadir)/grafx2/skins/ $(CP) $(SKIN_FILES) $(DESTDIR)$(datadir)/grafx2/skins/
$(CP) $(SCRIPT_FILES) $(DESTDIR)$(datadir)/grafx2/scripts/ for f in $(SCRIPT_FILES); do cp "$$f" "$(DESTDIR)$(bindir)/$$f" ; done
$(CP) $(SCRIPTLIB_FILES) $(DESTDIR)$(datadir)/grafx2/scripts/libs/
# Icon and desktop file for debian # Icon and desktop file for debian
$(CP) ../misc/unix/grafx2.desktop $(DESTDIR)$(datadir)/applications/ $(CP) ../misc/unix/grafx2.desktop $(DESTDIR)$(datadir)/applications/
$(CP) ../misc/unix/grafx2.xpm $(DESTDIR)$(pixmapdir) $(CP) ../misc/unix/grafx2.xpm $(DESTDIR)$(pixmapdir)
@ -478,14 +511,20 @@ uninstall :
$(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/gfx2def.ini $(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/gfx2def.ini
$(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/gfx2.gif $(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/gfx2.gif
$(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/fonts/* $(DELCOMMAND) $(DESTDIR)$(datadir)/grafx2/fonts/*
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/fonts),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/fonts) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/fonts),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/fonts,)
$(DELCOMMAND) $(SKIN_FILES:../share%=$(DESTDIR)$(datadir)%) $(DELCOMMAND) $(SKIN_FILES:../share%=$(DESTDIR)$(datadir)%)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/skins),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/skins) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/skins),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/skins,)
$(DELCOMMAND) $(SCRIPTLIB_FILES:../share%=$(DESTDIR)$(datadir)%)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/libs),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs)
$(DELCOMMAND) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%) $(DELCOMMAND) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2),,$(RMDIR) $(DESTDIR)$(datadir)/grafx2) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/palette,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/libs,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo/brush,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/demo,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/brush,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2),$(RMDIR) $(DESTDIR)$(datadir)/grafx2,)
# Icon and desktop file for debian # Icon and desktop file for debian
$(DELCOMMAND) $(DESTDIR)$(datadir)/applications/grafx2.desktop $(DELCOMMAND) $(DESTDIR)$(datadir)/applications/grafx2.desktop
$(DELCOMMAND) $(DESTDIR)$(pixmapdir)/grafx2.xpm $(DELCOMMAND) $(DESTDIR)$(pixmapdir)/grafx2.xpm

View File

@ -15,7 +15,7 @@ $(OBJDIR)/engine.o: engine.c const.h struct.h global.h graph.h misc.h special.h
input.h engine.h pages.h layers.h factory.h loadsave.h io.h input.h engine.h pages.h layers.h factory.h loadsave.h io.h
$(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h engine.h errors.h \ $(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h engine.h errors.h \
filesel.h loadsave.h global.h graph.h io.h misc.h pages.h readline.h \ filesel.h loadsave.h global.h graph.h io.h misc.h pages.h readline.h \
sdlscreen.h windows.h palette.h input.h help.h sdlscreen.h windows.h palette.h input.h help.h realpath.h
$(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \ $(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \
loadsave.h misc.h io.h windows.h pages.h loadsave.h misc.h io.h windows.h pages.h
$(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \ $(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \
@ -45,7 +45,8 @@ $(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h errors.h global.h io
engine.h brush.h setup.h engine.h brush.h setup.h
$(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \ $(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \
engine.h pages.h loadsave.h sdlscreen.h errors.h readini.h saveini.h \ engine.h pages.h loadsave.h sdlscreen.h errors.h readini.h saveini.h \
io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \
help.h
$(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.h \ $(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.h \
engine.h misc.h keyboard.h windows.h palette.h input.h graph.h pages.h engine.h misc.h keyboard.h windows.h palette.h input.h graph.h pages.h
$(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \ $(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \
@ -61,6 +62,9 @@ $(OBJDIR)/pages.o: pages.c global.h struct.h const.h pages.h errors.h loadsave.h
$(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \ $(OBJDIR)/palette.o: palette.c const.h struct.h global.h misc.h engine.h readline.h \
buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \ buttons.h pages.h help.h sdlscreen.h errors.h op_c.h windows.h input.h \
palette.h shade.h palette.h shade.h
$(OBJDIR)/palette_test.o: palette_test.c const.h struct.h global.h misc.h engine.h \
readline.h buttons.h pages.h help.h sdlscreen.h errors.h op_c.h \
windows.h input.h palette.h shade.h
$(OBJDIR)/pversion.o: pversion.c $(OBJDIR)/pversion.o: pversion.c
$(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \ $(OBJDIR)/pxdouble.o: pxdouble.c global.h struct.h const.h sdlscreen.h misc.h \
graph.h pxdouble.h pxwide.h graph.h pxdouble.h pxwide.h
@ -79,9 +83,9 @@ $(OBJDIR)/pxwide.o: pxwide.c global.h struct.h const.h sdlscreen.h misc.h graph.
$(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \ $(OBJDIR)/pxwide2.o: pxwide2.c global.h struct.h const.h sdlscreen.h misc.h graph.h \
pxwide2.h pxwide2.h
$(OBJDIR)/readini.o: readini.c const.h errors.h global.h struct.h misc.h readini.h \ $(OBJDIR)/readini.o: readini.c const.h errors.h global.h struct.h misc.h readini.h \
setup.h setup.h realpath.h io.h
$(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h \ $(OBJDIR)/readline.o: readline.c const.h struct.h global.h misc.h errors.h \
sdlscreen.h readline.h windows.h input.h sdlscreen.h readline.h windows.h input.h engine.h
$(OBJDIR)/realpath.o: realpath.c $(OBJDIR)/realpath.o: realpath.c
$(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \ $(OBJDIR)/saveini.o: saveini.c const.h global.h struct.h readini.h io.h errors.h \
misc.h saveini.h setup.h misc.h saveini.h setup.h

View File

@ -82,7 +82,7 @@ static NSString *getApplicationName(void)
if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) { if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) {
if ([anEvent modifierFlags] & NSCommandKeyMask) if ([anEvent modifierFlags] & NSCommandKeyMask)
{ {
SDL_SetModState(SDL_GetModState() | KMOD_META); // SDL_SetModState(SDL_GetModState() /*| KMOD_META*/);
[super sendEvent: anEvent]; [super sendEvent: anEvent];
} }
} else } else

View File

@ -117,7 +117,9 @@ SFont_Font* SFont_InitFont(SDL_Surface* Surface)
pixel = GetPixel(Surface, 0, Surface->h-1); pixel = GetPixel(Surface, 0, Surface->h-1);
SDL_UnlockSurface(Surface); SDL_UnlockSurface(Surface);
SDL_SetColorKey(Surface, SDL_SRCCOLORKEY, pixel); // No longer use SDL color keying
//SDL_SetColorKey(Surface, SDL_SRCCOLORKEY, pixel);
Font->Transparent=pixel;
return Font; return Font;
} }
@ -143,8 +145,13 @@ void SFont_Write(SDL_Surface *Surface, const SFont_Font *Font,
srcrect.h = dstrect.h = Font->Surface->h - 1; srcrect.h = dstrect.h = Font->Surface->h - 1;
for(c = text; *c != '\0' && x <= Surface->w ; c++) { for(c = text; *c != '\0' && x <= Surface->w ; c++) {
if (*c == '\n') {
dstrect.y += Font->Surface->h-1;
x=0;
continue;
}
// skip spaces and nonprintable characters // skip spaces and nonprintable characters
if (*c == ' ' || Font->CharWidth[(int)*c]==0) { else if (*c == ' ' || Font->CharWidth[(int)*c]==0) {
x += Font->Space; x += Font->Space;
continue; continue;
} }
@ -164,13 +171,23 @@ int SFont_TextWidth(const SFont_Font *Font, const char *text)
{ {
const char* c; const char* c;
int width = 0; int width = 0;
int previous_width = 0;
if(text == NULL) if(text == NULL)
return 0; return 0;
for(c = text; *c != '\0'; c++) { for(c = text; *c != '\0'; c++)
{
if (*c == '\n')
{
if (previous_width<width)
previous_width=width;
width=0;
}
else
// skip spaces and nonprintable characters // skip spaces and nonprintable characters
if (*c == ' ' || Font->CharWidth[(int)*c]==0) { if (*c == ' ' || Font->CharWidth[(int)*c]==0)
{
width += Font->Space; width += Font->Space;
continue; continue;
} }
@ -178,18 +195,30 @@ int SFont_TextWidth(const SFont_Font *Font, const char *text)
width += Font->CharWidth[(int)*c]; width += Font->CharWidth[(int)*c];
} }
return width; return previous_width<width ? width : previous_width;
} }
int SFont_TextHeight(const SFont_Font* Font) int SFont_TextHeight(const SFont_Font* Font, const char *text)
{ {
return Font->Surface->h - 1; // Count occurences of '\n'
int nb_cr=0;
while (*text!='\0')
{
if (*text=='\n')
nb_cr++;
text++;
}
return (Font->Surface->h - 1) * (nb_cr+1);
} }
/*
// Do not use: Doesn't implement carriage returns
void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font *Font, void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font *Font,
int y, const char *text) int y, const char *text)
{ {
SFont_Write(Surface, Font, Surface->w/2 - SFont_TextWidth(Font, text)/2, SFont_Write(Surface, Font, Surface->w/2 - SFont_TextWidth(Font, text)/2,
y, text); y, text);
} }
*/

View File

@ -59,6 +59,7 @@ typedef struct {
int CharBegin[256]; int CharBegin[256];
int CharWidth[256]; int CharWidth[256];
int Space; int Space;
unsigned char Transparent;
} SFont_Font; } SFont_Font;
/// ///
@ -86,7 +87,7 @@ void SFont_Write(SDL_Surface *Surface, const SFont_Font *Font, int x, int y,
/// Returns the width of "text" in pixels /// Returns the width of "text" in pixels
int SFont_TextWidth(const SFont_Font* Font, const char *text); int SFont_TextWidth(const SFont_Font* Font, const char *text);
/// Returns the height of "text" in pixels (which is always equal to Font->Surface->h) /// Returns the height of "text" in pixels (which is always equal to Font->Surface->h)
int SFont_TextHeight(const SFont_Font* Font); int SFont_TextHeight(const SFont_Font* Font, const char *text);
/// Blits a string to Surface with centered x position /// Blits a string to Surface with centered x position
void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font* Font, int y, void SFont_WriteCenter(SDL_Surface *Surface, const SFont_Font* Font, int y,

View File

@ -949,7 +949,7 @@ void Remap_brush(void)
Brush_colormap[color]=color; Brush_colormap[color]=color;
else else
// Usual method: closest by r g b // Usual method: closest by r g b
Brush_colormap[color]=Best_color_perceptual(r,g,b); Brush_colormap[color]=Best_color_perceptual_except(r,g,b,Back_color);
} }
// Il reste une couleur non calculée dans la table qu'il faut mettre à // Il reste une couleur non calculée dans la table qu'il faut mettre à

View File

@ -25,14 +25,11 @@
#include <proto/dos.h> #include <proto/dos.h>
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#elif defined(__WIN32__) #elif defined(__WIN32__)
#include <dirent.h> #include <dirent.h>
#include <windows.h> #include <windows.h>
#define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN)
#else #else
#include <dirent.h> #include <dirent.h>
#define isHidden(x) ((x)->d_name[0]=='.')
#endif #endif
#define _XOPEN_SOURCE 500 #define _XOPEN_SOURCE 500
@ -82,18 +79,14 @@
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h> #include <proto/dos.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#elif defined(__MINT__) #elif defined(__MINT__)
#include <mint/sysbind.h> #include <mint/sysbind.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#elif defined(__WIN32__) #elif defined(__WIN32__)
#include <dirent.h> #include <dirent.h>
#include <windows.h> #include <windows.h>
#define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN)
#else #else
#include <dirent.h> #include <dirent.h>
#define isHidden(x) ((x)->d_name[0]=='.')
#endif #endif
extern char Program_version[]; // generated in pversion.c extern char Program_version[]; // generated in pversion.c
@ -169,7 +162,7 @@ void Button_Message_initial(void)
for (x=14,x_pos=0; x_pos<231; x_pos++,x++) for (x=14,x_pos=0; x_pos<231; x_pos++,x++)
Pixel_in_window(x,y,Gfx->Logo_grafx2[offs_y+x_pos]); Pixel_in_window(x,y,Gfx->Logo_grafx2[offs_y+x_pos]);
Print_in_window(130-4*26,88,"Copyright (c) 2007-2010 by",MC_Dark,MC_Light); Print_in_window(130-4*26,88,"Copyright (c) 2007-2011 by",MC_Dark,MC_Light);
Print_in_window(130-4*23,96,"the Grafx2 project team",MC_Black,MC_Light); Print_in_window(130-4*23,96,"the Grafx2 project team",MC_Black,MC_Light);
Print_in_window(130-4*26,112,"Copyright (c) 1996-2001 by",MC_Dark,MC_Light); Print_in_window(130-4*26,112,"Copyright (c) 1996-2001 by",MC_Dark,MC_Light);
Print_in_window(130-4*13,120,"Sunset Design",MC_Black,MC_Light); Print_in_window(130-4*13,120,"Sunset Design",MC_Black,MC_Light);
@ -905,6 +898,7 @@ void Settings_display_config(T_Setting *setting, T_Config * conf, T_Special_butt
} }
} }
} }
Update_window_area(panel->Pos_X, panel->Pos_Y, panel->Width, panel->Height+1);
} }
void Settings_save_config(T_Config * conf) void Settings_save_config(T_Config * conf)
@ -959,10 +953,13 @@ void Button_Settings(void)
{"Merge movement:",1,&(selected_config.Mouse_merge_movement),0,100,4,NULL}, {"Merge movement:",1,&(selected_config.Mouse_merge_movement),0,100,4,NULL},
{"Double click speed:",2,&(selected_config.Double_click_speed),1,1999,4,NULL}, {"Double click speed:",2,&(selected_config.Double_click_speed),1,1999,4,NULL},
{"Double key speed:",2,&(selected_config.Double_key_speed),1,1999,4,NULL}, {"Double key speed:",2,&(selected_config.Double_key_speed),1,1999,4,NULL},
{"Mouse speed (fullscreen)",0,NULL,0,0,0,NULL}, //{"Mouse speed (fullscreen)",0,NULL,0,0,0,NULL},
{" horizontally:",1,&(selected_config.Mouse_sensitivity_index_x),1,4,0,Lookup_MouseSpeed}, //{" horizontally:",1,&(selected_config.Mouse_sensitivity_index_x),1,4,0,Lookup_MouseSpeed},
{" vertically:",1,&(selected_config.Mouse_sensitivity_index_y),1,4,0,Lookup_MouseSpeed}, //{" vertically:",1,&(selected_config.Mouse_sensitivity_index_y),1,4,0,Lookup_MouseSpeed},
{"Key to swap buttons:",2,&(selected_config.Swap_buttons),0,0,0,Lookup_SwapButtons}, {"Key to swap buttons:",2,&(selected_config.Swap_buttons),0,0,0,Lookup_SwapButtons},
{"",0,NULL,0,0,0,NULL},
{"",0,NULL,0,0,0,NULL},
{"",0,NULL,0,0,0,NULL},
{" --- Editing ---",0,NULL,0,0,0,NULL}, {" --- Editing ---",0,NULL,0,0,0,NULL},
{"Adjust brush pick:",1,&(selected_config.Adjust_brush_pick),0,1,0,Lookup_YesNo}, {"Adjust brush pick:",1,&(selected_config.Adjust_brush_pick),0,1,0,Lookup_YesNo},
@ -973,7 +970,7 @@ void Button_Settings(void)
{"Auto discontinuous:",1,&(selected_config.Auto_discontinuous),0,1,0,Lookup_YesNo}, {"Auto discontinuous:",1,&(selected_config.Auto_discontinuous),0,1,0,Lookup_YesNo},
{"Auto count colors:",1,&(selected_config.Auto_nb_used),0,1,0,Lookup_YesNo}, {"Auto count colors:",1,&(selected_config.Auto_nb_used),0,1,0,Lookup_YesNo},
{"Right click colorpick:",1,&(selected_config.Right_click_colorpick),0,1,0,Lookup_YesNo}, {"Right click colorpick:",1,&(selected_config.Right_click_colorpick),0,1,0,Lookup_YesNo},
{"",0,NULL,0,0,0,NULL}, {"Multi shortcuts:",1,&(selected_config.Allow_multi_shortcuts),0,1,0,Lookup_YesNo},
{"",0,NULL,0,0,0,NULL}, {"",0,NULL,0,0,0,NULL},
{" --- File selector ---",0,NULL,0,0,0,NULL}, {" --- File selector ---",0,NULL,0,0,0,NULL},
@ -1159,6 +1156,11 @@ void Button_Settings(void)
Spare_fileselector_position=0; Spare_fileselector_position=0;
Spare_fileselector_offset=0; Spare_fileselector_offset=0;
} }
if(Config.Allow_multi_shortcuts && !selected_config.Allow_multi_shortcuts)
{
// User just disabled multi shortcuts: make them unique now.
Remove_duplicate_shortcuts();
}
// Copy all // Copy all
Config=selected_config; Config=selected_config;
@ -1314,7 +1316,7 @@ void Button_Skins(void)
// Scroller for the fileselector // Scroller for the fileselector
(file_scroller = Window_set_scroller_button(155, FILESEL_Y - 1, 82, (file_scroller = Window_set_scroller_button(155, FILESEL_Y - 1, 82,
Skin_files_list.Nb_elements, 10, 0)), // 3 Skin_files_list.Nb_elements, 10, 0)), // 3
Draw_one_skin_name); // 4 Draw_one_skin_name, 2); // 4
skin_list->Cursor_position = Find_file_in_fileselector(&Skin_files_list, Config.Skin_file); skin_list->Cursor_position = Find_file_in_fileselector(&Skin_files_list, Config.Skin_file);
@ -1424,12 +1426,12 @@ void Button_Skins(void)
{ {
case 1 : // OK case 1 : // OK
break; break;
case 2 : // doesn't happen case 2 : // double-click file: do nothing
break; break;
case 3 : // doesn't happen case 3 : // doesn't happen
break; break;
case 4 : // a file is selected case 4 : // a file is selected
need_load=1; need_load=1;
break; break;
case 5 : // Font dropdown case 5 : // Font dropdown
selected_font = Window_attribute2; // Get the index of the chosen font. selected_font = Window_attribute2; // Get the index of the chosen font.
@ -4066,7 +4068,7 @@ void Refresh_airbrush_settings(byte selected_color, byte update_slider)
void Button_Airbrush_menu(void) void Button_Airbrush_menu(void)
{ {
static byte spray_init=0; static byte spray_init=1;
short clicked_button; short clicked_button;
char str[4]; char str[4];
word index; word index;
@ -4329,6 +4331,12 @@ void Button_Airbrush_menu(void)
Num2str(spray_init,str,2); Num2str(spray_init,str,2);
Window_input_content(input_init_button,str); Window_input_content(input_init_button,str);
} }
else if (spray_init<1)
{
spray_init=1;
Num2str(spray_init,str,2);
Window_input_content(input_init_button,str);
}
Display_cursor(); Display_cursor();
break; break;
} }
@ -4862,7 +4870,7 @@ void Button_Text(void)
Window_set_normal_button(54,160,60,14,"Cancel",0,1,KEY_ESC); // 12 Window_set_normal_button(54,160,60,14,"Cancel",0,1,KEY_ESC); // 12
// List of fonts // List of fonts
font_list = Window_set_list_button(font_list_button, font_scroller, Draw_one_font_name); // 13 font_list = Window_set_list_button(font_list_button, font_scroller, Draw_one_font_name, 2); // 13
// Restore its settings from last passage in screen // Restore its settings from last passage in screen
font_list->List_start = list_start; font_list->List_start = list_start;
font_list->Cursor_position = cursor_position; font_list->Cursor_position = cursor_position;
@ -4893,9 +4901,22 @@ void Button_Text(void)
if (str[0]) if (str[0])
preview_string=str; preview_string=str;
is_truetype=TrueType_font(selected_font_index); is_truetype=TrueType_font(selected_font_index);
Window_rectangle(8, 106, 273, 50,(antialias&&is_truetype)?MC_Black:Back_color);
free(new_brush); free(new_brush);
new_brush = Render_text(preview_string, selected_font_index, font_size, antialias, is_bold, is_italic, &new_width, &new_height, text_palette); new_brush = Render_text(preview_string, selected_font_index, font_size, antialias, is_bold, is_italic, &new_width, &new_height, text_palette);
// Background:
if (antialias&&is_truetype)
// Solid
Window_rectangle(8, 106, 273, 50,MC_Black);
else if (is_truetype)
{
long l = text_palette[Fore_color].R+text_palette[Fore_color].G+text_palette[Fore_color].B;
Window_rectangle(8, 106, 273, 50,l>128*3? MC_Black:MC_Light);
}
else
{
long l = text_palette[Back_color].R+text_palette[Back_color].G+text_palette[Back_color].B;
Window_rectangle(8, 106, 273, 50,l>128*3? MC_Light:MC_Black);
}
if (new_brush) if (new_brush)
{ {
if (!is_truetype || (is_truetype&&antialias)) if (!is_truetype || (is_truetype&&antialias))
@ -4932,7 +4953,7 @@ void Button_Text(void)
//if (r==Main_palette[color].R && g==Main_palette[color].G && b==Main_palette[color].B) //if (r==Main_palette[color].R && g==Main_palette[color].G && b==Main_palette[color].B)
// colmap[color]=color; // colmap[color]=color;
//else //else
colmap[color]=Best_color_perceptual(r,g,b); colmap[color]=Best_color_perceptual_except(r,g,b,Back_color);
} }
colmap[Back_color]=Back_color; colmap[Back_color]=Back_color;
@ -5022,10 +5043,6 @@ void Button_Text(void)
/* Cannot happen, event is catched by the list control */ /* Cannot happen, event is catched by the list control */
break; break;
case 6: // Selecteur de fonte
/* Cannot happen, event is catched by the list control */
break;
case 13: // Font selection case 13: // Font selection
selected_font_index = Window_attribute2; selected_font_index = Window_attribute2;
Hide_cursor(); Hide_cursor();
@ -5069,6 +5086,7 @@ void Button_Text(void)
break; break;
case 6: // Double-click font selector
case 11: // OK case 11: // OK
// Save the selector settings // Save the selector settings
list_start = font_list->List_start; list_start = font_list->List_start;

View File

@ -227,7 +227,7 @@ void Draw_menu_button(byte btn_number,byte pressed)
word y_pos; word y_pos;
byte current_menu; byte current_menu;
byte color; byte color;
char icon; signed char icon;
// Find in which menu the button is // Find in which menu the button is
for (current_menu = 0; current_menu < MENUBAR_COUNT; current_menu++) for (current_menu = 0; current_menu < MENUBAR_COUNT; current_menu++)
@ -2190,7 +2190,7 @@ void Window_dropdown_clear_items(T_Dropdown_button * dropdown)
// - entry_button is the textual area where the list values will be printed. // - entry_button is the textual area where the list values will be printed.
// - scroller is a scroller button attached to it // - scroller is a scroller button attached to it
T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroller_button * scroller, Func_draw_list_item draw_list_item) T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroller_button * scroller, Func_draw_list_item draw_list_item, byte color_index)
{ {
T_List_button *temp; T_List_button *temp;
@ -2201,6 +2201,7 @@ T_List_button * Window_set_list_button(T_Special_button * entry_button, T_Scroll
temp->Entry_button = entry_button; temp->Entry_button = entry_button;
temp->Scroller = scroller; temp->Scroller = scroller;
temp->Draw_list_item = draw_list_item; temp->Draw_list_item = draw_list_item;
temp->Color_index = color_index;
temp->Next=Window_list_button_list; temp->Next=Window_list_button_list;
Window_list_button_list=temp; Window_list_button_list=temp;
@ -2222,12 +2223,19 @@ void Window_redraw_list(T_List_button * list)
// Remaining rectangle under list // Remaining rectangle under list
i=list->Scroller->Nb_visibles-list->Scroller->Nb_elements; i=list->Scroller->Nb_visibles-list->Scroller->Nb_elements;
if (i>0) if (i>0)
{
byte color;
color = list->Color_index == 0 ? MC_Black :
(list->Color_index == 1 ? MC_Dark :
(list->Color_index == 2 ? MC_Light : MC_White));
Window_rectangle( Window_rectangle(
list->Entry_button->Pos_X, list->Entry_button->Pos_X,
list->Entry_button->Pos_Y+list->Scroller->Nb_elements*8, list->Entry_button->Pos_Y+list->Scroller->Nb_elements*8,
list->Entry_button->Width, list->Entry_button->Width,
i*8, i*8,
MC_Light); color);
}
} }
//----------------------- Ouverture d'un pop-up ----------------------- //----------------------- Ouverture d'un pop-up -----------------------
@ -3151,9 +3159,10 @@ short Window_get_button_shortcut(void)
short Window_clicked_button(void) short Window_clicked_button(void)
{ {
short Button; short Button;
byte old_mouse_k;
old_mouse_k=Mouse_K;
Get_input(20); Get_input(20);
// Handle clicks // Handle clicks
if (Mouse_K) if (Mouse_K)
{ {
@ -3180,6 +3189,9 @@ short Window_clicked_button(void)
{ {
short clicked_button; short clicked_button;
T_List_button * list; T_List_button * list;
static Uint32 time_last_click = 0;
static int last_list_number = -1;
Uint32 time_now;
// Check which controls was clicked (by rectangular area) // Check which controls was clicked (by rectangular area)
clicked_button = Window_get_clicked_button(); clicked_button = Window_get_clicked_button();
@ -3192,9 +3204,26 @@ short Window_clicked_button(void)
// Click in the textual part of a list. // Click in the textual part of a list.
short clicked_line; short clicked_line;
clicked_line = (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-list->Entry_button->Pos_Y)>>3; clicked_line = (((Mouse_Y-Window_pos_Y)/Menu_factor_Y)-list->Entry_button->Pos_Y)>>3;
if (clicked_line == list->Cursor_position || // Same as before if (clicked_line >= list->Scroller->Nb_elements) // Below last line
clicked_line >= list->Scroller->Nb_elements) // Below last line
return 0; return 0;
time_now = SDL_GetTicks();
if (clicked_line == list->Cursor_position)
{
// Double click check
if (old_mouse_k==0 && last_list_number==list->Number && time_now - time_last_click < Config.Double_click_speed)
{
time_last_click = time_now;
Input_sticky_control=0;
// Store the selected value as attribute2
Window_attribute2=list->List_start + list->Cursor_position;
// Return the control ID of the "special button" that covers the list.
return list->Entry_button->Number;
}
time_last_click = time_now;
last_list_number=list->Number;
// Already selected : don't activate anything
return 0;
}
Hide_cursor(); Hide_cursor();
// Redraw one item as disabled // Redraw one item as disabled

View File

@ -98,7 +98,7 @@ void Window_dropdown_clear_items(T_Dropdown_button * dropdown);
T_Dropdown_choice * Dropdown_activate(T_Dropdown_button *button, short off_x, short off_y); T_Dropdown_choice * Dropdown_activate(T_Dropdown_button *button, short off_x, short off_y);
T_List_button * Window_set_list_button(T_Special_button * entry_button, T_List_button * Window_set_list_button(T_Special_button * entry_button,
T_Scroller_button * scroller, Func_draw_list_item draw_list_item); T_Scroller_button * scroller, Func_draw_list_item draw_list_item, byte color_index);
void Window_redraw_list(T_List_button * list); void Window_redraw_list(T_List_button * list);
byte Window_click_in_rectangle(short start_x, short start_y, short end_x, byte Window_click_in_rectangle(short start_x, short start_y, short end_x,
short end_y); short end_y);

View File

@ -42,6 +42,10 @@
#include "palette.h" #include "palette.h"
#include "input.h" // Is_shortcut() #include "input.h" // Is_shortcut()
#include "help.h" // Window_help() #include "help.h" // Window_help()
#include "graph.h"
#include "filesel.h" // Read_list_of_drives()
#include "realpath.h"
/// Lua scripts bound to shortcut keys. /// Lua scripts bound to shortcut keys.
char * Bound_script[10]; char * Bound_script[10];
@ -148,11 +152,19 @@ void Update_colors_during_script(void)
} }
} }
/// Paint a pixel in image without updating the screen
void Pixel_figure_no_screen(short x_pos,short y_pos,byte color)
{
if (x_pos>0 && y_pos >0 && x_pos<Main_image_width && y_pos<Main_image_height)
Pixel_in_current_screen(x_pos,y_pos,color,0);
}
// Wrapper functions to call C from Lua // Wrapper functions to call C from Lua
int L_SetBrushSize(lua_State* L) int L_SetBrushSize(lua_State* L)
{ {
int i;
int w; int w;
int h; int h;
int nb_args=lua_gettop(L); int nb_args=lua_gettop(L);
@ -168,10 +180,12 @@ int L_SetBrushSize(lua_State* L)
Brush_was_altered=1; Brush_was_altered=1;
// Fill with Back_color // Fill with Back_color
memset(Brush_original_pixels,Back_color,(long)Brush_width*Brush_height); memset(Brush_original_pixels,Back_color,(long)Brush_width*Brush_height);
// Grab palette memset(Brush,Back_color,(long)Brush_width*Brush_height);
// Adopt the current palette.
memcpy(Brush_original_palette, Main_palette,sizeof(T_Palette)); memcpy(Brush_original_palette, Main_palette,sizeof(T_Palette));
// Remap (no change) for (i=0; i<256; i++)
Remap_brush(); Brush_colormap[i]=i;
//--
// Center the handle // Center the handle
Brush_offset_X=(Brush_width>>1); Brush_offset_X=(Brush_width>>1);
@ -345,6 +359,133 @@ int L_PutPicturePixel(lua_State* L)
return 0; // no values returned for lua return 0; // no values returned for lua
} }
int L_DrawLine(lua_State* L)
{
int x1, y1, x2, y2, c;
int nb_args = lua_gettop(L);
LUA_ARG_LIMIT(5, "drawline");
LUA_ARG_NUMBER(1, "drawline", x1, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(2, "drawline", y1, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(3, "drawline", x2, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(4, "drawline", y2, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(5, "drawline", c, INT_MIN, INT_MAX);
Pixel_figure = (void (*) (word,word,byte))Pixel_figure_no_screen;
Draw_line_general(x1, y1, x2, y2, c);
return 0;
}
int L_DrawFilledRect(lua_State* L)
{
int x1, y1, x2, y2, c;
int min_x,min_y,max_x,max_y, x_pos, y_pos;
int nb_args = lua_gettop(L);
LUA_ARG_LIMIT(5, "drawfilledrect");
LUA_ARG_NUMBER(1, "drawfilledrect", x1, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(2, "drawfilledrect", y1, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(3, "drawfilledrect", x2, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(4, "drawfilledrect", y2, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(5, "drawfilledrect", c, INT_MIN, INT_MAX);
// Put bounds in ascending order
if (x2>x1)
{
min_x=x1;
max_x=x2;
}
else
{
min_x=x2;
max_x=x1;
}
if (y2>y1)
{
min_y=y1;
max_y=y2;
}
else
{
min_y=y2;
max_y=y1;
}
// Clipping limits
if (max_x>Main_image_width)
max_x=Main_image_width-1;
if (max_y>Main_image_height)
max_y=Main_image_height-1;
if (min_x<0)
min_x=0;
if (min_y<0)
min_y=0;
// Perform drawing
for (y_pos=min_y; y_pos<=max_y;y_pos++)
for (x_pos=min_x; x_pos<=max_x;x_pos++)
Pixel_in_current_screen(x_pos,y_pos,c,0);
return 0;
}
int L_DrawCircle(lua_State* L)
{
int x1, y1, r, c;
int nb_args = lua_gettop(L);
LUA_ARG_LIMIT(4, "drawcircle");
LUA_ARG_NUMBER(1, "drawcircle", x1, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(2, "drawcircle", y1, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(3, "drawcircle", r, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(4, "drawcircle", c, INT_MIN, INT_MAX);
Pixel_figure = (void (*) (word,word,byte))Pixel_figure_no_screen;
Circle_limit = r*r;
Draw_empty_circle_general(x1, y1, r, c);
return 0;
}
int L_DrawDisk(lua_State* L)
{
int center_x, center_y, r, c;
long circle_limit;
short x_pos,y_pos;
short min_x,max_x,min_y,max_y;
int nb_args = lua_gettop(L);
LUA_ARG_LIMIT(4, "drawdisk");
LUA_ARG_NUMBER(1, "drawdisk", center_x, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(2, "drawdisk", center_y, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(3, "drawdisk", r, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(4, "drawdisk", c, INT_MIN, INT_MAX);
circle_limit = r*r;
// Compute clipping limits
min_x=center_x-r<0 ? 0 : center_x-r;
max_x=center_x+r>=Main_image_width? Main_image_width-1 : center_x+r;
min_y=center_y-r<0 ? 0 : center_y-r;
max_y=center_y+r>=Main_image_height? Main_image_height-1 : center_y+r;
for (y_pos=min_y;y_pos<=max_y;y_pos++)
for (x_pos=min_x;x_pos<=max_x;x_pos++)
Pixel_in_current_screen(x_pos,y_pos,c,0);
return 0;
}
int L_GetPicturePixel(lua_State* L) int L_GetPicturePixel(lua_State* L)
{ {
int x; int x;
@ -1089,11 +1230,16 @@ int L_UpdateScreen(lua_State* L)
int L_StatusMessage(lua_State* L) int L_StatusMessage(lua_State* L)
{ {
const char* msg; const char* msg;
char* msg2;
int nb_args = lua_gettop(L); int nb_args = lua_gettop(L);
LUA_ARG_LIMIT(1,"statusmessage"); LUA_ARG_LIMIT(1,"statusmessage");
LUA_ARG_STRING(1, "statusmessage", msg); LUA_ARG_STRING(1, "statusmessage", msg);
Print_in_menu(msg,0); msg2 = strdup(msg);
if(strlen(msg)>24)
msg2[24] = 0; // Cut off long messages
Print_in_menu(msg2,0);
free(msg2);
return 0; return 0;
} }
@ -1125,15 +1271,23 @@ void Draw_script_name(word x, word y, word index, byte highlighted)
current_item = Get_item_by_index(&Scripts_selector, index); current_item = Get_item_by_index(&Scripts_selector, index);
if (current_item->Type==1) // Directories if (current_item->Type==0) // Files
{ {
fg=(highlighted)?MC_Black:MC_Dark; fg=(highlighted)?MC_White:MC_Light;
bg=(highlighted)?MC_Dark:MC_Light; bg=(highlighted)?MC_Dark:MC_Black;
} }
else // Files else if (current_item->Type==1) // Directories
{ {
fg=MC_Black; fg=(highlighted)?MC_Light:MC_Dark;
bg=(highlighted)?MC_Dark:MC_Light; bg=(highlighted)?MC_Dark:MC_Black;
}
else // Drives
{
fg=(highlighted)?MC_Light:MC_Dark;
bg=(highlighted)?MC_Dark:MC_Black;
Window_display_icon_sprite(x,y,current_item->Icon);
x+=8;
} }
Print_in_window(x, y, current_item->Short_name, fg,bg); Print_in_window(x, y, current_item->Short_name, fg,bg);
@ -1144,26 +1298,24 @@ void Draw_script_name(word x, word y, word index, byte highlighted)
/// ///
/// Displays first lines of comments from a lua script in the window. /// Displays first lines of comments from a lua script in the window.
void Draw_script_information(T_Fileselector_item * script_item) void Draw_script_information(T_Fileselector_item * script_item, const char *full_directory)
{ {
FILE *script_file; FILE *script_file;
char full_name[MAX_PATH_CHARACTERS];
char text_block[3][DESC_WIDTH+1]; char text_block[3][DESC_WIDTH+1];
int x, y; int x, y;
int i; int i;
// Blank the target area // Blank the target area
Window_rectangle(7, FILESEL_Y + 89, DESC_WIDTH*6+2, 4*8, MC_Black); Window_rectangle(7, FILESEL_Y + 89, DESC_WIDTH*6+2, 4*8, MC_Black);
if (script_item && script_item->Full_name && script_item->Full_name[0]!='\0') if (script_item && script_item->Type==0 && script_item->Full_name && script_item->Full_name[0]!='\0')
{ {
strcpy(full_name, Data_directory); char full_name[MAX_PATH_CHARACTERS];
strcat(full_name, "scripts/"); strcpy(full_name, full_directory);
strcat(full_name, script_item->Full_name); Append_path(full_name, script_item->Full_name, NULL);
x=0; x=0;
y=0; y=0;
text_block[0][0] = text_block[1][0] = text_block[2][0] = '\0'; text_block[0][0] = text_block[1][0] = text_block[2][0] = '\0';
// Start reading // Start reading
script_file = fopen(full_name, "r"); script_file = fopen(full_name, "r");
@ -1209,7 +1361,7 @@ void Draw_script_information(T_Fileselector_item * script_item)
// Display a line with the keyboard shortcut // Display a line with the keyboard shortcut
Print_help(8, FILESEL_Y + 89+24, "Key:", 'N', 0, 0); Print_help(8, FILESEL_Y + 89+24, "Key:", 'N', 0, 0);
for (i=0; i<10; i++) for (i=0; i<10; i++)
if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], script_item->Full_name)) if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], full_name))
break; break;
if (i<10) if (i<10)
@ -1245,8 +1397,8 @@ void Add_script(const char *name, byte is_file, byte is_directory, byte is_hidde
if (len<=4 || strcasecmp(file_name+len-4, ".lua")) if (len<=4 || strcasecmp(file_name+len-4, ".lua"))
return; return;
// Hidden // Hidden
//if (is_hidden && !Config.Show_hidden_files) if (is_hidden && !Config.Show_hidden_files)
// return; return;
Add_element_to_list(&Scripts_selector, file_name, Format_filename(file_name, NAME_WIDTH+1, 0), 0, ICON_NONE); Add_element_to_list(&Scripts_selector, file_name, Format_filename(file_name, NAME_WIDTH+1, 0), 0, ICON_NONE);
} }
@ -1255,9 +1407,12 @@ void Add_script(const char *name, byte is_file, byte is_directory, byte is_hidde
// Ignore current directory // Ignore current directory
if ( !strcmp(file_name, ".")) if ( !strcmp(file_name, "."))
return; return;
// Ignore parent directory entry
if (!strcmp(file_name, PARENT_DIR))
return;
// Hidden // Hidden
//if (is_hidden && !Config.Show_hidden_directories) if (is_hidden && !Config.Show_hidden_directories)
// return; return;
Add_element_to_list(&Scripts_selector, file_name, Format_filename(file_name, NAME_WIDTH+1, 1), 1, ICON_NONE); Add_element_to_list(&Scripts_selector, file_name, Format_filename(file_name, NAME_WIDTH+1, 1), 1, ICON_NONE);
} }
@ -1268,7 +1423,7 @@ void Highlight_script(T_Fileselector *selector, T_List_button *list, const char
short index; short index;
index=Find_file_in_fileselector(selector, selected_file); index=Find_file_in_fileselector(selector, selected_file);
Locate_list_item(list, selector, index); Locate_list_item(list, index);
} }
static char Last_run_script[MAX_PATH_CHARACTERS]=""; static char Last_run_script[MAX_PATH_CHARACTERS]="";
@ -1280,61 +1435,85 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
lua_State* L; lua_State* L;
const char* message; const char* message;
byte old_cursor_shape=Cursor_shape; byte old_cursor_shape=Cursor_shape;
char scriptdir[MAX_PATH_CHARACTERS]; char buf[MAX_PATH_CHARACTERS];
strcpy(scriptdir, Data_directory);
strcat(scriptdir, "scripts/");
// Some scripts are slow // Some scripts are slow
Cursor_shape=CURSOR_SHAPE_HOURGLASS; Cursor_shape=CURSOR_SHAPE_HOURGLASS;
Display_cursor(); Display_cursor();
Flush_update(); Flush_update();
chdir(scriptdir);
if (script_subdirectory && script_subdirectory[0]!='\0') if (script_subdirectory && script_subdirectory[0]!='\0')
{ {
sprintf(Last_run_script, "%s%s%s", script_subdirectory, PATH_SEPARATOR, script_filename); strcpy(Last_run_script, script_subdirectory);
Append_path(Last_run_script, script_filename, NULL);
} }
else else
{ {
strcpy(Last_run_script, script_filename); strcpy(Last_run_script, script_filename);
} }
// This chdir is for the script's sake. Grafx2 itself will (try to)
// not rely on what is the system's current directory.
Extract_path(buf,Last_run_script);
chdir(buf);
L = lua_open(); L = lua_open();
putenv("LUA_PATH=libs\\?.lua");
strcpy(buf, "LUA_PATH=");
strcat(buf, Data_directory);
Append_path(buf+9, "scripts", NULL);
Append_path(buf+9, "libs", NULL);
Append_path(buf+9, "?.lua", NULL);
putenv(buf);
// writing and reading pixels
lua_register(L,"putbrushpixel",L_PutBrushPixel); lua_register(L,"putbrushpixel",L_PutBrushPixel);
lua_register(L,"putpicturepixel",L_PutPicturePixel);
lua_register(L, "drawline",L_DrawLine);
lua_register(L, "drawfilledrect",L_DrawFilledRect);
lua_register(L, "drawcircle",L_DrawCircle);
lua_register(L, "drawdisk",L_DrawDisk);
lua_register(L,"getbrushpixel",L_GetBrushPixel); lua_register(L,"getbrushpixel",L_GetBrushPixel);
lua_register(L,"getbrushbackuppixel",L_GetBrushBackupPixel); lua_register(L,"getbrushbackuppixel",L_GetBrushBackupPixel);
lua_register(L,"putpicturepixel",L_PutPicturePixel);
lua_register(L,"getpicturepixel",L_GetPicturePixel); lua_register(L,"getpicturepixel",L_GetPicturePixel);
lua_register(L,"getlayerpixel",L_GetLayerPixel); lua_register(L,"getlayerpixel",L_GetLayerPixel);
lua_register(L,"getbackuppixel",L_GetBackupPixel); lua_register(L,"getbackuppixel",L_GetBackupPixel);
lua_register(L,"getsparelayerpixel",L_GetSpareLayerPixel);
lua_register(L,"getsparepicturepixel",L_GetSparePicturePixel);
// resizing stuff
lua_register(L,"setbrushsize",L_SetBrushSize); lua_register(L,"setbrushsize",L_SetBrushSize);
lua_register(L,"setpicturesize",L_SetPictureSize); lua_register(L,"setpicturesize",L_SetPictureSize);
lua_register(L,"getbrushsize",L_GetBrushSize); lua_register(L,"getbrushsize",L_GetBrushSize);
lua_register(L,"getpicturesize",L_GetPictureSize); lua_register(L,"getpicturesize",L_GetPictureSize);
lua_register(L,"getsparepicturesize",L_GetSparePictureSize);
// color and palette
lua_register(L,"setcolor",L_SetColor); lua_register(L,"setcolor",L_SetColor);
lua_register(L,"setforecolor",L_SetForeColor);
lua_register(L,"setbackcolor",L_SetBackColor);
lua_register(L,"getcolor",L_GetColor); lua_register(L,"getcolor",L_GetColor);
lua_register(L,"getbackupcolor",L_GetBackupColor); lua_register(L,"getbackupcolor",L_GetBackupColor);
lua_register(L,"matchcolor",L_MatchColor);
lua_register(L,"getbrushtransparentcolor",L_GetBrushTransparentColor); lua_register(L,"getbrushtransparentcolor",L_GetBrushTransparentColor);
lua_register(L,"getsparecolor",L_GetSpareColor);
lua_register(L,"getsparetranscolor",L_GetSpareTransColor);
lua_register(L,"getforecolor",L_GetForeColor);
lua_register(L,"getbackcolor",L_GetBackColor);
lua_register(L,"gettranscolor",L_GetTransColor);
lua_register(L,"matchcolor",L_MatchColor);
// ui
lua_register(L,"inputbox",L_InputBox); lua_register(L,"inputbox",L_InputBox);
lua_register(L,"messagebox",L_MessageBox); lua_register(L,"messagebox",L_MessageBox);
lua_register(L,"statusmessage",L_StatusMessage); lua_register(L,"statusmessage",L_StatusMessage);
lua_register(L,"selectbox",L_SelectBox); lua_register(L,"selectbox",L_SelectBox);
lua_register(L,"getforecolor",L_GetForeColor);
lua_register(L,"getbackcolor",L_GetBackColor); // misc. stuff
lua_register(L,"setforecolor",L_SetForeColor);
lua_register(L,"setbackcolor",L_SetBackColor);
lua_register(L,"gettranscolor",L_GetTransColor);
lua_register(L,"getsparepicturesize",L_GetSparePictureSize);
lua_register(L,"getsparelayerpixel",L_GetSpareLayerPixel);
lua_register(L,"getsparepicturepixel",L_GetSparePicturePixel);
lua_register(L,"getsparecolor",L_GetSpareColor);
lua_register(L,"getsparetranscolor",L_GetSpareTransColor);
lua_register(L,"clearpicture",L_ClearPicture); lua_register(L,"clearpicture",L_ClearPicture);
lua_register(L,"wait",L_Wait); lua_register(L,"wait",L_Wait);
lua_register(L,"waitbreak",L_WaitBreak); lua_register(L,"waitbreak",L_WaitBreak);
@ -1407,6 +1586,7 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
Brush_backup=NULL; Brush_backup=NULL;
Update_colors_during_script(); Update_colors_during_script();
End_of_modification(); End_of_modification();
Print_in_menu(" ",0);
lua_close(L); lua_close(L);
@ -1467,20 +1647,19 @@ void Repeat_script(void)
Run_script(NULL, Last_run_script); Run_script(NULL, Last_run_script);
} }
void Set_script_shortcut(T_Fileselector_item * script_item) void Set_script_shortcut(T_Fileselector_item * script_item, const char *full_directory)
{ {
int i; int i;
char full_name[MAX_PATH_CHARACTERS]; char full_name[MAX_PATH_CHARACTERS];
if (script_item && script_item->Full_name && script_item->Full_name[0]!='\0') if (script_item && script_item->Full_name && script_item->Full_name[0]!='\0')
{ {
strcpy(full_name, Data_directory); strcpy(full_name, full_directory);
strcat(full_name, "scripts/"); Append_path(full_name, script_item->Full_name, NULL);
strcat(full_name, script_item->Full_name);
// Find if it already has a shortcut // Find if it already has a shortcut
for (i=0; i<10; i++) for (i=0; i<10; i++)
if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], script_item->Full_name)) if (Bound_script[i]!=NULL && !strcmp(Bound_script[i], full_name))
break; break;
if (i<10) if (i<10)
{ {
@ -1497,7 +1676,7 @@ void Set_script_shortcut(T_Fileselector_item * script_item)
if (i<10) if (i<10)
{ {
free(Bound_script[i]); free(Bound_script[i]);
Bound_script[i]=strdup(script_item->Full_name); Bound_script[i]=strdup(full_name);
} }
else else
{ {
@ -1514,33 +1693,42 @@ void Set_script_shortcut(T_Fileselector_item * script_item)
} }
// Refresh display // Refresh display
Hide_cursor(); Hide_cursor();
Draw_script_information(script_item); Draw_script_information(script_item, full_directory);
Display_cursor(); Display_cursor();
} }
} }
void Reload_scripts_list(void)
{
// Reinitialize the list
Free_fileselector_list(&Scripts_selector);
if (Config.Scripts_directory[0]=='\0')
{
Read_list_of_drives(&Scripts_selector,NAME_WIDTH+1);
}
else
{
Add_element_to_list(&Scripts_selector, PARENT_DIR, Format_filename(PARENT_DIR, NAME_WIDTH+1, 1), 1, ICON_NONE);
// Add each found file to the list
For_each_directory_entry(Config.Scripts_directory, Add_script);
}
// Sort it
Sort_list_of_files(&Scripts_selector);
//
}
void Button_Brush_Factory(void) void Button_Brush_Factory(void)
{ {
static char selected_file[MAX_PATH_CHARACTERS]=""; static char selected_file[MAX_PATH_CHARACTERS]="";
static char sub_directory[MAX_PATH_CHARACTERS]="";
short clicked_button; short clicked_button;
T_List_button* scriptlist; T_List_button* scriptlist;
T_Scroller_button* scriptscroll; T_Scroller_button* scriptscroll;
T_Special_button* scriptarea; T_Special_button* scriptarea;
char scriptdir[MAX_PATH_CHARACTERS];
T_Fileselector_item *item; T_Fileselector_item *item;
int last_selected_item=-1;
// Reinitialize the list Reload_scripts_list();
Free_fileselector_list(&Scripts_selector);
strcpy(scriptdir, Data_directory);
strcat(scriptdir, "scripts/");
strcat(scriptdir, sub_directory);
// Add each found file to the list
For_each_directory_entry(scriptdir, Add_script);
// Sort it
Sort_list_of_files(&Scripts_selector);
//
Open_window(33+8*NAME_WIDTH, 180, "Brush Factory"); Open_window(33+8*NAME_WIDTH, 180, "Brush Factory");
@ -1548,11 +1736,11 @@ void Button_Brush_Factory(void)
Window_display_frame_in(6, FILESEL_Y - 2, NAME_WIDTH*8+4, 84); // File selector Window_display_frame_in(6, FILESEL_Y - 2, NAME_WIDTH*8+4, 84); // File selector
// Fileselector // Fileselector
scriptarea=Window_set_special_button(8, FILESEL_Y + 1, NAME_WIDTH*8, 80); // 2 scriptarea=Window_set_special_button(8, FILESEL_Y + 0, NAME_WIDTH*8, 80); // 2
// Scroller for the fileselector // Scroller for the fileselector
scriptscroll = Window_set_scroller_button(NAME_WIDTH*8+14, FILESEL_Y - 1, 82, scriptscroll = Window_set_scroller_button(NAME_WIDTH*8+14, FILESEL_Y - 1, 82,
Scripts_selector.Nb_elements,10, 0); // 3 Scripts_selector.Nb_elements,10, 0); // 3
scriptlist = Window_set_list_button(scriptarea,scriptscroll,Draw_script_name); // 4 scriptlist = Window_set_list_button(scriptarea,scriptscroll,Draw_script_name, 0); // 4
Window_set_normal_button(10, 149, 67, 14, "Run", 0, 1, SDLK_RETURN); // 5 Window_set_normal_button(10, 149, 67, 14, "Run", 0, 1, SDLK_RETURN); // 5
@ -1569,17 +1757,23 @@ void Button_Brush_Factory(void)
Window_redraw_list(scriptlist); Window_redraw_list(scriptlist);
Draw_script_information(Get_item_by_index(&Scripts_selector, Draw_script_information(Get_item_by_index(&Scripts_selector,
scriptlist->List_start + scriptlist->Cursor_position)); scriptlist->List_start + scriptlist->Cursor_position), Config.Scripts_directory);
Update_window_area(0, 0, Window_width, Window_height); Update_window_area(0, 0, Window_width, Window_height);
Display_cursor(); Display_cursor();
// Wait for mouse release (needed for example after a double-click
// that navigates to a subdirectory)
while (last_selected_item==-1 && Mouse_K)
{
Get_input(20);
}
Reset_quicksearch(); Reset_quicksearch();
do do
{ {
clicked_button = Window_clicked_button(); clicked_button = Window_clicked_button();
if (Key==SDLK_BACKSPACE && sub_directory[0]!='\0') if (Key==SDLK_BACKSPACE && Config.Scripts_directory[0]!='\0')
{ {
// Make it select first entry (parent directory) // Make it select first entry (parent directory)
scriptlist->List_start=0; scriptlist->List_start=0;
@ -1598,34 +1792,20 @@ void Button_Brush_Factory(void)
switch (clicked_button) switch (clicked_button)
{ {
case 4: case 2: // Double-click an entry in script list
clicked_button=5;
break;
case 4: // Select script
last_selected_item = scriptlist->List_start + scriptlist->Cursor_position;
Hide_cursor(); Hide_cursor();
Draw_script_information(Get_item_by_index(&Scripts_selector, Draw_script_information(Get_item_by_index(&Scripts_selector,
scriptlist->List_start + scriptlist->Cursor_position)); scriptlist->List_start + scriptlist->Cursor_position), Config.Scripts_directory);
Display_cursor(); Display_cursor();
{
// Test double-click
static long time_click = 0;
static int last_selected_item=-1;
static long time_previous;
time_previous = time_click;
time_click = SDL_GetTicks();
if (scriptlist->List_start + scriptlist->Cursor_position == last_selected_item)
{
if (time_click - time_previous < Config.Double_click_speed)
clicked_button=5;
}
else
{
last_selected_item=scriptlist->List_start + scriptlist->Cursor_position;
}
}
break; break;
case 6: case 6:
Set_script_shortcut(Get_item_by_index(&Scripts_selector, Set_script_shortcut(Get_item_by_index(&Scripts_selector,
scriptlist->List_start + scriptlist->Cursor_position)); scriptlist->List_start + scriptlist->Cursor_position), Config.Scripts_directory);
break; break;
default: default:
@ -1652,60 +1832,30 @@ void Button_Brush_Factory(void)
if (item->Type==0) // File if (item->Type==0) // File
{ {
strcpy(selected_file, sub_directory); strcpy(selected_file, item->Full_name);
strcat(selected_file, item->Full_name);
break; break;
} }
else if (item->Type==1) // Directory else if (item->Type==1 || item->Type==2) // Directory
{ {
if (!strcmp(item->Full_name,PARENT_DIR)) if (item->Type==2)
{ {
// Going up one directory // Selecting one drive root
long len; strcpy(selected_file, PARENT_DIR);
char * slash_pos; strcat(Config.Scripts_directory, item->Full_name);
// Remove trailing slash
len=strlen(sub_directory);
if (len && !strcmp(sub_directory+len-1,PATH_SEPARATOR))
sub_directory[len-1]='\0';
slash_pos=Find_last_slash(sub_directory);
if (slash_pos)
{
strcpy(selected_file, slash_pos+1);
*slash_pos='\0';
}
else
{
strcpy(selected_file, sub_directory);
sub_directory[0]='\0';
}
} }
else else
{ {
// Going down one directory // Going down one or up by one directory
strcpy(selected_file, PARENT_DIR); Append_path(Config.Scripts_directory, item->Full_name, selected_file);
strcat(sub_directory, item->Full_name);
strcat(sub_directory, PATH_SEPARATOR);
} }
// No break: going back up to beginning of loop // No break: going back up to beginning of loop
// Reinitialize the list Reload_scripts_list();
Free_fileselector_list(&Scripts_selector);
strcpy(scriptdir, Data_directory);
strcat(scriptdir, "scripts/");
strcat(scriptdir, sub_directory);
// Add each found file to the list
For_each_directory_entry(scriptdir, Add_script);
// Sort it
Sort_list_of_files(&Scripts_selector);
//
scriptlist->Scroller->Nb_elements=Scripts_selector.Nb_elements; scriptlist->Scroller->Nb_elements=Scripts_selector.Nb_elements;
Compute_slider_cursor_length(scriptlist->Scroller); Compute_slider_cursor_length(scriptlist->Scroller);
last_selected_item = -1;
Hide_cursor(); Hide_cursor();
} }
} }
@ -1715,7 +1865,7 @@ void Button_Brush_Factory(void)
if (clicked_button == 5) // Run the script if (clicked_button == 5) // Run the script
{ {
Run_script("", selected_file); Run_script(Config.Scripts_directory, selected_file);
} }
else else
{ {

View File

@ -28,6 +28,9 @@
#ifndef __no_pnglib__ #ifndef __no_pnglib__
#include <png.h> #include <png.h>
#if !defined(PNG_HAVE_PLTE)
#define PNG_HAVE_PLTE 0x02
#endif
#if (PNG_LIBPNG_VER_MAJOR <= 1) && (PNG_LIBPNG_VER_MINOR < 4) #if (PNG_LIBPNG_VER_MAJOR <= 1) && (PNG_LIBPNG_VER_MINOR < 4)
// Compatibility layer to allow us to use libng 1.4 or any older one. // Compatibility layer to allow us to use libng 1.4 or any older one.
@ -2079,7 +2082,6 @@ void Load_GIF(T_IO_Context * context)
break; break;
case 0x2C: // Local Image Descriptor case 0x2C: // Local Image Descriptor
{ {
// Si on a deja lu une image, c'est une GIF animée ou bizarroide, on sort.
if (number_LID!=0) if (number_LID!=0)
{ {
// This a second layer/frame, or more. // This a second layer/frame, or more.
@ -2195,14 +2197,18 @@ void Load_GIF(T_IO_Context * context)
} }
} }
else else
{
File_error=2; File_error=2;
break;
}
} // Code End-Of-Information ou erreur de fichier rencontré } // Code End-Of-Information ou erreur de fichier rencontré
if (File_error==2 && GIF_pos_X==0 && GIF_pos_Y==IDB.Image_height)
File_error=0;
/*Close_lecture();*/ /*Close_lecture();*/
if (File_error>=0) if (File_error>=0)
if ( /* (GIF_pos_X!=0) || */ if ( /* (GIF_pos_X!=0) || */
( ( (!GIF_interlaced) && (GIF_pos_Y!=IDB.Image_height) ) || ( ( (!GIF_interlaced) && (GIF_pos_Y!=IDB.Image_height) && (GIF_pos_X!=0)) ||
( (GIF_interlaced) && (!GIF_finished_interlaced_image) ) ( (GIF_interlaced) && (!GIF_finished_interlaced_image) )
) ) ) )
File_error=2; File_error=2;
@ -2214,7 +2220,8 @@ void Load_GIF(T_IO_Context * context)
break; break;
} }
// Lecture du code de fonction suivant: // Lecture du code de fonction suivant:
Read_byte(GIF_file,&block_identifier); if (!Read_byte(GIF_file,&block_identifier))
File_error=2;
} }
} // Le fichier contenait un LSDB } // Le fichier contenait un LSDB
else else

View File

@ -29,20 +29,15 @@
#include <proto/dos.h> #include <proto/dos.h>
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#elif defined (__MINT__) #elif defined (__MINT__)
#include <mint/sysbind.h> #include <mint/sysbind.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#elif defined(__WIN32__) #elif defined(__WIN32__)
#include <dirent.h> #include <dirent.h>
#include <windows.h> #include <windows.h>
#include <commdlg.h> #include <commdlg.h>
#define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN)
#else #else
#include <dirent.h> #include <dirent.h>
#define isHidden(x) ((x)->d_name[0]=='.')
#endif #endif
#include <stdlib.h> #include <stdlib.h>
@ -393,7 +388,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format)
(!strcmp(entry->d_name, PARENT_DIR) || (!strcmp(entry->d_name, PARENT_DIR) ||
// ou qu'il n'est pas caché // ou qu'il n'est pas caché
Config.Show_hidden_directories || Config.Show_hidden_directories ||
!isHidden(entry))) !File_is_hidden(entry->d_name, entry->d_name)))
{ {
// On rajoute le répertoire à la liste // On rajoute le répertoire à la liste
Add_element_to_list(list, entry->d_name, Format_filename(entry->d_name, 19, 1), 1, ICON_NONE); Add_element_to_list(list, entry->d_name, Format_filename(entry->d_name, 19, 1), 1, ICON_NONE);
@ -401,7 +396,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format)
} }
else if (S_ISREG(Infos_enreg.st_mode) && //Il s'agit d'un fichier else if (S_ISREG(Infos_enreg.st_mode) && //Il s'agit d'un fichier
(Config.Show_hidden_files || //Il n'est pas caché (Config.Show_hidden_files || //Il n'est pas caché
!isHidden(entry))) !File_is_hidden(entry->d_name, entry->d_name)))
{ {
const char * ext = filter; const char * ext = filter;
while (ext!=NULL) while (ext!=NULL)
@ -479,7 +474,7 @@ void bstrtostr( BSTR in, STRPTR out, TEXT max )
#endif #endif
// -- Lecture d'une liste de lecteurs / volumes ----------------------------- // -- Lecture d'une liste de lecteurs / volumes -----------------------------
void Read_list_of_drives(T_Fileselector *list) void Read_list_of_drives(T_Fileselector *list, byte name_length)
{ {
// Empty the current content of fileselector: // Empty the current content of fileselector:
@ -500,7 +495,7 @@ void Read_list_of_drives(T_Fileselector *list)
{ {
bstrtostr( dl->dol_Name, tmp, 254 ); bstrtostr( dl->dol_Name, tmp, 254 );
strcat( tmp, ":" ); strcat( tmp, ":" );
Add_element_to_list(list, tmp, Format_filename(tmp, 19, 2), 2, ICON_NONE ); Add_element_to_list(list, tmp, Format_filename(tmp, name_length, 2), 2, ICON_NONE );
list->Nb_directories++; list->Nb_directories++;
} }
UnLockDosList( LDF_VOLUMES | LDF_READ ); UnLockDosList( LDF_VOLUMES | LDF_READ );
@ -544,7 +539,7 @@ void Read_list_of_drives(T_Fileselector *list)
break; break;
} }
drive_name[0]='A'+bit_index; drive_name[0]='A'+bit_index;
Add_element_to_list(list, drive_name, Format_filename(drive_name,18,2), 2, icon); Add_element_to_list(list, drive_name, Format_filename(drive_name,name_length-1,2), 2, icon);
list->Nb_directories++; list->Nb_directories++;
drive_index++; drive_index++;
} }
@ -561,7 +556,7 @@ void Read_list_of_drives(T_Fileselector *list)
if ( (1 << bit_index) & drive_bits ) if ( (1 << bit_index) & drive_bits )
{ {
drive_name[0]='A'+bit_index; drive_name[0]='A'+bit_index;
Add_element_to_list(list, drive_name,Format_filename(drive_name,19,2),2,ICON_NONE); Add_element_to_list(list, drive_name,Format_filename(drive_name,name_length,2),2,ICON_NONE);
list->Nb_directories++; list->Nb_directories++;
drive_index++; drive_index++;
} }
@ -583,11 +578,11 @@ void Read_list_of_drives(T_Fileselector *list)
#else #else
char * home_dir = getenv("HOME"); char * home_dir = getenv("HOME");
#endif #endif
Add_element_to_list(list, "/", Format_filename("/",19,2), 2, ICON_NONE); Add_element_to_list(list, "/", Format_filename("/",name_length,2), 2, ICON_NONE);
list->Nb_directories++; list->Nb_directories++;
if(home_dir) if(home_dir)
{ {
Add_element_to_list(list, home_dir, Format_filename(home_dir, 19, 2), 2, ICON_NONE); Add_element_to_list(list, home_dir, Format_filename(home_dir, name_length, 2), 2, ICON_NONE);
list->Nb_directories++; list->Nb_directories++;
} }
@ -597,7 +592,7 @@ void Read_list_of_drives(T_Fileselector *list)
{ {
if(mount_points_list->me_dummy == 0 && strcmp(mount_points_list->me_mountdir,"/") && strcmp(mount_points_list->me_mountdir,"/home")) if(mount_points_list->me_dummy == 0 && strcmp(mount_points_list->me_mountdir,"/") && strcmp(mount_points_list->me_mountdir,"/home"))
{ {
Add_element_to_list(list, mount_points_list->me_mountdir, Format_filename(mount_points_list->me_mountdir, 19, 2), 2, ICON_NONE); Add_element_to_list(list, mount_points_list->me_mountdir, Format_filename(mount_points_list->me_mountdir, name_length, 2), 2, ICON_NONE);
list->Nb_directories++; list->Nb_directories++;
} }
next = mount_points_list -> me_next; next = mount_points_list -> me_next;
@ -1227,7 +1222,7 @@ short Quicksearch(T_Fileselector *selector)
} }
// Translated from Highlight_file // Translated from Highlight_file
void Locate_list_item(T_List_button * list, T_Fileselector * selector, short selected_item) void Locate_list_item(T_List_button * list, short selected_item)
{ {
// Safety bounds // Safety bounds
@ -1263,7 +1258,7 @@ int Quicksearch_list(T_List_button * list, T_Fileselector * selector)
short selected_item=Quicksearch(selector); short selected_item=Quicksearch(selector);
if (selected_item>=0 && selected_item!=list->Cursor_position+list->List_start) if (selected_item>=0 && selected_item!=list->Cursor_position+list->List_start)
{ {
Locate_list_item(list, selector, selected_item); Locate_list_item(list, selected_item);
Hide_cursor(); Hide_cursor();
// Mise à jour du scroller // Mise à jour du scroller
@ -1419,12 +1414,13 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context)
else else
{ {
#if defined(__MINT__) #if defined(__MINT__)
chdir(context->File_directory);
static char path[1024]={0}; static char path[1024]={0};
chdir(context->File_directory);
Dgetpath(path,0); Dgetpath(path,0);
strcat(path,PATH_SEPARATOR); strcat(path,PATH_SEPARATOR);
strcpy(Main_current_directory,path); strcpy(Main_current_directory,path);
#else #else
chdir(context->File_directory);
getcwd(Main_current_directory,256); getcwd(Main_current_directory,256);
#endif #endif
@ -1610,7 +1606,6 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context)
if (Main_format != Window_attribute2) { if (Main_format != Window_attribute2) {
char* savename = (char *)strdup(Selector_filename); char* savename = (char *)strdup(Selector_filename);
int nameLength = strlen(savename); int nameLength = strlen(savename);
DEBUG(Selector_filename, 42);
Main_format = Window_attribute2; Main_format = Window_attribute2;
// Comme on change de liste, on se place en début de liste: // Comme on change de liste, on se place en début de liste:
Main_fileselector_position = 0; Main_fileselector_position = 0;
@ -1709,7 +1704,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context)
Main_fileselector_position=0; Main_fileselector_position=0;
Main_fileselector_offset=0; Main_fileselector_offset=0;
// Affichage des premiers fichiers visibles: // Affichage des premiers fichiers visibles:
Read_list_of_drives(&Filelist); Read_list_of_drives(&Filelist,19);
Sort_list_of_files(&Filelist); Sort_list_of_files(&Filelist);
Prepare_and_display_filelist(Main_fileselector_position,Main_fileselector_offset,file_scroller); Prepare_and_display_filelist(Main_fileselector_position,Main_fileselector_offset,file_scroller);
Display_cursor(); Display_cursor();
@ -1940,7 +1935,7 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context)
else // Sinon on essaye de charger ou sauver le fichier else // Sinon on essaye de charger ou sauver le fichier
{ {
strcpy(context->File_directory,Main_current_directory); strcpy(context->File_directory,Main_current_directory);
if (!load) if (!load && !Get_fileformat(Main_format)->Palette_only)
Main_fileformat=Main_format; Main_fileformat=Main_format;
save_or_load_image=1; save_or_load_image=1;
} }

View File

@ -46,9 +46,11 @@ void Recount_files(T_Fileselector *list);
T_Fileselector_item * Get_item_by_index(T_Fileselector *list, short index); T_Fileselector_item * Get_item_by_index(T_Fileselector *list, short index);
void Read_list_of_drives(T_Fileselector *list, byte name_length);
short Find_file_in_fileselector(T_Fileselector *list, const char * fname); short Find_file_in_fileselector(T_Fileselector *list, const char * fname);
void Locate_list_item(T_List_button * list, T_Fileselector * selector, short selected_item); void Locate_list_item(T_List_button * list, short selected_item);
int Quicksearch_list(T_List_button * list, T_Fileselector * selector); int Quicksearch_list(T_List_button * list, T_Fileselector * selector);

View File

@ -581,7 +581,7 @@ GFX2_GLOBAL struct
word Height; ///< Button's active heigth word Height; ///< Button's active heigth
byte Pressed; ///< Button is currently pressed byte Pressed; ///< Button is currently pressed
byte Shape; ///< Shape, listed in enum ::BUTTON_SHAPES byte Shape; ///< Shape, listed in enum ::BUTTON_SHAPES
char Icon; ///< Which icon to display: Either the one from the toolbar (-1) or one of ::MENU_SPRITE signed char Icon; ///< Which icon to display: Either the one from the toolbar (-1) or one of ::MENU_SPRITE
// Triggers on mouse/keyboard // Triggers on mouse/keyboard
Func_action Left_action; ///< Action triggered by a left mouseclick on the button Func_action Left_action; ///< Action triggered by a left mouseclick on the button

View File

@ -1275,7 +1275,6 @@ void Draw_empty_circle_general(short center_x,short center_y,short radius,byte c
Pixel_figure(center_x+radius,center_y,color); // Droite Pixel_figure(center_x+radius,center_y,color); // Droite
Pixel_figure(center_x,center_y+radius,color); // Bas Pixel_figure(center_x,center_y+radius,color); // Bas
if(Main_magnifier_mode) Update_part_of_screen(center_x-radius,center_y-radius,2*radius+1,2*radius+1);
} }
// -- Tracé définitif d'un cercle vide -- // -- Tracé définitif d'un cercle vide --

View File

@ -59,9 +59,12 @@ void Pixel_figure_preview_xor(word x_pos,word y_pos,byte color);
void Pixel_figure_preview_xorback(word x_pos,word y_pos,byte color); void Pixel_figure_preview_xorback(word x_pos,word y_pos,byte color);
void Pixel_figure_in_brush(word x_pos,word y_pos,byte color); void Pixel_figure_in_brush(word x_pos,word y_pos,byte color);
void Draw_empty_circle_general(short center_x,short center_y,short radius,byte color);
void Draw_empty_circle_permanent(short center_x,short center_y,short radius,byte color); void Draw_empty_circle_permanent(short center_x,short center_y,short radius,byte color);
void Draw_empty_circle_preview (short center_x,short center_y,short radius,byte color); void Draw_empty_circle_preview (short center_x,short center_y,short radius,byte color);
void Hide_empty_circle_preview (short center_x,short center_y,short radius); void Hide_empty_circle_preview (short center_x,short center_y,short radius);
void Draw_empty_circle_general(short center_x,short center_y,short radius,byte color);
void Draw_filled_circle (short center_x,short center_y,short radius,byte color); void Draw_filled_circle (short center_x,short center_y,short radius,byte color);
void Draw_empty_ellipse_permanent(short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color); void Draw_empty_ellipse_permanent(short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color);

View File

@ -226,6 +226,32 @@ void Window_set_shortcut(int action_id)
shortcut_ptr[0]=backup_shortcut[0]; shortcut_ptr[0]=backup_shortcut[0];
shortcut_ptr[1]=backup_shortcut[1]; shortcut_ptr[1]=backup_shortcut[1];
case 2: // OK case 2: // OK
// Replace twice by single
if (shortcut_ptr[0]==shortcut_ptr[1])
shortcut_ptr[1]=0;
// Remove all other shortcuts that use same keys
if (!Config.Allow_multi_shortcuts)
{
int n;
for (n=0; n<2; n++)
{
if (shortcut_ptr[n]!=0)
{
int i;
for(i=0; i<NB_SHORTCUTS; i++)
{
word * other_shortcut_ptr;
if (Ordering[i]==action_id)
continue;
other_shortcut_ptr=Shortcut(Ordering[i]);
if (other_shortcut_ptr[0]==shortcut_ptr[n])
other_shortcut_ptr[0]=0;
if (other_shortcut_ptr[1]==shortcut_ptr[n])
other_shortcut_ptr[1]=0;
}
}
}
}
default: default:
break; break;
} }
@ -236,6 +262,41 @@ void Window_set_shortcut(int action_id)
Display_cursor(); Display_cursor();
} }
///
/// Browse the complete list of shortcuts and ensure that a key only triggers
/// one of them.
void Remove_duplicate_shortcuts(void)
{
int action_1;
// This algorithm favors shortcuts that are first in the list.
// The idea is that we, coders, append new shortcuts at the end with default
// values; they should be discarded if user has chosen the key first.
for (action_1=0; action_1<NB_SHORTCUTS-1; action_1++)
{
int n;
word *shortcut_1 = Shortcut(Ordering[action_1]);
for (n=0; n<2; n++)
{
int action_2;
for (action_2=action_1+1; action_2<NB_SHORTCUTS; action_2++)
{
if (shortcut_1[n]!=0)
{
int i;
for(i=0; i<NB_SHORTCUTS; i++)
{
word *shortcut_2 = Shortcut(Ordering[action_2]);
if (shortcut_2[0]==shortcut_1[n])
shortcut_2[0]=0;
if (shortcut_2[1]==shortcut_1[n])
shortcut_2[1]=0;
}
}
}
}
}
}
/// ///
/// Print a line with the 'help' (6x8) font. /// Print a line with the 'help' (6x8) font.
short Print_help(short x_pos, short y_pos, const char *line, char line_type, short link_position, short link_size) short Print_help(short x_pos, short y_pos, const char *line, char line_type, short link_position, short link_size)

View File

@ -57,6 +57,10 @@ short Print_help(short x_pos, short y_pos, const char *line, char line_type, sho
// de type 0x100+BOUTON_* ou SPECIAL_* // de type 0x100+BOUTON_* ou SPECIAL_*
const char * Keyboard_shortcut_value(word shortcut_number); const char * Keyboard_shortcut_value(word shortcut_number);
///
/// Browse the complete list of shortcuts and ensure that a key only triggers
/// one of them.
void Remove_duplicate_shortcuts(void);
#endif #endif

View File

@ -67,7 +67,7 @@ static const T_Help_table helptable_about[] =
#else #else
HELP_TEXT ("") HELP_TEXT ("")
#endif #endif
HELP_TEXT ("Copyright 2007-2010, the Grafx2 project team") HELP_TEXT ("Copyright 2007-2011, the Grafx2 project team")
HELP_TEXT (" Copyright 1996-2001, SUNSET DESIGN") HELP_TEXT (" Copyright 1996-2001, SUNSET DESIGN")
}; };
static const T_Help_table helptable_licence[] = static const T_Help_table helptable_licence[] =
@ -460,19 +460,20 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT ("") HELP_TEXT ("")
//HELP_TEXT ("0----5----0----5----0----5----0----5----0--X") //HELP_TEXT ("0----5----0----5----0----5----0----5----0--X")
HELP_TEXT (" anibiqme blumunkee BDCIron ") HELP_TEXT (" anibiqme blumunkee BDCIron ")
HELP_TEXT (" Ced DawnBringer El Topo ") HELP_TEXT (" Ced DarkDefende DawnBringer ")
HELP_TEXT (" falenblood fanickbux fano ") HELP_TEXT (" El Topo falenblood fanickbux ")
HELP_TEXT (" fogbot121 Frost Grimmy ") HELP_TEXT (" fano fogbot121 Frost ")
HELP_TEXT (" Gürkan Sengün Hatch HoraK-FDF ") HELP_TEXT (" Grimmy Gürkan Sengün Hatch ")
HELP_TEXT (" iLKke Iw2evk Jamon ") HELP_TEXT (" HoraK-FDF iLKke Iw2evk ")
HELP_TEXT (" keito kusma Lord Graga ") HELP_TEXT (" jackfrost128 Jamon keito ")
HELP_TEXT (" Lorenzo Gatti MagerValp maymunbeyin ") HELP_TEXT (" kusma Lord Graga Lorenzo Gatti ")
HELP_TEXT (" mind MooZ Pasi Kallinen ") HELP_TEXT (" MagerValp maymunbeyin mind ")
HELP_TEXT (" the Peach petter PheeL ") HELP_TEXT (" MooZ Pasi Kallinen the Peach ")
HELP_TEXT (" petter PheeL Ravey1138 ")
HELP_TEXT (" richienyhus sm4tik spratek ") HELP_TEXT (" richienyhus sm4tik spratek ")
HELP_TEXT (" tape.yrm TeeEmCee tempest ") HELP_TEXT (" Surt tape.yrm TeeEmCee ")
HELP_TEXT (" Timo Kurrpa titus^Rab Tobé ") HELP_TEXT (" tempest Timo Kurrpa titus^Rab ")
HELP_TEXT (" yakumo2975 00ai99") HELP_TEXT (" Tobé yakumo2975 00ai99")
HELP_TEXT ("") HELP_TEXT ("")
HELP_TEXT (" ... posted the annoying bug reports.") HELP_TEXT (" ... posted the annoying bug reports.")
HELP_TEXT ("") HELP_TEXT ("")
@ -2455,6 +2456,16 @@ static const T_Help_table helptable_settings_details[] =
HELP_TEXT ("Background color.") HELP_TEXT ("Background color.")
HELP_TEXT ("This option is ignored when the Shade,") HELP_TEXT ("This option is ignored when the Shade,")
HELP_TEXT ("Quick-shade, or Tiling mode is used.") HELP_TEXT ("Quick-shade, or Tiling mode is used.")
HELP_TEXT ("")
HELP_TEXT (" Multi shortcuts")
HELP_TEXT ("When this setting is disabled, and you")
HELP_TEXT ("create a shortcut with a key that is already")
HELP_TEXT ("associated to another shortcut, Grafx2 will")
HELP_TEXT ("unset the latter. If you enable this mode,")
HELP_TEXT ("Grafx2 will not make such check, so you can")
HELP_TEXT ("design shortcuts that trigger several")
HELP_TEXT ("actions at once.")
HELP_TEXT ("")
}; };
static const T_Help_table helptable_clear[] = static const T_Help_table helptable_clear[] =
@ -2638,10 +2649,10 @@ static const T_Help_table helptable_palette[] =
HELP_TEXT ("modifies the picture).") HELP_TEXT ("modifies the picture).")
HELP_TEXT ("") HELP_TEXT ("")
HELP_TEXT ("- Undo: Allows you to recover the last") HELP_TEXT ("- Undo: Allows you to recover the last")
HELP_TEXT ("modifications made on the palette. If the") HELP_TEXT ("modifications made on the palette. Note that")
HELP_TEXT ("last operation modified the picture, it") HELP_TEXT ("it can't undo the changes that affect the")
HELP_TEXT ("won't recover them: you'll have to click on") HELP_TEXT ("pixels (remapping), you'll need to Cancel")
HELP_TEXT ("Cancel to do so.") HELP_TEXT ("them.")
HELP_TEXT ("") HELP_TEXT ("")
HELP_TEXT ("") HELP_TEXT ("")
HELP_TEXT ("If you press <Backspace>, the program will") HELP_TEXT ("If you press <Backspace>, the program will")

View File

@ -2512,7 +2512,7 @@ void Set_config_defaults(void)
{ {
int index, index2; int index, index2;
// Raccourcis clavier // Keyboard shortcuts
for (index=0; index<NB_SHORTCUTS; index++) for (index=0; index<NB_SHORTCUTS; index++)
{ {
switch(Ordering[index]>>8) switch(Ordering[index]>>8)
@ -2550,7 +2550,7 @@ void Set_config_defaults(void)
Shade_list[Shade_current].Mode, Shade_list[Shade_current].Mode,
Shade_table_left,Shade_table_right); Shade_table_left,Shade_table_right);
// Masque // Mask
for (index=0; index<256; index++) for (index=0; index<256; index++)
Mask_table[index]=0; Mask_table[index]=0;
@ -2577,7 +2577,7 @@ void Set_config_defaults(void)
Quick_shade_step=1; Quick_shade_step=1;
Quick_shade_loop=0; Quick_shade_loop=0;
// Grille // Grid
Snap_width=Snap_height=8; Snap_width=Snap_height=8;
Snap_offset_X=Snap_offset_Y=0; Snap_offset_X=Snap_offset_Y=0;
@ -2588,6 +2588,7 @@ void Set_config_defaults(void)
#if defined(__WIN32__) #if defined(__WIN32__)
#define SIGHANDLER_T __p_sig_fn_t #define SIGHANDLER_T __p_sig_fn_t
#elif defined(__macosx__) #elif defined(__macosx__)
typedef void (*sig_t) (int);
#define SIGHANDLER_T sig_t #define SIGHANDLER_T sig_t
#else #else
#define SIGHANDLER_T __sighandler_t #define SIGHANDLER_T __sighandler_t

View File

@ -85,12 +85,6 @@ word Input_new_mouse_Y;
byte Input_new_mouse_K; byte Input_new_mouse_K;
byte Button_inverter=0; // State of the key that swaps mouse buttons. byte Button_inverter=0; // State of the key that swaps mouse buttons.
byte Mouse_mode = 0; ///< Mouse mode = 0:normal, 1:emulated with custom sensitivity.
short Mouse_virtual_x_position;
short Mouse_virtual_y_position;
short Mouse_virtual_width;
short Mouse_virtual_height;
// Joystick/pad configurations for the various console ports. // Joystick/pad configurations for the various console ports.
// See the #else for the documentation of fields. // See the #else for the documentation of fields.
// TODO: Make these user-settable somehow. // TODO: Make these user-settable somehow.
@ -306,30 +300,8 @@ void Handle_window_exit(__attribute__((unused)) SDL_QuitEvent event)
int Handle_mouse_move(SDL_MouseMotionEvent event) int Handle_mouse_move(SDL_MouseMotionEvent event)
{ {
if (Mouse_mode == 0) Input_new_mouse_X = event.x/Pixel_width;
{ Input_new_mouse_Y = event.y/Pixel_height;
Input_new_mouse_X = event.x/Pixel_width;
Input_new_mouse_Y = event.y/Pixel_height;
}
else
{
Mouse_virtual_x_position += event.xrel * 12 / Config.Mouse_sensitivity_index_x;
// Clip
if (Mouse_virtual_x_position > Mouse_virtual_width)
Mouse_virtual_x_position = Mouse_virtual_width;
else if (Mouse_virtual_x_position < 0)
Mouse_virtual_x_position = 0;
Mouse_virtual_y_position += event.yrel * 12 / Config.Mouse_sensitivity_index_y;
// Clip
if (Mouse_virtual_y_position > Mouse_virtual_height)
Mouse_virtual_y_position = Mouse_virtual_height;
else if (Mouse_virtual_y_position < 0)
Mouse_virtual_y_position = 0;
Input_new_mouse_X = Mouse_virtual_x_position / 12 / Pixel_width;
Input_new_mouse_Y = Mouse_virtual_y_position / 12 / Pixel_height;
}
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
} }
@ -1050,32 +1022,13 @@ int Get_input(int sleep_time)
void Adjust_mouse_sensitivity(word fullscreen) void Adjust_mouse_sensitivity(word fullscreen)
{ {
if (fullscreen == 0) // Deprecated
{ (void)fullscreen;
Mouse_mode = 0;
return;
}
Mouse_mode = 1;
Mouse_virtual_x_position = 12*Mouse_X*Pixel_width;
Mouse_virtual_y_position = 12*Mouse_Y*Pixel_height;
Mouse_virtual_width = 12*(Screen_width-1)*Pixel_width;
Mouse_virtual_height = 12*(Screen_height-1)*Pixel_height;
} }
void Set_mouse_position(void) void Set_mouse_position(void)
{ {
if (Mouse_mode == 0) SDL_WarpMouse(Mouse_X*Pixel_width, Mouse_Y*Pixel_height);
{
SDL_WarpMouse(
Mouse_X*Pixel_width,
Mouse_Y*Pixel_height
);
}
else
{
Mouse_virtual_x_position = 12*Mouse_X*Pixel_width;
Mouse_virtual_y_position = 12*Mouse_Y*Pixel_height;
}
} }
int Color_cycling(__attribute__((unused)) void* useless) int Color_cycling(__attribute__((unused)) void* useless)

103
src/io.c
View File

@ -37,20 +37,16 @@
#include <proto/dos.h> #include <proto/dos.h>
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#elif defined(__WIN32__) #elif defined(__WIN32__)
#include <dirent.h> #include <dirent.h>
#include <windows.h> #include <windows.h>
//#include <commdlg.h> //#include <commdlg.h>
#define isHidden(x) (GetFileAttributesA((x)->d_name)&FILE_ATTRIBUTE_HIDDEN)
#elif defined(__MINT__) #elif defined(__MINT__)
#include <mint/osbind.h> #include <mint/osbind.h>
#include <mint/sysbind.h> #include <mint/sysbind.h>
#include <dirent.h> #include <dirent.h>
#define isHidden(x) (0)
#else #else
#include <dirent.h> #include <dirent.h>
#define isHidden(x) ((x)->d_name[0]=='.')
#endif #endif
#include "struct.h" #include "struct.h"
@ -204,6 +200,75 @@ void Extract_path(char *dest, const char *source)
strcat(dest, PATH_SEPARATOR); strcat(dest, PATH_SEPARATOR);
} }
///
/// Appends a file or directory name to an existing directory name.
/// As a special case, when the new item is equal to PARENT_DIR, this
/// will remove the rightmost directory name.
/// reverse_path is optional, if it's non-null, the function will
/// write there :
/// - if filename is ".." : The name of eliminated directory/file
/// - else: ".."
void Append_path(char *path, const char *filename, char *reverse_path)
{
// Parent
if (!strcmp(filename, PARENT_DIR))
{
// Going up one directory
long len;
char * slash_pos;
// Remove trailing slash
len=strlen(path);
if (len && (!strcmp(path+len-1,PATH_SEPARATOR)
#ifdef __WIN32__
|| path[len-1]=='/'
#endif
))
path[len-1]='\0';
slash_pos=Find_last_slash(path);
if (slash_pos)
{
if (reverse_path)
strcpy(reverse_path, slash_pos+1);
*slash_pos='\0';
}
else
{
if (reverse_path)
strcpy(reverse_path, path);
path[0]='\0';
}
#if defined(__WIN32__)
// Roots of drives need a pending antislash
if (path[0]!='\0' && path[1]==':' && path[2]=='\0')
{
strcat(path, PATH_SEPARATOR);
}
#endif
}
else
// Sub-directory
{
long len;
// Add trailing slash if needed
len=strlen(path);
if (len && (strcmp(path+len-1,PATH_SEPARATOR)
#ifdef __WIN32__
&& path[len-1]!='/'
#endif
))
{
strcpy(path+len, PATH_SEPARATOR);
len+=strlen(PATH_SEPARATOR);
}
strcat(path, filename);
if (reverse_path)
strcpy(reverse_path, PARENT_DIR);
}
}
int File_exists(char * fname) int File_exists(char * fname)
// Détermine si un file passé en paramètre existe ou non dans le // Détermine si un file passé en paramètre existe ou non dans le
// répertoire courant. // répertoire courant.
@ -242,6 +307,32 @@ int Directory_exists(char * directory)
} }
} }
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) || defined(__MINT__)
#define FILE_IS_HIDDEN_ATTRIBUTE __attribute__((unused))
#else
#define FILE_IS_HIDDEN_ATTRIBUTE
#endif
/// Check if a file or directory is hidden.
int File_is_hidden(FILE_IS_HIDDEN_ATTRIBUTE const char *fname, const char *full_name)
{
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) || defined(__MINT__)
// False (unable to determine, or irrrelevent for platform)
return 0;
#elif defined(__WIN32__)
unsigned long att;
if (full_name!=NULL)
att = GetFileAttributesA(full_name);
else
att = GetFileAttributesA(fname);
if (att==INVALID_FILE_ATTRIBUTES)
return 0;
return (att&FILE_ATTRIBUTE_HIDDEN)?1:0;
#else
return fname[0]=='.';
#endif
}
// Taille de fichier, en octets // Taille de fichier, en octets
int File_length(const char * fname) int File_length(const char * fname)
{ {
@ -296,7 +387,7 @@ void For_each_directory_entry(const char * directory_name, void Callback(const c
char full_filename[MAX_PATH_CHARACTERS]; char full_filename[MAX_PATH_CHARACTERS];
int filename_position; int filename_position;
strcpy(full_filename, directory_name); strcpy(full_filename, directory_name);
current_directory=opendir(directory_name); current_directory=opendir(full_filename);
if(current_directory == NULL) return; // Répertoire invalide ... if(current_directory == NULL) return; // Répertoire invalide ...
filename_position = strlen(full_filename); filename_position = strlen(full_filename);
if (filename_position==0 || strcmp(full_filename+filename_position-1,PATH_SEPARATOR)) if (filename_position==0 || strcmp(full_filename+filename_position-1,PATH_SEPARATOR))
@ -313,7 +404,7 @@ void For_each_directory_entry(const char * directory_name, void Callback(const c
full_filename, full_filename,
S_ISREG(Infos_enreg.st_mode), S_ISREG(Infos_enreg.st_mode),
S_ISDIR(Infos_enreg.st_mode), S_ISDIR(Infos_enreg.st_mode),
isHidden(entry)?1:0); File_is_hidden(entry->d_name, full_filename));
} }
closedir(current_directory); closedir(current_directory);
} }

View File

@ -90,18 +90,30 @@ int File_exists(char * fname);
/// Returns true if a directory passed as a parameter exists in the current directory. /// Returns true if a directory passed as a parameter exists in the current directory.
int Directory_exists(char * directory); int Directory_exists(char * directory);
/// Check if a file or directory is hidden. Full name (with directories) is optional.
int File_is_hidden(const char *fname, const char *full_name);
/// Scans a directory, calls Callback for each file in it, /// Scans a directory, calls Callback for each file in it,
void For_each_file(const char * directory_name, void Callback(const char *)); void For_each_file(const char * directory_name, void Callback(const char *));
/// Scans a directory, calls Callback for each file or directory in it, /// Scans a directory, calls Callback for each file or directory in it,
void For_each_directory_entry(const char * directory_name, void Callback(const char *, byte is_file, byte is_directory, byte is_hidden)); void For_each_directory_entry(const char * directory_name, void Callback(const char *, byte is_file, byte is_directory, byte is_hidden));
/// ///
/// Creates a fully qualified name from a directory and filename. /// Creates a fully qualified name from a directory and filename.
/// The point is simply to insert a PATH_SEPARATOR when needed. /// The point is simply to insert a PATH_SEPARATOR when needed.
void Get_full_filename(char * output_name, char * file_name, char * directory_name); void Get_full_filename(char * output_name, char * file_name, char * directory_name);
///
/// Appends a file or directory name to an existing directory name.
/// As a special case, when the new item is equal to PARENT_DIR, this
/// will remove the rightmost directory name.
/// reverse_path is optional, if it's non-null, the function will
/// write there :
/// - if filename is ".." : The name of eliminated directory/file
/// - else: ".."
void Append_path(char *path, const char *filename, char *reverse_path);
/// ///
/// Creates a lock file, to check if an other instance of Grafx2 is running. /// Creates a lock file, to check if an other instance of Grafx2 is running.
/// @return 0 on success (first instance), -1 on failure (others are running) /// @return 0 on success (first instance), -1 on failure (others are running)

View File

@ -601,6 +601,7 @@ word Keysym_to_ANSI(SDL_keysym keysym)
#if !(defined(__macosx__) || defined(__FreeBSD__)) #if !(defined(__macosx__) || defined(__FreeBSD__))
if ( keysym.unicode == 0) if ( keysym.unicode == 0)
{ {
switch(keysym.sym) switch(keysym.sym)
{ {
case SDLK_DELETE: case SDLK_DELETE:
@ -610,7 +611,11 @@ word Keysym_to_ANSI(SDL_keysym keysym)
case SDLK_END: case SDLK_END:
case SDLK_BACKSPACE: case SDLK_BACKSPACE:
case KEY_ESC: case KEY_ESC:
return keysym.sym;
case SDLK_RETURN: case SDLK_RETURN:
// Case alt-enter
if (SDL_GetModState() & (KMOD_ALT|KMOD_META))
return '\n';
return keysym.sym; return keysym.sym;
default: default:
return 0; return 0;

View File

@ -628,7 +628,8 @@ void Load_image(T_IO_Context *context)
if (File_error>0) if (File_error>0)
{ {
fprintf(stderr,"Unable to load file %s!\n",context->File_name); fprintf(stderr,"Unable to load file %s!\n",context->File_name);
Error(0); if (context->Type!=CONTEXT_SURFACE)
Error(0);
} }
// Post-load // Post-load
@ -693,14 +694,35 @@ void Load_image(T_IO_Context *context)
memset(color_usage,0,sizeof(color_usage)); memset(color_usage,0,sizeof(color_usage));
if (Count_used_colors(color_usage)<252) if (Count_used_colors(color_usage)<252)
{ {
int gui_index=0; int gui_index;
int c; // From white to black
for (c=255; c>=0 && gui_index<4; c--) for (gui_index=3; gui_index>=0; gui_index--)
{ {
if (color_usage[c]==0) int c;
T_Components gui_color;
gui_color=*Favorite_GUI_color(gui_index);
// Try find a very close match (ignore last 2 bits)
for (c=255; c>=0; c--)
{ {
context->Palette[c]=*Favorite_GUI_color(gui_index); if ((context->Palette[c].R|3) == (gui_color.R|3)
gui_index++; && (context->Palette[c].G|3) == (gui_color.G|3)
&& (context->Palette[c].B|3) == (gui_color.B|3) )
break;
}
if (c<0) // Not found
{
// Find an unused slot at end of palette
for (c=255; c>=0; c--)
{
if (color_usage[c]==0)
{
context->Palette[c]=gui_color;
// Tag as a used color
color_usage[c]=1;
break;
}
}
} }
} }
} }

View File

@ -67,6 +67,7 @@
#include "palette.h" #include "palette.h"
#include "realpath.h" #include "realpath.h"
#include "input.h" #include "input.h"
#include "help.h"
#if defined(__WIN32__) #if defined(__WIN32__)
#include <windows.h> #include <windows.h>
@ -658,6 +659,11 @@ int Init_program(int argc,char * argv[])
temp=Load_INI(&Config); temp=Load_INI(&Config);
if (temp) if (temp)
Error(temp); Error(temp);
if(!Config.Allow_multi_shortcuts)
{
Remove_duplicate_shortcuts();
}
Compute_menu_offsets(); Compute_menu_offsets();

View File

@ -25,6 +25,9 @@
// We don't use autoconf and all that in grafx2, so let's do the config here ... // We don't use autoconf and all that in grafx2, so let's do the config here ...
#if defined(__macosx__) || defined(__FreeBSD__) // MacOS X is POSIX compliant #if defined(__macosx__) || defined(__FreeBSD__) // MacOS X is POSIX compliant
#define MOUNTED_GETMNTINFO #define MOUNTED_GETMNTINFO
#if defined(__macosx__)
#include <sys/types.h>
#endif
#elif defined(__NetBSD__) #elif defined(__NetBSD__)
#define MOUNTED_GETMNTINFO2 #define MOUNTED_GETMNTINFO2
#elif defined(__BEOS__) || defined(__HAIKU__) #elif defined(__BEOS__) || defined(__HAIKU__)

View File

@ -2760,7 +2760,16 @@ void Scroll_12_0(void)
if (Mouse_K == LEFT_SIDE) if (Mouse_K == LEFT_SIDE)
Backup(); Backup();
else else
Backup_layers(Main_layers_visible); {
Backup_layers(-1); // Main_layers_visible
#ifndef NOLAYERS
// Ensure the backup visible image is up-to-date
// (after swapping some layers on/off, it gets outdated)
memcpy(Main_visible_image_backup.Image,
Main_visible_image.Image,
Main_image_width*Main_image_height);
#endif
}
Cursor_hidden_before_scroll=Cursor_hidden; Cursor_hidden_before_scroll=Cursor_hidden;
Cursor_hidden=1; Cursor_hidden=1;
@ -2818,7 +2827,6 @@ void Scroll_12_5(void)
{ {
// One layer at once // One layer at once
Scroll_picture(Main_backups->Pages->Next->Image[Main_current_layer], Main_backups->Pages->Image[Main_current_layer], x_offset, y_offset); Scroll_picture(Main_backups->Pages->Next->Image[Main_current_layer], Main_backups->Pages->Image[Main_current_layer], x_offset, y_offset);
//Redraw_layered_image();
Redraw_current_layer(); Redraw_current_layer();
} }
@ -2874,6 +2882,7 @@ void Scroll_0_5(void)
// Do the actual scroll operation on all layers. // Do the actual scroll operation on all layers.
for (i=0; i<Main_backups->Pages->Nb_layers; i++) for (i=0; i<Main_backups->Pages->Nb_layers; i++)
//if ((1<<i) & Main_layers_visible)
Scroll_picture(Main_backups->Pages->Next->Image[i], Main_backups->Pages->Image[i], x_offset, y_offset); Scroll_picture(Main_backups->Pages->Next->Image[i], Main_backups->Pages->Image[i], x_offset, y_offset);
// Update the depth buffer too ... // Update the depth buffer too ...
// It would be faster to scroll it, but we don't have method // It would be faster to scroll it, but we don't have method

View File

@ -207,6 +207,66 @@ void Spread_colors(short start,short end,T_Palette palette)
} }
} }
// FIXME: keep them in main function but pass them to Palette_edit_*()
T_Components * backup_palette;
T_Components * temp_palette;
T_Components * working_palette;
byte Palette_undo_state = 0;
byte Palette_change_state = 0;
/// Backup before doing one self-complete change.
void Palette_edit_step()
{
// back up
memcpy(backup_palette,working_palette,sizeof(T_Palette));
Palette_change_state=0;
Palette_undo_state=0;
}
/// Mode for incremental changes.
void Palette_edit_select_range()
{
if (Palette_change_state)
{/*
// acknowledge pending changes and back up
memcpy(backup_palette,working_palette,sizeof(T_Palette));
memcpy(temp_palette,working_palette,sizeof(T_Palette));
*/}
Palette_change_state=0;
}
/// Perform incremental change in RGB channel of some color(s).
void Palette_edit_alter_channel()
{
if (!Palette_change_state)
{
memcpy(backup_palette,working_palette,sizeof(T_Palette));
memcpy(temp_palette,working_palette,sizeof(T_Palette));
}
Palette_change_state=1;
}
/// Undo
void Palette_edit_undo_redo()
{
if (Palette_change_state)
{
// swap backup and working (temp serves as intermediate)
memcpy(temp_palette,backup_palette,sizeof(T_Palette));
memcpy(backup_palette,working_palette,sizeof(T_Palette));
memcpy(working_palette,temp_palette,sizeof(T_Palette));
}
else
{
// swap backup and working (temp serves as intermediate)
memcpy(temp_palette,backup_palette,sizeof(T_Palette));
memcpy(backup_palette,working_palette,sizeof(T_Palette));
memcpy(working_palette,temp_palette,sizeof(T_Palette));
}
Palette_undo_state=(Palette_undo_state==0);
}
void Update_color_count(short * used_colors, dword * color_usage) void Update_color_count(short * used_colors, dword * color_usage)
{ {
@ -1027,9 +1087,9 @@ void Button_Palette(void)
short used_colors = -1; // -1 <=> Inconnu short used_colors = -1; // -1 <=> Inconnu
byte conversion_table[256]; byte conversion_table[256];
T_Components * backup_palette; //T_Components * backup_palette;
T_Components * temp_palette; //T_Components * temp_palette;
T_Components * working_palette; //T_Components * working_palette;
static byte show_used_colors=0; static byte show_used_colors=0;
@ -1042,8 +1102,7 @@ void Button_Palette(void)
Open_window(299, 188,"Palette"); Open_window(299, 188,"Palette");
memcpy(working_palette, Main_palette, sizeof(T_Palette)); memcpy(working_palette, Main_palette, sizeof(T_Palette));
memcpy(backup_palette, Main_palette, sizeof(T_Palette)); Palette_edit_step();
memcpy(temp_palette, Main_palette, sizeof(T_Palette));
Window_set_palette_button(5, 79); // 1 Window_set_palette_button(5, 79); // 1
@ -1195,7 +1254,7 @@ void Button_Palette(void)
int nb_colors; int nb_colors;
// Backup // Backup
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
nb_colors = Get_clipboard_colors(working_palette, block_start); nb_colors = Get_clipboard_colors(working_palette, block_start);
if (nb_colors>0) if (nb_colors>0)
@ -1261,8 +1320,7 @@ void Button_Palette(void)
Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color); Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color);
Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H); Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H);
memcpy(backup_palette ,working_palette,sizeof(T_Palette)); Palette_edit_select_range();
memcpy(temp_palette,working_palette,sizeof(T_Palette));
} }
} }
else else
@ -1337,6 +1395,7 @@ void Button_Palette(void)
break; break;
case 2 : // Jauge rouge case 2 : // Jauge rouge
Hide_cursor(); Hide_cursor();
Palette_edit_alter_channel();
if (block_start==block_end) if (block_start==block_end)
{ {
if(Palette_view_is_RGB) if(Palette_view_is_RGB)
@ -1417,6 +1476,7 @@ void Button_Palette(void)
break; break;
case 3 : // Jauge verte case 3 : // Jauge verte
Hide_cursor(); Hide_cursor();
Palette_edit_alter_channel();
if (block_start==block_end) if (block_start==block_end)
{ {
if(Palette_view_is_RGB) if(Palette_view_is_RGB)
@ -1497,6 +1557,7 @@ void Button_Palette(void)
case 4 : // Jauge bleue case 4 : // Jauge bleue
Hide_cursor(); Hide_cursor();
Palette_edit_alter_channel();
if (block_start==block_end) if (block_start==block_end)
{ {
if(Palette_view_is_RGB) if(Palette_view_is_RGB)
@ -1580,7 +1641,7 @@ void Button_Palette(void)
{ {
dword sum_r=0, sum_g=0, sum_b=0, used=0; dword sum_r=0, sum_g=0, sum_b=0, used=0;
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
// Compute weighted average // Compute weighted average
for (i=block_start; i<=block_end; i++) for (i=block_start; i<=block_end; i++)
{ {
@ -1614,7 +1675,7 @@ void Button_Palette(void)
if (temp_color>=0) if (temp_color>=0)
{ {
dword sum_r=0, sum_g=0, sum_b=0, used; dword sum_r=0, sum_g=0, sum_b=0, used;
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
// Compute weighted average // Compute weighted average
used=color_usage[temp_color]+color_usage[Fore_color]; used=color_usage[temp_color]+color_usage[Fore_color];
@ -1656,7 +1717,7 @@ void Button_Palette(void)
case 6 : // Grey scale case 6 : // Grey scale
// Backup // Backup
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
// Grey Scale // Grey Scale
for (i=block_start;i<=block_end;i++) for (i=block_start;i<=block_end;i++)
{ {
@ -1680,7 +1741,7 @@ void Button_Palette(void)
&& (temp_color!=block_start)) && (temp_color!=block_start))
{ {
Hide_cursor(); Hide_cursor();
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
// On calcule le nombre de couleurs a swapper sans risquer de sortir // On calcule le nombre de couleurs a swapper sans risquer de sortir
// de la palette (La var. first_color est utilisée pour économiser 1 var; c'est tout) // de la palette (La var. first_color est utilisée pour économiser 1 var; c'est tout)
@ -1735,6 +1796,7 @@ void Button_Palette(void)
// En cas de X-Swap, tout l'ecran a pu changer de couleur. // En cas de X-Swap, tout l'ecran a pu changer de couleur.
if (clicked_button==8) if (clicked_button==8)
{ {
Palette_edit_step(); // Disable Undo
Update_rect(0, 0, Screen_width, Menu_Y_before_window); Update_rect(0, 0, Screen_width, Menu_Y_before_window);
End_of_modification(); End_of_modification();
} }
@ -1742,12 +1804,12 @@ void Button_Palette(void)
} }
break; break;
case 9 : // Copy case 9 : // Copy (to other slot)
temp_color=Wait_click_in_palette(Window_palette_button_list); temp_color=Wait_click_in_palette(Window_palette_button_list);
if ((temp_color>=0) && (temp_color!=block_start)) if ((temp_color>=0) && (temp_color!=block_start))
{ {
Hide_cursor(); Hide_cursor();
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
memcpy(working_palette+temp_color,backup_palette+block_start, memcpy(working_palette+temp_color,backup_palette+block_start,
((temp_color+block_end-block_start<=255)?block_end+1-block_start:256-temp_color)*3); ((temp_color+block_end-block_start<=255)?block_end+1-block_start:256-temp_color)*3);
memcpy(temp_palette,working_palette,sizeof(T_Palette)); memcpy(temp_palette,working_palette,sizeof(T_Palette));
@ -1788,7 +1850,7 @@ void Button_Palette(void)
case 10 : // Spread case 10 : // Spread
if (block_start!=block_end) if (block_start!=block_end)
{ {
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
Spread_colors(block_start,block_end,working_palette); Spread_colors(block_start,block_end,working_palette);
} }
else else
@ -1796,7 +1858,7 @@ void Button_Palette(void)
temp_color=Wait_click_in_palette(Window_palette_button_list); temp_color=Wait_click_in_palette(Window_palette_button_list);
if (temp_color>=0) if (temp_color>=0)
{ {
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
if (temp_color<Fore_color) if (temp_color<Fore_color)
Spread_colors(temp_color,Fore_color,working_palette); Spread_colors(temp_color,Fore_color,working_palette);
else else
@ -1816,7 +1878,7 @@ void Button_Palette(void)
break; break;
case 11: // Reduce case 11: // Reduce
memcpy(backup_palette, working_palette, sizeof(T_Palette)); Palette_edit_step();
if (Window_attribute2==0) // User picked "other" choice if (Window_attribute2==0) // User picked "other" choice
{ {
int choice; int choice;
@ -1857,16 +1919,14 @@ void Button_Palette(void)
Draw_all_palette_sliders(red_slider, green_slider, blue_slider, Draw_all_palette_sliders(red_slider, green_slider, blue_slider,
working_palette, block_start, block_end); working_palette, block_start, block_end);
memcpy(temp_palette, working_palette, sizeof(T_Palette)); memcpy(temp_palette, working_palette, sizeof(T_Palette));
Palette_edit_step(); // Disable Undo
End_of_modification(); End_of_modification();
need_to_remap = 1; need_to_remap = 1;
} }
break; break;
case 12: // Undo case 12: // Undo
memcpy(temp_palette,backup_palette ,sizeof(T_Palette)); Palette_edit_undo_redo();
memcpy(backup_palette ,working_palette,sizeof(T_Palette));
memcpy(working_palette,temp_palette,sizeof(T_Palette));
Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end); Draw_all_palette_sliders(red_slider,green_slider,blue_slider,working_palette,block_start,block_end);
Set_palette(working_palette); Set_palette(working_palette);
@ -1879,7 +1939,7 @@ void Button_Palette(void)
break; break;
case 16 : // Zap unused case 16 : // Zap unused
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
if (used_colors==-1) if (used_colors==-1)
Update_color_count(&used_colors,color_usage); Update_color_count(&used_colors,color_usage);
for (i=0; i<256; i++) for (i=0; i<256; i++)
@ -1912,6 +1972,7 @@ void Button_Palette(void)
if (!Palette_view_is_RGB) if (!Palette_view_is_RGB)
break; break;
Hide_cursor(); Hide_cursor();
Palette_edit_alter_channel();
if (block_start==block_end) if (block_start==block_end)
{ {
if (red_slider->Position) if (red_slider->Position)
@ -2037,6 +2098,7 @@ void Button_Palette(void)
if (!Palette_view_is_RGB) if (!Palette_view_is_RGB)
break; break;
Hide_cursor(); Hide_cursor();
Palette_edit_alter_channel();
if (block_start==block_end) if (block_start==block_end)
{ {
if (red_slider->Position<Color_max) if (red_slider->Position<Color_max)
@ -2160,7 +2222,7 @@ void Button_Palette(void)
case 19 : // Negative case 19 : // Negative
// Backup // Backup
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
// Negative // Negative
for (i=block_start;i<=block_end;i++) for (i=block_start;i<=block_end;i++)
{ {
@ -2179,7 +2241,7 @@ void Button_Palette(void)
case 20 : // Inversion case 20 : // Inversion
case 21 : // X-Inversion case 21 : // X-Inversion
// Backup // Backup
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step(); // Not undoable if X-Invert
// On initialise la table de conversion // On initialise la table de conversion
for (i=0; i<=255; i++) for (i=0; i<=255; i++)
conversion_table[i]=i; conversion_table[i]=i;
@ -2218,6 +2280,7 @@ void Button_Palette(void)
Remap_image_highlevel(conversion_table); Remap_image_highlevel(conversion_table);
Display_cursor(); Display_cursor();
End_of_modification(); End_of_modification();
Palette_edit_step(); // Disable Undo
} }
// On prépare la "modifiabilité" des nouvelles couleurs // On prépare la "modifiabilité" des nouvelles couleurs
Set_palette(working_palette); Set_palette(working_palette);
@ -2229,8 +2292,7 @@ void Button_Palette(void)
case 22 : // HSL <> RGB case 22 : // HSL <> RGB
// Acte les changements en cours sur une ou plusieurs couleurs // Acte les changements en cours sur une ou plusieurs couleurs
memcpy(temp_palette,working_palette,sizeof(T_Palette)); Palette_edit_select_range();
memcpy(backup_palette, working_palette,sizeof(T_Palette));
Hide_cursor(); Hide_cursor();
@ -2360,6 +2422,7 @@ void Button_Palette(void)
// Maintenant, tous ces calculs doivent êtres pris en compte dans la // Maintenant, tous ces calculs doivent êtres pris en compte dans la
// palette, l'image et à l'écran. // palette, l'image et à l'écran.
Set_palette(working_palette); Set_palette(working_palette);
Palette_edit_step(); // Disable Undo
End_of_modification(); End_of_modification();
need_to_remap=1; need_to_remap=1;
@ -2398,7 +2461,7 @@ void Button_Palette(void)
new_blue=(new_color&0x0000FF); new_blue=(new_color&0x0000FF);
// Backup // Backup
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
// Assign color // Assign color
for (i=block_start;i<=block_end;i++) for (i=block_start;i<=block_end;i++)
{ {
@ -2445,8 +2508,7 @@ void Button_Palette(void)
Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color); Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color);
Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H); Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H);
memcpy(backup_palette ,working_palette,sizeof(T_Palette)); Palette_edit_select_range();
memcpy(temp_palette,working_palette,sizeof(T_Palette));
} }
Display_cursor(); Display_cursor();
@ -2541,7 +2603,7 @@ void Button_Palette(void)
if (used_colors==-1) if (used_colors==-1)
Update_color_count(&used_colors, color_usage); Update_color_count(&used_colors, color_usage);
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
memcpy(temp_palette,Main_palette,sizeof(T_Palette)); memcpy(temp_palette,Main_palette,sizeof(T_Palette));
memcpy(Main_palette,working_palette,sizeof(T_Palette)); memcpy(Main_palette,working_palette,sizeof(T_Palette));
Set_nice_menu_colors(color_usage,0); Set_nice_menu_colors(color_usage,0);
@ -2594,8 +2656,7 @@ void Button_Palette(void)
Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color); Window_rectangle(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H,Fore_color);
Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H); Update_window_area(FGCOLOR_DISPLAY_X,FGCOLOR_DISPLAY_Y,FGCOLOR_DISPLAY_W,FGCOLOR_DISPLAY_H);
memcpy(backup_palette ,working_palette,sizeof(T_Palette)); Palette_edit_select_range();
memcpy(temp_palette,working_palette,sizeof(T_Palette));
} }
Display_cursor(); Display_cursor();
Wait_end_of_click(); Wait_end_of_click();
@ -2622,7 +2683,7 @@ void Button_Palette(void)
Hide_cursor(); Hide_cursor();
// Backup // Backup
memcpy(backup_palette,working_palette,sizeof(T_Palette)); Palette_edit_step();
nb_colors = Get_clipboard_colors(working_palette, block_start); nb_colors = Get_clipboard_colors(working_palette, block_start);
if (nb_colors>0) if (nb_colors>0)

View File

@ -1,2 +1,2 @@
char Program_version[]="2.3wip"; char Program_version[]="2.3";

View File

@ -34,6 +34,8 @@
#include "misc.h" #include "misc.h"
#include "readini.h" #include "readini.h"
#include "setup.h" #include "setup.h"
#include "realpath.h"
#include "io.h"
void Load_INI_clear_string(char * str, byte keep_comments) void Load_INI_clear_string(char * str, byte keep_comments)
{ {
@ -933,8 +935,26 @@ int Load_INI(T_Config * conf)
} }
} }
// Optional, Location of last directory used for Lua scripts browsing (>=2.3)
conf->Scripts_directory[0]='\0';
if (!Load_INI_get_string (file,buffer,"Scripts_directory",value_label, 1))
{
strcpy(conf->Scripts_directory,value_label);
}
if (conf->Scripts_directory[0]=='\0')
{
// Default when empty:
Realpath(Data_directory, conf->Scripts_directory);
Append_path(conf->Scripts_directory, "scripts", NULL);
}
conf->Allow_multi_shortcuts=0;
// Optional, allow or disallow multiple shortcuts on same key (>=2.3)
if (!Load_INI_get_values (file,buffer,"Allow_multi_shortcuts",1,values))
{
conf->Allow_multi_shortcuts=(values[0]!=0);
}
// Insert new values here // Insert new values here
fclose(file); fclose(file);

View File

@ -39,6 +39,7 @@
#include "readline.h" #include "readline.h"
#include "windows.h" #include "windows.h"
#include "input.h" #include "input.h"
#include "engine.h"
// Virtual keyboard is mandatory on these platforms: // Virtual keyboard is mandatory on these platforms:
#if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__) #if defined(__GP2X__) || defined(__WIZ__) || defined(__CAANOO__)
@ -509,7 +510,7 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz
switch(input_type) switch(input_type)
{ {
case INPUT_TYPE_STRING : case INPUT_TYPE_STRING :
if (input_key>=' ' && input_key<= 255) if ((input_key>=' ' && input_key<= 255)||input_key=='\n')
is_authorized=1; is_authorized=1;
break; break;
case INPUT_TYPE_INTEGER : case INPUT_TYPE_INTEGER :

View File

@ -419,7 +419,9 @@ int Save_INI(T_Config * conf)
strcpy(temp_filename,Config_directory); strcpy(temp_filename,Config_directory);
strcat(temp_filename,INISAVE_FILENAME); strcat(temp_filename,INISAVE_FILENAME);
// On renome l'ancienne version du fichier INI vers un fichier temporaire: // Delete gfx2.$$$
remove(temp_filename);
// Rename current config file as gfx2.$$$
if (rename(filename,temp_filename)!=0) if (rename(filename,temp_filename)!=0)
{ {
goto Erreur_ERREUR_SAUVEGARDE_INI; goto Erreur_ERREUR_SAUVEGARDE_INI;
@ -697,6 +699,13 @@ int Save_INI(T_Config * conf)
if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Swap_buttons",1,values,0))) if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Swap_buttons",1,values,0)))
goto Erreur_Retour; goto Erreur_Retour;
if ((return_code=Save_INI_set_strings (old_file,new_file,buffer,"Scripts_directory",conf->Scripts_directory)))
goto Erreur_Retour;
values[0]=(conf->Allow_multi_shortcuts);
if ((return_code=Save_INI_set_values (old_file,new_file,buffer,"Allow_multi_shortcuts",1,values,1)))
goto Erreur_Retour;
// Insert new values here // Insert new values here
Save_INI_flush(old_file,new_file,buffer); Save_INI_flush(old_file,new_file,buffer);

View File

@ -99,6 +99,8 @@ short Min_X=0;
short Min_Y=0; short Min_Y=0;
short Max_X=10000; short Max_X=10000;
short Max_Y=10000; short Max_Y=10000;
short Status_line_dirty_begin=0;
short Status_line_dirty_end=0;
#endif #endif
#if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE) #if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE)
@ -131,6 +133,13 @@ void Flush_update(void)
Min_X=Min_Y=10000; Min_X=Min_Y=10000;
Max_X=Max_Y=0; Max_X=Max_Y=0;
} }
if (Status_line_dirty_end)
{
SDL_UpdateRect(Screen_SDL, (18+(Status_line_dirty_begin*8))*Menu_factor_X*Pixel_width,Menu_status_Y*Pixel_height,(Status_line_dirty_end-Status_line_dirty_begin)*8*Menu_factor_X*Pixel_width,8*Menu_factor_Y*Pixel_height);
}
Status_line_dirty_begin=25;
Status_line_dirty_end=0;
#endif #endif
} }
@ -166,6 +175,28 @@ void Update_rect(short x, short y, unsigned short width, unsigned short height)
} }
void Update_status_line(short char_pos, short width)
{
#if (UPDATE_METHOD == UPDATE_METHOD_MULTI_RECTANGLE)
SDL_UpdateRect(Screen_SDL, (18+char_pos*8)*Menu_factor_X*Pixel_width,Menu_status_Y*Pixel_height,width*8*Menu_factor_X*Pixel_width,8*Menu_factor_Y*Pixel_height);
#endif
#if (UPDATE_METHOD == UPDATE_METHOD_CUMULATED)
// Merge the ranges
if (Status_line_dirty_end < char_pos+width)
Status_line_dirty_end=char_pos+width;
if (Status_line_dirty_begin > char_pos)
Status_line_dirty_begin=char_pos;
#endif
#if (UPDATE_METHOD == UPDATE_METHOD_FULL_PAGE)
(void)char_pos; // unused parameter
(void)width; // unused parameter
update_is_required=1;
#endif
}
/// ///
/// Converts a SDL_Surface (indexed colors or RGB) into an array of bytes /// Converts a SDL_Surface (indexed colors or RGB) into an array of bytes
/// (indexed colors). /// (indexed colors).

View File

@ -44,6 +44,8 @@ byte* Screen_pixels;
void Update_rect(short x, short y, unsigned short width, unsigned short height); void Update_rect(short x, short y, unsigned short width, unsigned short height);
void Flush_update(void); void Flush_update(void);
void Update_status_line(short char_pos, short width);
/// ///
/// Converts a SDL_Surface (indexed colors or RGB) into an array of bytes /// Converts a SDL_Surface (indexed colors or RGB) into an array of bytes
/// (indexed colors). /// (indexed colors).

View File

@ -215,7 +215,8 @@ typedef struct T_List_button
T_Special_button * Entry_button; ///< Pointer to the associated selection control. T_Special_button * Entry_button; ///< Pointer to the associated selection control.
T_Scroller_button * Scroller; ///< Pointer to the associated scroller T_Scroller_button * Scroller; ///< Pointer to the associated scroller
Func_draw_list_item Draw_list_item; ///< Func_draw_list_item Draw_list_item; ///< Function to call for each item to draw its line
byte Color_index; ///< Background color: From 0->MC_Black to 3->MC_White
struct T_List_button * Next; ///< Pointer to the next list button of current window. struct T_List_button * Next; ///< Pointer to the next list button of current window.
} T_List_button; } T_List_button;
@ -356,7 +357,7 @@ typedef struct
byte Screen_size_in_GIF; ///< Boolean, true to store current resolution in GIF files. byte Screen_size_in_GIF; ///< Boolean, true to store current resolution in GIF files.
byte Auto_nb_used; ///< Boolean, true to count colors in Palette screen. byte Auto_nb_used; ///< Boolean, true to count colors in Palette screen.
byte Default_resolution; ///< Default video mode to use on startup. Index in ::Video_mode. byte Default_resolution; ///< Default video mode to use on startup. Index in ::Video_mode.
char *Bookmark_directory[NB_BOOKMARKS];///< Bookmarked directories in fileselectors: This is the full dierctory name. char *Bookmark_directory[NB_BOOKMARKS];///< Bookmarked directories in fileselectors: This is the full directory name.
char Bookmark_label[NB_BOOKMARKS][8+1];///< Bookmarked directories in fileselectors: This is the displayed name. char Bookmark_label[NB_BOOKMARKS][8+1];///< Bookmarked directories in fileselectors: This is the displayed name.
int Window_pos_x; ///< Last window x position (9999 if unsupportd/irrelevant for the platform) int Window_pos_x; ///< Last window x position (9999 if unsupportd/irrelevant for the platform)
int Window_pos_y; ///< Last window y position (9999 if unsupportd/irrelevant for the platform) int Window_pos_y; ///< Last window y position (9999 if unsupportd/irrelevant for the platform)
@ -367,6 +368,8 @@ typedef struct
byte Sync_views; ///< Boolean, true when the Main and Spare should share their viewport settings. byte Sync_views; ///< Boolean, true when the Main and Spare should share their viewport settings.
byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus. byte Stylus_mode; ///< Boolean, true to tweak some tools (eg:Curve) for single-button stylus.
word Swap_buttons; ///< Sets which key swaps mouse buttons : 0=none, or MOD_CTRL, or MOD_ALT. word Swap_buttons; ///< Sets which key swaps mouse buttons : 0=none, or MOD_CTRL, or MOD_ALT.
char Scripts_directory[MAX_PATH_CHARACTERS];///< Full pathname of directory for Lua scripts
byte Allow_multi_shortcuts; ///< Boolean, true if the same key combination can trigger multiple shortcuts.
} T_Config; } T_Config;
// Structures utilisées pour les descriptions de pages et de liste de pages. // Structures utilisées pour les descriptions de pages et de liste de pages.

View File

@ -39,15 +39,17 @@
#if defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__) #if defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
// No X11 // No X11
#elif defined(__macosx__)
#include <Carbon/Carbon.h>
#import <corefoundation/corefoundation.h>
#import <sys/param.h>
#elif defined(__linux__) #elif defined(__linux__)
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif #endif
#endif #endif
#if defined(__macosx__)
#include <Carbon/Carbon.h>
#import <corefoundation/corefoundation.h>
#import <sys/param.h>
#endif
#include <SDL_image.h> #include <SDL_image.h>
#include "SFont.h" #include "SFont.h"
@ -483,12 +485,7 @@ byte *Render_text_TTF(const char *str, int font_number, int size, int antialias,
if (Fore_color==Back_color) if (Fore_color==Back_color)
{ {
if (Main_palette[Back_color].R+Main_palette[Back_color].G+Main_palette[Back_color].B > 128*3) new_fore=Best_color_perceptual_except(Main_palette[Back_color].R, Main_palette[Back_color].G, Main_palette[Back_color].B, Back_color);
// Back color is rather light:
new_fore=MC_Black;
else
// Back color is rather dark:
new_fore=MC_White;
} }
for (index=0; index < text_surface->w * text_surface->h; index++) for (index=0; index < text_surface->w * text_surface->h; index++)
@ -572,18 +569,18 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh
} }
// Calcul des dimensions // Calcul des dimensions
*height=SFont_TextHeight(font); *height=SFont_TextHeight(font, str);
*width=SFont_TextWidth(font, str); *width=SFont_TextWidth(font, str);
// Allocation d'une surface SDL // Allocation d'une surface SDL
text_surface=SDL_CreateRGBSurface(SDL_SWSURFACE, *width, *height, 8, 0, 0, 0, 0); text_surface=SDL_CreateRGBSurface(SDL_SWSURFACE, *width, *height, 8, 0, 0, 0, 0);
// Copy palette // Copy palette
SDL_SetPalette(text_surface, SDL_LOGPAL, font_surface->format->palette->colors, 0, 256); SDL_SetPalette(text_surface, SDL_LOGPAL, font_surface->format->palette->colors, 0, 256);
// Fill with backcolor // Fill with transparent color
rectangle.x=0; rectangle.x=0;
rectangle.y=0; rectangle.y=0;
rectangle.w=*width; rectangle.w=*width;
rectangle.h=*height; rectangle.h=*height;
SDL_FillRect(text_surface, &rectangle, Back_color); SDL_FillRect(text_surface, &rectangle, font->Transparent);
// Rendu du texte // Rendu du texte
SFont_Write(text_surface, font, 0, 0, str); SFont_Write(text_surface, font, 0, 0, str);
if (!text_surface) if (!text_surface)
@ -604,6 +601,29 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh
Get_SDL_Palette(font_surface->format->palette, palette); Get_SDL_Palette(font_surface->format->palette, palette);
// Swap current BG color with font's transparent color
if (font->Transparent != Back_color)
{
int c;
byte colmap[256];
// Swap palette entries
SWAP_BYTES(palette[font->Transparent].R, palette[Back_color].R)
SWAP_BYTES(palette[font->Transparent].G, palette[Back_color].G)
SWAP_BYTES(palette[font->Transparent].B, palette[Back_color].B)
// Define a colormap
for (c=0; c<256; c++)
colmap[c]=c;
// The swap
colmap[font->Transparent]=Back_color;
colmap[Back_color]=font->Transparent;
Remap_general_lowlevel(colmap, new_brush, new_brush, text_surface->w,text_surface->h, text_surface->w);
}
SDL_FreeSurface(text_surface); SDL_FreeSurface(text_surface);
SFont_FreeFont(font); SFont_FreeFont(font);

View File

@ -697,7 +697,7 @@ void Print_in_window(short x,short y,const char * str,byte text_color,byte backg
void Print_in_menu(const char * str, short position) void Print_in_menu(const char * str, short position)
{ {
Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light); Print_general((18+(position<<3))*Menu_factor_X,Menu_status_Y,str,MC_Black,MC_Light);
Update_rect((18+(position<<3))*Menu_factor_X,Menu_status_Y,strlen(str)*8*Menu_factor_X,8*Menu_factor_Y); Update_status_line(position, strlen(str));
} }
/// Draws the mouse coordinates on the menu /// Draws the mouse coordinates on the menu
@ -724,7 +724,6 @@ void Print_coordinates(void)
Num2str(Colorpicker_color,temp,3); Num2str(Colorpicker_color,temp,3);
Print_in_menu(temp,20); Print_in_menu(temp,20);
Print_general(170*Menu_factor_X,Menu_status_Y," ",0,Colorpicker_color); Print_general(170*Menu_factor_X,Menu_status_Y," ",0,Colorpicker_color);
Update_rect(170*Menu_factor_X,Menu_status_Y,8*Menu_factor_X,8*Menu_factor_Y);
} }
Num2str((dword)Paintbrush_X,temp,4); Num2str((dword)Paintbrush_X,temp,4);
@ -2721,6 +2720,48 @@ byte Best_color_perceptual(byte r,byte g,byte b)
return best_color; return best_color;
} }
byte Best_color_perceptual_except(byte r,byte g,byte b, byte except)
{
int col;
float best_diff=255.0*1.56905;
byte best_color=0;
float target_bri;
float bri;
float diff_b, diff_c, diff;
// Similar to Perceptual_lightness();
target_bri = sqrt(0.26*r*0.26*r + 0.55*g*0.55*g + 0.19*b*0.19*b);
for (col=0; col<256; col++)
{
if (col==except || Exclude_color[col])
continue;
diff_c = sqrt(
(0.26*(Main_palette[col].R-r))*
(0.26*(Main_palette[col].R-r))+
(0.55*(Main_palette[col].G-g))*
(0.55*(Main_palette[col].G-g))+
(0.19*(Main_palette[col].B-b))*
(0.19*(Main_palette[col].B-b)));
// Exact match
if (diff_c==0)
return col;
bri = sqrt(0.26*Main_palette[col].R*0.26*Main_palette[col].R + 0.55*Main_palette[col].G*0.55*Main_palette[col].G + 0.19*Main_palette[col].B*0.19*Main_palette[col].B);
diff_b = abs(target_bri-bri);
diff=0.25*(diff_b-diff_c)+diff_c;
if (diff<best_diff)
{
best_diff=diff;
best_color=col;
}
}
return best_color;
}
byte Old_black; byte Old_black;
byte Old_dark; byte Old_dark;

View File

@ -100,6 +100,7 @@ void Window_display_icon_sprite(word x_pos,word y_pos,byte type);
byte Best_color(byte red,byte green,byte blue); byte Best_color(byte red,byte green,byte blue);
byte Best_color_nonexcluded(byte red,byte green,byte blue); byte Best_color_nonexcluded(byte red,byte green,byte blue);
byte Best_color_perceptual(byte r,byte g,byte b); byte Best_color_perceptual(byte r,byte g,byte b);
byte Best_color_perceptual_except(byte r,byte g,byte b, byte except);
void Horizontal_XOR_line_zoom(short x_pos, short y_pos, short width); void Horizontal_XOR_line_zoom(short x_pos, short y_pos, short width);
void Vertical_XOR_line_zoom(short x_pos, short y_pos, short height); void Vertical_XOR_line_zoom(short x_pos, short y_pos, short height);