This commit is contained in:
Mikulas Florek 2016-03-17 18:23:48 +01:00
parent 4d6a7160b4
commit a7c62a1338
8 changed files with 8 additions and 19 deletions

View file

@ -1744,7 +1744,7 @@ public:
copyString(bkp_path, path.c_str());
catString(bkp_path, ".bkp");
copyFile(path.c_str(), bkp_path);
FS::IFile* file = fs.open(fs.getDefaultDevice(), path, FS::Mode::CREATE | FS::Mode::WRITE);
FS::IFile* file = fs.open(fs.getDefaultDevice(), path, FS::Mode::CREATE_AND_WRITE);
save(*file);
fs.close(*file);
if (save_path) m_universe_path = path;
@ -2064,8 +2064,8 @@ public:
}
else
{
m_game_mode_file = m_engine->getFileSystem().open(
m_engine->getFileSystem().getMemoryDevice(), Lumix::Path(""), FS::Mode::WRITE);
auto& fs = m_engine->getFileSystem();
m_game_mode_file = fs.open(fs.getMemoryDevice(), Lumix::Path(""), FS::Mode::WRITE);
save(*m_game_mode_file);
m_is_game_mode = true;
m_engine->startGame(*m_universe);
@ -2294,6 +2294,7 @@ public:
fs.openAsync(fs.getDefaultDevice(), path, FS::Mode::OPEN_AND_READ, file_read_cb);
}
void loadMap(FS::IFile& file, bool success)
{
ASSERT(success);
@ -2309,13 +2310,6 @@ public:
}
bool isRelativePath(const char* path)
{
const char* base_path = m_engine->getDiskFileDevice()->getBasePath(0);
return compareStringN(base_path, path, stringLength(base_path)) == 0;
}
void newUniverse() override
{
m_universe_path = "";
@ -3015,7 +3009,7 @@ public:
FS::IFile* file = m_engine->getFileSystem().open(
m_engine->getFileSystem().getDiskDevice(),
path,
FS::Mode::CREATE | FS::Mode::WRITE);
FS::Mode::CREATE_AND_WRITE);
if (file)
{
JsonSerializer serializer(
@ -3161,7 +3155,7 @@ public:
FS::IFile* file =
m_engine->getFileSystem().open(m_engine->getFileSystem().getMemoryDevice(),
Lumix::Path(""),
FS::Mode::CREATE | FS::Mode::WRITE);
FS::Mode::CREATE_AND_WRITE);
if (!file)
{
return false;

View file

@ -2,7 +2,6 @@
#include "core/iallocator.h"
#include "core/fs/file_system.h"
#include "core/fs/ifile.h"
#include "core/fs/ifile_system_defines.h"
#include "core/fs/os_file.h"
#include "core/path.h"
#include "core/string.h"

View file

@ -2,7 +2,6 @@
#include "core/iallocator.h"
#include "core/fs/file_system.h"
#include "core/fs/ifile.h"
#include "core/fs/ifile_system_defines.h"
#include "core/path.h"
#ifdef FILE_EVENT_DEVICE

View file

@ -1,7 +1,7 @@
#pragma once
#include "core/fs/ifile_system_defines.h"
#include "lumix.h"
#include "core/delegate.h"
namespace Lumix
{

View file

@ -1,7 +1,6 @@
#include "core/fs/memory_file_device.h"
#include "core/iallocator.h"
#include "core/fs/ifile.h"
#include "core/fs/ifile_system_defines.h"
#include "core/math_utils.h"
#include "core/string.h"

View file

@ -1,6 +1,5 @@
#include "core/fs/file_system.h"
#include "core/fs/ifile.h"
#include "core/fs/ifile_system_defines.h"
#include "core/iallocator.h"
#include "core/path.h"
#include "core/string.h"

View file

@ -2,7 +2,6 @@
#include "core/iallocator.h"
#include "core/blob.h"
#include "core/fs/ifile.h"
#include "core/fs/ifile_system_defines.h"
#include "core/fs/file_system.h"
#include "core/mt/sync.h"
#include "core/path.h"

View file

@ -1,7 +1,7 @@
#pragma once
#include "core/fs/ifile_system_defines.h"
#include "core/fs/file_system.h"
#include "core/delegate_list.h"
#include "core/path.h"