Tuesday 16 December 2008

Maps in Level

Maps are not yet member of Level, but they will be. They were exposed to global visibility and that may give me a whole lot of errors, although I guess terrain_map is less of a problem, because it's already accessed mainly in member functions of Level. There is a global pointer to current level, called current_level. I think I'm going to keep that, because making it a member of World (or Dungeon class in this case) would cause more pain than needed. It's fairly safe to use global pointer for Level class, because there is only one current level at a time.

I first planned to fuse all Level class files together, but that's actually not neccessary and would create one huge cpp file. The current Level main file (level.cpp) already takes a couple of seconds to compile. I think it's slow to compile mainly because of three or four game object class templates. Templates are something I'd like to avoid in C++, but sometimes it's not possible.

No comments:

Post a Comment