67 Commits

Author SHA1 Message Date
Yves Rizoud
4219ca839d The 'Clear' function now clears with Transparent color instead of hard-coded 0. Outside edges of images are also drawn with this color. Reduced max layers to 16, for consistency with UI. Added help screens for Layer menu and Brush factory.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1349 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2010-02-14 04:50:23 +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
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
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
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
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
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
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
cf54bb5f29 Implemented back the Mask mode. Fixed a historical bug of memory violation if you used Mask with images of different sizes (would crash all platforms except DOS)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1237 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-12-07 20:39:32 +00:00
Yves Rizoud
7d657e0c02 Fix issue 264: Undo/Redo/kill can leave no active or visible layer
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1233 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-12-01 23:51:34 +00:00
Yves Rizoud
7645d0844a Fix weird mixing of layers from main and spare pages (Issue 259)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1232 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-12-01 23:05:22 +00:00
Yves Rizoud
776da3980d Fix issue 251: random transparent color for new layers
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1219 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-19 00:13:12 +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
Yves Rizoud
110a7bdd58 [layers] continuted work on no-layer option. No more crash.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1141 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-11-02 00:10:59 +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
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
abb6204757 [layers] Limited to 32 layers. (previously there was no limit and the 16-bit depth buffer wrapped). Fixed a display bug after picture transforms or layers add/del.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1075 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-14 00:13:49 +00:00
Yves Rizoud
2dcc1cf8bd [layers] Stats on memory usage in the Stats screen. Tracks the number and total memory size of the pages (bitmaps) used by layers and their backups. Doesn't count housekeeping costs.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1074 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-13 19:07:58 +00:00
Yves Rizoud
7690cd9e50 [layers] Added functions to add and delete layers (Keyboard shortcuts alt-ins and alt-del) Now defaults back to 1 layer per image on startup.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1073 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-13 01:03:32 +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
2f1888e50d [layers] Implemented 'Copy to spare - pixels'. It replaces the current layer in the spare, resizing the whole spare (all layers) as needed.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1064 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-06 23:28:37 +00:00
Yves Rizoud
416ad0cd78 [layers] Added missing screen refresh on 'Kill page'
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1051 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-01 22:23:54 +00:00
Yves Rizoud
56e62c4b47 [layers] Fixed many embarrassing memory overruns and uninitialized memory reads. Woops.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1050 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-10-01 22:11:26 +00:00
Yves Rizoud
9be9ed9c17 [layers] Sped up the switching from one active layer to another, when the new layer was already displayed (thanks to the depth buffer, again)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1049 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-30 21:37:16 +00:00
Yves Rizoud
20b1aef7f5 [layers] cleanup
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1048 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-29 18:49:00 +00:00
Yves Rizoud
61f0a4ec71 [layers] Sped up the scrolling/adjusting of single layers. Speed is no longer relative to the number of visible layers. Pulkomandy, your idea of depth buffer was genius.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1047 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-29 17:57:43 +00:00
Yves Rizoud
473679ce29 [layers] Implemented shared layers. Speeds up Backup() by 800. Little unrelated bug: On program start, use 'tab' at least once, or the undo buffers won't be updated on screen.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1046 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-28 22:00:04 +00:00
Yves Rizoud
2fd88b81bb [layers] work on layer sharing (still stable)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1045 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-28 21:01:29 +00:00
Yves Rizoud
057d5e76e4 [layers] working swap between main/spare, and loading files in command-line. Start of work on variable layers number and layer sharing.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1044 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-28 18:48:05 +00:00
Yves Rizoud
b18266e017 [layers] Resizing canvas now works
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1042 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-26 17:51:08 +00:00
Yves Rizoud
78e59e6127 (layers branch) Adjust tool implemented. Left click and drag to move a single layer, Right-click and drag to move everything.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1041 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-09-22 22:55:02 +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
Yves Rizoud
8b340684bd Various internal changes, preparing for layers (mostly backup system)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@983 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-08-08 18:53:30 +00:00
Yves Rizoud
ff402b204b Code cleanup in pages.c. No functional change
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@948 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-07-21 22:13:05 +00:00
Yves Rizoud
164b538725 Fix 'Out of memory' message on machines with more than 4Gb free RAM (issue 182)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/release@880 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-06-20 19:08:13 +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
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
Yves Rizoud
efbc978e6f Source code translated to english
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@697 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-27 16:50:21 +00:00
Yves Rizoud
346d940889 All code ready for mass translation
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@691 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-23 18:08:42 +00:00
Yves Rizoud
f8c7c6730b translations
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@690 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-23 02:33:21 +00:00
Yves Rizoud
f342ff5ff7 More translations (about 500)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@687 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-19 03:18:42 +00:00
Yves Rizoud
4dcdc53409 more translations
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@684 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-18 00:16:29 +00:00
Yves Rizoud
ecafeaace1 more code cleanup to prepare translation
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@676 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-03-15 17:21:16 +00:00
Yves Rizoud
761d62f761 Removed some unneeded dependencies to speed up compile.
Code "cleanup": Functions that create a button now return its address.
This helps reduce the number of files that use the globals "Fenetre_Liste_boutons_*"


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@642 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-02-19 02:10:40 +00:00
Yves Rizoud
546dc6011f Fixed an old, possibly lethal memory overrun in Backup buffers, when using long file names (>12)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@627 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-02-11 01:07:43 +00:00
Adrien Destugues
91d4dc20b9 Fixes for compiling under freebsd
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@562 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-01-28 22:12:28 +00:00
Adrien Destugues
ab5f789fdf Mostly some cleanups.
Also added two experimetal functions, Ouvrir_popup and Fermer_popup, and started to implement a (commented) example popup menu for selecting freehand draw mode.
But it seems there are problem if doing a while(Mouse_K), Mouse_K seems to be reset when the mouse moves, or in some other place. Time to sleep so i'll continue that tomorrow.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@474 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2009-01-11 21:59:10 +00:00
Adrien Destugues
90b3f9b1a1 Finished updating the includes for graph.c split. Now we have :
-Graph.c : everything related to drawing.
-Brush.c : everything related to brushes (displaying, erasing, capturing, and effects)
-Windows.c : windows and menu drawing functions

Some functions were also moved to divers.c.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@396 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-16 22:14:08 +00:00