-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read new MercOpinions.xml format (#323)
Requires accompanying gameDir change. MercOpinions.xml now only contains opinions that are not 0. A new tag with fields "id" and "modifier" are used instead of old ones that had 255 <Opinion%d> $value$ </Opinion%d> tags for all profiles. Loading time of MercOpinions.xml went down from ~4.047 s to 0.011 s due to this change with default 1.13 VFS config. A small cmd utility tool for converting existing MercOpinions.xml data into the new format is available at https://github.com/Asdow/JA2-ConvertXMLData/tree/master
- Loading branch information
Showing
4 changed files
with
30 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "XML.h" | ||
|
||
const XML_Char* GetAttribute(const XML_Char* name, const XML_Char** atts) { | ||
for (const XML_Char** pIter = atts; *pIter != NULL; pIter++) { | ||
const XML_Char* key = *pIter++; | ||
if (strcmp(key, name) == 0) return *pIter; | ||
} | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters