Fixing bug with save game, sounds, and some hints are out of screen on Android
This commit is contained in:
1 parent
9f812f0318
commit
6406c4f258
9 files changed
+24
-16
No files matched your search
@@ -106,7 +106,7 @@ void AudioPlayerAsync::playSoundAsync(const std::string& filePath, int loops, in
|
||||
return;
|
||||
}
|
||||
sound = Mix_LoadWAV_RW(rw, 1); // 1 means it will free rw automatically
|
||||
FRG::logger() << "sound = Mix_LoadWAV_RW(rw, 1); just fired " << std::endl;
|
||||
//FRG::logger() << "sound = Mix_LoadWAV_RW(rw, 1); just fired " << std::endl;
|
||||
|
||||
#else
|
||||
sound = Mix_LoadWAV(filePath.c_str());
|
||||
|
||||
+1
-1
@@ -1217,7 +1217,7 @@ namespace FRG
|
||||
|
||||
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_RESIZED) {
|
||||
const bool wasPortrait = Environment::width < Environment::height;
|
||||
//FRG::logger() << "Window resized" << std::endl;
|
||||
FRG::logger() << "Window resized" << std::endl;
|
||||
if (Environment::isHighDPIEnabled) {
|
||||
// Если High DPI включен, запрашиваем реальное физическое разрешение буфера
|
||||
int drawW, drawH;
|
||||
|
||||
+12
-4
@@ -234,11 +234,11 @@ namespace FRG
|
||||
return file.good();
|
||||
}
|
||||
else {
|
||||
std::cerr << "[settings] Could not open " << filePath << " for writing" << std::endl;
|
||||
logger() << "[settings] Could not open " << filePath << " for writing" << std::endl;
|
||||
}
|
||||
}
|
||||
catch (const fs::filesystem_error& e) {
|
||||
std::cerr << "[settings] Filesystem error: " << e.what() << std::endl;
|
||||
logger() << "[settings] Filesystem error: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -254,6 +254,14 @@ namespace FRG
|
||||
// Для Web монтируем IDBFS обычно в локальную папку /offline или /home/webuser
|
||||
// Чтобы не усложнять иерархию в IndexedDB, можно использовать фиксированный корень
|
||||
baseDir = "/offline";
|
||||
#elif defined(__ANDROID__)
|
||||
char* prefPath = SDL_GetPrefPath("Fish Run Games", "Shadow Over Bishkek Demo");
|
||||
if (prefPath) {
|
||||
fs::path p(prefPath);
|
||||
SDL_free(prefPath);
|
||||
return p;
|
||||
}
|
||||
baseDir = fs::current_path();
|
||||
#elif defined(_WIN32)
|
||||
wchar_t* appDataPath = nullptr;
|
||||
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &appDataPath))) {
|
||||
@@ -294,7 +302,7 @@ namespace FRG
|
||||
|
||||
std::ifstream f(filePath, std::ios::in | std::ios::binary);
|
||||
if (!f.is_open()) {
|
||||
std::cerr << "[settings] Could not open " << filePath << " for reading" << std::endl;
|
||||
logger() << "[settings] Could not open " << filePath << " for reading" << std::endl;
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -303,7 +311,7 @@ namespace FRG
|
||||
std::istreambuf_iterator<char>());
|
||||
}
|
||||
catch (const fs::filesystem_error& e) {
|
||||
std::cerr << "[settings] Filesystem error during read: " << e.what() << std::endl;
|
||||
logger() << "[settings] Filesystem error during read: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
return "";
|
||||
|
||||
Reference in new issue
Block a user