mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-01 00:39:41 +01:00
Convert Game::loadquick() to TinyXML2
Same changes as all other XML-loading functions.
This commit is contained in:
parent
6706197741
commit
3419f9fa15
1 changed files with 8 additions and 8 deletions
|
@ -4954,16 +4954,16 @@ void Game::starttrial( int t )
|
||||||
|
|
||||||
void Game::loadquick()
|
void Game::loadquick()
|
||||||
{
|
{
|
||||||
TiXmlDocument doc;
|
tinyxml2::XMLDocument doc;
|
||||||
if (!FILESYSTEM_loadTiXmlDocument("saves/qsave.vvv", &doc)) return;
|
if (!FILESYSTEM_loadTiXml2Document("saves/qsave.vvv", doc)) return;
|
||||||
|
|
||||||
TiXmlHandle hDoc(&doc);
|
tinyxml2::XMLHandle hDoc(&doc);
|
||||||
TiXmlElement* pElem;
|
tinyxml2::XMLElement* pElem;
|
||||||
TiXmlHandle hRoot(0);
|
tinyxml2::XMLHandle hRoot(NULL);
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
pElem=hDoc.FirstChildElement().Element();
|
pElem=hDoc.FirstChildElement().ToElement();
|
||||||
// should always have a valid root but handle gracefully if it does
|
// should always have a valid root but handle gracefully if it does
|
||||||
if (!pElem)
|
if (!pElem)
|
||||||
{
|
{
|
||||||
|
@ -4971,10 +4971,10 @@ void Game::loadquick()
|
||||||
}
|
}
|
||||||
|
|
||||||
// save this for later
|
// save this for later
|
||||||
hRoot=TiXmlHandle(pElem);
|
hRoot=tinyxml2::XMLHandle(pElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
for( pElem = hRoot.FirstChild( "Data" ).FirstChild().Element(); pElem; pElem=pElem->NextSiblingElement())
|
for( pElem = hRoot.FirstChildElement( "Data" ).FirstChild().ToElement(); pElem; pElem=pElem->NextSiblingElement())
|
||||||
{
|
{
|
||||||
std::string pKey(pElem->Value());
|
std::string pKey(pElem->Value());
|
||||||
const char* pText = pElem->GetText() ;
|
const char* pText = pElem->GetText() ;
|
||||||
|
|
Loading…
Reference in a new issue