Archived

This topic is now archived and is closed to further replies.

Character Map (to array or not to array?)

This topic is 5777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Which is a better method of handling my character map? Should I keep all my symbols in a single bitmapped surface and just access the specific characters through offsets (based in ASCII character values) when I need to display them, or would it be better to load each character into it''s own surface in an array of surfaces. The first method means a little more code to access each character since my bitmap is layed out in a grid fashion (but it''s nothing horrible) while the second method means I only need to offset by -32 (Example: SPACE = 32 so SPACE - 32 = 0 so CHARSET[0] = My Bitmap for SPACE, and so on down the line for all the ASCII character I use 32-126). Any advice and or suggestions would be appreciated. Basically I''m looking for the most effient way to handle my character map. Note: my character map is currently 137x205 (I assume I should enlarge that a bit to make it a multiple of 2) and is setup such that there is a single pixel line border around each 16x16 character.

Share this post


Link to post
Share on other sites
In my opinion, go for the single surface. This probably saves you some memory, reduces the number of files you need to manage, and so on. An extra instruction or two for each letter is not going to hurt you one bit.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

Share this post


Link to post
Share on other sites