340 Commits

Author SHA1 Message Date
Franck Charlet
ccfc83dae3 - Updated the xcode project.
- Added my email in the credits just in case.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@402 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-18 18:17:27 +00:00
Yves Rizoud
77206f2baa Some sources converted from Unicode to ANSI, and removed some warnings for mingw (implicit include of libc)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@401 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-18 15:08:23 +00:00
Adrien Destugues
fb6d1100dc Lines will refresh instantly when you press shift, but, strangely, not when you release it.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@400 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-17 20:58:59 +00:00
Adrien Destugues
2825350f17 We missed a flush_update there...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@399 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-17 20:52:39 +00:00
Adrien Destugues
294ccbd2d3 Allow sliders to scroll more than once when the mouse button is pressed
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@398 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-17 20:00:15 +00:00
Yves Rizoud
efd02fbf00 Fix compilation warnings of r394
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@397 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-17 19:12:58 +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
Adrien Destugues
c004c90d90 Splitted graph.c in multiple files. Compiles but there is a lot of warnings about declarations. I'm cleaning it up but i wanted to commit that before starting to get conflicts
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@395 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-16 22:02:22 +00:00
Yves Rizoud
78df30d844 Fix broken characters >127 in the help window.
Fix broken characters >127 in normal fonts.
(Pkm: I unsigned the characters during gcc port, please don't re-sign them :)
Got rid of OEM->ANSI character translation in normal text.
Now displays the nice '...' character for filenames that dont fit windows/menus.
(dev) Added a sample Amstrad CPC picture with wide pixels. Remember to run grafx2 with '/wide'


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@394 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-16 19:26:19 +00:00
Yves Rizoud
22670e7215 Fonts re-ordered/redrawn in ANSI order
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@393 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-16 17:44:57 +00:00
Adrien Destugues
514eee4f79 Fixes the brush roatation missing update. Also switched to cumulative rects method instead of rect-by-rect, as it is faster, and flicker free when working with big brushes. It may makes it harder to diagnose missing refreshes, however.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@392 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-16 16:54:21 +00:00
Adrien Destugues
32f07b66ce Remove useless setting "show system directories".
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@391 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-16 12:41:57 +00:00
Yves Rizoud
71c2aa4ce6 Fix missing refresh in Spray menu.
Fix wrong color selection in Spray menu when clicking between columns.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@390 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 23:54:28 +00:00
Yves Rizoud
72738b9e48 Sieve menu displays sieve previews with wide/tall aspect ratio if needed.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@389 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 23:02:33 +00:00
Yves Rizoud
b6d18a012b Brush menu displays with wide/tall aspect ratio if needed
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@388 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 22:28:32 +00:00
Adrien Destugues
383bb56366 Added the missing text refresh for text in windows.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@387 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 22:05:32 +00:00
Yves Rizoud
9510441b7b Missing files from previous commit
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@386 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 21:45:13 +00:00
Yves Rizoud
d4dcf44f7c Support for "wide pixel" mode (Each pixel is 2x1). Run the program with "/wide" argument to test.
Now you can draw graphics for Amstrad CPC's "mode 0" :)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@385 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 21:00:18 +00:00
Adrien Destugues
d81a4a26f0 Oops ! Much lower cpu use and keyboard is working again.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@384 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 19:36:47 +00:00
Adrien Destugues
c72dcd1840 Only displays the coordinates if the mouse moved. Next step is to check the Operations and see wich of them are displaying the coordinates, wich are not, and decide wether we always display them in the main loop (smaller code for operations) or in each atomic action in operation (more code in the atomic actions but allow for displaying anything, like the selected color for the pipette, radius for the circle tool, relative positions for lines and rectangles, and so on. Might be interesting. We may also display the basic corrdinates and let each operation display (or not display) some string in the remaining menubar space.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@383 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 16:33:30 +00:00
Adrien Destugues
a5150484e4 Removed useless call to UpdateRect.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@382 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 15:53:13 +00:00
Adrien Destugues
87d887e240 One more small speedup. The coordinates were always printed twice in the menubar. Also added a missing refresh when using the pipette and the color replace tools. Now you get a preview of the color under the cursor in the menubar.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@381 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-15 15:17:47 +00:00
Adrien Destugues
6c8bbfbc56 Now idles when there is nothing to do. Much less CPUtime use, but the spray is slowed down. We need to improve the handling of Get_input in Gestion_principale.
Get_input now returns 1 if something happened, and 0 if not. So we can chose what to do depending on that.
We should try not to wait if the operation needs to be asynchronous, but there is no way to know that for now, and it may be quite complex to determine (i think the shade effect can be asynchronous for example, so it'll affect pretty much all operations).

The other solution would be to drop events to react to the more recent ones. It would look smoother but the mouse will do strange things.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@378 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-14 11:17:15 +00:00
Adrien Destugues
363ff934fd Added xman current working mail address to the credits screen
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@377 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-13 21:56:09 +00:00
Yves Rizoud
d2300cc2c1 Support for "tall pixel" mode (Each pixel is 1x2). Run the program with "/tall" argument to test.
The following tools don't take the ratio into account;
Circle,
Grad rectangle,
Brush rotation,
Resizable brushes (diamond, squares, circles...)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@376 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-13 16:20:37 +00:00
Adrien Destugues
2033f2dfb4 Some optimisations to the text drawing (Print_general) unfinished, breaks the OEM special chars for now.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@375 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-10 11:53:56 +00:00
Adrien Destugues
428e1c36cf Some more optimizations to the color reduction algorithm. Now runs in a decent time on my laptop :)
There may be some more small optimisations possible in this area... i'm still thinking we could get a better palette by putting more priority on highly saturated clusters, but, as we don't store the saturation property in the clusters, it seems difficult to do. Probably it would require switching to HSL before doing the clustering, and finetune the multiplications done in Cluster_Split. Note: these modifications (and the one in the previous commit) will probably crash badly if using the reduction algorithm with a smaller precision than 24bpp. The program will try to do that if it is unable to malloc the big lookup tables (we need a table of 256^3 = 16Mbytes for the color lookup, and when loading we also have the 24b image in memory, and also the clustermap, and the occurence table, wich is 256^3*4=64Mbytes). So, either we assume every computer out there has 128Mb RAM, or I'll have to change my code back to use a lower precision if the malloc ever fails. Anyways, who's wanting to open files bigger than our marbles.pcx in grafx2 ? and who except me is running a computer without swap memory at all ?


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@374 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-09 16:40:36 +00:00
Adrien Destugues
de726cae2f Some small optimisations to speed up the color reduction algorithm... still a little bit slow for me ...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@373 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-08 20:28:38 +00:00
Yves Rizoud
8695c31c1b Only code formatting (Tabs must die)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@372 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-06 17:28:21 +00:00
Yves Rizoud
d6d03dc6c7 Load/Save: Fixed "Backspace" shortcut (previous directory), broken recently.
Load/Save: Fixed "Backspace" shortcut detecting root only on MS filesystems.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@371 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-05 23:28:50 +00:00
Yves Rizoud
09ba984aa6 On all screens that display a palette, the grey columns are no longer "dead", you can
click them to pick the color to its right.
Added help text for HSL mode in Palette, and Grad rectangle
Fixed display of colored rectangles in Palette screen (issue 64)
Fixed more missing refreshes in the Palette screen
Fixed wrong shortcuts in Palette screen
Removed an obsolete message ("Sensibilite Souris") and dead code


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@370 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-04 21:44:59 +00:00
Adrien Destugues
7c658a6855 Some fixes to the floyd steinberg dithering. The error was added to the neughbour pixels, it is now substracted, the results are much better. However, the palette seems to lack saturated colors (in comparison to the one generated b ygimp, wich gives more dithering, but better overall subjective ressemblance to the 24bit image. Maybe having less dithering is fine for us, as we are in a pixelart painting program afterall...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@369 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-03 20:50:52 +00:00
Yves Rizoud
14accb544b Palette now uses RGB components in the full 0-255 range instead of 0-63.
All palette functions can be used in HSL color space too (multi-select, etc).
Fixed some more missing refreshes in Palette screen.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@368 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-03 01:03:32 +00:00
Yves Rizoud
bee5956c41 Enabled .pbf fonts : Opentype fonts, on Debian
Fixed a memory leak. Happens once, harmless.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@367 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-29 15:35:31 +00:00
Yves Rizoud
6413bdc474 Upload of the Win32 icons and DLLs
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@366 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-29 00:49:06 +00:00
Yves Rizoud
ff27c5dcf9 BIG change in directory handling:
- Unix users can "make install" and "make uninstall" (as root).
- Installation creates shortcuts "grafx2" and "gfx2cfg" in /usr/local/bin
- Installation puts data files (icon GIFs, gfx2.dat,..) and the actual binaries in /usr/local/share/grafx2
- At runtime, the programs search and create configuration files (gfx2.cfg and gfx2.ini) in ~/.grafx2
(But if there are some present in program's own directory, they override)
- Uninstall removes programs and data, but leaves all users' configurations.

Win32: User's config directory is %APPDATA%\GrafX2
Win98: %APPDATA% is not set by default, so the program falls back to executable's directory.

Tested on Debian Linux
Partially tested on Win XP (early version)
Tested on Win98


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@365 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-28 23:50:28 +00:00
Yves Rizoud
3d4def25f0 More Haiku fixes (gcc v2 support, actually)cf. Issue 61
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@364 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-26 21:56:36 +00:00
Yves Rizoud
3ca05279db Fix program hang in Save/Load (Issue 59)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@363 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-25 20:22:10 +00:00
Yves Rizoud
7ba57b206e Attempt at fixing BeOS build that I broke in r345 -> Issue 61.
Completed bugfinders list.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@362 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-25 19:55:06 +00:00
Adrien Destugues
8ce30de525 Add 32 null bytes at end of PI1 files to make ST Deluxe Paint happy (reported by tobe)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@361 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-25 18:58:50 +00:00
Yves Rizoud
436e3f15fd Help screens show the keyboard shortcuts from current configuration
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@359 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-24 00:07:49 +00:00
Yves Rizoud
a723537d94 Fix incomplete display of brush at screen edges in zoom mode (issue 53
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@358 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-23 16:54:18 +00:00
Yves Rizoud
d71d7d701d Fixed more missing screen refreshes:
- Issue 54: Palette screen, BG color area after picking a BG color by right-click.
- All screens that allow the user to press Tilde to hides the window and pick a color on the image.
- Stencil screen, the selected colors when you're back after picking a color.
- Issue 55: Load/Save, areas with file stats (size, preview) just after changing selection.
- Issue 44: Status bar when emptying it (ex: hovering the status bar or the zoom separator)


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@357 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-22 00:56:21 +00:00
Adrien Destugues
fc0bd94113 Fixed the rgb2hls and hls2rgb functions. But we are losing too much precision when converting the RGB components back to "VGA" 0..63... I think it's time to switch to real 256 colors ...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@356 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-19 22:04:32 +00:00
Yves Rizoud
b49cbc3acf grafx2 and gfxcfg now have a 32x32 icon while running. (gif image in install dir.)
(win32): Added embedded icon for gfxcfg.exe. Only 32x32 version, because lazy.

Tested on Win98 and Linux.



git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@355 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-18 22:53:28 +00:00
Yves Rizoud
6e7fa8690c Icon: gfx2.ico now contains 2 more versions, re-pixelled in 16x16 and 48x48
(win32): When compiled, the icon is embedded in executable.

Tested on win98 and linux.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@354 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-18 20:39:34 +00:00
Yves Rizoud
54ca84e094 Text: Implemented Bold and Italic, redid the screen layout.
GUI: Generalized the system that right-clicking an input area empties it while
entering edit mode, since it was indeed a very good idea, it saves a lot of time
once you do it intuitively. (Esc still cancels and restores)
Added a bitmap font, GrafX2_Classic.gif. Helpful for prototyping GUI screens.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@353 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-17 23:44:19 +00:00
Yves Rizoud
3c06848a8f Enabled OTF fonts for all platforms (tested OK on Windows)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@351 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-16 17:52:59 +00:00
Yves Rizoud
1a44350060 Fixes missing refresh when grabbing a brush with RMB (issue 50)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@350 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-16 17:20:45 +00:00
Franck Charlet
415b878844 - Added support for Mac OSX system fonts in texte.c.
- Inverted the "AntiAlias" and "No AA" labels so it's more intuitive that way.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@349 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-16 00:50:14 +00:00