Commit bbd99ad4 authored by mercury233's avatar mercury233 Committed by GitHub

use _IRR_WCHAR_FILESYSTEM instead of _WIN32 in related #ifdef (#2976)

parent 173d329b
...@@ -80,7 +80,7 @@ bool DataManager::ReadDB(sqlite3* pDB) { ...@@ -80,7 +80,7 @@ bool DataManager::ReadDB(sqlite3* pDB) {
bool DataManager::LoadDB(const wchar_t* wfile) { bool DataManager::LoadDB(const wchar_t* wfile) {
char file[256]; char file[256];
BufferIO::EncodeUTF8(wfile, file); BufferIO::EncodeUTF8(wfile, file);
#ifdef _WIN32 #ifdef _IRR_WCHAR_FILESYSTEM
auto reader = FileSystem->createAndOpenFile(wfile); auto reader = FileSystem->createAndOpenFile(wfile);
#else #else
auto reader = FileSystem->createAndOpenFile(file); auto reader = FileSystem->createAndOpenFile(file);
...@@ -394,7 +394,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) { ...@@ -394,7 +394,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
return nullptr; return nullptr;
} }
unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* slen) { unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* slen) {
#ifdef _WIN32 #ifdef _IRR_WCHAR_FILESYSTEM
wchar_t fname[256]{}; wchar_t fname[256]{};
BufferIO::DecodeUTF8(script_name, fname); BufferIO::DecodeUTF8(script_name, fname);
auto reader = dataManager.FileSystem->createAndOpenFile(fname); auto reader = dataManager.FileSystem->createAndOpenFile(fname);
......
...@@ -278,7 +278,7 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) { ...@@ -278,7 +278,7 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
return fp; return fp;
} }
irr::io::IReadFile* DeckManager::OpenDeckReader(const wchar_t* file) { irr::io::IReadFile* DeckManager::OpenDeckReader(const wchar_t* file) {
#ifdef _WIN32 #ifdef _IRR_WCHAR_FILESYSTEM
auto reader = dataManager.FileSystem->createAndOpenFile(file); auto reader = dataManager.FileSystem->createAndOpenFile(file);
#else #else
char file2[256]; char file2[256];
......
...@@ -1143,7 +1143,7 @@ void Game::LoadExpansions() { ...@@ -1143,7 +1143,7 @@ void Game::LoadExpansions() {
return; return;
} }
if (IsExtension(name, L".zip") || IsExtension(name, L".ypk")) { if (IsExtension(name, L".zip") || IsExtension(name, L".ypk")) {
#ifdef _WIN32 #ifdef _IRR_WCHAR_FILESYSTEM
dataManager.FileSystem->addFileArchive(fpath, true, false, irr::io::EFAT_ZIP); dataManager.FileSystem->addFileArchive(fpath, true, false, irr::io::EFAT_ZIP);
#else #else
char upath[1024]; char upath[1024];
...@@ -1156,7 +1156,7 @@ void Game::LoadExpansions() { ...@@ -1156,7 +1156,7 @@ void Game::LoadExpansions() {
for(irr::u32 i = 0; i < dataManager.FileSystem->getFileArchiveCount(); ++i) { for(irr::u32 i = 0; i < dataManager.FileSystem->getFileArchiveCount(); ++i) {
auto archive = dataManager.FileSystem->getFileArchive(i)->getFileList(); auto archive = dataManager.FileSystem->getFileArchive(i)->getFileList();
for(irr::u32 j = 0; j < archive->getFileCount(); ++j) { for(irr::u32 j = 0; j < archive->getFileCount(); ++j) {
#ifdef _WIN32 #ifdef _IRR_WCHAR_FILESYSTEM
const wchar_t* fname = archive->getFullFileName(j).c_str(); const wchar_t* fname = archive->getFullFileName(j).c_str();
#else #else
wchar_t fname[1024]; wchar_t fname[1024];
...@@ -1168,7 +1168,7 @@ void Game::LoadExpansions() { ...@@ -1168,7 +1168,7 @@ void Game::LoadExpansions() {
continue; continue;
} }
if (IsExtension(fname, L".conf")) { if (IsExtension(fname, L".conf")) {
#ifdef _WIN32 #ifdef _IRR_WCHAR_FILESYSTEM
auto reader = dataManager.FileSystem->createAndOpenFile(fname); auto reader = dataManager.FileSystem->createAndOpenFile(fname);
#else #else
auto reader = dataManager.FileSystem->createAndOpenFile(uname); auto reader = dataManager.FileSystem->createAndOpenFile(uname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment