more Android Support!

This commit is contained in:
whitecum1488 2026-07-02 22:16:31 +03:00
parent 767fc50cf5
commit 82c70b1a73
4 changed files with 22 additions and 13 deletions

View file

@ -25,7 +25,7 @@
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<string>11</string>
<key>LSBackgroundOnly</key>
<string>0</string>
<key>NSHumanReadableCopyright</key>

View file

@ -165,8 +165,11 @@ void Config::read(int argc, char *argv[]){
#undef PO_DESC_ALL
SE.sourceCount = clamp(SE.sourceCount, 1, 64);
#ifdef __ANDROID__
commonDataPath = prefPath(SDL_GetAndroidInternalStoragePath(), "/Sunshine");
#else
commonDataPath = prefPath(".", "Sunshine");
#endif
if(windowTitle == "")
game.title = "OneShot: Sunshine";

View file

@ -280,7 +280,6 @@ int main(int argc, char *argv[]){
}
#endif
if (!conf.gameFolder.empty()){
if (chdir(conf.gameFolder.c_str()) != 0){
crash(Exception::MEOW, "Unable to switch into gameFolder %s", conf.gameFolder);
@ -289,7 +288,6 @@ int main(int argc, char *argv[]){
}
std::string new_path = ModLoader(conf);
if(new_path != ""){
if (chdir(new_path.c_str()) != 0){
crash(Exception::MEOW, "Unable to switch into new gameFolder %s", new_path);

View file

@ -6,7 +6,6 @@
#include <SDL3_sound/SDL_sound.h>
#include <SDL3_ttf/SDL_ttf.h>
#include <SDL3/SDL_video.h>
#include "meow.h"
#include "eventthread.h"
#include "exception.h"
@ -23,7 +22,7 @@
#include <boost/version.hpp>
#include <physfs.h>
#include <pixman.h>
#include <SDL3/SDL_system.h>
#include <boost/stacktrace.hpp>
#ifdef __LINUX__
@ -56,7 +55,6 @@ void crash(Exception::Type t, const char *fmt, ...){
char *buf = (char*)SDL_malloc((size_t)len + 1);
SDL_vsnprintf(buf, (size_t)len + 1, fmt, args);
va_end(args);
SDL_snprintf(msg, sizeof msg, "Error occured! Error message: %s\n\n Want to create a crash log? You can share the crash log with the developers and help resolve the issue.", buf);
SDL_MessageBoxData messageboxdata = {
.flags = SDL_MESSAGEBOX_ERROR,
@ -117,7 +115,11 @@ void crash(Exception::Type t, const char *fmt, ...){
out << "Desktop enviroment(XDG_CURRENT_DESKTOP): " << getenv("XDG_CURRENT_DESKTOP") << std::endl;
}
#ifdef __ANDROID__
out << "Android API version: " << android_get_device_api_level() << std::endl;
out << "Android API version: " << android_get_device_api_level() << std::endl; out << "External storage State: " << SDL_GetAndroidExternalStorageState() << std::endl;
out << "Internal storage path: " << SDL_GetAndroidInternalStoragePath() << std::endl;
out << "External Storage path: " << SDL_GetAndroidExternalStoragePath() << ats::endl;
out << "Cache path: " << SDL_GetAndroidCachePath() << std::endl;
out << "
#elif __EMSCRIPTEN__
out << "Emscripten start address of the stack: " << emscripten_stack_get_base() << std::endl;
out << "Emscripten end address of the stack: " << emscripten_stack_get_end() << std::endl;
@ -126,6 +128,12 @@ void crash(Exception::Type t, const char *fmt, ...){
#elif __PSP__
out << "PSPdev MIPS Stack Trace: " << int pspDebugGetStackTrace() << std::endl;
#endif
out << "Is ChromeBook? " << SDL_IsChromebook() << std::endl;
out << "Is Phone? " << SDL_IsPhone() << std::endl;
out << "Is Tablet? " << SDL_IsTablet() << std::endl;
out << "Is Samsung DeX? " << SDL_IsDeXMode() << std::endl;
out << "Is TV? " << SDL_IsTV() << std::endl;
out << "Is Ubuntu Touch? " << SDL_IsUbuntuTouch() << std::endl;
out.close();
}else{
Debug() << "[CRASHLOG] Failed to write crashdump file";