mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Remove TinyXML-1
This removes the TinyXML source files, removes it from CMakeLists.txt, removes all the includes, and removes the functions FILESYSTEM_saveTiXmlDocument() and FILESYSTEM_loadTiXmlDocument() (use FILESYSTEM_saveTiXml2Document() and FILESYSTEM_loadTiXml2Document() instead). Additionally I've cleaned up the tinyxml2.h include in FileSystemUtils.h so that it doesn't actually include tinyxml2.h unnecessarily, meaning a change to TinyXML2 shouldn't rebuild all files that include FileSystemUtils.h.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <SDL.h>
|
||||
#include <physfs.h>
|
||||
|
||||
#include "tinyxml.h"
|
||||
#include "tinyxml2.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
@@ -253,35 +253,6 @@ void FILESYSTEM_freeMemory(unsigned char **mem)
|
||||
*mem = NULL;
|
||||
}
|
||||
|
||||
bool FILESYSTEM_saveTiXmlDocument(const char *name, TiXmlDocument *doc)
|
||||
{
|
||||
/* TiXmlDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */
|
||||
TiXmlPrinter printer;
|
||||
doc->Accept(&printer);
|
||||
PHYSFS_File* handle = PHYSFS_openWrite(name);
|
||||
if (handle == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
PHYSFS_writeBytes(handle, printer.CStr(), printer.Size());
|
||||
PHYSFS_close(handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FILESYSTEM_loadTiXmlDocument(const char *name, TiXmlDocument *doc)
|
||||
{
|
||||
/* TiXmlDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */
|
||||
unsigned char *mem = NULL;
|
||||
FILESYSTEM_loadFileToMemory(name, &mem, NULL, true);
|
||||
if (mem == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
doc->Parse((const char*)mem, NULL, TIXML_ENCODING_UTF8);
|
||||
FILESYSTEM_freeMemory(&mem);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc)
|
||||
{
|
||||
/* XMLDocument.SaveFile doesn't account for Unicode paths, PHYSFS does */
|
||||
|
||||
Reference in New Issue
Block a user