On 21 Aug 2005, at 05:23, Mark Wedel wrote: > Amorya North wrote: > >> I've got somewhere. Common files compile in now, and work fine. >> I've got a vague event loop up and running, and some of the >> callbacks work. I've got as far as displaying text sent to the >> console, and displaying a list of current stats. >> Here's a screenshot: >> http://www.amoryanorth.com/crossmac.png >> There's a lot I don't understand about the common code still - in >> particular, what the create_and_rescale_image_from_data() function >> is actually supposed to do! But I'm working on it. >> > > Just as it sounds. > > All image data is png. However, the png data has to be converted > to something that the display system knows how to display. > > In order to abstract this, the cache_entry image_data pointer is > basically private - whatever the display specific code deams to > store there is fine. > > The basic idea of this is to have the caching logic all in the > common code (if it gets a face it knows about, it will do the right > thing), but have the actual rendering code in the client area. > > For the gtk and gtk-v2 clients, that function is perhaps a bit > messier than need be, because those clients support different > display modes (pixmap, sdl, and in case of gtk-v2, opengl), so what > exactly is stores there may be different. > > The rescale part is jsut that - rescaling of the image. You may > decide for your client that you don't want to allow rescaling - > that's your choice. Just for the gtk clients, people wanted to be > able to rescale the data so they could play on lower resolution > displays. > Ah, ok - so I can store a pointer to an NSImage in the cache entry? That would help a lot. I was wondering where I'd be able to do the conversion. As for scaling, it's dead easy in Cocoa. A single line of code will scale the map window's contents _after_ it's been composited. So I won't allow scaling of images to be stored - it's just not needed! Thanks for your help. Amorya