57 Commits

Author SHA1 Message Date
Thomas Bernard
f9616f570a remove warnings when compiling with MSVC++2010 2018-03-19 16:49:32 +01:00
Thomas Bernard
f2d579695c implements selection of circle/ellipse mode with right button
see http://pulkomandy.tk/projects/GrafX2/ticket/54
2018-03-10 00:46:11 +01:00
Thomas Bernard
df73e91c08 Implement "corner to corner" Gradient ellipses 2018-03-10 00:46:11 +01:00
Thomas Bernard
c1afa188a2 Change empty/filled Ellipse drawing to draw ellipse inscribed in rectangle
still to do gradient ellipses.

see http://pulkomandy.tk/projects/GrafX2/ticket/54
2018-03-10 00:46:11 +01:00
Thomas Bernard
d6ce86cae4 Remove Circle_limit global variable 2018-03-10 00:46:11 +01:00
Thomas Bernard
ce1b55be03 graph.c: Pixel_figure is not a global var anymore 2018-03-10 00:46:11 +01:00
Thomas Bernard
be8b05a384 remove Ellipse_vertical_radius_squared Ellipse_horizontal_radius_squared Ellipse_limit global variables 2018-03-10 00:46:11 +01:00
Thomas Bernard
6b97fcc322 Remove Ellipse_cursor_X/Y and Circle_cursor_X/Y global variables 2018-03-10 00:46:11 +01:00
Thomas Bernard
6be7cb1e9f move circle/ellipse functions from misc.c to graph.c
void Ellipse_compute_limites(short horizontal_radius,short vertical_radius);
byte Pixel_in_ellipse(void);
byte Pixel_in_circle(void);
2018-03-10 00:46:11 +01:00
Thomas Bernard
92620bb4ba merge Upload_infos_page_main() / Upload_infos_page_spare() => Upload_infos_page() 2018-01-22 20:34:29 +01:00
Thomas Bernard
a53d6da6ea Add visible_image and backups to the T_Document structure 2018-01-22 16:16:39 +01:00
Thomas Bernard
8ae651c75f put common fields for Main and Spare page in a T_Document structure 2018-01-22 14:46:44 +01:00
Adrien Destugues
1d2cfc2a8d ZX: also apply brightness constraint
There may only be one brightness per cell: either two light, or two dark
colors.
2017-06-28 08:24:32 +02:00
Adrien Destugues
f2b04e08d0 Constraint modes: Thomson, ZX 2017-06-23 22:20:08 +02:00
Adrien Destugues
0b6e782f74 Support Amstrad CPC mode EGX2 2017-06-23 22:20:08 +02:00
Adrien Destugues
aef77744e1 EGX mode for CPC
In this custom mode, odd lines use MODE 0 (wide pixels, 16 colors), and
even lines use MODE 1 (square pixels, 4 colors).

- Add a settings window to the 8-bit effect where you can chose what you
want to draw
- Add the customizations required to make it work in graph.c
- Tweak some other places so it is easier to add other modes later on.
- Groundwork for some more modes: EGX2, ZX spectrum, Game Boy color.
2017-05-06 22:22:52 +02:00
Adrien Destugues
a8c7cdff15 Update copyright year in headers. 2017-05-01 20:41:46 +02:00
Adrien Destugues
23eded3e09 Fix endless event loop in Haiku
SDL for Haiku always send a WM size change at init. We did catch that it
would not cause any SDL mode set, so we ignored it, but we forgot to
reset the resize width and height. So each run of the event loop would
try to resize the window again and again to the same size.

Thanks to event throttling this was not very noticeable, the main
consequence was that some stuff was reset and for example the tooltips
in the status bar were not showing at all.
2017-05-01 20:34:05 +02:00
Adrien Destugues
8808625851 Add a "tall 3" drawing mode.
Pixels with 3:4 aspect ratio. Why not?

Contributed by Nic Soudée (zoner/xylem). Thanks!


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2166 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2016-10-15 18:57:14 +00:00
Yves Rizoud
f9eb1bfe7b Fix crash in contourfill when grid is visible - part of ticket #20. Also update credits and homepage address
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2122 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2015-06-25 22:26:49 +00:00
Adrien Destugues
878c926ce4 Fix issue 185 (XOR highlight) :
* Use a simple optimization algorithm to compute a good set of XOR color pairs
 * Algorothm is not very optimized (complexity is up to n^3). In practize, it stabilizes after 2 to 3 rounds of swapping colors
 * Use this color table for all XOR effects
 * Setting for grid color is now removed


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2048 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2013-01-06 12:46:46 +00:00
Adrien Destugues
65194af002 Use some macro magic to avoid repeating the list of graphic primitives for each pixel renderer.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2047 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2013-01-06 11:23:24 +00:00
Yves Rizoud
e87f9140c7 Fix issue 516: Some changes can't be undone on animations > 32 frames
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2033 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-10-16 00:07:42 +00:00
Yves Rizoud
effde4aee2 Issue 473: Fix mouse droppings in Brush rotate tool when you hold Shift
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2012 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-09-26 23:13:04 +00:00
Yves Rizoud
d8fd3d33a4 Fix issue 473: Brush-rotate cursor has display issues
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2011 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-09-26 00:37:49 +00:00
Yves Rizoud
a630a84822 Removed all usage of __attribute__((unused)), replaced by void cast which is supported both on GCC and VBCC
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1984 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-08-11 16:19:07 +00:00
Yves Rizoud
2aa72730ad Fix issue 495 : Contour fill crashes on new anim frame, and possibly random crashes when adding anim frames
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1968 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-07-10 23:03:29 +00:00
Adrien Destugues
b437d458d4 CPC Mode 5 fixes :
* Be case unsensitive when looking for the GFX-file,
 * When an underlay is hidden, do not use it and replace it with color 0, 1, 2 or 3. Allows to see pixel data 
alone or disable rasters on one color, as it's possible to get confused quite easily.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1964 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-06-13 19:50:35 +00:00
Yves Rizoud
064bbebc5b Fix part of issue 459: In anim mode, Color-replacer didn't refresh the screen
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1943 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2012-04-08 14:45:56 +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
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
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
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
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
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
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
706049a2d9 Merge all changes from trunk in CPCMode5 branch.
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1809 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-06-19 18:30:53 +00:00
Yves Rizoud
bf28d19f20 Lua: Fixed drawdisk which was drawing a square instead of a circle (doh!). Radius can now be a multiple of 0.5 to draw circles of even sizes (r=0 -> 1x1, r=0.5 -> 2x2, r=1 -> 3x3 etc.)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1798 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-06-14 21:52:20 +00:00
Yves Rizoud
1f10338f60 Merged trunk into branches/mode5 (=update mode5 branch to latest)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1785 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-04-25 15:17:18 +00:00
Yves Rizoud
64e39cda85 Lua: fix crash of the new drawing primitives (drawcircle, drawdisk, drawfilledrect, drawline) when outside view area
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1756 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-03-13 00:52:51 +00:00
Adrien Destugues
72e9892b53 Constraint mode is now switchable on/off in the effect screen.
I did some changes to the effect screen to make some space : instead of displaying an "on/off" label, we now keep the button pressed for active effects. 

There is no "constraint menu" yet, we should allow to select different constraints there (C64, MO5, spectrum, ...) to activate their respective enforcer and plug the right thing to the associated checker.

This should eventually allow drawers to :
 * Load any single-layer picture
 * Select the mode they want to use (without enabling it)
 * Run the checker and get the result as a multilayer (with an error layer)
 * Then, once they feel enough issues are solved, switch to "enforcer" mode for further manual tweaking.

Now we need a checker for CPC Mode5... :)

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1721 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-02-14 13:37:35 +00:00
Adrien Destugues
eba26aaa96 Merge trunk to the cpcmode5 branch. This gets us a more recent grafx2 with the cpcmode5 drawing. Now to make this mode optional so users can still work in regular mode :)
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1719 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-02-13 21:49:31 +00:00
Adrien Destugues
4e60f5ad74 Import the WIP CPC-Mode5 code from the sourcearchive
git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1718 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-02-13 21:20:45 +00:00
Yves Rizoud
ce3181b230 Fixed compilation warnings: a few missing declarations, and 2 strange casts on WIN32-specific code.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1712 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-02-07 19:39:45 +00:00
Yves Rizoud
1b0141367e Import colors from brush now works (F11)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1703 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2011-01-30 00:59:52 +00:00