Rockbox mail archive
Subject: Re: Working towards skin engine 2.0 (includes RFC on code!)
Re: Working towards skin engine 2.0 (includes RFC on code!)
Am 06.11.2011 16:24, schrieb Jonathan Gordon:
> Three macros and a typedef have been added.
> SKINOFFSETTOPTR() and PTRTOSKINOFFSET() convert between the offset and
> the real pointer. I originally wanted to put the type in the first
> macro and use that instead of void* but not sure if that is really
> the 3rd macro OFFSETTYPE() is added because I realised the structs
> used by the various tags will become very confusing if all the members
> are skinoffset (or long) types instead of the pointer type which the
> data actually contains. So I added this macro to hopefully help
> document the code a bit.
I'm not a too huge fan of this macros. Perhaps they're just too long
:). I particularly don't like OFFSETTYPE(). I got it right that it just
for documenting the purpose of the field? A comment can achieve the same.
What about making the skin buffer have handle based api
(skin_get_data(int) to be added), with the handle being that offset?
What you could also do is perhaps load it with pointers into the plugin
buffer, then move it into the buflib, and fix up the pointers using the
same code that a possible move_callback() would call. How does this sound?
Received on 2011-11-07
Page was last modified "Jan 10 2012" The Rockbox Crew