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
Adrien Destugues
07bfc119b8
-No need to check if a pointer is null before freeing it.
...
-However if the pointer is still living (for example a global) you should assign NULL to it to avoid bad ram access and random bugs. Accessing a NULL pointer always gives a segfault, accessing a freed pointer may or may not crash.
-Also fixed a memory leak
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@924 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-07-16 07:33:14 +00:00
Adrien Destugues
7bde7d90ce
Quick-made support for Neochrome files. Loading works, saving leaves parts of the header uninitialized. Neochrome may or may not like it.
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@911 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-07-13 08:09:40 +00:00
Adrien Destugues
7a847be4ec
Removed all instances of Read_one_byte.
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@798 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-05-12 17:41:22 +00:00
Adrien Destugues
402df48b7f
Removed some unused functions (kindly pointed out by the great ncc tool)
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@796 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-05-10 14:47:09 +00:00
Adrien Destugues
2fa494f77e
Removed postal address of the FSF since it's moving faster thant the website :)
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@779 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-05-05 18:19:37 +00:00
Yves Rizoud
1eeed5aca4
Added some missed translations in source code.
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@755 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-04-21 17:48:26 +00:00
Yves Rizoud
6c0637f65e
New: Reading 32bit and 16bit bitmaps, with and without bitfields.
...
Fixed: Reading 8-bit compressed bitmaps.
New: Reading bitmaps with v4 header.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@723 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-04-05 19:21:07 +00:00
Adrien Destugues
be1da7b6a6
Fixed a buffer overrun in the skin reading... make saving the config work again...
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@719 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-04-04 18:41:04 +00:00
Yves Rizoud
5655129401
Makefile: Added missing png library to linker options (issue 141)
...
Fix the minimum screen size not enforced when resizing window (since r705)
Fix the mouse cursor position when changing pixel size (since r705)
In fileselector, the image preview now enforces "safe colors". (issue 116)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@716 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-04-04 13:38:45 +00:00
Yves Rizoud
eb781b9bd6
Renamed sources files to english words, updated makefile, recomputed dependencies.
...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@703 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-29 00:12:33 +00:00