readmapsthread

server: load all maps into memory, scan for more maps
in the background
This commit is contained in:
ac-stef
2016-08-26 14:27:51 +02:00
parent c70808e5a4
commit 89f1f69eec
4 changed files with 531 additions and 4 deletions
+2 -1
View File
@@ -253,7 +253,6 @@ struct headerextra
};
vector<headerextra *> headerextras;
enum { HX_UNUSED = 0, HX_MAPINFO, HX_MODEINFO, HX_ARTIST, HX_EDITUNDO, HX_CONFIG, HX_VANTAGEPOINT, HX_NUM, HX_TYPEMASK = 0x3f, HX_FLAG_PERSIST = 0x40 };
const char *hx_names[] = { "unused", "mapinfo", "modeinfo", "artist", "editundo", "config", "vantage point", "unknown" };
#define addhxpacket(p, len, flags, buffer) { if(p.length() + len < MAXHEADEREXTRA) { putuint(p, len); putuint(p, flags); p.put(buffer, len); } }
#define hx_name(t) hx_names[min((t) & HX_TYPEMASK, int(HX_NUM))]
@@ -899,6 +898,8 @@ bool load_world(char *mname) // still supports all map formats that have
if(we) conoutf("world error %d", we);
delete[] smallworld;
DELETEA(mlayout);
mlayout = new char[cubicsize + 256];
memset(mlayout, 0, cubicsize * sizeof(char));