376 Commits

Author SHA1 Message Date
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
Yves Rizoud
9f8381593a Fonts are now sorted (bitmaps before TrueType, then alphabetically).
Duplicate fonts (already same path+filename) are skipped.
Font selector allows pageup and pagedown.
Windows fonts directory is now determined by WINDIR environment variable


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@348 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-16 00:26:50 +00:00
Adrien Destugues
a60b2bfd01 Some more work on HLS colors. Broken...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@347 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-15 22:43:12 +00:00
Adrien Destugues
48979bf251 Fixed the last bug remaining in the gradiation rectangle. Again caused by loss of precision by not using floats :)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@346 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-15 18:33:27 +00:00
Yves Rizoud
c4f6cf7762 Changed a lot of platform-specific code to "simplify" it:
A Unix-like system is now considered the default.
The number of platform-specific blocks is down to:
   win32: 13, watcomc: 3, linux: 4, macosx: 16, amigaos4: 8, beos/haiku: 1
Removed linux.c, implemented the relevant functions for all platforms.
(win32) In Stats screen, included free memory report
(macosx) Conversion_ANSI: Fixed the __macosx__ with wrong case from my former 'fix', sorry.
(macosx) readline.c : Removed a manual "Update_necessaire=1", because normally
all calls to UpdateRect() will set this flag already. Don't hesitate to call 
Flush_Update() anywhere where it's lacking, but you shouldn't put it inside a  #ifdef __macosx__
(win32) Packaging: 'make ziprelease' now includes libpng13.dll and zlib1.dll
(win32) Hacked something to resolve naming conflict of MOD_SHIFT constants with windows.h
(all) Resolution: Fixed the black space that appeared between button and label,
the memory overwrite also caused resolutions above number 2 to disappear from list.
 
Tested fine on Linux (without TTF) and Windows


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@345 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-15 16:25:37 +00:00
Adrien Destugues
b511ceafdb Slightly modified the operation hadling of the gradiation rectangle to avoid erasing the rectangle footprint while drawing the vector.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@344 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-15 15:53:42 +00:00
Adrien Destugues
a6774e5d73 Fixed the remaining bugs from r339. Now we have a fully working gradiation rectangle system !
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@343 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-15 15:35:02 +00:00
Adrien Destugues
d016b8ba48 Some tweaks and fixups to the gradiation rectangles. Clipping and zoom mode work better, but :
-I introduced some weird bug making lines appear on the screen when drawing outside the limits of the zoom in zoom mode. Seems there is a XOR line function that get called with negative coordinates
-The preview rectangle is drawn with XOR-lines on the screen and does not modify the picture. So it is possible to erase it in the zoom screen by moving the cursor around it.
-Maybe I missed some testcases, i did not manage to reproduce the problem trigerred by grid clipping, for one.
-The gradiation vector is horizontal when it should be inclined. I probably missed something when writing the code for it. Probably a division gets out of precision... i should check if i used floats where needed


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@339 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-13 21:56:03 +00:00
Adrien Destugues
14536f17d1 whoops... memory leak... always red the manpages :)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@338 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-13 20:23:58 +00:00
Adrien Destugues
d5143b5f82 Implemented font listing under linux in a quite hacky way. The directory list returned by XGetFontPath is not really usable, there are some path with appended :unscaled for non-ttf fonts, so i needed to add some null-pointer check to for_each_file after the opendir to avoid a crash. I think most of my ttf fonts gets listed, but at a quick glance i find some duplicates and the list is not alphabetically sorted. That would be a great improvement (sort and remove duplicates).
Also renamed Mask to Mask_table because XLib.h already defines some var called Mask.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@337 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-13 20:20:47 +00:00
Yves Rizoud
038303721c Fix long filenames, and cursor keys while editing text
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@336 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-12 23:39:05 +00:00
Adrien Destugues
bf7e4a53dd We are now officially running under BeOS !
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@335 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-12 21:21:26 +00:00
Franck Charlet
1b183d5861 - Added handling for right mouse button when entering filenames input array (clears it) also using escape key restores old filename.
- Clicking the button with default filename in an empty directory wouldn't work.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@334 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-12 13:30:22 +00:00
Franck Charlet
f5d45ade8e - Issue 51 should be fixed.
- Patched 2 segfaults in Save_PKM() which were due to the packing routine accessing a byte of a picture beyond the allocated memory block.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@333 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-12 12:55:54 +00:00
Franck Charlet
02bdbd4627 - Fixed the display of the current directory size by casting uint64_t for the multiplication (should work for linux too i guess).
- Fixed the macosx xcode project.
- More aspect ratios added.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@332 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-10 17:51:01 +00:00