1666 Commits

Author SHA1 Message Date
Adrien Destugues
8081c9527d Quick fix for realpath needing PATH_MAX following Haiku patch.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1930 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-12 21:26:13 +00:00
Yves Rizoud
7d6d3ad875 Fix the Tilemap mode : When grid was visible, the copied tiles were erasing the grid. Now the grid is refreshed as needed.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1929 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-11 17:41:52 +00:00
Yves Rizoud
145c9545e7 Fix the 'FX' button that didn't refresh its state when swapping pages between an image with Tilemap ON (button should be highlighted) and an image with Tilemap OFF (button not highlighted)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1928 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-11 16:50:28 +00:00
Yves Rizoud
5af6f7bd4d Fix crash of layer preview in some sizes, and removed overdraw
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1927 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-09 20:06:55 +00:00
Yves Rizoud
747f9e8526 Fix most of issue 462 : Inconsistent directories in file selectors for image and brush.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1926 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-09 01:18:23 +00:00
Adrien Destugues
9ca899355c Fix zoom factor for layer preview.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1925 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-08 19:04:44 +00:00
Adrien Destugues
dcffab6c79 Fix layer preview :
* Avoids running its own event loop and intercepting keyboard shortcuts
 * Show all the layers (lined up with the buttons)
 * Do not draw outside of screen when picture has strange dimensions.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1924 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-08 18:56:39 +00:00
Yves Rizoud
b435ff2582 Added minimal support of ANIM format as part of the LBM loader : The first frame can be read.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1923 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-07 19:44:37 +00:00
Yves Rizoud
341fa77a93 Fix the skin 'scenish' that was broken recently, and fix the new 'Fill' mouse cursor (Issue 457) in all skins to use the small version : the bigger one gets clipped as Grafx2 only uses 15x15 icons internallly.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1922 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-07 19:30:58 +00:00
Yves Rizoud
d34a2abc37 Added forgotten change of standard INI file, oops. This probably caused the settings for Tilemap mode to not be saved.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1921 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-07 19:27:30 +00:00
Adrien Destugues
af8316c279 * Second attempt at fixing #448.
* Fix another bug with realpath in Haiku (relying on nonstandard behaviour)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1917 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-06 21:05:54 +00:00
Yves Rizoud
8852f59a95 Loading a GIF animation now shows first image instead of last image
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1916 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 17:26:48 +00:00
Yves Rizoud
641be48aad Removed last occurrence of 'NOLAYERS' and refreshed Makefile dependencies
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1915 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 17:10:26 +00:00
Yves Rizoud
a292f4e356 Fileselector : Now only previews frame 1 of animations, instead of loading everything
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1914 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 17:03:46 +00:00
Yves Rizoud
20055dca31 Fix loading of GIF animations that use the 'restore to BGcolor' disposal method.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1913 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 16:53:40 +00:00
Yves Rizoud
4386f8d679 Fix 'unselect' appearance of some anim buttons. Fix display of mouse cursor when opening windows 'Anim Time' and 'Layers'
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1912 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 15:57:39 +00:00
Yves Rizoud
de6b3ac8d1 Toolbars now automatically switch to anim/layers when required
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1911 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-04 15:35:20 +00:00
Yves Rizoud
e73eb2786a Animation now has correct visual display and input feedback. Loading GIF guesses it's an anim if it loops, layers otherwise : Some rare non-looping GIF anims (usaully broken) will be misunderstood as layered. Editing of anims and layers seems flawless and stable. Still requires an auto-switch to the best toolbar (anim/layers) when relevant, but you can already switch manually.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1910 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-03-02 23:19:47 +00:00
Yves Rizoud
db50b4ebdc More unification of layers and anim version: toolbars work. You can switch toolbars by right-clicking the icon from status bar: it proposes 'Anim' only while the current image has 1 layer (see Button_toggle_toolbar()). The animation-specific stuff (rendering...) isn't activated yet, see all the NOLAYERS places remaining. Also will need a trick for keyboard shortcuts to work on multiple buttons, and extra code on swap-to-spare, undo, redo, load etc. to sync toolbars with Image_type.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1909 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-27 23:19:23 +00:00
Yves Rizoud
2343dcb54c Internal: Moved tooltips inside Buttons_pool, and Buttons_pool from globals.h to to windows.c/h for easier modification
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1908 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-27 01:36:40 +00:00
Yves Rizoud
d38f5ee981 CPC mode 5 : replaced the global Constraint_mode by a state (Image_mode) in each versioned T_Page: This allows keeping it sane when swapping to Spare, and when Undo/Redoing. Also fixed the first page when program starts, it was unnecessarily allocating pointers for the maximum number of layers(16)/frames(999)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1907 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-27 00:47:18 +00:00
Yves Rizoud
55d0889bc8 Change rendering system to use function pointers, see Issue 31 c38 : preliminary work to make the same executable handle Layers or Anims. Fixed an old issue where Lasso-ing a brush with right mouse button wouldn't erase cleanly (visual). Fixed an old issue where picking colors in layer 5 would not 'see' through layers.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1906 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-22 23:47:53 +00:00
Franck Charlet
8ea1ab7fc8 fixed makefile for macosx again
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1905 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-20 19:56:52 +00:00
Adrien Destugues
b92d66911f Should fix #448: make sure we go to the main file directory when wqloading one at startup.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1904 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-15 18:34:25 +00:00
Yves Rizoud
f77f38e238 When running new version of Grafx2 for first time, new shortcuts take priority over user's. Useful for the space=pan (issue 233) that replaces default space=left-click. Also improved pan to display updated xy coords.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1902 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-03 23:32:32 +00:00
Yves Rizoud
cbcb7a6b8f Issue 233: Added mouse panning. Default is 'space' for new users, others need pick a key in Help screen.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1901 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-02-01 00:56:21 +00:00
Adrien Destugues
46f2ec9475 Patch by Syllable software to complete Syllable support. Thanks!
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1900 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-15 13:52:31 +00:00
Adrien Destugues
7137e1fc05 Strings with more than 24 chars were not properly null-terminated before sending them to Print_in_menu, causing random data to appear in the status bar since Print_in_menu will print more chars if there's space.
Thanks to DawnBringer for noticing!

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1899 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-11 18:29:46 +00:00
Adrien Destugues
941817b915 More fixes (still not ok...)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1897 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-08 21:52:35 +00:00
Adrien Destugues
44d8a23fbe More improvements to the makefile to get everything in. But still not working...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1896 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-08 21:49:26 +00:00
Adrien Destugues
d74649ffbc Make sure XOR helpers are shown even after drawing the first circle/ellipse
Update helpfile credits.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1894 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-08 21:16:46 +00:00
Adrien Destugues
781cda3a47 Add a distinctive icon for the fill (and color replace) tool.
Thanks to DawnBringer for icon drawing.
All skins use the same icon, feel free to draw something else for them.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1893 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-08 20:44:05 +00:00
Adrien Destugues
5a8d016691 Fix Makefile for Mac OS X:
* Switch to Mac OS X Lion (doesn't xhange much, if someone still wants to do a build on Tiger for PPC support it's easy)
 * Cleanup things that got messed up by the $(shell) changes
 * Add some comments that can be uncommented when building with MacPorts, instead of the more official OSX frameworks. This seems easier to setup, but does not provide portable binaries (the SDL framework can't be embedded in the app).

Many thanks to Rikard Lang for giving access to an OSX computer so I could debug stuff!


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1892 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-08 20:32:02 +00:00
Adrien Destugues
bcb0b563ee Add XOR-line helper when drawing circles and ellipses.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1891 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-08 14:15:55 +00:00
Adrien Destugues
fb6f7f210d Remove useless goto label.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1889 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-01 17:51:32 +00:00
Adrien Destugues
cf617715d7 * Fix missing parenthses in function call (!). Still wondering why gcc compiled it...
* Remove useless goto, code flow does what's needed already.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1888 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-01 16:29:04 +00:00
Adrien Destugues
dda62b043a Fix some bugs with layer quick-preview:
* Compute the height of the preview matching the image aspect ratio, to avoid relying on the menu being shown. Also put the preview above the menu, to not hide other buttons.
 * Exit the popup loop when a button is clicked. This works for show/hide, but not for selecting a layer ? I don't get why... Any idea ?

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1887 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-01 16:15:53 +00:00
Adrien Destugues
ad7e0d3f1a OpenBSD compatibiliy patch from issue 461.
Thanks !

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1886 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-01 13:05:45 +00:00
Adrien Destugues
6e8d18baed Fix error in volume computation that led to weird results. Fixes all problems reported by DawnBringer :).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1885 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-01-01 12:13:12 +00:00
Adrien Destugues
1b805666e7 Add a quick-preview when hovering the layer buttons.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1884 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-12-31 17:16:44 +00:00
Adrien Destugues
9acd46841d Allow up to 35x13 chars in verbose messages (including lua messages).
Fixes #467.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1883 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-12-31 13:43:19 +00:00
Adrien Destugues
836c224169 Display font dropdown in skin menu with the selected font.
Fixes #450.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1882 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-12-31 13:27:17 +00:00
Adrien Destugues
ee6ddf139b * Fix issue with the color reduction: the node index was off by one, leading to a write out of the allocated memory, and, of course, strange crashes because of it.
* Add some const in function parameters, just to make sure.
 * Cleanup the comments, because I got lost in my own code...

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1881 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-12-30 23:12:14 +00:00
Adrien Destugues
48a3ccd54e Preliminary Syllable support.
Completely untested...

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1880 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-12-30 19:14:38 +00:00
Adrien Destugues
179110bdc5 Fix build with gcc4 on Haiku.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1879 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-12-04 10:34:05 +00:00
Adrien Destugues
0236d5342a Rework the color reduction algorithm:
* Split clusters according to their volume (narrow covering) instead of occurence count. This ensures clusters representating a lot 
of colors are split; and a lot of pixels with near colors are grouped together, which is what we want for low-color work.
 * Rework memory management of clusters. Some of them were not malloc'ed but put on the stack, and then inserted in the list. Also 
avoid copying+deleting a cluster in CT_Get, return the original instead.
 * Use an union in the cluster struct to pack it a bit, since some data is used only in the color reduction phase, and some only in 
the palette lookup.

The result is maybe slower, but looks much, much better. Fixes issues 63 and 441.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1878 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-28 22:31:06 +00:00
Yves Rizoud
dae1bc856b Tilemap mode: Undo and Redo only refresh tilemap when image size changes. Lua scripts that change image size also refresh tilemap
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1877 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-26 14:46:09 +00:00
Adrien Destugues
4813314638 * Remove debug output
* Further optimization to the colortree, now allocated in one single chunk of 4090 bytes (2051 times better than original code!). 
Not doing all the malloc/frees should be slightly faster, and it also helps with cache locality (the whole tree can fit in the 
cache).
 * Remove the useless color "balancing" multipliers that did more harm than good.

We still need some improvements on the median cut, or maybe switch to a smarter algorithm; or add some cheats. See the JFIF quirks 
for an example.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1876 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-23 21:26:43 +00:00
Yves Rizoud
58e8194f40 Compilation fix for dependencies
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1875 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-23 19:05:12 +00:00
Adrien Destugues
d3a107bb7c Finished working on the new color lookup system.
There is room for optimization and maybe bugfixing.
The cluster table size is now:
511*15 = 7665bytes, this is 1094 times better than the color table.

Please test and report your results !


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1874 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-22 21:38:03 +00:00