Skip to main content
gamedev.net
🔒 Locked

Pointer or enumerator

Started by Psilobe Nov 29, 2011 at 8:23 PM 2 replies 800+ views
Original Post
Psilobe
Psilobe
I'm making a small tilebased game and got a small question. My world contains chunks and these chunks then contains tiles. When drawing I'm considering of either having the tile containing an enumerator that corresponds to the image of the tile or a pointer to the image and then just look at this when drawing. So enumerators or pointers?
ApochPiQ
ApochPiQ
Go with an enumeration. It'll be easier to do debugging: you can just look at the value of a tile and go "aha! that's a 3, which is grass!" instead of "what the f*** does 0x58fb28e0 mean?"
Psilobe
Psilobe
That does sound easier, not that I'm really gonna need it for this but would there be any noticible preformance differences? Depending on tile sizr there will would be about 50*30 calls to get the data per terrain update.
ApochPiQ
ApochPiQ
Unless you're programming your toaster, you won't see any significant performance problem with an enumeration.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.