forked from Mirrorlandia_minetest/irrlicht
Drop _IRR_WCHAR_FILESYSTEM
never used and never worked for us.
This commit is contained in:
parent
2dc2846c3f
commit
75b4c05741
@ -332,16 +332,6 @@ you will not be able to use anything provided by the GUI Environment, including
|
|||||||
#undef _IRR_COMPILE_WITH_GUI_
|
#undef _IRR_COMPILE_WITH_GUI_
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine.
|
|
||||||
/** This enables the engine to read/write from unicode filesystem. If you
|
|
||||||
disable this feature, the engine behave as before (ansi). This is currently only supported
|
|
||||||
for Windows based systems. You also have to set #define UNICODE for this to compile.
|
|
||||||
*/
|
|
||||||
//#define _IRR_WCHAR_FILESYSTEM
|
|
||||||
#ifdef NO_IRR_WCHAR_FILESYSTEM
|
|
||||||
#undef _IRR_WCHAR_FILESYSTEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.
|
//! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.
|
||||||
/** This enables the engine to read jpeg images. If you comment this out,
|
/** This enables the engine to read jpeg images. If you comment this out,
|
||||||
the engine will no longer read .jpeg images. */
|
the engine will no longer read .jpeg images. */
|
||||||
@ -529,10 +519,6 @@ ones. */
|
|||||||
|
|
||||||
#endif // _IRR_WINDOWS_API_
|
#endif // _IRR_WINDOWS_API_
|
||||||
|
|
||||||
#ifndef _IRR_WINDOWS_API_
|
|
||||||
#undef _IRR_WCHAR_FILESYSTEM
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_IRR_SOLARIS_PLATFORM_)
|
#if defined(_IRR_SOLARIS_PLATFORM_)
|
||||||
#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,22 +73,6 @@ typedef double f64;
|
|||||||
#define swprintf_irr _snwprintf
|
#define swprintf_irr _snwprintf
|
||||||
#define snprintf_irr _snprintf
|
#define snprintf_irr _snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// define the wchar_t type if not already built in.
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#ifndef _WCHAR_T_DEFINED
|
|
||||||
//! A 16 bit wide character type.
|
|
||||||
/**
|
|
||||||
Defines the wchar_t-type.
|
|
||||||
In VS6, its not possible to tell
|
|
||||||
the standard compiler to treat wchar_t as a built-in type, and
|
|
||||||
sometimes we just don't want to include the huge stdlib.h or wchar.h,
|
|
||||||
so we'll use this.
|
|
||||||
*/
|
|
||||||
typedef unsigned short wchar_t;
|
|
||||||
#define _WCHAR_T_DEFINED
|
|
||||||
#endif // wchar is not defined
|
|
||||||
#endif // microsoft compiler
|
|
||||||
#else
|
#else
|
||||||
#define swprintf_irr swprintf
|
#define swprintf_irr swprintf
|
||||||
#define snprintf_irr snprintf
|
#define snprintf_irr snprintf
|
||||||
@ -98,18 +82,8 @@ namespace irr
|
|||||||
{
|
{
|
||||||
|
|
||||||
//! Type name for character type used by the file system.
|
//! Type name for character type used by the file system.
|
||||||
/** Should the wide character version of the FileSystem be used it is a
|
|
||||||
16 bit character variable. Used for Unicode Filesystem and Unicode strings.
|
|
||||||
Else it is a 8 bit character variable. Used for ansi Filesystem and non-unicode
|
|
||||||
strings
|
|
||||||
*/
|
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
typedef wchar_t fschar_t;
|
|
||||||
#define _IRR_TEXT(X) L##X
|
|
||||||
#else
|
|
||||||
typedef char fschar_t;
|
typedef char fschar_t;
|
||||||
#define _IRR_TEXT(X) X
|
#define _IRR_TEXT(X) X
|
||||||
#endif
|
|
||||||
|
|
||||||
} // end namespace irr
|
} // end namespace irr
|
||||||
|
|
||||||
|
@ -3015,11 +3015,7 @@ public:
|
|||||||
//! \return An io::path string containing the properly encoded string.
|
//! \return An io::path string containing the properly encoded string.
|
||||||
io::path toPATH_s(const unicode::EUTF_ENDIAN endian = unicode::EUTFEE_NATIVE, const bool addBOM = false) const
|
io::path toPATH_s(const unicode::EUTF_ENDIAN endian = unicode::EUTFEE_NATIVE, const bool addBOM = false) const
|
||||||
{
|
{
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
return toWCHAR_s(endian, addBOM);
|
|
||||||
#else
|
|
||||||
return toUTF8_s(addBOM);
|
return toUTF8_s(addBOM);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Loads an unknown stream of data.
|
//! Loads an unknown stream of data.
|
||||||
|
@ -515,15 +515,9 @@ const io::path& CFileSystem::getWorkingDirectory()
|
|||||||
{
|
{
|
||||||
#if defined(_IRR_WINDOWS_API_)
|
#if defined(_IRR_WINDOWS_API_)
|
||||||
fschar_t tmp[_MAX_PATH];
|
fschar_t tmp[_MAX_PATH];
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM )
|
|
||||||
_wgetcwd(tmp, _MAX_PATH);
|
|
||||||
WorkingDirectory[FILESYSTEM_NATIVE] = tmp;
|
|
||||||
WorkingDirectory[FILESYSTEM_NATIVE].replace(L'\\', L'/');
|
|
||||||
#else
|
|
||||||
_getcwd(tmp, _MAX_PATH);
|
_getcwd(tmp, _MAX_PATH);
|
||||||
WorkingDirectory[FILESYSTEM_NATIVE] = tmp;
|
WorkingDirectory[FILESYSTEM_NATIVE] = tmp;
|
||||||
WorkingDirectory[FILESYSTEM_NATIVE].replace('\\', '/');
|
WorkingDirectory[FILESYSTEM_NATIVE].replace('\\', '/');
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
|
#if (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
|
||||||
@ -532,21 +526,6 @@ const io::path& CFileSystem::getWorkingDirectory()
|
|||||||
// so try it until the call was successful
|
// so try it until the call was successful
|
||||||
// Note that neither the first nor the second parameter may be 0 according to POSIX
|
// Note that neither the first nor the second parameter may be 0 according to POSIX
|
||||||
|
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM )
|
|
||||||
u32 pathSize=256;
|
|
||||||
wchar_t *tmpPath = new wchar_t[pathSize];
|
|
||||||
while ((pathSize < (1<<16)) && !(wgetcwd(tmpPath,pathSize)))
|
|
||||||
{
|
|
||||||
delete [] tmpPath;
|
|
||||||
pathSize *= 2;
|
|
||||||
tmpPath = new char[pathSize];
|
|
||||||
}
|
|
||||||
if (tmpPath)
|
|
||||||
{
|
|
||||||
WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;
|
|
||||||
delete [] tmpPath;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
u32 pathSize=256;
|
u32 pathSize=256;
|
||||||
char *tmpPath = new char[pathSize];
|
char *tmpPath = new char[pathSize];
|
||||||
while ((pathSize < (1<<16)) && !(getcwd(tmpPath,pathSize)))
|
while ((pathSize < (1<<16)) && !(getcwd(tmpPath,pathSize)))
|
||||||
@ -560,7 +539,6 @@ const io::path& CFileSystem::getWorkingDirectory()
|
|||||||
WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;
|
WorkingDirectory[FILESYSTEM_NATIVE] = tmpPath;
|
||||||
delete [] tmpPath;
|
delete [] tmpPath;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WorkingDirectory[type].validate();
|
WorkingDirectory[type].validate();
|
||||||
@ -587,17 +565,9 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory)
|
|||||||
WorkingDirectory[FILESYSTEM_NATIVE] = newDirectory;
|
WorkingDirectory[FILESYSTEM_NATIVE] = newDirectory;
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
success = (_wchdir(newDirectory.c_str()) == 0);
|
|
||||||
#else
|
|
||||||
success = (_chdir(newDirectory.c_str()) == 0);
|
success = (_chdir(newDirectory.c_str()) == 0);
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
success = (_wchdir(newDirectory.c_str()) == 0);
|
|
||||||
#else
|
|
||||||
success = (chdir(newDirectory.c_str()) == 0);
|
success = (chdir(newDirectory.c_str()) == 0);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,15 +582,9 @@ io::path CFileSystem::getAbsolutePath(const io::path& filename) const
|
|||||||
#if defined(_IRR_WINDOWS_API_)
|
#if defined(_IRR_WINDOWS_API_)
|
||||||
fschar_t *p=0;
|
fschar_t *p=0;
|
||||||
fschar_t fpath[_MAX_PATH];
|
fschar_t fpath[_MAX_PATH];
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM )
|
|
||||||
p = _wfullpath(fpath, filename.c_str(), _MAX_PATH);
|
|
||||||
core::stringw tmp(p);
|
|
||||||
tmp.replace(L'\\', L'/');
|
|
||||||
#else
|
|
||||||
p = _fullpath(fpath, filename.c_str(), _MAX_PATH);
|
p = _fullpath(fpath, filename.c_str(), _MAX_PATH);
|
||||||
core::stringc tmp(p);
|
core::stringc tmp(p);
|
||||||
tmp.replace('\\', '/');
|
tmp.replace('\\', '/');
|
||||||
#endif
|
|
||||||
return tmp;
|
return tmp;
|
||||||
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
|
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
|
||||||
c8* p=0;
|
c8* p=0;
|
||||||
@ -958,17 +922,9 @@ bool CFileSystem::existFile(const io::path& filename) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
return (_waccess(filename.c_str(), 0) != -1);
|
|
||||||
#else
|
|
||||||
return (_access(filename.c_str(), 0) != -1);
|
return (_access(filename.c_str(), 0) != -1);
|
||||||
#endif
|
|
||||||
#elif defined(F_OK)
|
#elif defined(F_OK)
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
return (_waccess(filename.c_str(), F_OK) != -1);
|
|
||||||
#else
|
|
||||||
return (access(filename.c_str(), F_OK) != -1);
|
return (access(filename.c_str(), F_OK) != -1);
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
return (access(filename.c_str(), 0) != -1);
|
return (access(filename.c_str(), 0) != -1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "CGUIFileOpenDialog.h"
|
#include "CGUIFileOpenDialog.h"
|
||||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include "IGUISkin.h"
|
#include "IGUISkin.h"
|
||||||
#include "IGUIEnvironment.h"
|
#include "IGUIEnvironment.h"
|
||||||
#include "IVideoDriver.h"
|
#include "IVideoDriver.h"
|
||||||
@ -382,14 +380,7 @@ void CGUIFileOpenDialog::deserializeAttributes(io::IAttributes* in, io::SAttribu
|
|||||||
|
|
||||||
void CGUIFileOpenDialog::pathToStringW(irr::core::stringw& result, const irr::io::path& p)
|
void CGUIFileOpenDialog::pathToStringW(irr::core::stringw& result, const irr::io::path& p)
|
||||||
{
|
{
|
||||||
#ifndef _IRR_WCHAR_FILESYSTEM
|
|
||||||
char* oldLocale = setlocale(LC_CTYPE, NULL);
|
|
||||||
setlocale(LC_CTYPE,""); // multibyteToWString is affected by LC_CTYPE. Filenames seem to need the system-locale.
|
|
||||||
core::multibyteToWString(result, p);
|
core::multibyteToWString(result, p);
|
||||||
setlocale(LC_CTYPE, oldLocale);
|
|
||||||
#else
|
|
||||||
result = p.c_str();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! fills the listbox with files.
|
//! fills the listbox with files.
|
||||||
|
@ -73,11 +73,7 @@ void CReadFile::openFile()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined ( _IRR_WCHAR_FILESYSTEM )
|
|
||||||
File = _wfopen(Filename.c_str(), L"rb");
|
|
||||||
#else
|
|
||||||
File = fopen(Filename.c_str(), "rb");
|
File = fopen(Filename.c_str(), "rb");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (File)
|
if (File)
|
||||||
{
|
{
|
||||||
|
@ -81,11 +81,7 @@ void CWriteFile::openFile(bool append)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_IRR_WCHAR_FILESYSTEM)
|
|
||||||
File = _wfopen(Filename.c_str(), append ? L"ab" : L"wb");
|
|
||||||
#else
|
|
||||||
File = fopen(Filename.c_str(), append ? "ab" : "wb");
|
File = fopen(Filename.c_str(), append ? "ab" : "wb");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (File)
|
if (File)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user