void act (const char *format, CHAR_DATA *ch, const void *arg1, const void *arg2, int type)
register_mouse_callback(my_mouse_function, &my_app_state);
void my_mouse_function(int x, int y, void* userdata) {
AppState* state = (AppState*) userdata;
state->mouseX = x;
state->mouseY = y;
}
as parameters to my call_lua(…) function. From what I've read this can be an inefficient use of memory.
Is this true? If so, can you explain why?
Because each call to lua may require 1 or more objects, would it just be better to construct a container
of pointers to these objects, then send in the head pointer to this container? Just an idea anyway.