mirror of
https://github.com/isledecomp/actionheadergen.git
synced 2025-02-18 09:00:39 -05:00
split up extremely large enums
This commit is contained in:
parent
847339f7b0
commit
e03e14f4e4
1 changed files with 7 additions and 1 deletions
|
@ -110,7 +110,7 @@ bool HeaderGenerator::WriteHeader(char *p_interleafName, std::map<size_t, std::s
|
|||
bool isLast = false;
|
||||
size_t i = 0;
|
||||
ActionMap::iterator prev = p_actionMap->begin();
|
||||
for (ActionMap::iterator it = p_actionMap->begin(); it != p_actionMap->end(); it++) {
|
||||
for (ActionMap::iterator it = p_actionMap->begin(); it != p_actionMap->end(); ++it) {
|
||||
isLast = it == (--p_actionMap->end());
|
||||
|
||||
// seperate distanced action ids with whitespace (styling)
|
||||
|
@ -118,6 +118,12 @@ bool HeaderGenerator::WriteHeader(char *p_interleafName, std::map<size_t, std::s
|
|||
m_fout << "\n";
|
||||
}
|
||||
|
||||
if (i == 2000) {
|
||||
// some compilers don't accept extremely large enums,
|
||||
// so we split them up here in case of 2000+ entries
|
||||
m_fout << "};\n\n#ifdef COMPAT_MODE\nenum Script2 : int {\n#else\nenum Script2 {\n#endif\n";
|
||||
}
|
||||
|
||||
// actually write the enum entry
|
||||
m_fout << "\t" << g_enumEntryPrefix << it->second << " = " << it->first;
|
||||
if (!isLast) {
|
||||
|
|
Loading…
Reference in a new issue