mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-26 17:34:35 +02:00
Minute performance improvement for Sign.getText
This commit is contained in:
@@ -17,6 +17,8 @@ std::string sign::getText(Simulation *sim)
|
||||
char signText[256];
|
||||
sprintf(signText, "%s", text.substr(0, 255).c_str());
|
||||
|
||||
if(signText[0] && signText[0] == '{')
|
||||
{
|
||||
if (!strcmp(signText,"{p}"))
|
||||
{
|
||||
float pressure = 0.0f;
|
||||
@@ -42,6 +44,11 @@ std::string sign::getText(Simulation *sim)
|
||||
else
|
||||
strcpy(buff, signText);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(buff, signText);
|
||||
}
|
||||
|
||||
return std::string(buff);
|
||||
}
|
||||
|
Reference in New Issue
Block a user