mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
more Android Support!
This commit is contained in:
parent
767fc50cf5
commit
82c70b1a73
4 changed files with 22 additions and 13 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -165,13 +165,16 @@ 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";
|
||||
game.scripts = "Data/xScripts.rxdata";
|
||||
|
||||
|
||||
if(defScreenW == 640 || defScreenH == 480){
|
||||
if (EnableSixteenByNine){
|
||||
defScreenW = 1280;
|
||||
|
|
|
|||
|
|
@ -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,12 +288,11 @@ 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);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern int screenMain(Config &conf);
|
||||
|
|
|
|||
22
src/meow.cpp
22
src/meow.cpp
|
|
@ -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,
|
||||
|
|
@ -104,7 +102,7 @@ void crash(Exception::Type t, const char *fmt, ...){
|
|||
out << "SDL_TTF(compiled) version: " << SDL_TTF_MAJOR_VERSION << "." << SDL_TTF_MINOR_VERSION << "." << SDL_TTF_MICRO_VERSION << std::endl;
|
||||
out << "Ruby version: " << RUBY_API_VERSION_CODE << std::endl;
|
||||
out << "ZLib version: " << ZLIB_VERSION << std::endl;
|
||||
out << "OpenAL version: " << AL_VERSION << std::endl;
|
||||
out << "OpenAL version: " << AL_VERSION << std::endl;
|
||||
out << "Boost versino: " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl;
|
||||
out << "Pixman version: " << PIXMAN_VERSION_STRING << std::endl;
|
||||
out << "[Platform specific]" << std::endl;
|
||||
|
|
@ -114,18 +112,28 @@ void crash(Exception::Type t, const char *fmt, ...){
|
|||
out << "Detected OS: " << e.what() << std::endl;
|
||||
}
|
||||
if(!getenv("XDG_CURRENT_DESKTOP") == NULL){
|
||||
out << "Desktop enviroment(XDG_CURRENT_DESKTOP): " << getenv("XDG_CURRENT_DESKTOP") << std::endl;
|
||||
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;
|
||||
out << "Emscripten current stack pointer: " << emscripten_stack_get_current() << std::endl;
|
||||
out << "Emscripten number of free bytes left on the stack: " << emscripten_stack_get_free() << std::endl;
|
||||
#elif __PSP__
|
||||
out << "PSPdev MIPS Stack Trace: " << int pspDebugGetStackTrace() << std::endl;
|
||||
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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue