157 Commits

Author SHA1 Message Date
Yves Rizoud
8862c1994f Fixes a SIGSEGV when using line,polyline,polygon etc. with a starting point below the picture (outside).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@405 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-20 17:50:54 +00:00
Yves Rizoud
28805017a2 Fix issue 56: Window resizing and zoom mode.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@404 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-12-19 16:49:01 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
3e04f68127 FIX screen refresh with large brushes and in zoomed mode
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@330 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-08 20:54:00 +00:00
Yves Rizoud
863f5111f0 Text: You can now type long lines (250car).
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@327 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-05 23:59:05 +00:00
Adrien Destugues
3422eeff46 Patch from begasus to allow building under haiku and beos. The program is crashing when you launch it (segmentation violation).
I'm not sure the way to get the program directory we use is ok for beos, but the official way of doing that is using C++ code.
Maybe it's time to switch to some more unix way to store the config files...

This should also fix watcom build (very untested as i'm using mingw to cross compile windows builds now)
Also added begasus to the credits screen.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@325 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-11-05 18:59:55 +00:00
Adrien Destugues
72c42b92ce fixed crash when drawing a vertical gradiation or a single-point (nonsense) gradiation.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@315 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-28 09:59:58 +00:00
Adrien Destugues
d72897e93d Some more fixes for the gradiation rectangles. The position is now calculated in an int, you should not experience any problem with the circle limit.
Also fixed the operation handling. The rectangle is now drawn properly when you finish sizing it.
The vector line still leaves some artifact on screen, however...


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@310 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-27 09:02:33 +00:00
Adrien Destugues
78e48f5156 Fixed sprite cursor drawing on screen edges
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@304 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-23 17:04:18 +00:00
Adrien Destugues
468af075c3 Fixed the vector calculation. You can now draw gradiation rectangles.
However there is still some work needed :

-Some crash when the calculation gives something outside the range (clipping will probably do the trick)
-Divide by zero or something nasty like that when doing a vertical vector
-Some vector give horizontal gradiation... maybe because all the calculations are done with integers
-The operation handler still need some work : rigt click for cancelling, displaying the selected rectangle properly.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@302 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-23 06:59:11 +00:00
Adrien Destugues
cef61562d0 Some progress on the gradiation rectangles. I messed up the vector calculation somehow. Is someone good at maths ?
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@301 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-22 19:56:30 +00:00
Adrien Destugues
221b7cae00 ok, fixed line drawing. The error in previous commit was my fault, after all :)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@295 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-21 13:56:28 +00:00
Adrien Destugues
31c278813e Trying to get straight lines drawn with shift + click. Seems the value of the starting point gets cut to 8 bit somewhere but i can't see where that happens... and it works fine when drawing, but not in preview mode !
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@294 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-21 13:39:47 +00:00
Yves Rizoud
b488ec9272 Fixed stricter compilation warnings, deleted unused asm code
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@288 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-18 19:23:35 +00:00
Yves Rizoud
9a759615ae Cleaned up some DOS leftovers.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@282 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-17 21:30:38 +00:00
Yves Rizoud
763087a626 Implemented Meilleure_couleur_sans_exclusion().
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@281 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-17 21:01:47 +00:00
Yves Rizoud
a453821325 Fixed the darn color remapping bug in Palette window, that still happened with zoomed menus (x2 x3)
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@271 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-16 22:02:42 +00:00
Franck Charlet
6a778031fe Handling for these formats were broken due to endianness problems on PPC: pkm img bmp gif
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@268 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-16 00:29:04 +00:00
Yves Rizoud
9770d70f2a Refactored the "#ifndef __macosx__" that were around every SDL_UpdateRect().
Redraw method is now defined once, in sdlscreen.c

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@266 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 22:52:00 +00:00
Franck Charlet
99b99322be Added the missing objective C files for the macosx and fixed the changes you forgot in main.c etc..
Also added a way to handle the right mouse button when the shift key is pressed (for mice with only have 1 button :]).

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@264 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 20:55:31 +00:00
Yves Rizoud
dac1e814ec Fixes color mismatch under palette window when it's low and you alter a color used in the GUI and the menu bar is
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@262 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 19:34:45 +00:00
Adrien Destugues
4117dace60 You can now change zoom factor while in magnify mode.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@261 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 19:03:13 +00:00
Adrien Destugues
db9e12eda4 Fixed the screen update function... again...
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@260 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 17:58:36 +00:00
Adrien Destugues
99d485210c Some speedup for macosx build
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@259 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 13:29:34 +00:00
Yves Rizoud
9434f76dfd More fixes of palette remapping. Todo: Button Swap needs a refresh, button Cancel requires a toolbar redraw.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@258 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-15 00:04:15 +00:00
Yves Rizoud
9fb162e748 Fixes the missing color remapping of windows background (and status bar) when palette remapping occurs.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@257 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-14 22:46:51 +00:00
Adrien Destugues
584c4696c1 Mac os X port. Compiles and runs slowly
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@256 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-14 20:42:05 +00:00
Adrien Destugues
70a750e187 fixed screen update for cursor outside screen
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@252 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-14 19:31:16 +00:00
Adrien Destugues
ff1d5d4dd6 Fixed screen update issues.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@251 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-14 16:16:32 +00:00
Yves Rizoud
403159f9a3 Resolution in gfx2.ini is now default.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@248 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-13 21:23:43 +00:00
Yves Rizoud
8a1e44ed30 Windows restore their background. Fixes/speeds-up some refreshes, and prepares for pop-up windows
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@237 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-12 17:32:46 +00:00
Adrien Destugues
717a7f1fbb fixed line artifacts.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@223 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2008-10-10 15:48:40 +00:00