diff --git a/src/scripted_input/script_runner.cpp b/src/scripted_input/script_runner.cpp index c60c9302b..eeb0152e9 100644 --- a/src/scripted_input/script_runner.cpp +++ b/src/scripted_input/script_runner.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "common/logging/log.h" #include "scripted_input/script_runner.h" #include "scripted_input/scripted_buttons.h" @@ -123,20 +124,32 @@ void ScriptRunner::SaveScreenshot() { // https://web.archive.org/web/20080912171714/http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html int image_bytes = (w * h * 3); int size = 14 + 40 + image_bytes; - unsigned char file_header[14] = {'B', 'M', size, size >> 8, size >> 16, size >> 24, 0, - 0, 0, 0, 14 + 40, 0, 0, 0}; + unsigned char file_header[14] = {'B', + 'M', + static_cast(size), + static_cast(size >> 8), + static_cast(size >> 16), + static_cast(size >> 24), + 0, + 0, + 0, + 0, + 14 + 40, + 0, + 0, + 0}; unsigned char info_header[40] = {40, 0, 0, 0, - w, - w >> 8, - w >> 16, - w >> 24, - h, - h >> 8, - h >> 16, - h >> 24, + static_cast(w), + static_cast(w >> 8), + static_cast(w >> 16), + static_cast(w >> 24), + static_cast(h), + static_cast(h >> 8), + static_cast(h >> 16), + static_cast(h >> 24), 1, 0, 24, @@ -145,10 +158,10 @@ void ScriptRunner::SaveScreenshot() { 0, 0, 0, - image_bytes, - image_bytes >> 8, - image_bytes >> 16, - image_bytes >> 24, + static_cast(image_bytes), + static_cast(image_bytes >> 8), + static_cast(image_bytes >> 16), + static_cast(image_bytes >> 24), 0, 0, 0, diff --git a/src/scripted_input/script_runner.h b/src/scripted_input/script_runner.h index b20f5e4c8..e7a4d49c4 100644 --- a/src/scripted_input/script_runner.h +++ b/src/scripted_input/script_runner.h @@ -4,6 +4,7 @@ #pragma once +#include #include "core/frontend/input.h" #include "scripted_input/scripted_buttons.h" diff --git a/src/scripted_input/scripted_buttons.cpp b/src/scripted_input/scripted_buttons.cpp index 59f3d5718..40c484bc2 100644 --- a/src/scripted_input/scripted_buttons.cpp +++ b/src/scripted_input/scripted_buttons.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include #include "scripted_input/scripted_buttons.h" const int button_count = 15; @@ -70,7 +71,7 @@ void ScriptedButtons::SetActiveButtons(const std::vector& buttons_active) { LOG_ERROR( ScriptedInput, "Button %s isn't mapped but is scripted, it should have engine:scripted,button:%s", - button_name_to_index[i], button_name_to_index[i]); + button_name_to_index[i].c_str(), button_name_to_index[i].c_str()); } } }