Re: [AD] [ alleg-Bugs-2333410 ] think of a way to allocate user event type numbers.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


2008/12/11 Evert Glebbeek <eglebbk@xxxxxxxxxx>:
> On 11 Dec 2008, at 15:49, Milan Mimica wrote:
>> How about this:
>> #define ALLEGRO_EVENT_ID(a,b,c,d,e,f)     ((((a)-0x41)<<25) \
>>                                           | (((b)-0x41)<<20) \
>>                                           | (((c)-0x41)<<15) \
>>                                           | (((d)-0x41)<<10) \
>>                                           | (((e)-0x41)<<5)  \
>>                                           |  ((f)-0x41))
>>
>> It uniquely codes any of the upper case letters and [\]^_`. Leaves
>> 2 bits for
>> something...
>
> Leaves out numbers though (based on your description), which isn't
> particularly nice.

Doesn't leave out numbers, except the two bits at the end. It takes
values in range from 'A' to '`'.


-- 
Milan Mimica
http://sparklet.sf.net




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/