--- deliantra/server/include/face.h 2012/11/11 04:29:11 1.42 +++ deliantra/server/include/face.h 2018/12/05 19:03:26 1.48 @@ -1,7 +1,8 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -24,7 +25,8 @@ #define FACE_H__ #include -#include + +#include "flat_hash_map.hpp" #define CHKSUM_MAXLEN 15 #define MAX_FACES 65535 // we reserve face #65535 @@ -33,13 +35,11 @@ struct facedata { - uint32_t size; - uint32_t fofs; // file offste in facedatax uint8 chksum[CHKSUM_MAXLEN]; uint8 chksum_len; facedata () - : size (0), fofs (0), chksum_len (0) + : chksum_len (0) { } }; @@ -50,12 +50,11 @@ struct faceinfo { faceinfo () - : number (0), smooth (0), type (0), smoothlevel (0), visibility (0), magicmap (0), refcnt (1), meta_hv (0) + : number (0), smooth (0), type (0), smoothlevel (0), visibility (0), magicmap (0), refcnt (1) { } shstr name; - HV *meta_hv; /* note, no destructor of copy constructor, must never be freed, but can be moved aorund */ facedata face[3]; // indexed by faceset, 0 == 32 bit or generic, 1 == 64, 2 == text faceidx number; /* This is the image id. It should be the */ /* same value as its position in the array */ @@ -75,13 +74,13 @@ inline void object_freezer::put (const keyword_string k, faceinfo *v) { - if (expect_true (v)) + if (ecb_expect_true (v)) put (k, v->name); else put (k); } -typedef std::tr1::unordered_map > > facehash_t; +typedef ska::flat_hash_map>> facehash_t; extern facehash_t facehash; extern std::vector faces; @@ -123,7 +122,7 @@ void resize (int new_size); }; -typedef std::tr1::unordered_map > > animhash_t; +typedef ska::flat_hash_map>> animhash_t; extern std::vector animations;