1626 Commits

Author SHA1 Message Date
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
Adrien Destugues
91e7d459a3 WIP on new color reduction data structures.
The 8megabytes conversion table is replaced by an octree taking 10kbytes (800 times better !)
The conversion is done with full 24bit precision instead of 19 bits (8 green, 6 red, 5 blue) previously.

Not added to makefile and integrated yet, because I need to bugfix first.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1873 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-21 21:56:07 +00:00
Yves Rizoud
30edcddd07 Fix a color imprecision in the ILBM (IFF) loader. It has existed forever in the SDL port, though it was always better than the 6bit/channel of the DOS version.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1872 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-16 23:01:19 +00:00
Yves Rizoud
b448a600fc Tilemap: helpfile, fix loss of mouse cursor when tile count window appears
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1871 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-13 23:49:31 +00:00
Yves Rizoud
496148d485 Tilemap effect: Added a menu to set options. Options saved and reloaded in .INI. Added support for shortcuts (but no helpfile so far, so you can't set them)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1870 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-13 23:21:59 +00:00
Yves Rizoud
d60a4441d1 Max Grid size increased: from 80 to 999. Kudos to Robinson and X-Man for planning 15 years ahead and storing the settings as 16bit in the config file.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1869 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-13 14:06:09 +00:00
Yves Rizoud
1fd7b42fcc Fixed Brush grab and Lasso grab tools to work with tilemap (when right-clicking to clear)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1868 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-12 16:26:36 +00:00
Yves Rizoud
eb4bab6d67 Fixed Fill tool to work with tilemap
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1867 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-12 16:10:59 +00:00
Yves Rizoud
e7d37cf367 Tilemap: now separate for main and spare. Safeties added in most places necessary (auto-recompute tilemap after load, undo, etc)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1866 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-11 22:57:35 +00:00
Yves Rizoud
83fff59f66 Tilemap: waiting window during computation, shows tile count when done
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1865 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-11 17:23:26 +00:00
Yves Rizoud
e9a2ad8e81 Tilemap: Support for x-flipped and xy-flipped (180°) tiles
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1864 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-11 15:39:23 +00:00
Yves Rizoud
3b989f3eb3 Tilemap: support Y-flipped tiles
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1863 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-10 19:59:19 +00:00
Yves Rizoud
914ec63c90 Compilation fix for GNU make v3.79 : "else ifeq" is only supported on v3.81+
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1862 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-09 19:57:39 +00:00
Yves Rizoud
6965b6f464 Fix tilemap offset.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1861 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-08 23:59:14 +00:00
Yves Rizoud
82860387bc Added missing source file, and make the tilemap depend on current layer instead of the sum of layers
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1860 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-08 23:38:14 +00:00
Yves Rizoud
ef030fec3f Tilemap mode improved to analyze and detect identical tiles, so you write in real time on all occurences of same tile. Works very well but unfinished, will crash or have other problems when you resize image
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1859 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-08 23:11:18 +00:00
Yves Rizoud
a60a33c204 Tilemap mode works, and it's faster than I thought possible.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1858 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-07 00:06:17 +00:00
Yves Rizoud
1b4b242a06 Split Display_paintbrush() in two: one function for preview, another function (Draw_paintbrush()) for image modification. Should be functionally identical, but code becomes simpler.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1857 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-06 19:38:55 +00:00
Yves Rizoud
f1f658ded4 Start of tilemap. Only a togglable effect
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1856 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-11-06 19:03:27 +00:00
Yves Rizoud
59a20c6e3e GIF format now saves pixel ratio in the Logical Screen Descriptor if you use tall or wide pixels. I know no viewer that respects it, so the only effect is that Grafx2 automatically switches to the right scaler when you reload the file.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1855 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-31 19:45:57 +00:00
Yves Rizoud
b232e51c4c Added help entries for anim functions. Fixed a compilation warning and a wrong anim button refresh.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1854 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-31 18:52:13 +00:00
Yves Rizoud
51a9ad0132 Icon for effect '8-bit'. Added in all skins
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1844 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-25 22:15:14 +00:00
Yves Rizoud
e9acd1e8e4 The scroll tool (adjust) now works in the 'nolayers' version
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1843 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-24 23:12:01 +00:00
Yves Rizoud
8dde93fde2 Fix shortcuts count
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1842 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-19 23:44:29 +00:00
Yves Rizoud
8fb16e7089 Re-integrated anim in trunk, fixing the 999-layer limit at the same time
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1841 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-19 23:35:56 +00:00
Yves Rizoud
775ee56ed0 Paste in Text tool: fix a graphic overflow.
Palette reduce: use DawnBringer's formula for color likeness

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1837 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-10-01 19:26:13 +00:00
Yves Rizoud
db3293060f Clipboard paste: Support carriage returns and characters 128-255
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1836 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-27 00:03:16 +00:00
Adrien Destugues
22d3f19df3 * Add lua stuff to write to spare page
* Use it in Tiler to put the tilemap in the spare.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1834 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 20:37:45 +00:00
Adrien Destugues
6e30a87f4c Some fixes to the Tiler script.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1833 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 18:20:49 +00:00
Adrien Destugues
da48c58445 * Sync Brush Factory documentation and sourcecode
* Remove useless and undocumented function getbrushtransparentcolor (does the same as getbackcolor)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1832 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 14:35:50 +00:00
Adrien Destugues
242c73f4c3 Validate pasted strings.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1830 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 13:40:22 +00:00
Adrien Destugues
87b7c45da4 Respect cursor position when pasting.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1829 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 12:03:06 +00:00
Adrien Destugues
d34c3d9df5 Clipboard paste support for Haiku.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1828 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 11:48:37 +00:00
Adrien Destugues
afa22ae0ac Experimental "paste" support for text fields.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1827 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-25 08:45:48 +00:00
Adrien Destugues
4dc40e7784 Add lua getfilename function (that also returns the path).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1826 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-24 13:38:54 +00:00
Adrien Destugues
1d510d40bc Remove unused vars. I think there are others since the IO_Context introduction ?
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1825 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-24 13:29:42 +00:00
Adrien Destugues
a8f03cfb20 fix issue #435 : resizing not precise enough on small pictures/brushes.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1824 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-24 13:15:25 +00:00
Adrien Destugues
51c1a6de09 Add Tiler, a factory script that extracts (unique) tiles from spare to main page.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1823 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-09-24 11:15:27 +00:00
nokturnal
66ff11b4f2 added extra step for Atari MiNT/TOS target (cross and native builds). Explicit program flags and stack setting.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1822 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-08-03 16:16:05 +00:00
Yves Rizoud
8ba389e06b Lua: matchcolor2() now takes an optional argument that is the weight of lightness in color proximity algorithm (instead of the 0.25 default).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1821 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-07-18 23:08:33 +00:00
Yves Rizoud
f2316f12e2 Lua: statusmessage() now clears remainder of line
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1820 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-07-16 19:15:08 +00:00