Merge all changes from trunk in CPCMode5 branch.

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1809 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2011-06-19 18:30:53 +00:00
commit 706049a2d9
59 changed files with 412 additions and 134 deletions

View File

@ -184,3 +184,67 @@ Lua:
Copy liblua.a to c:\msys\mingw\lib Copy liblua.a to c:\msys\mingw\lib
Copy lua51.dll to c:\msys\mingw\bin Copy lua51.dll to c:\msys\mingw\bin
== Atari TOS machines ==
The Atari build is very similar to the Linux one. The build might work on native machine with gcc 4.3> compiler,
but it wasn't tested. You can also build binary for Coldfire based machines(e.g. Firebee) by
replacing '-m68020-60' in makefile to '-mcpu=5475'.
Preferable way is to build GRAFX2 with use of cross compiler, you can get one from Vincent Riviere site:
(URL: http://vincent.riviere.free.fr/soft/m68k-atari-mint). There are versions for win32 (Cygwin) and
debian packages for latest Ubuntu (32/64bit).
Before compilation you have to build all the needed libraries mentioned in requirements.
To compile a Atari TOS executable, type in
make ATARICROSS=1 prefix=/usr/m68k-atari-mint
You can also add other options like NOTTF,NOLUA,NOLAYERS etc. to enable/disable program features..
If you don't know how build libraries here's some hints. Please note that prefix path in examples below is valid only under Linux,
in case of Cygwin the path will be '/opt/m68k-atari-mint'. There will be no prefix when building on native machine.
You have to omit 'sudo' under Cygwin and native build. Stick to this order and you will be fine ;> ...
The versions of libraries were tested, you can also try newer versions. As I mentioned earlier, replace '-m68020-60' with '-mcpu=5475'
if you want to target Coldfire machines.
libpng [optional](for png reading in SDL_image):
------------------------------------------------
note: you will need libzip too
libpng 1.2.44
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer"
sudo make install
or
libpng 1.4.44
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer -DPNG_NO_SETJMP"
sudo make install
libjpeg, libtiff [optional] (for jpeg/tiff support in SDL_image)
----------------------------------------------------------------
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer"
sudo make install
freetype 2.4.4 [optional] (for TTF fonts support, required by SDL_ttf)
----------------------------------------------------------------------
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint CFLAGS="-m68020-60 -O2 -fomit-frame-pointer"
sudo make install
lua 5.0.4 [optional] (for LUA scripting support)
------------------------------------------------
Here you have to customize makefiles, add prefixes, platform has to be set as generic.
SDL 1.2 [mandatory]
--------------------
note: best is to grab it directly from Mercurial repository
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint --disable-video-opengl --disable-shared --enable-static --disable-threads CFLAGS="-m68020-60 -O2 -fomit-frame-pointer"
sudo make install
SDL_ttf [optional] (for ttf fonts support, depends on SDL and freetype)
-------------------------------------------
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint --disable-shared --enable-static --with-sdl-prefix=/usr/m68k-atari-mint --with-freetype-prefix=/usr/m68k-atari-mint CFLAGS=" -m68020-60 -O2 -fomit-frame-pointer"
sudo make install
SDL_image 1.2.10 [mandatory]
----------------------------
./configure --prefix=/usr/m68k-atari-mint --disable-shared --enable-static --host=m68k-atari-mint --disable-shared --enable-static --with-sdl-prefix=/usr/m68k-atari-mint CFLAGS="-DHAVE_OPENGL=0 -m68020-60 -O2 -fomit-frame-pointer"
sudo make install
And that's it! :)

BIN
src/.DS_Store vendored

Binary file not shown.

View File

@ -50,8 +50,8 @@ ifdef COMSPEC
RMDIR = rmdir --ignore-fail-on-non-empty 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 $(shell sdl-config --cflags) $(TTFCOPT) $(JOYCOPT) $(VKEYCOPT) $(LUACOPT) $(LAYERCOPT)
LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng14 $(LUALOPT) LOPT = $(shell sdl-config --libs) -lSDL_image $(TTFLOPT) -lpng14 $(LUALOPT)
LUALOPT = -llua LUALOPT = -llua
CC = gcc CC = gcc
OBJDIR = ../obj/win32 OBJDIR = ../obj/win32
@ -74,8 +74,8 @@ else
RMDIR = rmdir --ignore-fail-on-non-empty 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 $(shell sdl-config --cflags) $(TTFCOPT)
LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2 LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lft2
CC = gcc CC = gcc
OBJDIR = ../obj/amiga OBJDIR = ../obj/amiga
ZIP = lha ZIP = lha
@ -100,8 +100,8 @@ else
SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE SDLCOPT = $(MACOSX_ARCH) -I$(FWDIR)/SDL.framework/Headers -I$(FWDIR)/SDL_image.framework/Headers -I$(FWDIR)/SDL_ttf.framework/Headers -D_THREAD_SAFE
#-framework SDL_ttf #-framework SDL_ttf
SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL SDLLOPT = -isysroot $(MACOSX_SYSROOT) $(MACOSX_ARCH) -L/usr/lib -framework SDL -framework SDL_image -framework Cocoa -framework Carbon -framework OpenGL
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 COPT = -D_DARWIN_C_SOURCE -D__macosx__ -D__linux__ -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -std=c99 -c -g $(LUACOPT) $(shell sdlCOPT) $(TTFCOPT) -I/usr/X11/include
LOPT = $(SDLLOPT) -llua -lpng -lz LOPT = $(shell sdlLOPT) -llua -lpng -lz
# Use gcc for compiling. Use ncc to build a callgraph and analyze the code. # Use gcc for compiling. Use ncc to build a callgraph and analyze the code.
CC = gcc CC = gcc
#CC = nccgen -ncgcc -ncld -ncfabs #CC = nccgen -ncgcc -ncld -ncfabs
@ -119,8 +119,8 @@ else
RMDIR = rmdir --ignore-fail-on-non-empty 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 $(shell sdl-config --cflags) $(TTFCOPT)
LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared LOPT = -lSDL_image $(shell sdl-config --libs) -lpng -ljpeg -lz $(TTFLOPT) -lfreetype2shared
CC = gcc CC = gcc
OBJDIR = ../obj/aros OBJDIR = ../obj/aros
STRIP = strip --strip-unneeded --remove-section .comment STRIP = strip --strip-unneeded --remove-section .comment
@ -135,8 +135,8 @@ else
RMDIR = rmdir --ignore-fail-on-non-empty 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 $(shell sdl-config --cflags) $(TTFCOPT)
LOPT = -lSDL_image `sdl-config --libs` -lpng -ljpeg -lz $(TTFLOPT) LOPT = -lSDL_image $(shell sdl-config --libs) -lpng -ljpeg -lz $(TTFLOPT)
CC = gcc CC = gcc
OBJDIR = ../obj/morphos OBJDIR = ../obj/morphos
ZIP = lha ZIP = lha
@ -151,8 +151,8 @@ else
RMDIR = rmdir --ignore-fail-on-non-empty 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 $(shell sdl-config --cflags) $(TTFCOPT) -I/boot/home/config/include
LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT)
CC = gcc CC = gcc
OBJDIR = ../obj/beos OBJDIR = ../obj/beos
ZIP = zip ZIP = zip
@ -172,8 +172,8 @@ 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 $(shell sdl-config --cflags) $(TTFCOPT) -I/boot/common/include $(LUACOPT)
LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT) LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) -lfreetype -lbe $(LUALOPT)
CC = gcc CC = gcc
OBJDIR = ../obj/haiku OBJDIR = ../obj/haiku
ZIP = zip ZIP = zip
@ -186,8 +186,8 @@ else
RMDIR = rmdir --ignore-fail-on-non-empty 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 $(shell sdl-config --cflags) $(TTFCOPT)
LOPT = `sdl-config --libs` -lSDL_image -lpng -ljpeg -lz $(TTFLOPT) LOPT = $(shell sdl-config --libs) -lSDL_image -lpng -ljpeg -lz $(TTFLOPT)
CC = gcc CC = gcc
OBJDIR = ../obj/skyos OBJDIR = ../obj/skyos
ZIP = zip ZIP = zip
@ -202,13 +202,30 @@ else
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__ $(shell sdl-config --cflags) $(TTFCOPT) $(LUACOPT)
LOPT = `sdl-config --libs` -lSDL_image $(TTFLOPT) -lpng $(LUALOPT) -lm LOPT = $(shell 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
ifeq ($(PLATFORM),FreeMiNT) #10
#Atari FreeMiNT/TOS specific
DELCOMMAND = rm -rf
MKDIR = mkdir -p
RMDIR = rmdir
CP = cp
ZIP = zip
PLATFORMFILES = gfx2.png
CC = gcc
BIN = ../bin/grafx2.ttp
LUALOPT = -llua
OBJDIR = ../obj/m68k-atari-mint
PLATFORM = m68k-atari-mint
STRIP = strip -s
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)
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
# 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
@ -232,8 +249,8 @@ else
#cross compile a Win32 executable #cross compile a Win32 executable
CC = i586-mingw32msvc-gcc CC = i586-mingw32msvc-gcc
BIN = ../bin/grafx2.exe BIN = ../bin/grafx2.exe
COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags` $(TTFCOPT) COPT = -W -Wall -Wdeclaration-after-statement -O$(OPTIM) -g -ggdb -Dmain=SDL_main $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --cflags) $(TTFCOPT)
LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi `/usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs` -lSDL_image $(TTFLOPT) LOPT = -mwindows -lmingw32 -lSDLmain -lSDL -lshlwapi $(shell /usr/local/cross-tools/i386-mingw32/bin/sdl-config --libs) -lSDL_image $(TTFLOPT)
OBJDIR = ../obj/win32 OBJDIR = ../obj/win32
PLATFORM = win32 PLATFORM = win32
else else
@ -271,8 +288,8 @@ else
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 -std=c99 -Wdeclaration-after-statement -D__MINT__ -ffast-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) -lm $(LAYERLOPT) -Wl,--stack,8k
else else
# Compiles a regular linux executable for the native platform # Compiles a regular linux executable for the native platform
@ -297,6 +314,7 @@ else
endif endif
endif endif
endif endif
endif
endif endif
### BUILD SETTINGS are set according to vars set in the platform selection, ### BUILD SETTINGS are set according to vars set in the platform selection,
@ -373,11 +391,11 @@ OBJ = $(OBJDIR)/main.o $(OBJDIR)/init.o $(OBJDIR)/graph.o $(OBJDIR)/sdlscreen.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 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_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_FILES = ../share/grafx2/scripts/samples_2.4/brush/ApplyColor.lua ../share/grafx2/scripts/samples_2.4/brush/Fisheye.lua ../share/grafx2/scripts/samples_2.4/brush/GrayscaleAvg.lua ../share/grafx2/scripts/samples_2.4/brush/GrayscaleDesat.lua ../share/grafx2/scripts/samples_2.4/brush/Halfsmooth.lua ../share/grafx2/scripts/samples_2.4/brush/Waves.lua ../share/grafx2/scripts/samples_2.4/demo/3DPalette.lua ../share/grafx2/scripts/samples_2.4/demo/Ellipse.lua ../share/grafx2/scripts/samples_2.4/demo/FlipPicture.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 \ ../share/grafx2/scripts/samples_2.4/demo/SierpinskyCarpet.lua ../share/grafx2/scripts/samples_2.4/demo/SierpinskyTriangle.lua ../share/grafx2/scripts/samples_2.4/demo/Spritesheet.lua ../share/grafx2/scripts/samples_2.4/demo/brush/Amigaball.lua ../share/grafx2/scripts/samples_2.4/demo/brush/ColorSphere.lua ../share/grafx2/scripts/samples_2.4/demo/brush/FindAA.lua ../share/grafx2/scripts/samples_2.4/demo/brush/Mandelbrot.lua ../share/grafx2/scripts/samples_2.4/libs/dawnbringer_lib.lua ../share/grafx2/scripts/samples_2.4/libs/memory.lua \
../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.4/palette/Desaturate.lua ../share/grafx2/scripts/samples_2.4/palette/ExpandColors.lua ../share/grafx2/scripts/samples_2.4/palette/FillColorCube.lua ../share/grafx2/scripts/samples_2.4/palette/InvertedRGB.lua ../share/grafx2/scripts/samples_2.4/palette/Set3bit.lua ../share/grafx2/scripts/samples_2.4/palette/Set6bit.lua ../share/grafx2/scripts/samples_2.4/palette/SetC64Palette.lua ../share/grafx2/scripts/samples_2.4/palette/ShiftHue.lua ../share/grafx2/scripts/samples_2.4/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 \ ../share/grafx2/scripts/samples_2.4/picture/DrawGridIsometric.lua ../share/grafx2/scripts/samples_2.4/picture/DrawgridOrthogonal_Index.lua ../share/grafx2/scripts/samples_2.4/picture/DrawGridOrthogonal_RGB.lua ../share/grafx2/scripts/samples_2.4/picture/GlassGridFilter.lua ../share/grafx2/scripts/samples_2.4/picture/PaletteToPicture.lua ../share/grafx2/scripts/samples_2.4/picture/Pic2isometric.lua ../share/grafx2/scripts/samples_2.4/picture/Rainbow-Dark2Bright.lua ../share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB.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 ../share/grafx2/scripts/samples_2.4/picture/RemapImage2RGB_ed.lua ../share/grafx2/scripts/samples_2.4/picture/RemapImageTo3bitPal.lua ../share/grafx2/scripts/samples_2.4/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
@ -387,6 +405,12 @@ 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 Grafx2.app/Contents/Resources/scripts mkdir -p Grafx2.app Grafx2.app/Contents Grafx2.app/Contents/Frameworks Grafx2.app/Contents/MacOS Grafx2.app/Contents/Resources Grafx2.app/Contents/Resources/scripts
mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4
mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/brush
mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/demo
mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/libs
mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/palette
mkdir -p Grafx2.app/Contents/Resources/scripts/samples_2.4/picture
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 Grafx2.icns Grafx2.app/Contents/Resources
@ -394,13 +418,18 @@ $(MACAPPEXE) : $(BIN)
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 -r $(SCRIPT_FILES) Grafx2.app/Contents/Resources/scripts cp -r ../share/grafx2/scripts/samples_2.4/brush Grafx2.app/Contents/Resources/scripts/samples_2.4
cp -r ../share/grafx2/scripts/samples_2.4/demo Grafx2.app/Contents/Resources/scripts/samples_2.4
cp -r ../share/grafx2/scripts/samples_2.4/libs Grafx2.app/Contents/Resources/scripts/samples_2.4
cp -r ../share/grafx2/scripts/samples_2.4/palette Grafx2.app/Contents/Resources/scripts/samples_2.4
cp -r ../share/grafx2/scripts/samples_2.4/picture Grafx2.app/Contents/Resources/scripts/samples_2.4
mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions mkdir -p Grafx2.app/Contents/Frameworks/SDL.framework/Versions
mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions mkdir -p Grafx2.app/Contents/Frameworks/SDL_image.framework/Versions
# mkdir -p Grafx2.app/Contents/Frameworks/SDL_ttf.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.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_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 # cp -Rp $(FWDIR)/SDL_ttf.framework/Versions/A Grafx2.app/Contents/Frameworks/SDL_ttf.framework/Versions
# remove those
rm -fr Grafx2.app/Contents/Frameworks/SDL.framework/Versions/A/Headers 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.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/Headers
@ -483,13 +512,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.4 || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4
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.4/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/demo || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/demo/brush || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/libs || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/palette || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/palette
test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture test -d $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture || $(MKDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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
@ -515,13 +544,13 @@ uninstall :
$(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) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%) $(DELCOMMAND) $(SCRIPT_FILES:../share%=$(DESTDIR)$(datadir)%)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3/picture,) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/picture,)
$(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.4/palette),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/demo/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/demo),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/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.4/brush),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4/brush,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.3,) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/samples_2.4,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2/scripts/libs),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts/libs,) $(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/scripts),$(RMDIR) $(DESTDIR)$(datadir)/grafx2/scripts,)
$(if $(wildcard $(DESTDIR)$(datadir)/grafx2),$(RMDIR) $(DESTDIR)$(datadir)/grafx2,) $(if $(wildcard $(DESTDIR)$(datadir)/grafx2),$(RMDIR) $(DESTDIR)$(datadir)/grafx2,)

View File

@ -36,6 +36,10 @@
#include "sdlscreen.h" #include "sdlscreen.h"
#include "brush.h" #include "brush.h"
// Data used during brush rotation operation
static byte * Brush_rotate_buffer;
static int Brush_rotate_width;
static int Brush_rotate_height;
// Calcul de redimensionnement du pinceau pour éviter les débordements de // Calcul de redimensionnement du pinceau pour éviter les débordements de
// l'écran et de l'image // l'écran et de l'image
@ -1775,7 +1779,8 @@ void Interpolate_texture(int start_x,int start_y,int xt1,int yt1,
void Compute_quad_texture(int x1,int y1,int xt1,int yt1, void Compute_quad_texture( byte *texture, int texture_width,
int x1,int y1,int xt1,int yt1,
int x2,int y2,int xt2,int yt2, int x2,int y2,int xt2,int yt2,
int x3,int y3,int xt3,int yt3, int x3,int y3,int xt3,int yt3,
int x4,int y4,int xt4,int yt4, int x4,int y4,int xt4,int yt4,
@ -1824,7 +1829,7 @@ void Compute_quad_texture(int x1,int y1,int xt1,int yt1,
xt=Round((float)(ScanY_Xt[0][y])+(temp*(ScanY_Xt[1][y]-ScanY_Xt[0][y]))); xt=Round((float)(ScanY_Xt[0][y])+(temp*(ScanY_Xt[1][y]-ScanY_Xt[0][y])));
yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y])));
if (xt>=0 && yt>=0) if (xt>=0 && yt>=0)
buffer[x+(y*width)]=*(Brush_original_pixels + yt * Brush_width + xt); buffer[x+(y*width)]=*(texture + yt * texture_width + xt);
} }
for (; x<width; x++) for (; x<width; x++)
buffer[x+(y*width)]=Back_color; buffer[x+(y*width)]=Back_color;
@ -1840,13 +1845,86 @@ void Compute_quad_texture(int x1,int y1,int xt1,int yt1,
ScanY_Xt[0] = ScanY_Xt[1] = ScanY_Yt[0] = ScanY_Yt[1] = ScanY_X[0] = ScanY_X[1] = NULL; ScanY_Xt[0] = ScanY_Xt[1] = ScanY_Yt[0] = ScanY_Yt[1] = ScanY_X[0] = ScanY_X[1] = NULL;
} }
void Scale2x(byte **bitmap, int *width, int *height)
{
byte *new_bitmap;
int new_width;
int new_height;
int x_pos, y_pos;
byte b,d,e,f,h;
new_width=(*width)*2;
new_height=(*height)*2;
new_bitmap=(byte *)(malloc(new_width*new_height));
if (!new_bitmap)
return;
// Algorithm from scale2x sourceforge project
for (y_pos=0; y_pos<*height; y_pos++)
{
for (x_pos=0; x_pos<*width; x_pos++)
{
// Check colors in pixels: (E is center)
// A B C
// D E F
// G H I
e=*(*bitmap + y_pos* *width + x_pos);
d = (x_pos==0) ? e : *(*bitmap + y_pos* *width + x_pos-1);
f = (x_pos==*width-1) ? e : *(*bitmap + y_pos* *width + x_pos+1);
b = (y_pos==0) ? e : *(*bitmap + (y_pos-1)* *width + x_pos);
h = (y_pos==*height-1) ? e : *(*bitmap + (y_pos+1)* *width + x_pos);
if (b != h && d != f)
{
*(new_bitmap + (y_pos*2)*new_width + x_pos*2) = d == b ? d : e;
*(new_bitmap + (y_pos*2)*new_width + x_pos*2+1) = b == f ? f : e;
*(new_bitmap + (y_pos*2+1)*new_width + x_pos*2) = d == h ? d : e;
*(new_bitmap + (y_pos*2+1)*new_width + x_pos*2+1) = h == f ? f : e;
}
else
{
*(new_bitmap + (y_pos*2)*new_width + x_pos*2) = e;
*(new_bitmap + (y_pos*2)*new_width + x_pos*2+1) = e;
*(new_bitmap + (y_pos*2+1)*new_width + x_pos*2) = e;
*(new_bitmap + (y_pos*2+1)*new_width + x_pos*2+1) = e;
}
}
}
*width=new_width;
*height=new_height;
*bitmap=new_bitmap;
}
void Begin_brush_rotation(void)
{
Brush_rotate_buffer=Brush_original_pixels;
Brush_rotate_width=Brush_width;
Brush_rotate_height=Brush_height;
Scale2x(&Brush_rotate_buffer, &Brush_rotate_width, &Brush_rotate_height);
Scale2x(&Brush_rotate_buffer, &Brush_rotate_width, &Brush_rotate_height);
Scale2x(&Brush_rotate_buffer, &Brush_rotate_width, &Brush_rotate_height);
}
void End_brush_rotation(void)
{
if (Brush_rotate_buffer && Brush_rotate_buffer != Brush_original_pixels)
{
free(Brush_rotate_buffer);
Brush_rotate_buffer=NULL;
}
}
void Rotate_brush(float angle) void Rotate_brush(float angle)
{ {
byte * new_brush; byte * new_brush;
int new_brush_width; // Width de la nouvelle brosse int new_brush_width; // Width de la nouvelle brosse
int new_brush_height; // Height de la nouvelle brosse int new_brush_height; // Height de la nouvelle brosse
int offset=0;
short x1,y1,x2,y2,x3,y3,x4,y4; short x1,y1,x2,y2,x3,y3,x4,y4;
int start_x,end_x,start_y,end_y; int start_x,end_x,start_y,end_y;
@ -1862,6 +1940,7 @@ void Rotate_brush(float angle)
start_y=1-(Brush_height>>1); start_y=1-(Brush_height>>1);
end_x=start_x+Brush_width-1; end_x=start_x+Brush_width-1;
end_y=start_y+Brush_height-1; end_y=start_y+Brush_height-1;
//offset = Brush_rotate_width/Brush_width-1;
Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1);
Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2);
@ -1885,10 +1964,11 @@ void Rotate_brush(float angle)
return; return;
} }
// Et maintenant on calcule la nouvelle brosse tournée. // Et maintenant on calcule la nouvelle brosse tournée.
Compute_quad_texture(x1,y1, 0, 0, Compute_quad_texture( Brush_rotate_buffer, Brush_rotate_width,
x2,y2,Brush_width-1, 0, x1,y1, offset, offset,
x3,y3, 0,Brush_height-1, x2,y2,Brush_rotate_width-offset-1, offset,
x4,y4,Brush_width-1,Brush_height-1, x3,y3, offset,Brush_rotate_height-offset-1,
x4,y4,Brush_rotate_width-offset-1,Brush_rotate_height-offset-1,
new_brush,new_brush_width,new_brush_height); new_brush,new_brush_width,new_brush_height);
if (Realloc_brush(new_brush_width, new_brush_height, new_brush, NULL)) if (Realloc_brush(new_brush_width, new_brush_height, new_brush, NULL))
@ -1907,7 +1987,8 @@ void Rotate_brush(float angle)
void Draw_quad_texture_preview(int x1,int y1,int xt1,int yt1, void Draw_quad_texture_preview(byte *texture, int texture_width,
int x1,int y1,int xt1,int yt1,
int x2,int y2,int xt2,int yt2, int x2,int y2,int xt2,int yt2,
int x3,int y3,int xt3,int yt3, int x3,int y3,int xt3,int yt3,
int x4,int y4,int xt4,int yt4) int x4,int y4,int xt4,int yt4)
@ -1966,7 +2047,7 @@ void Draw_quad_texture_preview(int x1,int y1,int xt1,int yt1,
yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y]))); yt=Round((float)(ScanY_Yt[0][y])+(temp*(ScanY_Yt[1][y]-ScanY_Yt[0][y])));
if (xt>=0 && yt>=0) if (xt>=0 && yt>=0)
{ {
color=Read_pixel_from_brush(xt,yt); color=Brush_colormap[*(texture+xt+yt*texture_width)];
if (color!=Back_color) if (color!=Back_color)
Pixel_preview(x,y_,color); Pixel_preview(x,y_,color);
} }
@ -1990,6 +2071,7 @@ void Rotate_brush_preview(float angle)
int start_x,end_x,start_y,end_y; int start_x,end_x,start_y,end_y;
float cos_a=cos(angle); float cos_a=cos(angle);
float sin_a=sin(angle); float sin_a=sin(angle);
int offset=0;
// Calcul des coordonnées des 4 coins: // Calcul des coordonnées des 4 coins:
// 1 2 // 1 2
@ -1999,6 +2081,7 @@ void Rotate_brush_preview(float angle)
start_y=1-(Brush_height>>1); start_y=1-(Brush_height>>1);
end_x=start_x+Brush_width-1; end_x=start_x+Brush_width-1;
end_y=start_y+Brush_height-1; end_y=start_y+Brush_height-1;
//offset = Brush_rotate_width/Brush_width-1;
Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1); Transform_point(start_x,start_y, cos_a,sin_a, &x1,&y1);
Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2); Transform_point(end_x ,start_y, cos_a,sin_a, &x2,&y2);
@ -2015,10 +2098,11 @@ void Rotate_brush_preview(float angle)
y4+=Brush_rotation_center_Y; y4+=Brush_rotation_center_Y;
// Et maintenant on dessine la brosse tournée. // Et maintenant on dessine la brosse tournée.
Draw_quad_texture_preview(x1,y1, 0, 0, Draw_quad_texture_preview(Brush_rotate_buffer, Brush_rotate_width,
x2,y2,Brush_width-1, 0, x1, y1, offset, offset,
x3,y3, 0,Brush_height-1, x2, y2, Brush_rotate_width-offset-1, offset,
x4,y4,Brush_width-1,Brush_height-1); x3, y3, offset, Brush_rotate_height-offset-1,
x4, y4, Brush_rotate_width-offset-1, Brush_rotate_height-offset-1);
start_x=Min(Min(x1,x2),Min(x3,x4)); start_x=Min(Min(x1,x2),Min(x3,x4));
end_x=Max(Max(x1,x2),Max(x3,x4)); end_x=Max(Max(x1,x2),Max(x3,x4));
start_y=Min(Min(y1,y2),Min(y3,y4)); start_y=Min(Min(y1,y2),Min(y3,y4));

View File

@ -125,5 +125,7 @@ byte Realloc_brush(word new_brush_width, word new_brush_height, byte *new_brush,
/// Sets brush's original palette and color mapping. /// Sets brush's original palette and color mapping.
void Brush_set_palette(T_Palette *palette); void Brush_set_palette(T_Palette *palette);
void Begin_brush_rotation(void);
void End_brush_rotation(void);
#endif #endif

View File

@ -42,7 +42,6 @@
#define M_PI 3.141592653589793238462643 #define M_PI 3.141592653589793238462643
#endif #endif
/// Simulates clicking the "Draw" button. /// Simulates clicking the "Draw" button.
void Return_to_draw_mode(void) void Return_to_draw_mode(void)
{ {
@ -971,8 +970,7 @@ void Rotate_brush_1_5(void)
{ {
dx=Paintbrush_X-Brush_rotation_center_X; dx=Paintbrush_X-Brush_rotation_center_X;
dy=Paintbrush_Y-Brush_rotation_center_Y; dy=Paintbrush_Y-Brush_rotation_center_Y;
angle=acos(((float)dx)/sqrt((dx*dx)+(dy*dy))); angle=M_2PI-atan2(dy,dx);
if (dy>0) angle=M_2PI-angle;
} }
if (Menu_is_visible) if (Menu_is_visible)

View File

@ -45,7 +45,7 @@
#include "graph.h" #include "graph.h"
#include "filesel.h" // Read_list_of_drives() #include "filesel.h" // Read_list_of_drives()
#include "realpath.h" #include "realpath.h"
#include "setup.h"
/// Lua scripts bound to shortcut keys. /// Lua scripts bound to shortcut keys.
char * Bound_script[10]; char * Bound_script[10];
@ -457,30 +457,44 @@ int L_DrawCircle(lua_State* L)
int L_DrawDisk(lua_State* L) int L_DrawDisk(lua_State* L)
{ {
int center_x, center_y, r, c; int center_x, center_y, diameter, c, r, even;
long circle_limit; long circle_limit;
short x_pos,y_pos; short x_pos,y_pos;
short min_x,max_x,min_y,max_y; short min_x,max_x,min_y,max_y;
double r_float;
int nb_args = lua_gettop(L); int nb_args = lua_gettop(L);
LUA_ARG_LIMIT(4, "drawdisk"); LUA_ARG_LIMIT(4, "drawdisk");
LUA_ARG_NUMBER(1, "drawdisk", center_x, INT_MIN, INT_MAX); 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(2, "drawdisk", center_y, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(3, "drawdisk", r, INT_MIN, INT_MAX); LUA_ARG_NUMBER(3, "drawdisk", r_float, INT_MIN, INT_MAX);
LUA_ARG_NUMBER(4, "drawdisk", c, INT_MIN, INT_MAX); LUA_ARG_NUMBER(4, "drawdisk", c, INT_MIN, INT_MAX);
circle_limit = r*r; if (r_float<0.0)
return 0;
diameter=(int)(floor(r_float*2.0+1.0));
r=diameter/2;
even=!(diameter&1);
circle_limit = Circle_squared_diameter(diameter);
// Compute clipping limits // Compute clipping limits
min_x=center_x-r<0 ? 0 : center_x-r; min_x=center_x-r+even<0 ? 0 : center_x-r+even;
max_x=center_x+r>=Main_image_width? Main_image_width-1 : 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; min_y=center_y-r+even<0 ? 0 : center_y-r+even;
max_y=center_y+r>=Main_image_height? Main_image_height-1 : 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 (y_pos=min_y;y_pos<=max_y;y_pos++)
{
short y=(y_pos-center_y)*2-even;
for (x_pos=min_x;x_pos<=max_x;x_pos++) for (x_pos=min_x;x_pos<=max_x;x_pos++)
{
short x=(x_pos-center_x)*2-even;
if (x*x+y*y <= circle_limit)
Pixel_in_current_screen(x_pos,y_pos,c,0); Pixel_in_current_screen(x_pos,y_pos,c,0);
}
}
return 0; return 0;
} }
@ -690,6 +704,22 @@ int L_MatchColor(lua_State* L)
return 1; return 1;
} }
int L_MatchColor2(lua_State* L)
{
double r, g, b;
int c;
int nb_args=lua_gettop(L);
LUA_ARG_LIMIT (3, "matchcolor2");
LUA_ARG_NUMBER(1, "matchcolor2", r, -DBL_MAX, DBL_MAX);
LUA_ARG_NUMBER(2, "matchcolor2", g, -DBL_MAX, DBL_MAX);
LUA_ARG_NUMBER(3, "matchcolor2", b, -DBL_MAX, DBL_MAX);
c = Best_color_perceptual(clamp_byte(r),clamp_byte(g),clamp_byte(b));
lua_pushinteger(L, c);
return 1;
}
int L_GetForeColor(lua_State* L) int L_GetForeColor(lua_State* L)
{ {
lua_pushinteger(L, Fore_color); lua_pushinteger(L, Fore_color);
@ -1461,8 +1491,8 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
strcpy(buf, "LUA_PATH="); strcpy(buf, "LUA_PATH=");
strcat(buf, Data_directory); strcat(buf, Data_directory);
Append_path(buf+9, "scripts", NULL); Append_path(buf+9, SCRIPTS_SUBDIRECTORY, NULL);
Append_path(buf+9, "libs", NULL); Append_path(buf+9, LUALIB_SUBDIRECTORY, NULL);
Append_path(buf+9, "?.lua", NULL); Append_path(buf+9, "?.lua", NULL);
putenv(buf); putenv(buf);
@ -1506,6 +1536,7 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
lua_register(L,"gettranscolor",L_GetTransColor); lua_register(L,"gettranscolor",L_GetTransColor);
lua_register(L,"matchcolor",L_MatchColor); lua_register(L,"matchcolor",L_MatchColor);
lua_register(L,"matchcolor2",L_MatchColor2);
// ui // ui
lua_register(L,"inputbox",L_InputBox); lua_register(L,"inputbox",L_InputBox);

View File

@ -46,6 +46,11 @@
#endif #endif
#endif #endif
#ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif
#include <stdlib.h> #include <stdlib.h>
#include "errors.h" #include "errors.h"
@ -1102,7 +1107,7 @@ typedef struct
dword Size_2; // 40 dword Size_2; // 40
dword Width; dword Width;
dword Height; int32_t Height; // signed: negative means a top-down bitmap (rare)
word Planes; // 1 word Planes; // 1
word Nb_bits; // 1,4,8 ou 24 word Nb_bits; // 1,4,8 ou 24
dword Compression; dword Compression;
@ -1132,7 +1137,7 @@ void Test_BMP(T_IO_Context * context)
&& Read_dword_le(file,&(header.Offset)) && Read_dword_le(file,&(header.Offset))
&& Read_dword_le(file,&(header.Size_2)) && Read_dword_le(file,&(header.Size_2))
&& Read_dword_le(file,&(header.Width)) && Read_dword_le(file,&(header.Width))
&& Read_dword_le(file,&(header.Height)) && Read_dword_le(file,(dword *)&(header.Height))
&& Read_word_le(file,&(header.Planes)) && Read_word_le(file,&(header.Planes))
&& Read_word_le(file,&(header.Nb_bits)) && Read_word_le(file,&(header.Nb_bits))
&& Read_dword_le(file,&(header.Compression)) && Read_dword_le(file,&(header.Compression))
@ -1209,6 +1214,7 @@ void Load_BMP(T_IO_Context * context)
word line_size; word line_size;
byte a,b,c=0; byte a,b,c=0;
long file_size; long file_size;
byte negative_height;
Get_full_filename(filename, context->File_name, context->File_directory); Get_full_filename(filename, context->File_name, context->File_directory);
@ -1225,7 +1231,7 @@ void Load_BMP(T_IO_Context * context)
&& Read_dword_le(file,&(header.Offset)) && Read_dword_le(file,&(header.Offset))
&& Read_dword_le(file,&(header.Size_2)) && Read_dword_le(file,&(header.Size_2))
&& Read_dword_le(file,&(header.Width)) && Read_dword_le(file,&(header.Width))
&& Read_dword_le(file,&(header.Height)) && Read_dword_le(file,(dword *)&(header.Height))
&& Read_word_le(file,&(header.Planes)) && Read_word_le(file,&(header.Planes))
&& Read_word_le(file,&(header.Nb_bits)) && Read_word_le(file,&(header.Nb_bits))
&& Read_dword_le(file,&(header.Compression)) && Read_dword_le(file,&(header.Compression))
@ -1250,6 +1256,16 @@ void Load_BMP(T_IO_Context * context)
File_error=1; File_error=1;
} }
if (header.Height < 0)
{
negative_height=1;
header.Height = -header.Height;
}
else
{
negative_height=0;
}
if (!File_error) if (!File_error)
{ {
Pre_load(context, header.Width,header.Height,file_size,FORMAT_BMP,PIXEL_SIMPLE,0); Pre_load(context, header.Width,header.Height,file_size,FORMAT_BMP,PIXEL_SIMPLE,0);
@ -1271,6 +1287,9 @@ void Load_BMP(T_IO_Context * context)
context->Width=header.Width; context->Width=header.Width;
context->Height=header.Height; context->Height=header.Height;
if (fseek(file, header.Offset, SEEK_SET))
File_error=2;
switch (header.Compression) switch (header.Compression)
{ {
case 0 : // Pas de compression case 0 : // Pas de compression
@ -1283,26 +1302,29 @@ void Load_BMP(T_IO_Context * context)
line_size=(line_size*header.Nb_bits)>>3; line_size=(line_size*header.Nb_bits)>>3;
buffer=(byte *)malloc(line_size); buffer=(byte *)malloc(line_size);
for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++)
{ {
short target_y;
target_y = negative_height ? y_pos : context->Height-1-y_pos;
if (Read_bytes(file,buffer,line_size)) if (Read_bytes(file,buffer,line_size))
for (x_pos=0; x_pos<context->Width; x_pos++) for (x_pos=0; x_pos<context->Width; x_pos++)
switch (header.Nb_bits) switch (header.Nb_bits)
{ {
case 8 : case 8 :
Set_pixel(context, x_pos,y_pos,buffer[x_pos]); Set_pixel(context, x_pos,target_y,buffer[x_pos]);
break; break;
case 4 : case 4 :
if (x_pos & 1) if (x_pos & 1)
Set_pixel(context, x_pos,y_pos,buffer[x_pos>>1] & 0xF); Set_pixel(context, x_pos,target_y,buffer[x_pos>>1] & 0xF);
else else
Set_pixel(context, x_pos,y_pos,buffer[x_pos>>1] >> 4 ); Set_pixel(context, x_pos,target_y,buffer[x_pos>>1] >> 4 );
break; break;
case 1 : case 1 :
if ( buffer[x_pos>>3] & (0x80>>(x_pos&7)) ) if ( buffer[x_pos>>3] & (0x80>>(x_pos&7)) )
Set_pixel(context, x_pos,y_pos,1); Set_pixel(context, x_pos,target_y,1);
else else
Set_pixel(context, x_pos,y_pos,0); Set_pixel(context, x_pos,target_y,0);
} }
else else
File_error=2; File_error=2;
@ -1481,11 +1503,14 @@ void Load_BMP(T_IO_Context * context)
line_size+=(4-x_pos); line_size+=(4-x_pos);
buffer=(byte *)malloc(line_size); buffer=(byte *)malloc(line_size);
for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++)
{ {
short target_y;
target_y = negative_height ? y_pos : context->Height-1-y_pos;
if (Read_bytes(file,buffer,line_size)) if (Read_bytes(file,buffer,line_size))
for (x_pos=0,index=0; x_pos<context->Width; x_pos++,index+=3) for (x_pos=0,index=0; x_pos<context->Width; x_pos++,index+=3)
Set_pixel_24b(context, x_pos,y_pos,buffer[index+2],buffer[index+1],buffer[index+0]); Set_pixel_24b(context, x_pos,target_y,buffer[index+2],buffer[index+1],buffer[index+0]);
else else
File_error=2; File_error=2;
} }
@ -1495,13 +1520,15 @@ void Load_BMP(T_IO_Context * context)
case 32: case 32:
line_size=context->Width*4; line_size=context->Width*4;
buffer=(byte *)malloc(line_size); buffer=(byte *)malloc(line_size);
for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++)
{ {
short target_y;
target_y = negative_height ? y_pos : context->Height-1-y_pos;
if (Read_bytes(file,buffer,line_size)) if (Read_bytes(file,buffer,line_size))
for (x_pos=0; x_pos<context->Width; x_pos++) for (x_pos=0; x_pos<context->Width; x_pos++)
{ {
dword pixel=*(((dword *)buffer)+x_pos); dword pixel=*(((dword *)buffer)+x_pos);
Set_pixel_24b(context, x_pos,y_pos,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask)); Set_pixel_24b(context, x_pos,target_y,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask));
} }
else else
File_error=2; File_error=2;
@ -1512,13 +1539,15 @@ void Load_BMP(T_IO_Context * context)
case 16: case 16:
line_size=(context->Width*2) + (context->Width&1)*2; line_size=(context->Width*2) + (context->Width&1)*2;
buffer=(byte *)malloc(line_size); buffer=(byte *)malloc(line_size);
for (y_pos=context->Height-1; ((y_pos>=0) && (!File_error)); y_pos--) for (y_pos=0; (y_pos < context->Height && !File_error); y_pos++)
{ {
short target_y;
target_y = negative_height ? y_pos : context->Height-1-y_pos;
if (Read_bytes(file,buffer,line_size)) if (Read_bytes(file,buffer,line_size))
for (x_pos=0; x_pos<context->Width; x_pos++) for (x_pos=0; x_pos<context->Width; x_pos++)
{ {
word pixel=*(((word *)buffer)+x_pos); word pixel=*(((word *)buffer)+x_pos);
Set_pixel_24b(context, x_pos,y_pos,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask)); Set_pixel_24b(context, x_pos,target_y,Bitmap_mask(pixel,red_mask),Bitmap_mask(pixel,green_mask),Bitmap_mask(pixel,blue_mask));
} }
else else
File_error=2; File_error=2;

View File

@ -120,7 +120,8 @@ byte Native_filesel(byte load)
// Check if cancel // Check if cancel
return CommDlgExtendedError(); return CommDlgExtendedError();
} }
#else #else ifndef(__linux__) // This makes no sense on X11-oriented platform. Nothing is really native there.
#warning "EXPERIMENTAL function for native fileselector not available for this platform!"
return 255; // fail ! return 255; // fail !
#endif #endif
} }
@ -437,7 +438,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format)
} }
if(!bFound){ if(!bFound){
Add_element_to_list(list, "..",1,Format_filename("/",19,1),ICON_NONE); // add if not present Add_element_to_list(list, "..",Format_filename("/",19,1),1,ICON_NONE); // add if not present
list->Nb_directories ++; list->Nb_directories ++;
} }
@ -1401,8 +1402,9 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context)
if (load) if (load)
{ {
#if defined(__MINT__) #if defined(__MINT__)
chdir(Main_current_directory);
static char path[1024]={0}; static char path[1024]={0};
chdir(Main_current_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);

View File

@ -1340,6 +1340,20 @@ void Draw_filled_circle(short center_x,short center_y,short radius,byte color)
Update_part_of_screen(start_x,start_y,end_x+1-start_x,end_y+1-start_y); Update_part_of_screen(start_x,start_y,end_x+1-start_x,end_y+1-start_y);
} }
int Circle_squared_diameter(int diameter)
{
int result = diameter*diameter;
// Trick to make some circles rounder, even though
// mathematically incorrect.
if (diameter==3 || diameter==9)
return result-2;
if (diameter==11)
return result-6;
if (diameter==14)
return result-4;
return result;
}
// -- Tracer général d'une ellipse vide ----------------------------------- // -- Tracer général d'une ellipse vide -----------------------------------

View File

@ -67,6 +67,8 @@ 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_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);
int Circle_squared_diameter(int diameter);
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);
void Draw_empty_ellipse_preview (short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color); void Draw_empty_ellipse_preview (short center_x,short center_y,short horizontal_radius,short vertical_radius,byte color);
void Hide_empty_ellipse_preview (short center_x,short center_y,short horizontal_radius,short vertical_radius); void Hide_empty_ellipse_preview (short center_x,short center_y,short horizontal_radius,short vertical_radius);

View File

@ -411,6 +411,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT ("") HELP_TEXT ("")
HELP_BOLD (" AROS PORT") HELP_BOLD (" AROS PORT")
HELP_TEXT ("") HELP_TEXT ("")
HELP_TEXT (" Yannick")
HELP_TEXT (" Fernando Mastandrea (masta.uy)") HELP_TEXT (" Fernando Mastandrea (masta.uy)")
HELP_TEXT (" Markus Weiss") HELP_TEXT (" Markus Weiss")
HELP_TEXT ("") HELP_TEXT ("")
@ -459,21 +460,22 @@ static const T_Help_table helptable_credits[] =
HELP_TITLE(" BUGFINDERS") HELP_TITLE(" BUGFINDERS")
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 antdzeryn blumunkee ")
HELP_TEXT (" Ced DarkDefende DawnBringer ") HELP_TEXT (" BDCIron Ced DarkDefende ")
HELP_TEXT (" El Topo falenblood fanickbux ") HELP_TEXT (" DawnBringer El Topo falenblood ")
HELP_TEXT (" fano fogbot121 Frost ") HELP_TEXT (" fanickbux fano fogbot121 ")
HELP_TEXT (" Grimmy Gürkan Sengün Hatch ") HELP_TEXT (" Frost Grimmy Gürkan Sengün ")
HELP_TEXT (" HoraK-FDF iLKke Iw2evk ") HELP_TEXT (" Hatch HoraK-FDF iLKke ")
HELP_TEXT (" jackfrost128 Jamon keito ") HELP_TEXT (" Iw2evk jackfrost128 Jamon ")
HELP_TEXT (" kusma Lord Graga Lorenzo Gatti ") HELP_TEXT (" keito kusma Lord Graga ")
HELP_TEXT (" MagerValp maymunbeyin mind ") HELP_TEXT (" Lorenzo Gatti MagerValp maymunbeyin ")
HELP_TEXT (" MooZ Pasi Kallinen the Peach ") HELP_TEXT (" mind MooZ Pasi Kallinen ")
HELP_TEXT (" petter PheeL Ravey1138 ") HELP_TEXT (" the Peach petter PheeL ")
HELP_TEXT (" richienyhus sm4tik spratek ") HELP_TEXT (" Ravey1138 richienyhus sm4tik ")
HELP_TEXT (" Surt tape.yrm TeeEmCee ") HELP_TEXT (" spratek Surt tape.yrm ")
HELP_TEXT (" tempest Timo Kurrpa titus^Rab ") HELP_TEXT (" TeeEmCee tempest Timo Kurrpa ")
HELP_TEXT (" Tobé yakumo2975 00ai99") HELP_TEXT (" titus^Rab Tobé yakumo2975 ")
HELP_TEXT (" 00ai99")
HELP_TEXT ("") HELP_TEXT ("")
HELP_TEXT (" ... posted the annoying bug reports.") HELP_TEXT (" ... posted the annoying bug reports.")
HELP_TEXT ("") HELP_TEXT ("")

View File

@ -738,7 +738,7 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line,
#elif defined(__macosx__) || defined(__FreeBSD__) || defined(__NetBSD__) #elif defined(__macosx__) || defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/sysctl.h> #include <sys/sysctl.h>
#elif defined(__BEOS__) || defined(__HAIKU__) #elif defined(__BEOS__) || defined(__HAIKU__)
// sysinfo not implemented #include <kernel/OS.h>
#elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) || defined(__amigaos__) #elif defined(__AROS__) || defined(__amigaos4__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/exec.h> #include <proto/exec.h>
#elif defined(__MINT__) #elif defined(__MINT__)
@ -754,11 +754,8 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line,
// atari have two kinds of memory // atari have two kinds of memory
// standard and fast ram // standard and fast ram
void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam){ void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam){
//TODO: return STRAM/TT-RAM
unsigned long mem=0;
*stRam=Mxalloc(-1L,0); *stRam=Mxalloc(-1L,0);
*ttRam = Mxalloc(-1L,1); *ttRam = Mxalloc(-1L,1);
} }
#else #else
// Indique quelle est la mémoire disponible // Indique quelle est la mémoire disponible
@ -787,17 +784,23 @@ unsigned long Memory_free(void)
len = sizeof(maxmem); len = sizeof(maxmem);
sysctl(mib,2,&maxmem,&len,NULL,0); sysctl(mib,2,&maxmem,&len,NULL,0);
return maxmem; return maxmem;
#elif defined(__BEOS__) || defined(__HAIKU__) || defined(__SKYOS__) || defined(__amigaos4__) || defined(__TRU64__) #elif defined(__HAIKU__) || defined(__BEOS__)
// No <sys/sysctl.h> on BeOS or Haiku int pages;
// AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate) system_info systemInfo;
#warning "There is missing code there for your platform ! please check and correct :)" get_system_info(&systemInfo);
return 10*1024*1024;
pages = systemInfo.max_pages - systemInfo.used_pages;
return pages * B_PAGE_SIZE;
#elif defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #elif defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
return AvailMem(MEMF_ANY); return AvailMem(MEMF_ANY);
#else #elif defined(__linux__)
struct sysinfo info; struct sysinfo info;
sysinfo(&info); sysinfo(&info);
return info.freeram*info.mem_unit; return info.freeram*info.mem_unit;
#else
// AvailMem is misleading on os4 (os4 caches stuff in memory that you can still allocate)
#warning "There is missing code there for your platform ! please check and correct :)"
return 10*1024*1024;
#endif #endif
} }
#endif #endif

View File

@ -146,8 +146,11 @@ dword Timer_start; // Heure de d
byte New_preview_is_needed; // Booléen "Il faut relancer le chrono de preview" byte New_preview_is_needed; // Booléen "Il faut relancer le chrono de preview"
#if defined (__MINT__)
void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam);
#else
unsigned long Memory_free(void); unsigned long Memory_free(void);
#endif
#define Num2str(a,b,c) sprintf(b,"%*lu",c,(long)(a)) #define Num2str(a,b,c) sprintf(b,"%*lu",c,(long)(a))
#define Dec2str(a,b,c) sprintf(b,"%.*f",c,(double)(a)) #define Dec2str(a,b,c) sprintf(b,"%.*f",c,(double)(a))

View File

@ -49,7 +49,17 @@ Uint32 Airbrush_next_time;
void Start_operation_stack(word new_operation) void Start_operation_stack(word new_operation)
{ {
// This part handles things that must be done when exiting an operation.
Brush_rotation_center_is_defined=0; Brush_rotation_center_is_defined=0;
switch(Current_operation)
{
case OPERATION_ROTATE_BRUSH:
End_brush_rotation();
break;
default:
break;
}
// On mémorise l'opération précédente si on démarre une interruption // On mémorise l'opération précédente si on démarre une interruption
switch(new_operation) switch(new_operation)
@ -60,7 +70,12 @@ void Start_operation_stack(word new_operation)
case OPERATION_GRAB_BRUSH: case OPERATION_GRAB_BRUSH:
case OPERATION_POLYBRUSH: case OPERATION_POLYBRUSH:
case OPERATION_STRETCH_BRUSH: case OPERATION_STRETCH_BRUSH:
Operation_before_interrupt=Current_operation;
// On passe à l'operation demandée
Current_operation=new_operation;
break;
case OPERATION_ROTATE_BRUSH: case OPERATION_ROTATE_BRUSH:
Begin_brush_rotation();
Operation_before_interrupt=Current_operation; Operation_before_interrupt=Current_operation;
// On passe à l'operation demandée // On passe à l'operation demandée
Current_operation=new_operation; Current_operation=new_operation;

View File

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

View File

@ -945,7 +945,7 @@ int Load_INI(T_Config * conf)
{ {
// Default when empty: // Default when empty:
Realpath(Data_directory, conf->Scripts_directory); Realpath(Data_directory, conf->Scripts_directory);
Append_path(conf->Scripts_directory, "scripts", NULL); Append_path(conf->Scripts_directory, SCRIPTS_SUBDIRECTORY, NULL);
} }
conf->Allow_multi_shortcuts=0; conf->Allow_multi_shortcuts=0;

View File

@ -89,7 +89,6 @@ void Set_program_directory(ARG_UNUSED const char * argv0,char * program_dir)
#elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__) #elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
strcpy(program_dir,"PROGDIR:"); strcpy(program_dir,"PROGDIR:");
#elif defined(__MINT__) #elif defined(__MINT__)
static char path[1024]={0}; static char path[1024]={0};
char currentDrive='A'; char currentDrive='A';
currentDrive=currentDrive+Dgetdrv(); currentDrive=currentDrive+Dgetdrv();

View File

@ -70,6 +70,22 @@ void Set_config_directory(const char * program_dir, char * config_dir);
#define SKINS_SUBDIRECTORY "skins" #define SKINS_SUBDIRECTORY "skins"
#endif #endif
/// Name of the subdirectory containing scripts
#if defined (__MINT__)
#define SCRIPTS_SUBDIRECTORY "SCRIPTS"
#else
#define SCRIPTS_SUBDIRECTORY "scripts"
#endif
/// LUA directory prefix
#if defined (__MINT__)
#define LUALIB_SUBDIRECTORY "LIBS"
#else
#define LUALIB_SUBDIRECTORY "libs"
#endif
/// Name of the binary file containing some configuration settings. /// Name of the binary file containing some configuration settings.
#if defined (__MINT__) #if defined (__MINT__)
#define CONFIG_FILENAME "GFX2.CFG" #define CONFIG_FILENAME "GFX2.CFG"

View File

@ -37,21 +37,6 @@
//---------------------- Modifier le pinceau spécial ------------------------- //---------------------- Modifier le pinceau spécial -------------------------
int Circle_squared_diameter(int diameter)
{
int result = diameter*diameter;
// Trick to make some circles rounder, even though
// mathematically incorrect.
if (diameter==3 || diameter==9)
return result-2;
if (diameter==11)
return result-6;
if (diameter==14)
return result-4;
return result;
}
void Set_paintbrush_size(int width, int height) void Set_paintbrush_size(int width, int height)
{ {
int x_pos,y_pos; int x_pos,y_pos;