I don't have much of a reason to want to do this that couldn't be done by a macro, but I was thinking of this:
entity->Think();
Where the allocated function goes like this:
Code: Select all
void Think(void)
{
entity_t* me = &entity[52];
_Think(me)
}
#define THINK_ENT(_ent) _Think(_ent) // Yes this is a stupid macro, but I'm thinking of more complex applications of this ultimately with more arguments...
Or call the function directly. I just enjoy exploiting C capabilities to the max. Sadly, during the course of writing this, I've already thought of a way to maybe explore this that goes like this ....
Code: Select all
void Think1(void)
{
entity_t* me = &entity[0];
_Think(me)
}
void Think2(void)
{
entity_t* me = &entity[1];
_Think(me)
}
void Think3(void)
{
entity_t* me = &entity[2];
_Think(me)
}
Thoughts? Would I accidentally piss off anti-virus or something by doing this or make an operating system security model mad at me that maybe uses certain addresses for execution and certain addresses for storage?