Core/ObjectMgr: Refactor sPageTextStore

This commit is contained in:
leak
2011-04-28 22:13:09 +02:00
parent 85a1e9e7ab
commit 19cab2c508
5 changed files with 73 additions and 64 deletions
+26 -1
View File
@@ -48,7 +48,6 @@ extern SQLStorage sCreatureDataAddonStorage;
extern SQLStorage sCreatureInfoAddonStorage;
extern SQLStorage sEquipmentStorage;
extern SQLStorage sGOStorage;
extern SQLStorage sPageTextStore;
extern SQLStorage sItemStorage;
extern SQLStorage sInstanceTemplate;
@@ -57,6 +56,29 @@ class Guild;
class ArenaTeam;
class Item;
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
#if defined(__GNUC__)
#pragma pack(1)
#else
#pragma pack(push,1)
#endif
struct PageText
{
std::string Text;
uint16 NextPage;
};
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined(__GNUC__)
#pragma pack()
#else
#pragma pack(pop)
#endif
// Faster (insert/find) than UNORDERED_MAP in this case
typedef std::map<uint32, PageText> PageTextContainer;
struct GameTele
{
float position_x;
@@ -943,6 +965,7 @@ class ObjectMgr
void LoadGameObjectForQuests();
void LoadPageTexts();
PageText const* GetPageText(uint32 pageEntry);
void LoadPlayerInfo();
void LoadPetLevelInfo();
@@ -1343,6 +1366,8 @@ class ObjectMgr
LocaleConstant DBCLocaleIndex;
PageTextContainer PageTextStore;
private:
void LoadScripts(ScriptsType type);
void CheckScripts(ScriptsType type, std::set<int32>& ids);