1353 Commits

Author SHA1 Message Date
Adrien Destugues
84ccd7f845 Fixed polygon and polyform overdrawing the first point in an approximate way.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1300 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-03 18:27:04 +00:00
Adrien Destugues
4c40a0a99a Fix backup not being deleted on exit.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1299 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-03 18:07:15 +00:00
Yves Rizoud
e96be96ce1 Magnifier: Both views positions are preserved on switching to Spare and back. Changing zoom with dropdown menu doesn't accidentally zoom on mouse
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1298 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-02 19:40:51 +00:00
Adrien Destugues
051f5e60cf Missed this one in my mailbox.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1297 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-02 16:19:40 +00:00
Adrien Destugues
46ed0b5718 Script contest entries.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1296 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-02 16:14:46 +00:00
Yves Rizoud
47f8f8ffc4 Improved zoom-on-mouse: when changing zoom factor, the pixel under mouse cursor, either in normal or magnified view, stays 'stuck' under it, and both views re-center accordingly. Only limits are the scrolling constraints of Grafx2: The zoomed view must always be part of the non-zoomed view, it's not allowed to see above and left of picture limits, and it auto-scrolls left or top when you go near the right or bottom limit (show more pixels)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1295 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-02 01:06:14 +00:00
Yves Rizoud
0125c15209 Eliminated some alien tab characters in source file windows.c
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1294 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-01 23:17:51 +00:00
Adrien Destugues
59f2c45c43 Fixed stupid bug making the zoom drift to bottom right corner of the picture.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1292 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-01 19:31:32 +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
62cc506737 Fix Fill, Polyform/Polyline, and Contour fill when using effects (Transparency) with layers: it was reading from all visible layers instead of only current, so the result kind of 'fused' the pixels. Related to issue 245.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1286 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-28 02:48:56 +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
dddc128794 * Add a set of palettes contributed by Nitrofurano. Thanks !
* Add a small python script to convert palettes back to the old .PAL format if you ever need it.
 * Update wiki page about palette to link to the new palettes ( I din't know where to put that)
 * also moved "translation" tools to the "tools" folder along with the convert script


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1283 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-27 17:23:12 +00:00
Yves Rizoud
c04dbcb19a Layer-specific: Fixed possible double free on exit. Removed unused global pointer. Implemented proper backup (history) before the various Copy-to-spare actions, fixing a severe history bug when using layers (issue 270). Grafx2 no longer asks 'Spare page was modified, continue?' on Spare modifications. Fixed missing screen refresh in Copy-to-spare (issue 293). Fixed the save-on-crash to actually save the spare
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1282 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-26 02:23:44 +00:00
Yves Rizoud
4ddcd01730 Palette operations that displace colors (sort, x-swap, x-inv, maybe others) now move around the transparent color index accordingly. The idea is that these changes don't modify 'What you see' of the image, and if the transp color was unchanged, it would be a huge visual change.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1281 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-25 19:15:25 +00:00
Yves Rizoud
b07ab82b20 Fix missing preview of palette formats. Fixed JASC PAL saving that didn't close file (!), so saving more than once would make empty file. Fixed loading palette formats that didn't have any effect.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1280 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-23 20:51:32 +00:00
Yves Rizoud
bece65fcbb Safety backup: On recovery, load all images even if it exceeds the normal setting of Backup Pages. On crash, do not attempt to save current visible image if the edited image has multiple layers.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1279 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-23 18:33:48 +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
b36dee613e Ensure pointers are put back to NULL when freed.
--Cette ligne, et les suivantes ci-dessous, seront ignorées--

M    trunk/palette.c
M    trunk/init.c
M    trunk/engine.c
M    trunk/filesel.c
M    trunk/miscfileformats.c
M    trunk/pages.c
M    trunk/brush_ops.c
M    trunk/op_c.c
M    trunk/operatio.c
M    trunk/brush.c
M    trunk/loadsave.c
M    trunk/graph.c
M    trunk/fileformats.c
M    trunk/main.c


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1277 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-18 14:26:59 +00:00
Adrien Destugues
04d7359ef5 -"Fixed" issue 222 : if your WM force grafx2 to get a smaller window more than 10 times, it will switch to PIXEL_SIMPLE. It will still flicker, but only if you try to go below 320x200.
-Btw, there seem to be a bug in Verbose_error_message : I needed to pad my message with spaces at the end, or it would display garbage. I think it doesn't detect the \0 properly and expects the last word to end with space...


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1276 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-18 10:43:00 +00:00
Yves Rizoud
357f8b37ef Fixed the 'Save as' not updating the current file's name (bug 289) and ignoring the selected format (!). When going to parent directory, the origin is now highlighted. When 'Saving as', the original file is highlighted. In DPaint skin, fixed the layer order arrows which were reversed, and made the default BG color 0, as it's more consistent with empty images which are filled with 0.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1275 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-18 02:13:20 +00:00
Yves Rizoud
8d2e0642e6 MIME type for rtf... lets see if googlecode handles it better
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1274 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 23:14:08 +00:00
Yves Rizoud
06c2c4aa83 Add first draft of a Quickstart guide (uncomplete)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1273 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 23:08:59 +00:00
Adrien Destugues
fe0f87521b -Add some more zoom factors (up to x32)
-Replace the zoom window with a popup menu. Note this make shift+M unusable. Do you think it's annoying ? (also, I don't know how to remove/disable the shortcut, and have no idea what it could do instead)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1272 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 22:10:19 +00:00
Adrien Destugues
98a9eb44c4 Fix X-Swap not remapping the layers properly.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1271 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 20:36:17 +00:00
Adrien Destugues
64c3bc7771 The skin preview could corrupt the screen palette. Now always restore it properly.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1270 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 20:01:37 +00:00
Adrien Destugues
28b2122997 Fix wrong menu colors when recovering a backup.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1269 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 19:54:02 +00:00
Adrien Destugues
027db7736a -Fix best_color_nonexcluded again.
-Fix zoom position drifting when switching to spare


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1268 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 19:16:55 +00:00
Adrien Destugues
97ca0c65e3 Fix stupid bug. No one noticed yet :p
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1267 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 09:36:47 +00:00
Yves Rizoud
6a69fa2b79 Hide button now brings a drop-down menu to choose toolbars to show/hide. Right-clicking it toggles them all off/on. Internal: Added support for dropdowns that expand above the button (available in toolbars and windows); Allowed toolbar buttons to wait for button release (the usual) or immediately trigger their effect.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1266 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-17 01:56:56 +00:00
Adrien Destugues
450b64ca10 Fixed a bug in gradrect xor lines drawing where they could sometime get to draw over the menu or even outside the screen.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1265 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 21:58:45 +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
Yves Rizoud
247d7f54fd Compilation adjustment for win32. I suspect the other targets also need something for lua.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1260 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 18:40:38 +00:00
Adrien Destugues
b62f86bf45 Fixed double free when loading 24b image.
Yves, it is not needed to check if a pointer is NULL before freeing it, free(NULL) is okay and will not crash.
However, each time you free something, you should put it back to NULL :
-It makes sure the program will crash on next access to it (even if the memory chunk is reallocated)
-It makes it easier to debug things, a NULL pointer is freed data.

If you can't gt used to it, create a Free macro that does the NULLification for you...


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1259 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 17:48:14 +00:00
Adrien Destugues
c1800bb42d Sanity checks in the pixel ratio loading.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1258 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 17:27:15 +00:00
Adrien Destugues
655116bd37 -Save pixel ratio in infile
-Fix a bug if a wrong grid xor value was set (was mostly harmless)
-Some cleanup.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1257 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 16:31:03 +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
235d556296 Patch to XCode project by Tomasz, to at least get GrafX2 to a buildable state. Thanks !
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1254 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-16 13:48:14 +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
Yves Rizoud
3294a304bf Issue 275: Fixed cursor 'moving by itself' by disabling joystick control on desktop platforms
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1251 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-15 19:47:27 +00:00
Adrien Destugues
75226f6438 This is apparently a build fix for macosX
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1250 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-15 19:37:57 +00:00
Yves Rizoud
9cb3f7a70d Issue 284:Made the UI zoomed by x2 maximum, by default (Menu_ratio = -2 in gfx2.ini). Fix issue 286.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1249 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-15 19:19:01 +00:00
Yves Rizoud
e351605a24 Reverted the icon-loading code to SDL_image, using more solid code to handle both 8bit and hi-color icons
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1248 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-15 02:40:32 +00:00
Yves Rizoud
84ac0df49c Issue 285: For skins and fonts, replaced calls to SDL_image with our own image-loading functions. Also fixed the generic loader that was updating the screen palette even when not useful.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1247 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-15 01:48:33 +00:00
Adrien Destugues
3226961fb5 Added svg logo.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1246 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-13 19:40:58 +00:00
Yves Rizoud
8bdd163ede Huge rewrite of the file loading/saving system. Normally safer in case of problem. Added incremental safety backups at regular intervals in the 'application data' directory (Windows) or $HOME/.grafx2 (unix). Keeps 8 files, saves every 30-60s and/or every 10-30 clicks.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1245 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-13 02:09:47 +00:00
Adrien Destugues
c93a9bd1c1 Mask and Stencil shortcuts were reversed.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1244 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-12 23:14:38 +00:00
Adrien Destugues
ca6a10216b -Some support for TRU64 unix. I don't have SDL on this machine so I'm
not sure how far I can get it...


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1243 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-01-12 12:26:27 +00:00