A little code cleanup in AnimQueue
This commit is contained in:
@@ -22,23 +22,28 @@
|
||||
// by mixing the hash value of the previous step with the hash value
|
||||
// of the encoded string of key-value pairs.
|
||||
//
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SERIALIZED STORAGE
|
||||
//
|
||||
// The entired animation queue is stored in a serialized format,
|
||||
// as a shared string. This means that the animation queue can be
|
||||
// passed to the graphics engine as a single string. This vastly
|
||||
// simplifies the API for passing the animation queue to the
|
||||
// graphics engine. It also vastly reduces the amount of computation
|
||||
// done during the graphics engine probe: all we have to do is get
|
||||
// the already existing string and pass a reference to it.
|
||||
// passed to the graphics engine as a single string. This can be
|
||||
// accomplished by the function EngineWrapper.get_animation_queues.
|
||||
//
|
||||
// However, that means that when manipulating the animation queue,
|
||||
// we have to decode it, manipulate it, and then reencode it. This
|
||||
// is a good tradeoff: we update animation queues rarely, compared
|
||||
// to how often we pass them to the graphics engine.
|
||||
// The fact that the queue is stored in a serialized format means
|
||||
// that when manipulating the animation queue, we have to decode it,
|
||||
// manipulate it, and then reencode it.
|
||||
//
|
||||
// From an efficiency perspective, this means that manipulation is
|
||||
// slower, but passing the strings to the graphics engine is faster
|
||||
// and simpler. This is a good tradeoff: we manipulate animation
|
||||
// queues rarely, compared to how often we pass them to the graphics
|
||||
// engine.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// THE SERIALIZED REPRESENTATION
|
||||
//
|
||||
// So first, you need to know how to serialize a single animation
|
||||
// step. Remember, an animation step consists of a list of key-value
|
||||
@@ -287,6 +292,7 @@ public:
|
||||
|
||||
// Debug strings.
|
||||
//
|
||||
void print_debug_string(eng::ostringstream &oss, bool full) const;
|
||||
eng::string steps_debug_string() const;
|
||||
eng::string full_debug_string() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user