Expose getPointedThing to Lua
[oweals/minetest.git] / src / clientmedia.h
index 1f0da70d9de456ecc6ad62297a2eabb06cd7f5e5..1834fb67f2524eb85de5b297edc165c051259706 100644 (file)
@@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <map>
 #include <set>
 #include <vector>
+#include <unordered_map>
 
 class Client;
 struct HTTPFetchResult;
@@ -58,10 +59,10 @@ public:
        }
 
        // Add a file to the list of required file (but don't fetch it yet)
-       void addFile(std::string name, std::string sha1);
+       void addFile(const std::string &name, const std::string &sha1);
 
        // Add a remote server to the list; ignored if not built with cURL
-       void addRemoteServer(std::string baseurl);
+       void addRemoteServer(const std::string &baseurl);
 
        // Steps the media downloader:
        // - May load media into client by calling client->loadMedia()
@@ -122,28 +123,28 @@ private:
 
        // Has an attempt been made to load media files from the file cache?
        // Have hash sets been requested from remote servers?
-       bool m_initial_step_done;
+       bool m_initial_step_done = false;
 
        // Total number of media files to load
-       s32 m_uncached_count;
+       s32 m_uncached_count = 0;
 
        // Number of media files that have been received
-       s32 m_uncached_received_count;
+       s32 m_uncached_received_count = 0;
 
        // Status of remote transfers
        unsigned long m_httpfetch_caller;
-       unsigned long m_httpfetch_next_id;
-       long m_httpfetch_timeout;
-       s32 m_httpfetch_active;
-       s32 m_httpfetch_active_limit;
-       s32 m_outstanding_hash_sets;
-       std::map<unsigned long, std::string> m_remote_file_transfers;
+       unsigned long m_httpfetch_next_id = 0;
+       long m_httpfetch_timeout = 0;
+       s32 m_httpfetch_active = 0;
+       s32 m_httpfetch_active_limit = 0;
+       s32 m_outstanding_hash_sets = 0;
+       std::unordered_map<unsigned long, std::string> m_remote_file_transfers;
 
        // All files up to this name have either been received from a
        // remote server or failed on all remote servers, so those files
        // don't need to be looked at again
        // (use m_files.upper_bound(m_name_bound) to get an iterator)
-       std::string m_name_bound;
+       std::string m_name_bound = "";
 
 };