Friday, July 25, 2008

i am teh ninja c0d3rz. ph34r my sk11lz!

I've struggled a bit getting a modal messagebox working, but it's almost there now. A nice new construct for me - an array of function pointers!

 typedef void (*m_print_func_t) (int, int, char *);
m_print_func_t M_PrintFunc[2] = {M_PrintWhite, M_Print};

------------------------

M_PrintFunc[this->ActiveButton] (184, ypos + 20, "Yes");
M_PrintFunc[!this->ActiveButton] (240, ypos + 20, "No");
Just 4 lines of code, but doesn't it make your eyes bleed?

0 comments: