Commit b2dcd0aa authored by cutealien's avatar cutealien

Get rid of unnecessary warning "Could not load sprite bank because the file...

Get rid of unnecessary warning "Could not load sprite bank because the file does not exist" for "#defaultfont".

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4222 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 2d01842f
......@@ -52,6 +52,8 @@ const wchar_t* IRR_XML_FORMAT_GUI_ENV = L"irr_gui";
const wchar_t* IRR_XML_FORMAT_GUI_ELEMENT = L"element";
const wchar_t* IRR_XML_FORMAT_GUI_ELEMENT_ATTR_TYPE = L"type";
const io::path CGUIEnvironment::DefaultFontName = "#DefaultFont";
//! constructor
CGUIEnvironment::CGUIEnvironment(io::IFileSystem* fs, video::IVideoDriver* driver, IOSOperator* op)
: IGUIElement(EGUIET_ROOT, 0, 0, 0, core::rect<s32>(core::position2d<s32>(0,0), driver ? core::dimension2d<s32>(driver->getScreenSize()) : core::dimension2d<s32>(0,0))),
......@@ -166,11 +168,9 @@ CGUIEnvironment::~CGUIEnvironment()
void CGUIEnvironment::loadBuiltInFont()
{
io::path filename = "#DefaultFont";
io::IReadFile* file = io::createMemoryReadFile(BuiltInFontData, BuiltInFontDataSize, filename, false);
io::IReadFile* file = io::createMemoryReadFile(BuiltInFontData, BuiltInFontDataSize, DefaultFontName, false);
CGUIFont* font = new CGUIFont(this, filename );
CGUIFont* font = new CGUIFont(this, DefaultFontName );
if (!font->load(file))
{
os::Printer::log("Error: Could not load built-in Font. Did you compile without the BMP loader?", ELL_ERROR);
......@@ -180,7 +180,7 @@ void CGUIEnvironment::loadBuiltInFont()
}
SFont f;
f.NamedPath.setPath(filename);
f.NamedPath.setPath(DefaultFontName);
f.Font = font;
Fonts.push_back(f);
......@@ -1528,8 +1528,11 @@ IGUISpriteBank* CGUIEnvironment::getSpriteBank(const io::path& filename)
// we don't have this sprite bank, we should load it
if (!FileSystem->existFile(b.NamedPath.getPath()))
{
if ( filename != DefaultFontName )
{
os::Printer::log("Could not load sprite bank because the file does not exist", b.NamedPath.getPath(), ELL_DEBUG);
}
return 0;
}
......
......@@ -310,6 +310,7 @@ private:
io::IFileSystem* FileSystem;
IEventReceiver* UserReceiver;
IOSOperator* Operator;
static const io::path DefaultFontName;
};
} // end namespace gui
......
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