From 5c6b6bbc7c9f97c53442ae9847aca8f09b256d9a Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Wed, 28 May 2014 18:49:50 -0700 Subject: [PATCH] Fix the rest of the plString::Format calls --- .../pfAnimation/plAnimDebugList.cpp | 10 ++++----- .../Plasma/FeatureLib/pfAudio/plListener.cpp | 12 +++++++---- .../NucleusLib/pnDispatch/plDispatch.cpp | 5 +++-- .../NucleusLib/pnNetCommon/plGenericVar.cpp | 2 +- .../PubUtilLib/plAvatar/plArmatureMod.cpp | 11 +++++----- .../PubUtilLib/plAvatar/plAvBehaviors.cpp | 5 ++--- .../PubUtilLib/plAvatar/plAvBrainHuman.cpp | 2 +- .../PubUtilLib/plAvatar/plAvBrainSwim.cpp | 4 ++-- .../plContainer/plKeysAndValues.cpp | 8 +++---- .../PubUtilLib/plNetClient/plNetClientMgr.cpp | 2 +- .../plNetClient/plNetClientMgrSend.cpp | 8 +++---- .../plPhysX/plPXPhysicalControllerCore.cpp | 10 ++++----- .../plPhysical/plPhysicalSDLModifier.cpp | 21 ++++++++++--------- .../PubUtilLib/plSDL/plStateVariable.cpp | 6 +++--- .../PubUtilLib/plStatusLog/plStatusLog.cpp | 13 ++++++------ Sources/Tools/MaxConvert/plBitmapCreator.cpp | 4 ++-- 16 files changed, 64 insertions(+), 59 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp index 0877f280..2d965a03 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp @@ -123,10 +123,10 @@ void plAnimDebugList::ShowReport() plLayerAnimation *layerAnim = plLayerAnimation::ConvertNoRef(layer); if (layerAnim) { - str = plString::Format("%s: %s %.3f (%.3f)", mat->GetKeyName().c_str(), layerAnim->GetKeyName().c_str(), + str = plFormat("{}: {} {.3f} ({.3f})", mat->GetKeyName(), layerAnim->GetKeyName(), layerAnim->GetTimeConvert().CurrentAnimTime(), layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); - txt.DrawString(x, y, str.c_str()); + txt.DrawString(x, y, str); y += yOff; } layer = layer->GetOverLay(); @@ -148,16 +148,16 @@ void plAnimDebugList::ShowReport() continue; str = plFormat(" {}", so->GetKeyName()); - txt.DrawString(x, y, str.c_str()); + txt.DrawString(x, y, str); y += yOff; for (j = 0; j < mod->GetNumATCAnimations(); j++) { plAGAnimInstance *anim = mod->GetATCAnimInstance(j); - str = plString::Format(" %s: %.3f (%.3f)", anim->GetAnimation()->GetName().c_str(), + str = plFormat(" {}: {.3f} ({.3f})", anim->GetAnimation()->GetName(), anim->GetTimeConvert()->CurrentAnimTime(), anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); - txt.DrawString(x, y, str.c_str()); + txt.DrawString(x, y, str); y += yOff; } } diff --git a/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp b/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp index d893d216..e8081859 100644 --- a/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp +++ b/Sources/Plasma/FeatureLib/pfAudio/plListener.cpp @@ -183,19 +183,23 @@ bool plListener::IEval(double secs, float del, uint32_t dirty) if( fPrintDbgInfo ) { plString str; - str = plString::Format( "Direction: (%3.2f,%3.2f,%3.2f) from %s", dir.fX, dir.fY, dir.fZ, ( facingType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); + str = plFormat("Direction: ({3.2f},{3.2f},{3.2f}) from {}", dir.fX, dir.fY, dir.fZ, + (facingType == kObject) ? pRefObject->GetKeyName() : "VCam"); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); y += 12; - str = plString::Format( "Up: (%3.2f,%3.2f,%3.2f) from %s", up.fX, up.fY, up.fZ, ( facingType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); + str = plFormat("Up: ({3.2f},{3.2f},{3.2f}) from {}", up.fX, up.fY, up.fZ, + (facingType == kObject) ? pRefObject->GetKeyName() : "VCam"); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); y += 12; - str = plString::Format( "Position: (%3.2f,%3.2f,%3.2f) from %s", position.fX, position.fY, position.fZ, ( posType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); + str = plFormat("Position: ({3.2f},{3.2f},{3.2f}) from {}", position.fX, position.fY, position.fZ, + (posType == kObject) ? pRefObject->GetKeyName() : "VCam"); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); y += 12; - str = plString::Format( "Velocity: (%3.2f,%3.2f,%3.2f) from %s", velocity.fX, velocity.fY, velocity.fZ, ( velType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); + str = plFormat("Velocity: ({3.2f},{3.2f},{3.2f}) from {}", velocity.fX, velocity.fY, velocity.fZ, + (velType == kObject) ? pRefObject->GetKeyName() : "VCam"); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); y += 12; } diff --git a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp index 79401720..e865a09b 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp +++ b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp @@ -335,8 +335,9 @@ void plDispatch::IMsgDispatch() if (plNetObjectDebuggerBase::GetInstance()->IsDebugObject(ko)) { hsLogEntry(plNetObjectDebuggerBase::GetInstance()->LogMsg( - plString::Format(" object:%s, GameMessage %s st=%.3f rt=%.3f", - ko->GetKeyName().c_str(), msg->ClassName(), hsTimer::GetSysSeconds(), hsTimer::GetSeconds()).c_str())); + plFormat(" object:{}, GameMessage {} st={.3f} rt={.3f}", + ko->GetKeyName(), msg->ClassName(), hsTimer::GetSysSeconds(), + hsTimer::GetSeconds()).c_str())); } } } diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp index 17bb7ac7..422978c5 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp @@ -244,7 +244,7 @@ plString plGenericType::GetAsString() const return plFormat("{}", fU); case kFloat : case kDouble : - return plString::Format("%f", fType==kDouble?fD:fF); + return plFormat("{f}", fType==kDouble ? fD : fF); case kChar : return plFormat("{}", fC); case kAny : diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index b20e2d14..1cfff012 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -2664,9 +2664,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe hsMatrix44 l2w = SO->GetLocalToWorld(); hsPoint3 worldPos = l2w.GetTranslate(); - const char *opaque = IsOpaque() ? "yes" : "no"; - debugTxt.DrawString(x, y, plString::Format("position(world): %.2f, %.2f, %.2f Opaque: %3s", - worldPos.fX, worldPos.fY, worldPos.fZ, opaque)); + debugTxt.DrawString(x, y, plFormat("position(world): {.2f}, {.2f}, {.2f} Opaque: {>3}", + worldPos.fX, worldPos.fY, worldPos.fZ, IsOpaque() ? "yes" : "no")); y += lineHeight; const char* frozen = "n.a."; @@ -2687,8 +2686,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe hsPoint3 physPos; GetPositionAndRotationSim(&physPos, nil); const hsVector3& vel = fController->GetLinearVelocity(); - details = plString::Format("position(physical): <%.2f, %.2f, %.2f> velocity: <%5.2f, %5.2f, %5.2f>", - physPos.fX, physPos.fY, physPos.fZ, vel.fX, vel.fY, vel.fZ); + details = plFormat("position(physical): <{.2f}, {.2f}, {.2f}> velocity: <{5.2f}, {5.2f}, {5.2f}>", + physPos.fX, physPos.fY, physPos.fZ, vel.fX, vel.fY, vel.fZ); } else { @@ -2796,7 +2795,7 @@ void plArmatureMod::DebugDumpMoveKeys(int &x, int &y, int lineHeight, plDebugTex plAvatarInputInterface::GetInstance()->GetInputMapName())); y += lineHeight; - debugTxt.DrawString(x, y, plString::Format("Turn strength: %.2f (key: %.2f, analog: %.2f)", + debugTxt.DrawString(x, y, plFormat("Turn strength: {.2f} (key: {.2f}, analog: {.2f})", GetTurnStrength(), GetKeyTurnStrength(), GetAnalogTurnStrength())); y += lineHeight; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp index ceeac667..bb78bf1c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp @@ -105,16 +105,15 @@ void plArmatureBehavior::DumpDebug(int &x, int &y, int lineHeight, plDebugText & { float strength = GetStrength(); const char *onOff = strength > 0 ? "on" : "off"; - char blendBar[11] = "||||||||||"; + char blendBar[] = "||||||||||"; int bars = (int)min(10 * strength, 10); blendBar[bars] = '\0'; plString details; if (fAnim) { - plString animName = fAnim->GetName(); float time = fAnim->GetTimeConvert()->CurrentAnimTime(); - details = plString::Format("%20s %3s time: %5.2f %s", animName.c_str(), onOff, time, blendBar); + details = plFormat("{>20} {>3} time: {5.2f} {}", fAnim->GetName(), onOff, time, blendBar); } else details = plFormat(" Behavior {2} {>3} {}", fIndex, onOff, blendBar); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index d7957df1..0e3a0f09 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -903,7 +903,7 @@ void plAvBrainHuman::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugT const char *grounded = fWalkingStrategy->IsOnGround() ? "yes" : "no"; const char *pushing = (fWalkingStrategy->GetPushingPhysical() ? (fWalkingStrategy->GetFacingPushingPhysical() ? "facing" : "behind") : "none"); - debugTxt.DrawString(x, y, plString::Format("Ground: %3s, AirTime: %5.2f (Peak: %5.2f), PushingPhys: %6s", + debugTxt.DrawString(x, y, plFormat("Ground: {>3}, AirTime: {5.2f} (Peak: {5.2f}), PushingPhys: {>6}", grounded, fWalkingStrategy->GetAirTime(), fWalkingStrategy->GetImpactTime(), pushing)); y += lineHeight; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp index 18c8bbe6..94b7b77a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp @@ -619,11 +619,11 @@ void plAvBrainSwim::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe y += lineHeight; float buoy = fSwimStrategy ? fSwimStrategy->GetBuoyancy() : 0.0f; - debugTxt.DrawString(x, y, plString::Format("Distance to surface: %f Buoyancy: %f", fSurfaceDistance, buoy)); + debugTxt.DrawString(x, y, plFormat("Distance to surface: {f} Buoyancy: {f}", fSurfaceDistance, buoy)); y += lineHeight; hsVector3 linV = fAvMod->GetController()->GetAchievedLinearVelocity(); - debugTxt.DrawString(x, y, plString::Format("Linear Velocity: (%5.2f, %5.2f, %5.2f)", linV.fX, linV.fY, linV.fZ)); + debugTxt.DrawString(x, y, plFormat("Linear Velocity: ({5.2f}, {5.2f}, {5.2f})", linV.fX, linV.fY, linV.fZ)); y += lineHeight; int i; diff --git a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp index ec7ac682..fad2ac09 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp +++ b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp @@ -92,7 +92,7 @@ bool plKeysAndValues::KeyHasValue(const plString & key, int value) bool plKeysAndValues::KeyHasValue(const plString & key, double value) { - return KeyHasValue(key, plString::Format("%f", value)); + return KeyHasValue(key, plFormat("{f}", value)); } bool plKeysAndValues::AddValue(const plString & key, const plString & value, KAddValueMode mode) @@ -121,7 +121,7 @@ bool plKeysAndValues::AddValue(const plString & key, int value, KAddValueMode mo bool plKeysAndValues::AddValue(const plString & key, double value, KAddValueMode mode) { - return AddValue(key, plString::Format("%f", value), mode); + return AddValue(key, plFormat("{f}", value), mode); } bool plKeysAndValues::AddValues(const plString & key, const std::vector & values, KAddValueMode mode) @@ -144,7 +144,7 @@ bool plKeysAndValues::SetValue(const plString & key, int value) bool plKeysAndValues::SetValue(const plString & key, double value) { - return SetValue(key, plString::Format("%f", value)); + return SetValue(key, plFormat("{f}", value)); } plString plKeysAndValues::GetValue(const plString & key, const plString & defval, bool * outFound) const @@ -170,7 +170,7 @@ int plKeysAndValues::GetValue(const plString & key, int defval, bool * outFound) double plKeysAndValues::GetValue(const plString & key, double defval, bool * outFound) const { - return GetValue(key, plString::Format("%f", defval), outFound).ToDouble(); + return GetValue(key, plFormat("{f}", defval), outFound).ToDouble(); } std::vector plKeysAndValues::GetAllValues(const plString & key) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index e24982a7..9631cae8 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -279,7 +279,7 @@ bool plNetClientMgr::Log(const char* str) const return true; // prepend raw time - plString buf2 = plString::Format("%.2f %s", hsTimer::GetSeconds(), ProcessTab(str)); + plString buf2 = plFormat("{.2f} {}", hsTimer::GetSeconds(), ProcessTab(str)); if ( GetConsoleOutput() ) hsStatusMessage(buf2.c_str()); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index ff5d4aa6..b5758393 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -393,10 +393,10 @@ int plNetClientMgr::ISendGameMessage(plMessage* msg) { #if 0 hsLogEntry(plNetObjectDebugger::GetInstance()->LogMsg( - plString::Format(" object:%s, rcvr %s %s", - msg->GetSender().GetKeyName().c_str(), - msg->GetNumReceivers() ? msg->GetReceiver(0)->GetName().c_str() : "?", - netMsgWrap->AsStdString().c_str()).c_str())); + plFormat(" object:{}, rcvr {} {}", + msg->GetSender().GetKeyName(), + msg->GetNumReceivers() ? msg->GetReceiver(0)->GetName() : "?", + netMsgWrap->AsStdString()).c_str())); #endif } diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp index 5be29cc0..50da61ea 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp @@ -858,7 +858,7 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx) { y = 10; debugString = plFormat("Controller Count: {}", gControllers.size()); - debugTxt.DrawString(x, y, debugString.c_str()); + debugTxt.DrawString(x, y, debugString); y += lineHeight; } @@ -868,7 +868,7 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx) { debugString = plFormat("Controller #{} ({}) Collisions:", controllerIdx + 1, gControllers[controllerIdx]->fOwner->GetName()); - debugTxt.DrawString(x, y, debugString.c_str()); + debugTxt.DrawString(x, y, debugString); y += lineHeight; for (int i = 0; i < collisionCount; i++) @@ -876,11 +876,11 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx) hsVector3 normal = fDbgCollisionInfo[i].fNormal; const char* overlapStr = fDbgCollisionInfo[i].fOverlap ? "yes" : "no"; float angle = hsRadiansToDegrees(acos(normal * hsVector3(0, 0, 1))); - debugString = plString::Format("\tObj: %s, Normal: (%.2f, %.2f, %.2f), Angle(%.1f), Overlap(%s)", - fDbgCollisionInfo[i].fSO->GetKeyName().c_str(), + debugString = plFormat("\tObj: {}, Normal: ({.2f}, {.2f}, {.2f}), Angle({.1f}), Overlap({})", + fDbgCollisionInfo[i].fSO->GetKeyName(), normal.fX, normal.fY, normal.fZ, angle, overlapStr); - debugTxt.DrawString(x, y, debugString.c_str()); + debugTxt.DrawString(x, y, debugString); y += lineHeight; } } diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp index 1d5f1122..004424d2 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp @@ -215,29 +215,30 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi plPhysical* phys = IGetPhysical(); - plString log = plFormat("{}: {}", phys->GetKeyName(), prefix); + plStringStream log; + log << phys->GetKeyName() << ": " << prefix; if (isPosSet) - log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ); + log << plFormat(" Pos={.1f} {.1f} {.1f}", pos.fX, pos.fY, pos.fZ); else - log += " Pos=None"; + log << " Pos=None"; if (isLinVSet) - log += plString::Format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ); + log << plFormat(" LinV={.1f} {.1f} {.1f}", linV.fX, linV.fY, linV.fZ); else - log += " LinV=None"; + log << " LinV=None"; if (isAngVSet) - log += plString::Format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ); + log << plFormat(" AngV={.1f} {.1f} {.1f}", angV.fX, angV.fY, angV.fZ); else - log += " AngV=None"; + log << " AngV=None"; if (isRotSet) - log += plString::Format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW); + log << plFormat(" Rot={.1f} {.1f} {.1f} {.1f}", rot.fX, rot.fY, rot.fZ, rot.fW); else - log += " Rot=None"; + log << " Rot=None"; - IGetLog()->AddLine(log.c_str(), color); + IGetLog()->AddLine(log.GetString().c_str(), color); } plStatusLog* plPhysicalSDLModifier::IGetLog() diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp index 6b78fbc6..d466513f 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp @@ -437,14 +437,14 @@ plString plSimpleStateVariable::GetAsString(int idx) const else if (type==plVarDescriptor::kByte) str << fBy[i++]; else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) - str << plString::Format( "%.3f", fF[i++]); + str << plFormat("{.3f}", fF[i++]); else if (type==plVarDescriptor::kDouble) - str << plString::Format( "%.3f", fD[i++]); + str << plFormat("{.3f}", fD[i++]); else if (type==plVarDescriptor::kTime) { double tmp; Get(&tmp, i++); - str << plString::Format( "%.3f", tmp); + str << plFormat("{.3f}", tmp); } if (j==fVar.GetAtomicCount()-1) diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp index 54fd6241..02fad6b6 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp @@ -715,21 +715,22 @@ bool plStatusLog::IPrintLineToFile( const char *line, uint32_t count ) } - if ( fFlags & kDebugOutput ) + plString out_str = plString::FromUtf8(line, count) + "\n"; + if (fFlags & kDebugOutput) { + #if HS_BUILD_FOR_WIN32 #ifndef PLASMA_EXTERNAL_RELEASE - plString str = plString::Format( "%.*s\n", count, line ); - OutputDebugString( str.c_str() ); + OutputDebugString(out_str.c_str()); #endif #else - fprintf( stderr, "%.*s\n", count, line ); + fputs(str.c_str(), str); #endif } - if ( fFlags & kStdout ) + if (fFlags & kStdout) { - fprintf( stdout, "%.*s\n", count, line ); + fputs(out_str.c_str(), stdout); } return ret; diff --git a/Sources/Tools/MaxConvert/plBitmapCreator.cpp b/Sources/Tools/MaxConvert/plBitmapCreator.cpp index 26925834..1503acdb 100644 --- a/Sources/Tools/MaxConvert/plBitmapCreator.cpp +++ b/Sources/Tools/MaxConvert/plBitmapCreator.cpp @@ -538,11 +538,11 @@ plBitmap *plBitmapCreator::ICreateTexture( plBitmapData *bd, const plLocation &l { // Mangle of the form: name@dropStart&dropStop&max&min if( clipID != -1 ) - name = plString::Format( "%s*%x#%d@%s&%3.2f&%3.2f&%3.2f&%3.2f", temp.c_str(), bd->texFlags, clipID, + name = plFormat("{}*{x}#{}@{}&{3.2f}&{3.2f}&{3.2f}&{3.2f}", temp, bd->texFlags, clipID, bd->createFlags & plMipmap::kCreateDetailAlpha ? "al" : ( bd->createFlags & plMipmap::kCreateDetailAdd ? "ad" : "mu" ), bd->detailDropoffStart, bd->detailDropoffStop, bd->detailMax, bd->detailMin ); else - name = plString::Format( "%s*%x@%s&%3.2f&%3.2f&%3.2f&%3.2f", temp.c_str(), bd->texFlags, + name = plFormat("{}*{x}@{}&{3.2f}&{3.2f}&{3.2f}&{3.2f}", temp, bd->texFlags, bd->createFlags & plMipmap::kCreateDetailAlpha ? "al" : ( bd->createFlags == plMipmap::kCreateDetailAdd ? "ad" : "mu" ), bd->detailDropoffStart, bd->detailDropoffStop, bd->detailMax, bd->detailMin ); }