From 8639c902aefb98848c46fcef42a3467a11500818 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 8 Dec 2019 23:14:56 +0100 Subject: [PATCH] map_convert_07: use regular paths --- src/engine/shared/datafile.cpp | 8 ++++---- src/engine/shared/datafile.h | 6 ++++-- src/tools/map_convert_07.cpp | 6 ++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/engine/shared/datafile.cpp b/src/engine/shared/datafile.cpp index 9e95e196a..0a243e338 100644 --- a/src/engine/shared/datafile.cpp +++ b/src/engine/shared/datafile.cpp @@ -578,10 +578,10 @@ CDataFileWriter::~CDataFileWriter() m_pDatas = 0; } -bool CDataFileWriter::OpenFile(class IStorage *pStorage, const char *pFilename) +bool CDataFileWriter::OpenFile(class IStorage *pStorage, const char *pFilename, int StorageType) { dbg_assert(!m_File, "a file already exists"); - m_File = pStorage->OpenFile(pFilename, IOFLAG_WRITE, IStorage::TYPE_SAVE); + m_File = pStorage->OpenFile(pFilename, IOFLAG_WRITE, StorageType); return m_File != 0; } @@ -602,10 +602,10 @@ void CDataFileWriter::Init() } } -bool CDataFileWriter::Open(class IStorage *pStorage, const char *pFilename) +bool CDataFileWriter::Open(class IStorage *pStorage, const char *pFilename, int StorageType) { Init(); - return OpenFile(pStorage, pFilename); + return OpenFile(pStorage, pFilename, StorageType); } int CDataFileWriter::GetExtendedItemTypeIndex(int Type) diff --git a/src/engine/shared/datafile.h b/src/engine/shared/datafile.h index d8e73f234..ac69b986e 100644 --- a/src/engine/shared/datafile.h +++ b/src/engine/shared/datafile.h @@ -3,6 +3,8 @@ #ifndef ENGINE_SHARED_DATAFILE_H #define ENGINE_SHARED_DATAFILE_H +#include + #include #include @@ -95,8 +97,8 @@ public: CDataFileWriter(); ~CDataFileWriter(); void Init(); - bool OpenFile(class IStorage *pStorage, const char *pFilename); - bool Open(class IStorage *pStorage, const char *Filename); + bool OpenFile(class IStorage *pStorage, const char *pFilename, int StorageType = IStorage::TYPE_SAVE); + bool Open(class IStorage *pStorage, const char *Filename, int StorageType = IStorage::TYPE_SAVE); int AddData(int Size, void *pData); int AddDataSwapped(int Size, void *pData); int AddItem(int Type, int ID, int Size, void *pData); diff --git a/src/tools/map_convert_07.cpp b/src/tools/map_convert_07.cpp index 87f4ec0d2..5da31c745 100644 --- a/src/tools/map_convert_07.cpp +++ b/src/tools/map_convert_07.cpp @@ -11,7 +11,6 @@ #include /* Usage: map_convert_07 - Notes: map filepath must be relative to user default teeworlds folder */ CDataFileReader g_DataReader; @@ -104,7 +103,6 @@ int main(int argc, const char **argv) { dbg_msg("map_convert_07", "Invalid arguments"); dbg_msg("map_convert_07", "Usage: map_convert_07 "); - dbg_msg("map_convert_07", "Notes: map filepath must be relative to user default teeworlds folder"); return -1; } @@ -123,13 +121,13 @@ int main(int argc, const char **argv) void *pItem = 0; void *pData = 0; - if(!g_DataReader.Open(pStorage, pSourceFileName, IStorage::TYPE_ALL)) + if(!g_DataReader.Open(pStorage, pSourceFileName, IStorage::TYPE_ABSOLUTE)) { dbg_msg("map_convert_07", "failed to open source map. filename='%s'", pSourceFileName); return -1; } - if(!g_DataWriter.Open(pStorage, pDestFileName)) + if(!g_DataWriter.Open(pStorage, pDestFileName, IStorage::TYPE_ABSOLUTE)) { dbg_msg("map_convert_07", "failed to open destination map. filename='%s'", pDestFileName); return -1;