Build debug string by consecutive calls to XPLMDebugString

snprintf was not supported by MSVC for a very long time. It got added
the first time in MSVC 2015. To be able to build libxplanemp with
earlier versions, don't use snprintf but just pass the debug message
in multiple consecutive calls to XPLMDebugString.
This commit is contained in:
Roland Winklmeier
2015-11-20 16:14:14 +01:00
parent 3103389dd1
commit 502b41ff96

View File

@@ -347,10 +347,11 @@ int OBJ_LoadModel(const char * inFilePath)
tex_path += ".png";
sObjects.back().texnum = OBJ_LoadTexture(tex_path.c_str(), false);
if(sObjects.back().texnum == 0) {
char debug[500];
snprintf(debug, 500, "WARNING: %s failed to load for %s.\n", tex_path.c_str(),inFilePath);
debug[499] = '\0';
XPLMDebugString(debug);
XPLMDebugString("WARNING: ");
XPLMDebugString(tex_path.c_str());
XPLMDebugString(" failed to load for ");
XPLMDebugString(inFilePath);
XPLMDebugString("\n");
}
tex_path = path;