Migrated engine to using dlmalloc through eng::
This commit is contained in:
@@ -87,13 +87,13 @@ public:
|
||||
void configure_id_pool_for_actor() { id_player_pool_.set_fifo_capacity(3); id_player_pool_.refill(); }
|
||||
};
|
||||
|
||||
using UniqueTangible = std::unique_ptr<Tangible>;
|
||||
using UniqueTangible = eng::unique_ptr<Tangible>;
|
||||
|
||||
class World {
|
||||
public:
|
||||
using IdVector = util::IdVector;
|
||||
using TanVector = std::vector<const Tangible*>;
|
||||
using Redirects = std::map<int64_t, int64_t>;
|
||||
using TanVector = eng::vector<const Tangible*>;
|
||||
using Redirects = eng::map<int64_t, int64_t>;
|
||||
const float RadiusVisibility = 100.0;
|
||||
const float RadiusClose = 10.0;
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
// the tangible's database onto the lua stack. Otherwise, leaves the lua
|
||||
// stack untouched.
|
||||
//
|
||||
Tangible *tangible_make(lua_State *L, int64_t id, const std::string &plane, bool pushdb);
|
||||
Tangible *tangible_make(lua_State *L, int64_t id, const eng::string &plane, bool pushdb);
|
||||
|
||||
// Get a pointer to the specified tangible.
|
||||
//
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
// from the stringstream. If the lua expression returns a
|
||||
// value, that is also printed to the stringstream.
|
||||
//
|
||||
std::string probe_lua(int64_t actor_id, const std::string &lua);
|
||||
eng::string probe_lua(int64_t actor_id, const eng::string &lua);
|
||||
|
||||
// Probe the 'interface' function of the specified sprite.
|
||||
//
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
void open_lthread_state(int64_t actor_id, int64_t place_id, bool ppool, bool prints);
|
||||
void close_lthread_state();
|
||||
|
||||
std::ostream *lthread_print_stream() const;
|
||||
eng::ostream *lthread_print_stream() const;
|
||||
|
||||
// Allocate a single ID.
|
||||
//
|
||||
@@ -266,23 +266,23 @@ private:
|
||||
|
||||
// Invoke a plan.
|
||||
//
|
||||
void invoke_plan(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
|
||||
void invoke_plan(int64_t actor_id, int64_t place_id, const eng::string &action, const InvocationData &data);
|
||||
|
||||
// Invoke a lua string.
|
||||
//
|
||||
void invoke_lua(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
|
||||
void invoke_lua(int64_t actor_id, int64_t place_id, const eng::string &action, const InvocationData &data);
|
||||
|
||||
// Invoke the flush-prints operation.
|
||||
//
|
||||
void invoke_flush_prints(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
|
||||
void invoke_flush_prints(int64_t actor_id, int64_t place_id, const eng::string &action, const InvocationData &data);
|
||||
|
||||
// Invoke the tick operation.
|
||||
//
|
||||
void invoke_tick(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
|
||||
void invoke_tick(int64_t actor_id, int64_t place_id, const eng::string &action, const InvocationData &data);
|
||||
|
||||
// Invoke the lua_source operation.
|
||||
//
|
||||
void invoke_lua_source(int64_t actor_id, int64_t place_id, const std::string &action, const InvocationData &data);
|
||||
void invoke_lua_source(int64_t actor_id, int64_t place_id, const eng::string &action, const InvocationData &data);
|
||||
|
||||
public:
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@@ -300,49 +300,49 @@ public:
|
||||
|
||||
// Get the tangible's animation queue as a debug string.
|
||||
//
|
||||
std::string tangible_anim_debug_string(int64_t id) const;
|
||||
eng::string tangible_anim_debug_string(int64_t id) const;
|
||||
|
||||
// Get the tangible's ID Pool as a debug string.
|
||||
//
|
||||
std::string tangible_id_pool_debug_string(int64_t id) const;
|
||||
eng::string tangible_id_pool_debug_string(int64_t id) const;
|
||||
|
||||
// Get a list of all existing tangibles as a comma-separated string.
|
||||
//
|
||||
std::string tangible_ids_debug_string() const;
|
||||
eng::string tangible_ids_debug_string() const;
|
||||
|
||||
// Get a list of all tangibles near the target as a string.
|
||||
//
|
||||
std::string tangibles_near_debug_string(int64_t actor, int64_t distance);
|
||||
eng::string tangibles_near_debug_string(int64_t actor, int64_t distance);
|
||||
|
||||
// Shows the TID (table ID) of the tables that were numbered.
|
||||
// TIDs are in alphabetical order. Any table without a TID
|
||||
// shows up as "unknown"
|
||||
//
|
||||
std::string numbered_tables_debug_string() const;
|
||||
eng::string numbered_tables_debug_string() const;
|
||||
|
||||
// Paired tables debug string. Shows TID=TID pairs, sorted alphabetically.
|
||||
//
|
||||
std::string paired_tables_debug_string(lua_State *master) const;
|
||||
eng::string paired_tables_debug_string(lua_State *master) const;
|
||||
|
||||
// Store a string in the tangible's database.
|
||||
//
|
||||
void tangible_set_string(int64_t id, const std::string &path, const std::string &value);
|
||||
void tangible_set_string(int64_t id, const eng::string &path, const eng::string &value);
|
||||
|
||||
// Copy a lua global variable into the tangible's database.
|
||||
//
|
||||
void tangible_copy_global(int64_t id, const std::string &path, const std::string &global);
|
||||
void tangible_copy_global(int64_t id, const eng::string &path, const eng::string &global);
|
||||
|
||||
// Pretty-print the entire tangible database and return it as a string.
|
||||
//
|
||||
std::string tangible_pprint(int64_t id) const;
|
||||
eng::string tangible_pprint(int64_t id) const;
|
||||
|
||||
// Set the tangible's lua class.
|
||||
//
|
||||
void tangible_set_class(int64_t id, const std::string &c) const;
|
||||
void tangible_set_class(int64_t id, const eng::string &c) const;
|
||||
|
||||
// Get the tangible's lua class (returns empty string if none).
|
||||
//
|
||||
std::string tangible_get_class(int64_t id) const;
|
||||
eng::string tangible_get_class(int64_t id) const;
|
||||
|
||||
|
||||
public:
|
||||
@@ -467,7 +467,7 @@ private:
|
||||
|
||||
// Tangibles table.
|
||||
//
|
||||
std::unordered_map<int64_t, UniqueTangible> tangibles_;
|
||||
eng::unordered_map<int64_t, UniqueTangible> tangibles_;
|
||||
|
||||
// Current time.
|
||||
int64_t clock_;
|
||||
@@ -489,7 +489,7 @@ private:
|
||||
int64_t lthread_actor_id_;
|
||||
int64_t lthread_place_id_;
|
||||
int64_t lthread_use_ppool_;
|
||||
std::unique_ptr<std::ostringstream> lthread_prints_;
|
||||
eng::unique_ptr<eng::ostringstream> lthread_prints_;
|
||||
|
||||
friend class Tangible;
|
||||
friend int lfn_tangible_animate(lua_State *L);
|
||||
@@ -502,7 +502,7 @@ private:
|
||||
friend int lfn_tangible_scan(lua_State *L);
|
||||
};
|
||||
|
||||
using UniqueWorld = std::unique_ptr<World>;
|
||||
using UniqueWorld = eng::unique_ptr<World>;
|
||||
|
||||
|
||||
#endif // WORLD_HPP
|
||||
|
||||
Reference in New Issue
Block a user