mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-27 01:44:31 +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];
|
char signText[256];
|
||||||
sprintf(signText, "%s", text.substr(0, 255).c_str());
|
sprintf(signText, "%s", text.substr(0, 255).c_str());
|
||||||
|
|
||||||
|
if(signText[0] && signText[0] == '{')
|
||||||
|
{
|
||||||
if (!strcmp(signText,"{p}"))
|
if (!strcmp(signText,"{p}"))
|
||||||
{
|
{
|
||||||
float pressure = 0.0f;
|
float pressure = 0.0f;
|
||||||
@@ -42,6 +44,11 @@ std::string sign::getText(Simulation *sim)
|
|||||||
else
|
else
|
||||||
strcpy(buff, signText);
|
strcpy(buff, signText);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy(buff, signText);
|
||||||
|
}
|
||||||
|
|
||||||
return std::string(buff);
|
return std::string(buff);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user