Migrated engine to using dlmalloc through eng::

This commit is contained in:
2022-02-24 02:17:41 -05:00
parent acc00289fb
commit f467944095
61 changed files with 631 additions and 590 deletions

View File

@@ -48,15 +48,14 @@
#include "wrap-set.hpp"
#include "wrap-string.hpp"
#include "wrap-deque.hpp"
#include "wrap-ostream.hpp"
#include "wrap-unordered-map.hpp"
#include <cassert>
#include "wrap-ostream.hpp"
#include "streambuffer.hpp"
#include "debugcollector.hpp"
#include "util.hpp"
#include <cassert>
class AnimStep {
friend class AnimQueue;
@@ -78,14 +77,14 @@ public:
int64_t id() const { return id_; }
int bits() const { return bits_; }
const std::string &action() const { return action_; }
const eng::string &action() const { return action_; }
double facing() const { return facing_; }
float x() const { return xyz_.x; }
float y() const { return xyz_.y; }
float z() const { return xyz_.z; }
const util::XYZ &xyz() const { return xyz_; }
const std::string &graphic() const { return graphic_; }
const std::string &plane() const { return plane_; }
const eng::string &graphic() const { return graphic_; }
const eng::string &plane() const { return plane_; }
bool has_facing() const { return bits_ & HAS_FACING; }
bool has_x() const { return bits_ & HAS_X; }
@@ -95,14 +94,14 @@ public:
bool has_graphic() const { return bits_ & AnimStep::HAS_GRAPHIC; }
bool has_plane() const { return bits_ & AnimStep::HAS_PLANE; }
void set_action(const std::string &action);
void set_action(const eng::string &action);
void set_facing(float f);
void set_x(float f);
void set_y(float f);
void set_z(float z);
void set_xyz(const util::XYZ &xyz);
void set_graphic(const std::string &g);
void set_plane(const std::string &p);
void set_graphic(const eng::string &g);
void set_plane(const eng::string &p);
void clear();
@@ -147,22 +146,22 @@ public:
bool echoes(const AnimStep &prev) const;
// Convert to a string for debugging purposes.
std::string debug_string() const;
eng::string debug_string() const;
// Convert a string to an animstep (for testing only).
bool from_string(const std::string &s);
bool from_string(const eng::string &s);
private:
int64_t id_;
int16_t bits_;
std::string action_;
eng::string action_;
float facing_;
util::XYZ xyz_;
std::string graphic_;
std::string plane_;
eng::string graphic_;
eng::string plane_;
void from_lua_store_string(lua_State *L, int idx, std::string *target, int16_t bits, const char *name);
void from_lua_store_string(lua_State *L, int idx, eng::string *target, int16_t bits, const char *name);
void from_lua_store_number(lua_State *L, int idx, float *target, float offset, int16_t bits, const char *name);
};
@@ -186,7 +185,7 @@ public:
void add(int64_t id, const AnimStep &step);
// Clear and set the plane.
void clear(const std::string &plane);
void clear(const eng::string &plane);
// Serialize or deserialize to a StreamBuffer
//
@@ -222,15 +221,15 @@ public:
bool valid() const;
// Convert to a string for debugging purposes.
std::string steps_debug_string() const;
std::string full_debug_string() const;
eng::string steps_debug_string() const;
eng::string full_debug_string() const;
// Convert to a
private:
bool version_autoinc_;
int32_t size_limit_;
std::deque<AnimStep> steps_;
eng::deque<AnimStep> steps_;
int64_t version_number_;
// Called whenever the animation queue is mutated.