1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Cleanup: Don't pass a writable scratch buffer off to dozens of virtual

functions -- that's just silly!
This commit is contained in:
2014-01-09 20:14:16 -08:00
parent b865e8c9f2
commit 8323758d33
24 changed files with 112 additions and 275 deletions

View File

@ -896,28 +896,19 @@ bool plAvBrainHuman::LeaveAge()
return false;
}
void plAvBrainHuman::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *strBuf, plDebugText &debugTxt)
void plAvBrainHuman::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugText &debugTxt)
{
sprintf(strBuf, "Brain type: Human");
debugTxt.DrawString(x, y, strBuf);
debugTxt.DrawString(x, y, "Brain type: Human");
y += lineHeight;
const char *grounded = fWalkingStrategy->IsOnGround() ? "yes" : "no";
const char *pushing = (fWalkingStrategy->GetPushingPhysical() ? (fWalkingStrategy->GetFacingPushingPhysical() ? "facing" : "behind") : "none");
sprintf(strBuf, "Ground: %3s, AirTime: %5.2f (Peak: %5.2f), PushingPhys: %6s",
grounded, fWalkingStrategy->GetAirTime(), fWalkingStrategy->GetImpactTime(), pushing);
debugTxt.DrawString(x, y, strBuf);
debugTxt.DrawString(x, y, plString::Format("Ground: %3s, AirTime: %5.2f (Peak: %5.2f), PushingPhys: %6s",
grounded, fWalkingStrategy->GetAirTime(), fWalkingStrategy->GetImpactTime(), pushing));
y += lineHeight;
int i;
//strBuf[0] = '\0';
//for (i = 0; i < 32; i++)
// strcat(strBuf, fPreconditions & (0x1 << i) ? "1" : "0");
//debugTxt.DrawString(x, y, strBuf);
//y += lineHeight;
for (i = 0; i < fBehaviors.GetCount(); i++)
fBehaviors[i]->DumpDebug(x, y, lineHeight, strBuf, debugTxt);
for (int i = 0; i < fBehaviors.GetCount(); i++)
fBehaviors[i]->DumpDebug(x, y, lineHeight, debugTxt);
debugTxt.DrawString(x, y, "Tasks:");
y += lineHeight;
@ -928,7 +919,7 @@ void plAvBrainHuman::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *st
y += lineHeight;
int indentedX = x + 4;
fCurTask->DumpDebug("-", indentedX, y, lineHeight, strBuf, debugTxt);
fCurTask->DumpDebug("-", indentedX, y, lineHeight, debugTxt);
}
int tasks = fTaskQueue.size();
if(tasks > 0)
@ -941,7 +932,7 @@ void plAvBrainHuman::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *st
for (int i = 0; i < tasks; i++)
{
plAvTask *each = fTaskQueue[i];
each->DumpDebug("-", indentedX, y, lineHeight, strBuf, debugTxt);
each->DumpDebug("-", indentedX, y, lineHeight, debugTxt);
}
}
}