31 Commits

Author SHA1 Message Date
Yves Rizoud
f64117aeda Fix display in message boxes when very long messages happened (normally only with Lua messages)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1338 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-13 18:23:13 +00:00
Yves Rizoud
87432470f3 Fix a crash in 'Copy to spare:Palette' when both images have different height. Fix Lua which didin't report useful message when an error was detected.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1337 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-13 14:54:19 +00:00
Yves Rizoud
05d6d546a3 More Lua functions: GetForeColor, GetBackColor, GetTransColor (layer translucency), and to read data from spare page: GetSparePictureSize, GetSpareColor (spare's palette), GetSpareTransColor, GetSpareLayerPixel (pixel from 'current layer' only of spare), GetSparePicturePixel (pixel from 'all visible layers' of spare)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1336 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-12 02:57:00 +00:00
Yves Rizoud
25097afafd Lua: added a command that creates an input box with variable arguments (inputbox), up to 9 values can be input. Fix a cursor issue when opening brush factory.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1334 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-12 01:52:18 +00:00
Yves Rizoud
b0a700850f Lua factory: More room for file names (34 chars instead of 18), and a preview of the script's first lines of comments.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1326 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-07 20:13:54 +00:00
Adrien Destugues
056ce73ee9 Some user-contributed patches to cleanup the build and remove warnings.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1322 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-07 11:44:38 +00:00
Yves Rizoud
571cf70b58 Hide button: inverted right and left clicks. Fixed credits. Lua: arguments of MatchColor and SetColor are now automatically clamped on 0 and 255 when they are too small or too big, instead of wrapping.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1321 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-05 01:27:00 +00:00
Yves Rizoud
56785bd94e Lua: Added GetBackupColor, to read RGB values from the original palette (Useful if your script modifies the palette then reads pixels from backup)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1290 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-31 16:09:40 +00:00
Yves Rizoud
fa15037a42 Lua: GetBrushBackupPixel now works (Had forgotten to make initial copy :-/ )
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1289 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-29 02:20:45 +00:00
Yves Rizoud
bfbefeff82 Lua changes: Safety in all functions. Invalid arguments raise an error message and halt script (ex: Resize screen or brush with size < 1) or is silently ignored (drawing outside limits does nothing, reading outside limit reports transparent color). Fixed: SetColor. New: GetBrushTransparentColor, GetBrushBackupPixel. Removed: BrushEnabled (autodetected when needed)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1287 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-29 01:47:09 +00:00
Yves Rizoud
259a3d3338 Lua scripts: Add missing screen update. GetPicturePixel now reads from 'all visible layers'. New GetLayerPixel. Hourglass cursor while script is running.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1285 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-27 20:44:32 +00:00
Adrien Destugues
27014064ab * Actually write something to the picture (not only the screen) when using lua scripts
* Call end_of_modification when drawing is finished
There's something weird hapenning still : when I call the script the fist time nothing is shown on screen, then I draw something, then I call the script again. The second call should overwrite everything, but doesnt. I can draw over it, and if I hide then show back the picture, the old lines that should have been erased are now gone...

Yves, can you have a look ?


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1284 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-27 18:02:53 +00:00
Adrien Destugues
9933e1fddc We can now build on tru64. Mountlist.c doesn't seem to work so it crashes when trying to do something in the loadsave screen.
As the available machines don't have gdb, I can't go much further...
I could try building with compaq compiler but it seems a lot more strict than gcc. Do you want me to fix these problems to get cleaner ansi code (may be less readable...)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1278 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-20 11:18:26 +00:00
Adrien Destugues
ae873551ff -Fixed and extended the brush factory API. The factory now does a backup before running a script.
-Updated the convolution sample factory to do a proper convolution, reading from the backup. There is still no colormapping.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1262 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 20:00:10 +00:00
Adrien Destugues
70a61a07ef -Linux now uses pkgconfig to find infos about lua. This may break other platforms
-No longer enforce lua5.1 as the include dir for lua files.
--Cette ligne, et les suivantes ci-dessous, seront ignorées--

M    trunk/Makefile
M    trunk/factory.c


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1255 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 15:40:05 +00:00
Adrien Destugues
3b3bb3b2ec -Fixed brush factory : it was unable to draw on the picture !
-Added a script that do a convolution of the image with a matrix. Not sure it works perfect yet.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1252 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-15 21:44:34 +00:00
Adrien Destugues
9507cf8df2 Fixed missing include and const in brush factory.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1235 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-12-02 12:58:24 +00:00
Adrien Destugues
0be1f7bff1 -Load Lua's math library when running factory scripts, as this makes them a lot more useful (sin, cos, ...)
-Don't crash when Lua fails loading a script but does not return an error message.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1223 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-24 17:56:05 +00:00
Yves Rizoud
c150be2664 [layers] merged in the recent changes from trunk
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1162 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-10 20:35:09 +00:00
Adrien Destugues
e6e698c2bd Added vim modelines to all files.
Set them to 2-space indent, I hope this is ok.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1161 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-10 20:08:11 +00:00
Adrien Destugues
045d8714ad Removed leftover debug.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1150 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-04 18:58:09 +00:00
Yves Rizoud
3ede1f3a56 [layers] NOLAYERS option at compile time. Unfinished.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1140 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-01 23:22:43 +00:00
Yves Rizoud
119e679e32 [layers] Adapted lua bindings to draw/read in current layer (untested)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1134 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-01 14:31:36 +00:00
Yves Rizoud
f38fd068a2 [layers] Merged changes from trunk
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1131 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-01 01:05:21 +00:00
Adrien Destugues
ba36fa675f -Moved test script to "scripts" directory
-Allow to add other scripts to this dir and run them too.
--Cette ligne, et les suivantes ci-dessous, seront ignorées--

A    trunk/scripts
A  + trunk/scripts/test.lua
D    trunk/test.lua
M    trunk/buttons.c
M    trunk/factory.c


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1125 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-31 17:33:04 +00:00
Yves Rizoud
7105566433 Compilation fixes: A typo, and a cast double->int
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1119 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-31 13:50:55 +00:00
Adrien Destugues
8114cae1e9 Added (r,g,b)=getcolor(c) to lua binding.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1118 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-31 13:01:56 +00:00
Adrien Destugues
56a4c704fe Added lua binding to select the color brush.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1104 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-30 10:45:52 +00:00
Adrien Destugues
2a67c9bdce Refactored (yes, already) the lua API to allow also generating pictures directly.
Updated doc, and added sample script.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1099 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-29 17:27:49 +00:00
Adrien Destugues
06892015ea added lua binding to set a color in the palette
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1097 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-29 15:52:21 +00:00
Adrien Destugues
1934425972 Added "Brush Factory", allowing you to run a lua script to generate (or alter, untested yet) a brush.
Added a simple (and ugly) sample script.
This needs updates to the makefile for platforms other than linux.
TODO: add a listbox to select the script you want to run. Do we have a simple API to handle filelists yet ?


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1094 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-29 15:22:45 +00:00