Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C GENERIC PROGRAMMING?

Name: Anonymous 2011-02-13 12:02

http://dis.4chan.org/read/prog/1297507372/56

i was reworking my memory manager a little bit (trying to get rid of memset initialization by keeping a mem_biggest_used_index variable) and i suddenly noticed that there's another problem i didn't consider: i'll have to duplicate all this code for every type of object pool i want. i'll need at least a pool for items and another one for NPCs. WHAT DO NOW?!

i found some code online and threw up in my mouth, is this how it's done in C?

http://www.flipcode.com/archives/Faking_Templates_In_C.shtml

Name: Anonymous 2011-02-13 13:59

I suggest you work on the high level stuff of your game before the low level stuff like this. You need to nail down the high level stuff first to discover what kind of interface you actually need to the low level stuff. If you don't, it's too easy to run in circles trying to make overly general code. The fact that you are writing a "memory manager" smells strongly of this problem.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List