diff --git a/src/audio_generic.cpp b/src/audio_generic.cpp index 6985cd0dc9..8eba6bdc8d 100644 --- a/src/audio_generic.cpp +++ b/src/audio_generic.cpp @@ -458,7 +458,7 @@ void GenericAudio::Decode(uint8_t* output_buffer, int buffer_length) { if (channel_active) { if (total_volume > 1.0) { - float threshold = 0.8; + float threshold = 0.8f; for (unsigned i = 0; i < (unsigned)(samples_per_frame * 2); i++) { float sample = mixer_buffer[i]; float sign = (sample < 0) ? -1.0 : 1.0; diff --git a/src/fileext_guesser.cpp b/src/fileext_guesser.cpp index 756ea27412..568e891960 100644 --- a/src/fileext_guesser.cpp +++ b/src/fileext_guesser.cpp @@ -22,7 +22,7 @@ #include "meta.h" #include "output.h" #include "string_view.h" - +#include namespace { const std::string RtPrefix = "rpg_rt."; diff --git a/src/game_ineluki.h b/src/game_ineluki.h index 8bd49bbc5b..80a46cbd38 100644 --- a/src/game_ineluki.h +++ b/src/game_ineluki.h @@ -22,6 +22,7 @@ #include #include #include +#include #include diff --git a/src/maniac_patch.cpp b/src/maniac_patch.cpp index dcc00b6edf..92dc26361e 100644 --- a/src/maniac_patch.cpp +++ b/src/maniac_patch.cpp @@ -668,6 +668,16 @@ std::array ManiacPatch::GetKeyRange() { pressed[i] = Input::IsRawKeyPressed(keys[i]); } + if (!pressed[41]) { + pressed[41] = Input::IsRawKeyPressed(Input::Keys::LSHIFT) || Input::IsRawKeyPressed(Input::Keys::RSHIFT); + } + if (!pressed[42]) { + pressed[42] = Input::IsRawKeyPressed(Input::Keys::LCTRL) || Input::IsRawKeyPressed(Input::Keys::RCTRL); + } + if (!pressed[43]) { + pressed[43] = Input::IsRawKeyPressed(Input::Keys::LALT) || Input::IsRawKeyPressed(Input::Keys::RALT); + } + return pressed; } diff --git a/src/scene_gamebrowser.cpp b/src/scene_gamebrowser.cpp index 0299565395..0acf02fbe9 100644 --- a/src/scene_gamebrowser.cpp +++ b/src/scene_gamebrowser.cpp @@ -60,6 +60,8 @@ void Scene_GameBrowser::Continue(SceneType /* prev_scene */) { Player::game_title = ""; Player::game_title_original = ""; + Player::translation.Reset(); + Font::ResetDefault(); Main_Data::game_system = std::make_unique(); diff --git a/src/translation.h b/src/translation.h index 1bbe6c6c2f..02f2b00d3d 100644 --- a/src/translation.h +++ b/src/translation.h @@ -225,15 +225,14 @@ class Translation { */ const Language& GetDefaultLanguage() const; - -private: - void SelectLanguageAsync(FileRequestResult* result, std::string_view lang_id); - /** * Reset all saved language data and revert to "no translation". */ void Reset(); +private: + void SelectLanguageAsync(FileRequestResult* result, std::string_view lang_id); + /** * Reset all lookups loaded from .po files for the active language. */ diff --git a/src/utils.cpp b/src/utils.cpp index 39fc77dc07..8600ddb359 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -17,15 +17,14 @@ // Headers #include "utils.h" -#include "output.h" #include "compiler.h" #include #include #include #include #include -#include #include +#include #include namespace { diff --git a/src/utils.h b/src/utils.h index b219da6467..01804acb2e 100644 --- a/src/utils.h +++ b/src/utils.h @@ -22,9 +22,7 @@ #include #include #include -#include #include -#include #include "string_view.h" #include "span.h" @@ -439,7 +437,8 @@ inline bool Utils::IsControlCharacter(T ch) { inline bool Utils::StringIsAscii(std::string_view s) { return std::all_of(s.begin(), s.end(), [](char c) { - return isascii(static_cast(c)); + // non-ascii is for signed char in range [-128, 0) + return c >= 0; }); } diff --git a/src/window_input_settings.cpp b/src/window_input_settings.cpp index def2e4803f..350ed93f8f 100644 --- a/src/window_input_settings.cpp +++ b/src/window_input_settings.cpp @@ -20,7 +20,7 @@ #include "bitmap.h" #include "input_buttons.h" #include "window_selectable.h" - +#include Window_InputSettings::Window_InputSettings(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight) { diff --git a/tests/json.cpp b/tests/json.cpp index 65eb4ac392..6212b341e8 100644 --- a/tests/json.cpp +++ b/tests/json.cpp @@ -1,10 +1,11 @@ #include "doctest.h" #include "json_helper.h" #include -#include #ifdef HAVE_NLOHMANN_JSON +#include + TEST_SUITE_BEGIN("JSON"); json load(std::string_view file) {