From: Charles W. <kat...@ya...> - 2003-05-28 18:05:55
|
> Using Allegro under OSX requires the use of the END_OF_MAIN() macro > at the > end of the user main() function. Otherwise you'll get that error > while > linking. Cheers! And now my tool works just fine. ^_^; Not bad for a few hours of work... I used Tony's code because while Allegro does support a number of file formats, I've found that saving a PNG of the icon and using it to make icons under OSX tends to be the easiest way of doing things as well as the nicest-looking. As well, using NSImage to do the loading gives a number of other advantages, such as easy blending and quality scaling. (A side note -- Woudln't it be nice to extend Allegro's bitmap loading routine under OS X to support PNG images using NSImage? We're already linking against the Cocoa library, so it'd be a "free" addition.) I tried your tool, and it does seem to work aside from the empty icons. (I'd add change the -c feature to a -m (move) switch, and copy by default, however; but that's me.) I'm thinking it could be one of two things: When you set the icon data of the family the data is just copying the pointer, and when you dispose of the handles you're disposing of the data. The other thing it might be is that I noticed in Troy's code there's problems with creating an IconFamily as NewHandle(0). (That's why his [IconFamily init ] doesn't work.) You may want to try creating an empty icon suite and then converting it to a family. Well, we now have two tools that do the same amount of work in different ways. ^_^;; I can add the ability to pull icons from a datafile in mine, or we can scrap mine and just use yours. Let me know, because if my two little programs aren't needed I won't continue working on them. Also, something I noticed about OSX command line allegro tools -- as soon as allegro_init() or install_allegro are called the icon for the program pops up on the dock and the component manager errors appear in the terminal. Is there a way to supress this behaviour for console apps? - Charles |