// Read the first few bytes of the PNG file\r
if( file->read(buffer, 8) != 8 )\r
{\r
- os::Printer::log("LOAD PNG: can't read file\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("LOAD PNG: can't read file (filesize < 8)", file->getFileName(), ELL_ERROR);\r
return 0;\r
}\r
\r
// Check if it really is a PNG file\r
if( png_sig_cmp(buffer, 0, 8) )\r
{\r
- os::Printer::log("LOAD PNG: not really a png\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("LOAD PNG: not really a png (wrong signature)", file->getFileName(), ELL_ERROR);\r
return 0;\r
}\r
\r
NULL, (png_error_ptr)png_cpexcept_error, (png_error_ptr)png_cpexcept_warn);\r
if (!png_ptr)\r
{\r
- os::Printer::log("LOAD PNG: Internal PNG create read struct failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("LOAD PNG: Internal PNG create read struct failure", file->getFileName(), ELL_ERROR);\r
return 0;\r
}\r
\r
png_infop info_ptr = png_create_info_struct(png_ptr);\r
if (!info_ptr)\r
{\r
- os::Printer::log("LOAD PNG: Internal PNG create info struct failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("LOAD PNG: Internal PNG create info struct failure", file->getFileName(), ELL_ERROR);\r
png_destroy_read_struct(&png_ptr, NULL, NULL);\r
return 0;\r
}\r
image = new CImage(ECF_R8G8B8, core::dimension2d<u32>(Width, Height));\r
if (!image)\r
{\r
- os::Printer::log("LOAD PNG: Internal PNG create image struct failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("LOAD PNG: Internal PNG create image struct failure", file->getFileName(), ELL_ERROR);\r
png_destroy_read_struct(&png_ptr, NULL, NULL);\r
return 0;\r
}\r
RowPointers = new png_bytep[Height];\r
if (!RowPointers)\r
{\r
- os::Printer::log("LOAD PNG: Internal PNG create row pointers failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("LOAD PNG: Internal PNG create row pointers failure", file->getFileName(), ELL_ERROR);\r
png_destroy_read_struct(&png_ptr, NULL, NULL);\r
delete image;\r
return 0;\r
\r
if (!checkImageDimensions(header.ImageWidth, header.ImageHeight))\r
{\r
- os::Printer::log("Rejecting TGA with unreasonable size.", ELL_ERROR);\r
+ os::Printer::log("Image dimensions too large in file", file->getFileName(), ELL_ERROR);\r
return 0;\r
}\r
\r
NULL, (png_error_ptr)png_cpexcept_error, (png_error_ptr)png_cpexcept_warning);\r
if (!png_ptr)\r
{\r
- os::Printer::log("PNGWriter: Internal PNG create write struct failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("PNGWriter: Internal PNG create write struct failure", file->getFileName(), ELL_ERROR);\r
return false;\r
}\r
\r
png_infop info_ptr = png_create_info_struct(png_ptr);\r
if (!info_ptr)\r
{\r
- os::Printer::log("PNGWriter: Internal PNG create info struct failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("PNGWriter: Internal PNG create info struct failure", file->getFileName(), ELL_ERROR);\r
png_destroy_write_struct(&png_ptr, NULL);\r
return false;\r
}\r
u8* tmpImage = new u8[image->getDimension().Height*lineWidth];\r
if (!tmpImage)\r
{\r
- os::Printer::log("PNGWriter: Internal PNG create image failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("PNGWriter: Internal PNG create image failure", file->getFileName(), ELL_ERROR);\r
png_destroy_write_struct(&png_ptr, &info_ptr);\r
return false;\r
}\r
u8** RowPointers = new png_bytep[image->getDimension().Height];\r
if (!RowPointers)\r
{\r
- os::Printer::log("PNGWriter: Internal PNG create row pointers failure\n", file->getFileName(), ELL_ERROR);\r
+ os::Printer::log("PNGWriter: Internal PNG create row pointers failure", file->getFileName(), ELL_ERROR);\r
png_destroy_write_struct(&png_ptr, &info_ptr);\r
delete [] tmpImage;\r
return false;\r
{\r
if ( grabResult == GrabSuccess )\r
{\r
-// os::Printer::log(grabCommand, ": GrabSuccess", ELL_INFORMATION);\r
+// os::Printer::log(grabCommand, "GrabSuccess", ELL_INFORMATION);\r
return;\r
}\r
\r
switch ( grabResult )\r
{\r
case AlreadyGrabbed:\r
- os::Printer::log(grabCommand, ": AlreadyGrabbed", ELL_WARNING);\r
+ os::Printer::log(grabCommand, "AlreadyGrabbed", ELL_WARNING);\r
break;\r
case GrabNotViewable:\r
- os::Printer::log(grabCommand, ": GrabNotViewable", ELL_WARNING);\r
+ os::Printer::log(grabCommand, "GrabNotViewable", ELL_WARNING);\r
break;\r
case GrabFrozen:\r
- os::Printer::log(grabCommand, ": GrabFrozen", ELL_WARNING);\r
+ os::Printer::log(grabCommand, "GrabFrozen", ELL_WARNING);\r
break;\r
case GrabInvalidTime:\r
- os::Printer::log(grabCommand, ": GrabInvalidTime", ELL_WARNING);\r
+ os::Printer::log(grabCommand, "GrabInvalidTime", ELL_WARNING);\r
break;\r
default:\r
- os::Printer::log(grabCommand, ": grab failed with unknown problem", ELL_WARNING);\r
+ os::Printer::log(grabCommand, "grab failed with unknown problem", ELL_WARNING);\r
break;\r
}\r
}\r
}\r
#ifdef _DEBUG\r
else\r
- os::Printer::log("Visual chosen: ", core::stringc(static_cast<u32>(VisualInfo->visualid)).c_str(), ELL_DEBUG);\r
+ os::Printer::log("Visual chosen", core::stringc(static_cast<u32>(VisualInfo->visualid)).c_str(), ELL_DEBUG);\r
#endif\r
\r
// create color map\r
{\r
if ( event && event->type == *(int*)arg )\r
{\r
-// os::Printer::log("remove event:", core::stringc((int)arg).c_str(), ELL_INFORMATION);\r
+// os::Printer::log("remove event", core::stringc((int)arg).c_str(), ELL_INFORMATION);\r
return True;\r
}\r
return False;\r
#endif\r
if (SDL_Init(flags) < 0)\r
{\r
- os::Printer::log( "Unable to initialize SDL!", SDL_GetError());\r
+ os::Printer::log("Unable to initialize SDL!", SDL_GetError());\r
Close = true;\r
}\r
else\r
}\r
if ( !Window )\r
{\r
- os::Printer::log( "Could not initialize display!" );\r
+ os::Printer::log("Could not initialize display!" );\r
return false;\r
}\r
\r
v.Pos = vertexBuffer[Idx[0]];\r
else\r
{\r
- os::Printer::log("Invalid vertex index in this line:", wordBuffer.c_str(), ELL_ERROR);\r
+ os::Printer::log("Invalid vertex index in this line", wordBuffer.c_str(), ELL_ERROR);\r
delete [] buf;\r
return 0;\r
}\r
\r
if ( redundantPosKeys > 0 )\r
{\r
- os::Printer::log("Skinned Mesh - redundant position frames kicked:", core::stringc(redundantPosKeys).c_str(), ELL_DEBUG);\r
+ os::Printer::log("Skinned Mesh - redundant position frames kicked", core::stringc(redundantPosKeys).c_str(), ELL_DEBUG);\r
}\r
if ( unorderedPosKeys > 0 )\r
{\r
- irr::os::Printer::log("Skinned Mesh - unsorted position frames kicked:", irr::core::stringc(unorderedPosKeys).c_str(), irr::ELL_DEBUG);\r
+ irr::os::Printer::log("Skinned Mesh - unsorted position frames kicked", irr::core::stringc(unorderedPosKeys).c_str(), irr::ELL_DEBUG);\r
}\r
if ( redundantScaleKeys > 0 )\r
{\r
- os::Printer::log("Skinned Mesh - redundant scale frames kicked:", core::stringc(redundantScaleKeys).c_str(), ELL_DEBUG);\r
+ os::Printer::log("Skinned Mesh - redundant scale frames kicked", core::stringc(redundantScaleKeys).c_str(), ELL_DEBUG);\r
}\r
if ( unorderedScaleKeys > 0 )\r
{\r
- irr::os::Printer::log("Skinned Mesh - unsorted scale frames kicked:", irr::core::stringc(unorderedScaleKeys).c_str(), irr::ELL_DEBUG);\r
+ irr::os::Printer::log("Skinned Mesh - unsorted scale frames kicked", irr::core::stringc(unorderedScaleKeys).c_str(), irr::ELL_DEBUG);\r
}\r
if ( redundantRotationKeys > 0 )\r
{\r
- os::Printer::log("Skinned Mesh - redundant rotation frames kicked:", core::stringc(redundantRotationKeys).c_str(), ELL_DEBUG);\r
+ os::Printer::log("Skinned Mesh - redundant rotation frames kicked", core::stringc(redundantRotationKeys).c_str(), ELL_DEBUG);\r
}\r
if ( unorderedRotationKeys > 0 )\r
{\r
- irr::os::Printer::log("Skinned Mesh - unsorted rotation frames kicked:", irr::core::stringc(unorderedRotationKeys).c_str(), irr::ELL_DEBUG);\r
+ irr::os::Printer::log("Skinned Mesh - unsorted rotation frames kicked", irr::core::stringc(unorderedRotationKeys).c_str(), irr::ELL_DEBUG);\r
}\r
}\r
\r
{\r
if (!wglMakeCurrent((HDC)PrimaryContext.OpenGLWin32.HDc, (HGLRC)PrimaryContext.OpenGLWin32.HRc))\r
{\r
- os::Printer::log("Render Context switch failed.");\r
+ os::Printer::log("Render Context switch (back to main) failed.");\r
return false;\r
}\r
CurrentContext=PrimaryContext;\r
\r
// parse specific object\r
#ifdef _XREADER_DEBUG\r
- os::Printer::log("debug DataObject:", objectName.c_str(), ELL_DEBUG);\r
+ os::Printer::log("debug DataObject", objectName.c_str(), ELL_DEBUG);\r
#endif\r
\r
if (objectName == "template")\r
}\r
\r
#ifdef _XREADER_DEBUG\r
- os::Printer::log("debug DataObject in mesh:", objectName.c_str(), ELL_DEBUG);\r
+ os::Printer::log("debug DataObject in mesh", objectName.c_str(), ELL_DEBUG);\r
#endif\r
\r
if (objectName == "MeshNormals")\r
static void print(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);\r
static void log(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);\r
static void log(const wchar_t* message, ELOG_LEVEL ll = ELL_INFORMATION);\r
+\r
+ // The string ": " is added between message and hint\r
static void log(const c8* message, const c8* hint, ELOG_LEVEL ll = ELL_INFORMATION);\r
static void log(const c8* message, const io::path& hint, ELOG_LEVEL ll = ELL_INFORMATION);\r
static ILogger* Logger;\r