mirror of https://github.com/OpenTTD/OpenTTD
Codefix: move or pass by reference instead of copy
parent
754311a779
commit
18e1440947
|
@ -454,7 +454,7 @@ static bool RealMakeScreenshot(ScreenshotType t, const std::string &name, uint32
|
||||||
* @return true iff the screenshot was successfully made.
|
* @return true iff the screenshot was successfully made.
|
||||||
* @see MakeScreenshotWithConfirm
|
* @see MakeScreenshotWithConfirm
|
||||||
*/
|
*/
|
||||||
bool MakeScreenshot(ScreenshotType t, std::string name, uint32_t width, uint32_t height)
|
bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width, uint32_t height)
|
||||||
{
|
{
|
||||||
if (t == SC_CRASHLOG) {
|
if (t == SC_CRASHLOG) {
|
||||||
/* Video buffer might or might not be locked. */
|
/* Video buffer might or might not be locked. */
|
||||||
|
|
|
@ -26,7 +26,7 @@ enum ScreenshotType : uint8_t {
|
||||||
void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32_t width = 0, uint32_t height = 0);
|
void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32_t width = 0, uint32_t height = 0);
|
||||||
bool MakeHeightmapScreenshot(const char *filename);
|
bool MakeHeightmapScreenshot(const char *filename);
|
||||||
void MakeScreenshotWithConfirm(ScreenshotType t);
|
void MakeScreenshotWithConfirm(ScreenshotType t);
|
||||||
bool MakeScreenshot(ScreenshotType t, std::string name, uint32_t width = 0, uint32_t height = 0);
|
bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width = 0, uint32_t height = 0);
|
||||||
bool MakeMinimapWorldScreenshot();
|
bool MakeMinimapWorldScreenshot();
|
||||||
|
|
||||||
extern std::string _screenshot_format_name;
|
extern std::string _screenshot_format_name;
|
||||||
|
|
|
@ -91,7 +91,7 @@ bool ScriptAdminMakeJSON(nlohmann::json &json, HSQUIRRELVM vm, SQInteger index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
json[key] = std::move(value);
|
json[std::move(key)] = std::move(value);
|
||||||
}
|
}
|
||||||
sq_pop(vm, 1);
|
sq_pop(vm, 1);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue