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:
Misa
2020-06-03 19:37:01 -07:00
committed by Ethan Lee
parent c397c898fc
commit 3f4df82583
13 changed files with 4 additions and 6373 deletions

View File

@@ -68,7 +68,6 @@ ENDIF()
# Include Directories
INCLUDE_DIRECTORIES(
src
../third_party/tinyxml
../third_party/tinyxml2
../third_party/physfs
../third_party/lodepng
@@ -121,12 +120,6 @@ IF(GOG)
ADD_DEFINITIONS(-DGOG_NETWORK)
ENDIF()
SET(XML_SRC
../third_party/tinyxml/tinystr.cpp
../third_party/tinyxml/tinyxml.cpp
../third_party/tinyxml/tinyxmlerror.cpp
../third_party/tinyxml/tinyxmlparser.cpp
)
SET(XML2_SRC
../third_party/tinyxml2/tinyxml2.cpp
)
@@ -193,13 +186,12 @@ SET_PROPERTY(TARGET VVVVVV PROPERTY CXX_STANDARD 98)
SET_PROPERTY(TARGET VVVVVV PROPERTY CXX_EXTENSIONS FALSE)
# Library information
ADD_LIBRARY(tinyxml-static STATIC ${XML_SRC})
ADD_LIBRARY(tinyxml2-static STATIC ${XML2_SRC})
ADD_LIBRARY(physfs-static STATIC ${PFS_SRC} ${PFSP_SRC})
ADD_LIBRARY(lodepng-static STATIC ${PNG_SRC})
# Static Dependencies
TARGET_LINK_LIBRARIES(VVVVVV physfs-static tinyxml-static tinyxml2-static lodepng-static)
TARGET_LINK_LIBRARIES(VVVVVV physfs-static tinyxml2-static lodepng-static)
# SDL2 Dependency (Detection pulled from FAudio)
if (DEFINED SDL2_INCLUDE_DIRS AND DEFINED SDL2_LIBRARIES)

View File

@@ -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 */

View File

@@ -4,8 +4,8 @@
#include <string>
#include <vector>
#include "tinyxml.h"
#include "tinyxml2.h"
// Forward declaration, including the entirety of tinyxml2.h across all files this file is included in is unnecessary
namespace tinyxml2 { class XMLDocument; }
int FILESYSTEM_init(char *argvZero, char* baseDir, char* assetsPath);
void FILESYSTEM_deinit();
@@ -20,8 +20,6 @@ void FILESYSTEM_unmountassets();
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
size_t *len, bool addnull = false);
void FILESYSTEM_freeMemory(unsigned char **mem);
bool FILESYSTEM_saveTiXmlDocument(const char *name, TiXmlDocument *doc);
bool FILESYSTEM_loadTiXmlDocument(const char *name, TiXmlDocument *doc);
bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);
bool FILESYSTEM_loadTiXml2Document(const char *name, tinyxml2::XMLDocument& doc);

View File

@@ -14,7 +14,6 @@
#include "FileSystemUtils.h"
#include "tinyxml.h"
#include "tinyxml2.h"
#include "Network.h"

View File

@@ -3,7 +3,6 @@
#include "MakeAndPlay.h"
#include "tinyxml.h"
#include "tinyxml2.h"
#include "FileSystemUtils.h"

View File

@@ -10,7 +10,6 @@
#include "Script.h"
#include "time.h"
#include "tinyxml.h"
#include "tinyxml2.h"
#include "Enums.h"