diff --git a/Makefile b/Makefile index bca0acc0..ae836047 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ include $(DEVKITPPC)/wii_rules #--------------------------------------------------------------------------------- TARGET := boot BUILD := build -SOURCES := source source/libwiigui source/images source/fonts source/sounds source/libwbfs source/unzip source/mxml +SOURCES := source source/libwiigui source/images source/fonts source/sounds source/libwbfs source/unzip INCLUDES := source SVNDEV := -D'SVN_REV="$(shell svnversion -n ..)"' diff --git a/source/cfg.c b/source/cfg.c index 59f6c6a6..2083cc8c 100644 --- a/source/cfg.c +++ b/source/cfg.c @@ -5,10 +5,11 @@ #include #include #include +#include #include "cfg.h" #include "language.h" #include "xml.h" /* XML - Lustar*/ -#include "mxml/mxml.h" + struct SSettings Settings; diff --git a/source/xml.c b/source/xml.c index b21691e7..68bc930b 100644 --- a/source/xml.c +++ b/source/xml.c @@ -4,9 +4,8 @@ Load game information from XML - Lustar - MiniZip adapted by Tantric */ +#include #include "cfg.h" - -#include "mxml/mxml.h" #include "xml.h" #include "unzip/unzip.h" @@ -176,6 +175,7 @@ bool OpenXMLFile(char *filename) } else { //if (xmldebug); // xmlloadtime = dbg_time2(NULL); + nodetree = emptynode; return true; } } @@ -267,10 +267,9 @@ void ConvertRating(char *ratingvalue, char *fromrating, char *torating, char *de void LoadTitlesFromXML(char *langtxt, bool forcejptoen) /* langtxt: set to "English","French","German", to force language for all titles, or "" to load title depending on each game's setting */ /* forcejptoen: set to true to load English title instead of Japanese title when game is set to Japanese */ -{ - - if (nodeindex == NULL) - return ; +{ + if (nodeindex == NULL || nodedata == NULL) + return; bool forcelang = false; if (strcmp(langtxt,"")) @@ -373,9 +372,9 @@ void GetPublisherFromGameid(char *idtxt, char *dest) bool LoadGameInfoFromXML(char* gameid, char* langtxt) /* gameid: full game id */ /* langcode: "English","French","German" */ -{ bool exist=false; - if (nodeindex == NULL) - return exist; +{ + if (nodeindex == NULL || nodedata == NULL) + return; /* convert language text into ISO 639 two-letter language codes */ char langcode[100] = ""; @@ -389,11 +388,13 @@ bool LoadGameInfoFromXML(char* gameid, char* langtxt) *element_text = 0; /* search for game matching gameid */ - while (strcmp(element_text,gameid) != 0) - { exist=true; + while (1) + { nodeid = mxmlIndexFind(nodeindex,"id", NULL); if (nodeid != NULL) { get_text(nodeid, element_text, sizeof(element_text)); + if (!strcmp(element_text,gameid)) + break; } else { break; }