I'm quite confused on using a hash algo to come up with an index into an array. Prelude said something in another thread about a classic AND,XOR and OR system that works but I've never heard of this.
I essentially have a static array that is built using macros (think MFC's message map system) and I need a way to index into the array to find a handler for the message based on it's ID. Iterating the static array would take time and I'm not sure the game engine could do it fast enough to be useful.
The MFC source code takes the LOWORD of the static array's address, XORs it with the message ID and blah blah blah somehow comes out with an index. I have no idea how taking an address of a static array and doing anything with it can get you an index into the array since the array address is dependent on the machine state and OS at run-time. Quite odd. And looking at the source for MFC more than gives me a headache.
I will check out Prelude's site on hashing but thought I'd ask here anyways.
Help Bubba plz.