Codechange: add SetDParamStr that accepts std::string&
This commit is contained in:
@@ -296,6 +296,17 @@ void SetDParamStr(uint n, const char *str)
|
||||
SetDParam(n, (uint64)(size_t)str);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to "bind" the C string of a std::string to a OpenTTD dparam slot.
|
||||
* The caller has to ensure that the std::string reference remains valid while the string is shown.
|
||||
* @param n slot of the string
|
||||
* @param str string to bind
|
||||
*/
|
||||
void SetDParamStr(uint n, const std::string &str)
|
||||
{
|
||||
SetDParamStr(n, str.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
* Shift the string parameters in the global string parameter array by \a amount positions, making room at the beginning.
|
||||
* @param amount Number of positions to shift.
|
||||
|
||||
Reference in New Issue
Block a user