map_convert_07: use regular paths

This commit is contained in:
def 2019-12-08 23:14:56 +01:00
parent b88ebbc771
commit 8639c902ae
3 changed files with 10 additions and 10 deletions

View file

@ -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)

View file

@ -3,6 +3,8 @@
#ifndef ENGINE_SHARED_DATAFILE_H
#define ENGINE_SHARED_DATAFILE_H
#include <engine/storage.h>
#include <base/system.h>
#include <base/hash.h>
@ -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);

View file

@ -11,7 +11,6 @@
#include <pnglite.h>
/*
Usage: map_convert_07 <source map filepath> <dest map filepath>
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 <source map filepath> <dest map filepath>");
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;