136 Commits

Author SHA1 Message Date
Adrien Destugues
7fe8d44805 Fix all remaining warnings in gp2x build. The compiler is a bit more picky about the includes and feature macros.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1352 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-16 13:31:29 +00:00
Yves Rizoud
25e8943e4c Fix an hourglass cursor when loading a file from command-line (recent bug). Fix issue 307: Drop-opened files do not retain name in Save-as dialog.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1346 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-14 01:39:56 +00:00
Yves Rizoud
4c3a0b6f68 Grafx2 now disables safety backups (and warns the user on startup) if another instance is running or if its configuration directory is read-only. Implemented separately on Linux and Windows, tested only on Windows
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1343 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-14 00:28:42 +00:00
Yves Rizoud
4f73c24989 Added Layer menu. Issue 263 and issue 110: Added background transparency, for GIF and PNG formats (tested OK in Load, Save, and preview
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1332 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-09 20:04:56 +00:00
Adrien Destugues
b928aa306a oops.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1323 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-07 11:45:05 +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
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
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
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
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
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
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
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
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
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
Yves Rizoud
141a523c46 Fix issue 271: Loading 16/24/32bit images wasn't working since the layers. oops.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1236 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-12-03 02:14:31 +00:00
Yves Rizoud
8c9321d98b Fix issue 250: Alert box for image flattening is too wide. Implemented basic multi-line alert box (use explicit carriage returns).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1220 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-19 01:24:10 +00:00
Yves Rizoud
33ef5cfde2 Fix on loading all formats 'misc': Marking some formats 'Backup_done=0' didn't work because this flag was specialized for importing and exporting palettes (a modification of the image), without updating the image on screen or remembering the file name.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1183 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-14 17:16:46 +00:00
Yves Rizoud
a24557ff98 Fix compilation warnings in file formats
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1180 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-14 15:36:52 +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
74f723c3b0 Added save function for amstrad cpc scr images. No load available yet, and the code was pretty quickly hacked. Thanks to CloudStrife for providing libraw2crtc.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1158 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-07 16:45:22 +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
Adrien Destugues
1406e74f56 Load and save palettes using JASC "standard" format. Still load old palettes from DOS Grafx2, but now we handle full color :)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1137 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-01 21:55:54 +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
1a2ac678e0 Splitted loadsave.c :
- loadsave.c : common things
- fileformats.c : format that make a full backup of any picture without palette loss
- miscfileformats.c : formats that are not saving all the picture (palette only, pixels only, constrained palette)

I was not very precise in the splitting and we may rethink the flags that mark if a picture is fully saved or not... it was not updated after we decided to allow the full palette range 0.255 instead of 0.63, so most of the atari format were marked as saving everything.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1120 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-31 15:20:44 +00:00
Adrien Destugues
4d20be0053 Fixed some more amiga vbcc warnings
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1093 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-27 10:28:32 +00:00
Yves Rizoud
3781dae7d3 [layers] Updated from trunk.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1087 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-21 22:44:45 +00:00
Yves Rizoud
2a8546eaef trunk: Windows' .ICO icons can be read too. Removed jpeg.dll, not used.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1086 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-21 22:28:38 +00:00
Yves Rizoud
db130fc60d trunk: Implemented file loading of JPEG, TGA, TIFF and a few others, by using SDL_Image builtin loader. Added visible 'hourglass' cursor during 24bit color reduction.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1085 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-21 22:12:56 +00:00
Yves Rizoud
22d5e7de70 [layers] Updated from trunk: 'All formats' filter in file selectors
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1084 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-21 09:57:38 +00:00
Yves Rizoud
9ef0e6b74c (trunk) File save/load only shows common file extensions by default. (choice 'all' in filter, different from '*.*')
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1083 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-21 01:52:07 +00:00
Yves Rizoud
3037d1a84e [layers] Fixed crash on png saving (thanks Roberto)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1078 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-18 19:14:34 +00:00
Yves Rizoud
89f2173d70 [layers] Implemented SwapUp and SwapDown (Alt-PgUp, Alt-PgDown) to change layers order; Implemented layer merge (Alt-End); improved GIF loader to read images with optimized layers (smaller) and the ones with a transparent color different than zero.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1077 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-18 19:06:07 +00:00
Yves Rizoud
2049f96c59 [layers] Implemented layer insertion. No keys or menu yet, but it's already used when loading images, to make an image with right number of layers. Undoing/redoing such change works. Implemented single-layer deletion (untested)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1069 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-08 23:54:02 +00:00
Yves Rizoud
dc70d2f59f [layers] Merged-in the trunk changes (support for variable-height menu bar). Color replacer now works. Saving non-layer formats issues a warning and saves flattened version of the visible layers.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1068 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-08 21:41:25 +00:00
Yves Rizoud
0b07b43722 [layers] Merged r1063 from trunk. Separated the controls for layers from translucency keys. Can now control up to 8 layers
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1065 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-07 00:07:27 +00:00
Yves Rizoud
874ccd4430 [layers] Fix a bug with scroll. Implemented basic save/load of layers in GIF as non-looping animation.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1058 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-04 01:25:38 +00:00
Yves Rizoud
cedb706326 First svn commit of the experiment with layers. Preemptive backup (to shorten delay before drawing) is currently disabled. Basic Undo/Redo works, but not image resizing, the adjust tool, and saving (not even flattened)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1039 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-21 14:16:41 +00:00
Adrien Destugues
b12423d03b Trying to compile on amiga with vbcc.
Removed some useless unixisms.
Still not working.
Hope I did not break too much things.




git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1035 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-19 22:41:51 +00:00
Yves Rizoud
2ce0a2538b Merged in fix by Petter (issue 211 comment 26). Made the C64 save window remember its settings (while the program is open)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1021 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-06 18:59:20 +00:00
Yves Rizoud
c894caf2f8 Merged in Petter's save options for c64 pictures. (issue 211 comment 25)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1020 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 22:10:49 +00:00
Yves Rizoud
b934f1d57c 4-space tabs for c64 load/save code
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1018 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 20:52:43 +00:00
Yves Rizoud
b92e8f288e Updated copyright line
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1017 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 19:53:15 +00:00
Yves Rizoud
2e46820b83 Fixed tabulations to 2spaces (the most common in this file). Tiny bit of error-check on saving. Implemented preview scaling to display c64 widepixel pictures properly. Not done yet: Auto-set wide or wide2 pixels after loading a picture with wide pixels.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1016 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 19:49:18 +00:00
Adrien Destugues
6c3963bf33 We're going to get it right...
Some vocabulary :
-We call "screen" the pixels that the user actually sees, including any menu, cursor, opened window. So the function count_used_colors_screen_area counts colors there.
-We call "picture" the pixels that make the full picture, as you want to save it. count_used_colors and count_used_colors_area counts color there.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1015 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 17:02:18 +00:00
Adrien Destugues
62ba2fd885 Added c64 picture samples
Put the correct version of loadsave.c. Sorry I'm a little ill today.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1014 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 16:22:35 +00:00
Adrien Destugues
cc47a21eca Added support for loading and saving c64 fileformats. Please test it :)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1013 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-05 13:55:51 +00:00
Yves Rizoud
4e0d95b5e7 New: PNG 24bit loader (issue 201). Fixed greyscale PNG loader which never worked. Fixed 24-bit image loading on program startup which didnt update palette.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@984 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-08-09 16:54:39 +00:00