Worn down hard by hardware
I couldn't really code away to my hearts' desire because hardware failures kept interrupting my flow. My video card is cranky and when strained it likes to deadlock. Probably due to its cheap nature and the fact that there are no good drivers for Win7 yet. I foresee the purchase of a new one in the near future.
Properties using boost::any
I made a first attempt towards a limited property implementation. The idea is that every entity holds a dynamic set of properties which its components use to publish and share data.
My current system has a way of doing this through a string-to-float mapping that all components can access. However only being able to store floats has been cumbersome when trying to store 2D vectors and integers.
The new attempt uses a mapping from string to a boost::any object. The any can be viewed as a boostified void pointer, but without any unsafe casting.
Apparently boost::any it uses the typeid() operator but implements its own any_cast<>() operation instead of using dynamic_cast<>(). I have to admit I don't know the finer points to this or how it compares in speed, but the robustness is there all right.
Using this little magic bean I swiftly coded up a property container with a get<>() and set<>() templated interface. Now I can write get("position") or set("health", 10) and it simply works. Very nice! [grin]
Bitmap fonts using AngelCode BMFont
Another concern has been that the text output during debugging was eating up 80% of the CPU time. Not that debug output optimization is that important, really, but lately it's been very hard to profile other parts of the code as their time was overshadowed by the colossal times of the text.
Something had to be done. I went for AngelCode's Bitmap Font Generator and the great, short tutorial by Promit on parsing the FNT file.
With this at my disposal the rest was easy. A quick and dirty implementation lowered the debug output CPU time to 50% of total. This is still horrible but less so than before. More to come on this.