X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fresourcemanager.h;fp=source%2Fresourcemanager.h;h=9378d920c9671743daafddfec70def0acee39e68;hp=399d479abd2111dab7de39b557846d03aa797b2c;hb=5ef508ffc324d4f00239555c0566e4c1f2c9c5c4;hpb=123985e47ac66903b94bd72c09d3d371f1aec61c diff --git a/source/resourcemanager.h b/source/resourcemanager.h index 399d479a..9378d920 100644 --- a/source/resourcemanager.h +++ b/source/resourcemanager.h @@ -114,6 +114,7 @@ private: LoadingPolicy policy; bool async_loads; + mutable Mutex map_mutex; ResourceMap resources; LoadQueue queue; UInt64 size_limit; @@ -134,7 +135,11 @@ public: void set_max_retain_frames(unsigned); void add_resource(Resource &); - void *get_data_for_resource(const Resource &); +private: + const ManagedResource &get_managed_resource(const Resource &) const; + ManagedResource &get_managed_resource(const Resource &); +public: + void *get_data_for_resource(const Resource &r) { return &get_managed_resource(r); } void set_resource_location(Resource &, DataFile::Collection &, const std::string &); void set_resource_location(Resource &, const ResourceLocation &); const ResourceLocation *get_resource_location(const Resource &) const; @@ -151,6 +156,7 @@ private: void dispatch_work(); void unload_by_age(); void unload_by_size(); + UInt64 get_total_data_size_() const; public: UInt64 get_total_data_size() const;