mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 18:20:30 +01:00
Reduce needless use of wchar / stringw
This commit is contained in:
parent
2894d9ab03
commit
19819bd23a
@ -73,27 +73,6 @@ public:
|
|||||||
filtered with these levels. If you want to be a text displayed,
|
filtered with these levels. If you want to be a text displayed,
|
||||||
independent on what level filter is set, use ELL_NONE. */
|
independent on what level filter is set, use ELL_NONE. */
|
||||||
virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
||||||
virtual void log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
/** \param text: Text to print out.
|
|
||||||
\param hint: Additional info. This string is added after a " :" to the
|
|
||||||
string.
|
|
||||||
\param ll: Log level of the text. If the text is an error, set
|
|
||||||
it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
|
||||||
is just an informational text, set it to ELL_INFORMATION. Texts are
|
|
||||||
filtered with these levels. If you want to be a text displayed,
|
|
||||||
independent on what level filter is set, use ELL_NONE. */
|
|
||||||
virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
/** \param text: Text to print out.
|
|
||||||
\param ll: Log level of the text. If the text is an error, set
|
|
||||||
it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
|
||||||
is just an informational text, set it to ELL_INFORMATION. Texts are
|
|
||||||
filtered with these levels. If you want to be a text displayed,
|
|
||||||
independent on what level filter is set, use ELL_NONE. */
|
|
||||||
virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace
|
} // end namespace
|
||||||
|
@ -869,7 +869,7 @@ namespace video
|
|||||||
//! Gets name of this video driver.
|
//! Gets name of this video driver.
|
||||||
/** \return Returns the name of the video driver, e.g. in case
|
/** \return Returns the name of the video driver, e.g. in case
|
||||||
of the Direct3D8 driver, it would return "Direct3D 8.1". */
|
of the Direct3D8 driver, it would return "Direct3D 8.1". */
|
||||||
virtual const wchar_t* getName() const =0;
|
virtual const char* getName() const =0;
|
||||||
|
|
||||||
//! Adds an external image loader to the engine.
|
//! Adds an external image loader to the engine.
|
||||||
/** This is useful if the Irrlicht Engine should be able to load
|
/** This is useful if the Irrlicht Engine should be able to load
|
||||||
|
@ -17,6 +17,9 @@ namespace io
|
|||||||
*/
|
*/
|
||||||
typedef core::string<fschar_t> path;
|
typedef core::string<fschar_t> path;
|
||||||
|
|
||||||
|
// Type only exists for historcal reasons, paths are always char now.
|
||||||
|
static_assert(sizeof(fschar_t) == sizeof(char));
|
||||||
|
|
||||||
//! Used in places where we identify objects by a filename, but don't actually work with the real filename
|
//! Used in places where we identify objects by a filename, but don't actually work with the real filename
|
||||||
/** Irrlicht is internally not case-sensitive when it comes to names.
|
/** Irrlicht is internally not case-sensitive when it comes to names.
|
||||||
Also this class is a first step towards support for correctly serializing renamed objects.
|
Also this class is a first step towards support for correctly serializing renamed objects.
|
||||||
@ -62,11 +65,6 @@ struct SNamedPath
|
|||||||
{
|
{
|
||||||
return core::stringc(getPath());
|
return core::stringc(getPath());
|
||||||
}
|
}
|
||||||
//! Implicit cast to io::path
|
|
||||||
operator core::stringw() const
|
|
||||||
{
|
|
||||||
return core::stringw(getPath());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// convert the given path string to a name string.
|
// convert the given path string to a name string.
|
||||||
|
@ -59,38 +59,6 @@ namespace irr
|
|||||||
log (s.c_str(), ll);
|
log (s.c_str(), ll);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
void CLogger::log(const wchar_t* text, ELOG_LEVEL ll)
|
|
||||||
{
|
|
||||||
if (ll < LogLevel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
core::stringc s = text;
|
|
||||||
log(s.c_str(), ll);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
void CLogger::log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll)
|
|
||||||
{
|
|
||||||
if (ll < LogLevel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
core::stringc s1 = text;
|
|
||||||
core::stringc s2 = hint;
|
|
||||||
log(s1.c_str(), s2.c_str(), ll);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
void CLogger::log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll)
|
|
||||||
{
|
|
||||||
if (ll < LogLevel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
core::stringc s2 = hint;
|
|
||||||
log( text, s2.c_str(), ll);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Sets a new event receiver
|
//! Sets a new event receiver
|
||||||
void CLogger::setReceiver(IEventReceiver* r)
|
void CLogger::setReceiver(IEventReceiver* r)
|
||||||
{
|
{
|
||||||
|
@ -28,18 +28,9 @@ public:
|
|||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
|
||||||
|
|
||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
void log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
|
||||||
|
|
||||||
//! Prints out a text into the log
|
|
||||||
void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
|
||||||
|
|
||||||
//! Sets a new event receiver
|
//! Sets a new event receiver
|
||||||
void setReceiver(IEventReceiver* r);
|
void setReceiver(IEventReceiver* r);
|
||||||
|
|
||||||
|
@ -839,9 +839,9 @@ const SColorf& CNullDriver::getAmbientLight() const
|
|||||||
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
|
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
|
||||||
//! driver, it would return "Direct3D8".
|
//! driver, it would return "Direct3D8".
|
||||||
|
|
||||||
const wchar_t* CNullDriver::getName() const
|
const char* CNullDriver::getName() const
|
||||||
{
|
{
|
||||||
return L"Irrlicht NullDevice";
|
return "Irrlicht NullDevice";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1929,7 +1929,7 @@ IImage* CNullDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_REND
|
|||||||
// prints renderer version
|
// prints renderer version
|
||||||
void CNullDriver::printVersion()
|
void CNullDriver::printVersion()
|
||||||
{
|
{
|
||||||
core::stringw namePrint = L"Using renderer: ";
|
core::stringc namePrint = "Using renderer: ";
|
||||||
namePrint += getName();
|
namePrint += getName();
|
||||||
os::Printer::log(namePrint.c_str(), ELL_INFORMATION);
|
os::Printer::log(namePrint.c_str(), ELL_INFORMATION);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ namespace video
|
|||||||
|
|
||||||
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
|
//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8
|
||||||
//! driver, it would return "Direct3D8.1".
|
//! driver, it would return "Direct3D8.1".
|
||||||
const wchar_t* getName() const override;
|
const char* getName() const override;
|
||||||
|
|
||||||
//! Sets the dynamic ambient light color. The default color is
|
//! Sets the dynamic ambient light color. The default color is
|
||||||
//! (0,0,0,0) which means it is dark.
|
//! (0,0,0,0) which means it is dark.
|
||||||
|
@ -159,9 +159,9 @@ COGLES2Driver::~COGLES2Driver()
|
|||||||
io::IReadFile* vsFile = FileSystem->createAndOpenFile(vsPath);
|
io::IReadFile* vsFile = FileSystem->createAndOpenFile(vsPath);
|
||||||
if ( !vsFile )
|
if ( !vsFile )
|
||||||
{
|
{
|
||||||
core::stringw warning(L"Warning: Missing shader files needed to simulate fixed function materials:\n");
|
std::string warning("Warning: Missing shader files needed to simulate fixed function materials:\n");
|
||||||
warning += core::stringw(vsPath) + L"\n";
|
warning.append(vsPath.c_str()).append("\n");
|
||||||
warning += L"Shaderpath can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
warning += "The path can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
||||||
os::Printer::log(warning.c_str(), ELL_WARNING);
|
os::Printer::log(warning.c_str(), ELL_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -169,9 +169,9 @@ COGLES2Driver::~COGLES2Driver()
|
|||||||
io::IReadFile* fsFile = FileSystem->createAndOpenFile(fsPath);
|
io::IReadFile* fsFile = FileSystem->createAndOpenFile(fsPath);
|
||||||
if ( !fsFile )
|
if ( !fsFile )
|
||||||
{
|
{
|
||||||
core::stringw warning(L"Warning: Missing shader files needed to simulate fixed function materials:\n");
|
std::string warning("Warning: Missing shader files needed to simulate fixed function materials:\n");
|
||||||
warning += core::stringw(fsPath) + L"\n";
|
warning.append(fsPath.c_str()).append("\n");
|
||||||
warning += L"Shaderpath can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
warning += "The path can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
||||||
os::Printer::log(warning.c_str(), ELL_WARNING);
|
os::Printer::log(warning.c_str(), ELL_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1858,7 +1858,7 @@ COGLES2Driver::~COGLES2Driver()
|
|||||||
|
|
||||||
|
|
||||||
//! \return Returns the name of the video driver.
|
//! \return Returns the name of the video driver.
|
||||||
const wchar_t* COGLES2Driver::getName() const
|
const char* COGLES2Driver::getName() const
|
||||||
{
|
{
|
||||||
return Name.c_str();
|
return Name.c_str();
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ namespace video
|
|||||||
// virtual void drawPixel(u32 x, u32 y, const SColor & color);
|
// virtual void drawPixel(u32 x, u32 y, const SColor & color);
|
||||||
|
|
||||||
//! Returns the name of the video driver.
|
//! Returns the name of the video driver.
|
||||||
const wchar_t* getName() const override;
|
const char* getName() const override;
|
||||||
|
|
||||||
//! Returns the maximum texture size supported.
|
//! Returns the maximum texture size supported.
|
||||||
core::dimension2du getMaxTextureSize() const override;
|
core::dimension2du getMaxTextureSize() const override;
|
||||||
@ -352,7 +352,7 @@ namespace video
|
|||||||
virtual void setViewPortRaw(u32 width, u32 height);
|
virtual void setViewPortRaw(u32 width, u32 height);
|
||||||
|
|
||||||
COGLES2CacheHandler* CacheHandler;
|
COGLES2CacheHandler* CacheHandler;
|
||||||
core::stringw Name;
|
core::stringc Name;
|
||||||
core::stringc VendorName;
|
core::stringc VendorName;
|
||||||
SIrrlichtCreationParameters Params;
|
SIrrlichtCreationParameters Params;
|
||||||
|
|
||||||
|
@ -2041,7 +2041,7 @@ void COGLES1Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
|
|||||||
|
|
||||||
|
|
||||||
//! \return Returns the name of the video driver.
|
//! \return Returns the name of the video driver.
|
||||||
const wchar_t* COGLES1Driver::getName() const
|
const char* COGLES1Driver::getName() const
|
||||||
{
|
{
|
||||||
return Name.c_str();
|
return Name.c_str();
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ namespace video
|
|||||||
SColor color = SColor(255,255,255,255)) override;
|
SColor color = SColor(255,255,255,255)) override;
|
||||||
|
|
||||||
//! Returns the name of the video driver.
|
//! Returns the name of the video driver.
|
||||||
const wchar_t* getName() const override;
|
const char* getName() const override;
|
||||||
|
|
||||||
//! Sets the dynamic ambient light color.
|
//! Sets the dynamic ambient light color.
|
||||||
void setAmbientLight(const SColorf& color) override;
|
void setAmbientLight(const SColorf& color) override;
|
||||||
@ -318,7 +318,7 @@ namespace video
|
|||||||
|
|
||||||
COGLES1CacheHandler* CacheHandler;
|
COGLES1CacheHandler* CacheHandler;
|
||||||
|
|
||||||
core::stringw Name;
|
core::stringc Name;
|
||||||
core::matrix4 Matrices[ETS_COUNT];
|
core::matrix4 Matrices[ETS_COUNT];
|
||||||
core::array<u8> ColorBuffer;
|
core::array<u8> ColorBuffer;
|
||||||
|
|
||||||
|
@ -90,9 +90,9 @@ bool COpenGLDriver::genericDriverInit()
|
|||||||
if (ContextManager)
|
if (ContextManager)
|
||||||
ContextManager->grab();
|
ContextManager->grab();
|
||||||
|
|
||||||
Name=L"OpenGL ";
|
Name="OpenGL ";
|
||||||
Name.append(glGetString(GL_VERSION));
|
Name.append(glGetString(GL_VERSION));
|
||||||
s32 pos=Name.findNext(L' ', 7);
|
s32 pos=Name.findNext(' ', 7);
|
||||||
if (pos != -1)
|
if (pos != -1)
|
||||||
Name=Name.subString(0, pos);
|
Name=Name.subString(0, pos);
|
||||||
printVersion();
|
printVersion();
|
||||||
@ -2920,7 +2920,7 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh
|
|||||||
|
|
||||||
|
|
||||||
//! \return Returns the name of the video driver.
|
//! \return Returns the name of the video driver.
|
||||||
const wchar_t* COpenGLDriver::getName() const
|
const char* COpenGLDriver::getName() const
|
||||||
{
|
{
|
||||||
return Name.c_str();
|
return Name.c_str();
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ namespace video
|
|||||||
|
|
||||||
//! \return Returns the name of the video driver. Example: In case of the Direct3D8
|
//! \return Returns the name of the video driver. Example: In case of the Direct3D8
|
||||||
//! driver, it would return "Direct3D8.1".
|
//! driver, it would return "Direct3D8.1".
|
||||||
const wchar_t* getName() const override;
|
const char* getName() const override;
|
||||||
|
|
||||||
//! Sets the dynamic ambient light color. The default color is
|
//! Sets the dynamic ambient light color. The default color is
|
||||||
//! (0,0,0,0) which means it is dark.
|
//! (0,0,0,0) which means it is dark.
|
||||||
@ -439,7 +439,7 @@ namespace video
|
|||||||
|
|
||||||
COpenGLCacheHandler* CacheHandler;
|
COpenGLCacheHandler* CacheHandler;
|
||||||
|
|
||||||
core::stringw Name;
|
core::stringc Name;
|
||||||
core::matrix4 Matrices[ETS_COUNT];
|
core::matrix4 Matrices[ETS_COUNT];
|
||||||
core::array<u8> ColorBuffer;
|
core::array<u8> ColorBuffer;
|
||||||
|
|
||||||
|
@ -290,9 +290,9 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
|
|||||||
io::IReadFile* vsFile = FileSystem->createAndOpenFile(vsPath);
|
io::IReadFile* vsFile = FileSystem->createAndOpenFile(vsPath);
|
||||||
if ( !vsFile )
|
if ( !vsFile )
|
||||||
{
|
{
|
||||||
core::stringw warning(L"Warning: Missing shader files needed to simulate fixed function materials:\n");
|
std::string warning("Warning: Missing shader files needed to simulate fixed function materials:\n");
|
||||||
warning += core::stringw(vsPath) + L"\n";
|
warning.append(vsPath.c_str()).append("\n");
|
||||||
warning += L"Shaderpath can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
warning += "Shaderpath can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
||||||
os::Printer::log(warning.c_str(), ELL_WARNING);
|
os::Printer::log(warning.c_str(), ELL_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -300,9 +300,9 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
|
|||||||
io::IReadFile* fsFile = FileSystem->createAndOpenFile(fsPath);
|
io::IReadFile* fsFile = FileSystem->createAndOpenFile(fsPath);
|
||||||
if ( !fsFile )
|
if ( !fsFile )
|
||||||
{
|
{
|
||||||
core::stringw warning(L"Warning: Missing shader files needed to simulate fixed function materials:\n");
|
std::string warning("Warning: Missing shader files needed to simulate fixed function materials:\n");
|
||||||
warning += core::stringw(fsPath) + L"\n";
|
warning.append(fsPath.c_str()).append("\n");
|
||||||
warning += L"Shaderpath can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
warning += "Shaderpath can be changed in SIrrCreationParamters::OGLES2ShaderPath";
|
||||||
os::Printer::log(warning.c_str(), ELL_WARNING);
|
os::Printer::log(warning.c_str(), ELL_WARNING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1619,7 +1619,7 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
|
|||||||
|
|
||||||
|
|
||||||
//! \return Returns the name of the video driver.
|
//! \return Returns the name of the video driver.
|
||||||
const wchar_t* COpenGL3DriverBase::getName() const
|
const char* COpenGL3DriverBase::getName() const
|
||||||
{
|
{
|
||||||
return Name.c_str();
|
return Name.c_str();
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ namespace video
|
|||||||
// virtual void drawPixel(u32 x, u32 y, const SColor & color);
|
// virtual void drawPixel(u32 x, u32 y, const SColor & color);
|
||||||
|
|
||||||
//! Returns the name of the video driver.
|
//! Returns the name of the video driver.
|
||||||
const wchar_t* getName() const override;
|
const char* getName() const override;
|
||||||
|
|
||||||
//! Returns the maximum texture size supported.
|
//! Returns the maximum texture size supported.
|
||||||
core::dimension2du getMaxTextureSize() const override;
|
core::dimension2du getMaxTextureSize() const override;
|
||||||
@ -345,7 +345,7 @@ namespace video
|
|||||||
void endDraw(const VertexType &vertexType);
|
void endDraw(const VertexType &vertexType);
|
||||||
|
|
||||||
COpenGL3CacheHandler* CacheHandler;
|
COpenGL3CacheHandler* CacheHandler;
|
||||||
core::stringw Name;
|
core::stringc Name;
|
||||||
core::stringc VendorName;
|
core::stringc VendorName;
|
||||||
SIrrlichtCreationParameters Params;
|
SIrrlichtCreationParameters Params;
|
||||||
OpenGLVersion Version;
|
OpenGLVersion Version;
|
||||||
|
@ -263,12 +263,6 @@ namespace os
|
|||||||
Logger->log(message, ll);
|
Logger->log(message, ll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Printer::log(const wchar_t* message, ELOG_LEVEL ll)
|
|
||||||
{
|
|
||||||
if (Logger)
|
|
||||||
Logger->log(message, ll);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Printer::log(const c8* message, const c8* hint, ELOG_LEVEL ll)
|
void Printer::log(const c8* message, const c8* hint, ELOG_LEVEL ll)
|
||||||
{
|
{
|
||||||
if (Logger)
|
if (Logger)
|
||||||
|
Loading…
Reference in New Issue
Block a user