Game Development Community

Macro Replacement Inquiry

by Fabian Holmberg · in Torque Game Engine · 11/24/2004 (8:57 pm) · 2 replies

I am currently using the TNL library and am aware of the fact that you are currently developing a verson that supports TCP which is great. Having gone through your code I noticed in your RPC's that there is a strong emphasis on macros, such as TNL_IMPLEMENT_RPC, defined in tnlrpc.h.

From a functional perspective they appear to be duplicating what templates do in C++. Clearly whoever wrote this code was very strong in C but not so in C++ or he would not have opted for this method of development.

So to conclude I would like to know what the status of your decision is with regard to keeping / replacing these macros with something more user friendly such as templates. Would appreciate feedback on this.

#1
11/25/2004 (5:36 pm)
Hmm... it should be possible to use templates to do what the assembly code does for the RPCs -- i.e. marshall and unmarshall the data and dispatch the call, but the macros would still be necessary for the automatic registration of the functions, assignment of class ids and so on. If you want to reimplement the TNL method dispatch code using templates, we'd be happy to integrate such a submission into the code base.
#2
11/25/2004 (6:37 pm)
Indeed - well we are too stripped for time to be able to come up with our own implementation. Just wanted to bring this issue to your attention so you can keep it in mind for the future.