This commit is contained in:
parent
84e5d24398
commit
5352c63336
|
|
@ -17,7 +17,6 @@ end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
RPG::Mod.exec_hooks("hooks/Main/start", binding)
|
RPG::Mod.exec_hooks("hooks/Main/start", binding)
|
||||||
print PhysFS.exist?("gaysex")
|
|
||||||
$console = Graphics.fullscreen
|
$console = Graphics.fullscreen
|
||||||
Graphics.frame_rate = 60
|
Graphics.frame_rate = 60
|
||||||
Font.default_size = 20
|
Font.default_size = 20
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ void Config::read(int argc, char *argv[]){
|
||||||
#define PO_DESC_ALL \
|
#define PO_DESC_ALL \
|
||||||
PO_DESC(debugMode, bool, false) \
|
PO_DESC(debugMode, bool, false) \
|
||||||
PO_DESC(screenMode, bool, false) \
|
PO_DESC(screenMode, bool, false) \
|
||||||
PO_DESC(printFPS, bool, false) \
|
|
||||||
PO_DESC(fullscreen, bool, false) \
|
PO_DESC(fullscreen, bool, false) \
|
||||||
PO_DESC(fixedAspectRatio, bool, true) \
|
PO_DESC(fixedAspectRatio, bool, true) \
|
||||||
PO_DESC(smoothScaling, bool, false) \
|
PO_DESC(smoothScaling, bool, false) \
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ void EventThread::process(RGSSThreadData &rtData){
|
||||||
case SDL_EVENT_QUIT:
|
case SDL_EVENT_QUIT:
|
||||||
if (rtData.allowExit) {
|
if (rtData.allowExit) {
|
||||||
terminate = true;
|
terminate = true;
|
||||||
Debug() << "[EventThread::process] EventThread termination requested";
|
Debug() << "EventThread termination requested";
|
||||||
} else {
|
} else {
|
||||||
rtData.triedExit.set();
|
rtData.triedExit.set();
|
||||||
}
|
}
|
||||||
|
|
@ -530,7 +530,6 @@ void EventThread::setFullscreen(SDL_Window *win, bool mode){
|
||||||
void EventThread::updateCursorState(bool inWindow, const SDL_Rect &screen){
|
void EventThread::updateCursorState(bool inWindow, const SDL_Rect &screen){
|
||||||
SDL_Point pos = { mouseState.x, mouseState.y };
|
SDL_Point pos = { mouseState.x, mouseState.y };
|
||||||
bool inScreen = inWindow && SDL_PointInRect(&pos, &screen);
|
bool inScreen = inWindow && SDL_PointInRect(&pos, &screen);
|
||||||
|
|
||||||
if (inScreen)
|
if (inScreen)
|
||||||
SDL_ShowCursor();
|
SDL_ShowCursor();
|
||||||
else
|
else
|
||||||
|
|
|
||||||
10
src/main.cpp
10
src/main.cpp
|
|
@ -264,7 +264,6 @@ int main(int argc, char *argv[]){
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* OSX and Windows have their own native ways of
|
/* OSX and Windows have their own native ways of
|
||||||
* dealing with icons; don't interfere with them */
|
* dealing with icons; don't interfere with them */
|
||||||
#ifdef unix_like
|
#ifdef unix_like
|
||||||
|
|
@ -279,7 +278,6 @@ int main(int argc, char *argv[]){
|
||||||
spec.freq = 44100;
|
spec.freq = 44100;
|
||||||
|
|
||||||
MIX_Mixer* mixer = MIX_CreateMixerDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec);
|
MIX_Mixer* mixer = MIX_CreateMixerDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec);
|
||||||
|
|
||||||
if (!mixer){
|
if (!mixer){
|
||||||
SDL_DestroyWindow(win);
|
SDL_DestroyWindow(win);
|
||||||
WarnMsg("Error creating Mixer Device, check your system audio configuration");
|
WarnMsg("Error creating Mixer Device, check your system audio configuration");
|
||||||
|
|
@ -307,12 +305,7 @@ int main(int argc, char *argv[]){
|
||||||
/* Load and post key bindings */
|
/* Load and post key bindings */
|
||||||
rtData.bindingUpdateMsg.post(loadBindings(conf));
|
rtData.bindingUpdateMsg.post(loadBindings(conf));
|
||||||
/* Start RGSS thread */
|
/* Start RGSS thread */
|
||||||
try{
|
|
||||||
SDL_Thread *rgssThread = SDL_CreateThread(rgssThreadFun, "rgss", &rtData);
|
SDL_Thread *rgssThread = SDL_CreateThread(rgssThreadFun, "rgss", &rtData);
|
||||||
if(rgssThread){
|
|
||||||
WarnMsg("Thread creation failed: %s", SDL_GetError());
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* Start event processing */
|
/* Start event processing */
|
||||||
eventThread.process(rtData);
|
eventThread.process(rtData);
|
||||||
|
|
||||||
|
|
@ -347,9 +340,6 @@ int main(int argc, char *argv[]){
|
||||||
|
|
||||||
unloadLocale();
|
unloadLocale();
|
||||||
unloadLanguageMetadata();
|
unloadLanguageMetadata();
|
||||||
}catch(const char* msg){
|
|
||||||
ErrorMsg(msg);
|
|
||||||
}
|
|
||||||
if(show_crash_sceen){
|
if(show_crash_sceen){
|
||||||
crash_screen(win);
|
crash_screen(win);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
90
src/meow.cpp
90
src/meow.cpp
|
|
@ -24,6 +24,7 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <ios>
|
||||||
#include <ruby/version.h>
|
#include <ruby/version.h>
|
||||||
#include <ruby/internal/interpreter.h>
|
#include <ruby/internal/interpreter.h>
|
||||||
#undef vsnprintf
|
#undef vsnprintf
|
||||||
|
|
@ -48,6 +49,7 @@
|
||||||
#include "crash.png.xxd"
|
#include "crash.png.xxd"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
//help functions
|
||||||
static inline const char* glGetStringInt(GLenum name){
|
static inline const char* glGetStringInt(GLenum name){
|
||||||
return (const char*) gl.GetString(name);
|
return (const char*) gl.GetString(name);
|
||||||
}
|
}
|
||||||
|
|
@ -72,6 +74,53 @@ static inline const char* glGetStringInt(GLenum name){
|
||||||
#define COMPILER_VER "n/a"
|
#define COMPILER_VER "n/a"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// https://stackoverflow.com/questions/152016/detecting-cpu-architecture-compile-time
|
||||||
|
const static char* get_processor(){
|
||||||
|
#if defined(__x86_64__) || defined(_M_X64)
|
||||||
|
return "x86_64";
|
||||||
|
#elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86)
|
||||||
|
return "x86_32";
|
||||||
|
#elif defined(__ARM_ARCH_2__)
|
||||||
|
return "ARM2";
|
||||||
|
#elif defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__)
|
||||||
|
return "ARM3";
|
||||||
|
#elif defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T)
|
||||||
|
return "ARM4T";
|
||||||
|
#elif defined(__ARM_ARCH_5_) || defined(__ARM_ARCH_5E_)
|
||||||
|
return "ARM5"
|
||||||
|
#elif defined(__ARM_ARCH_6T2_) || defined(__ARM_ARCH_6T2_)
|
||||||
|
return "ARM6T2";
|
||||||
|
#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
|
||||||
|
return "ARM6";
|
||||||
|
#elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
|
||||||
|
return "ARM7";
|
||||||
|
#elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
|
||||||
|
return "ARM7A";
|
||||||
|
#elif defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)
|
||||||
|
return "ARM7R";
|
||||||
|
#elif defined(__ARM_ARCH_7M__)
|
||||||
|
return "ARM7M";
|
||||||
|
#elif defined(__ARM_ARCH_7S__)
|
||||||
|
return "ARM7S";
|
||||||
|
#elif defined(__aarch64__) || defined(_M_ARM64)
|
||||||
|
return "ARM64";
|
||||||
|
#elif defined(mips) || defined(__mips__) || defined(__mips)
|
||||||
|
return "MIPS";
|
||||||
|
#elif defined(__sh__)
|
||||||
|
return "SUPERH";
|
||||||
|
#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) || defined(__POWERPC__) || defined(__ppc__) || defined(__PPC__) || defined(_ARCH_PPC)
|
||||||
|
return "POWERPC";
|
||||||
|
#elif defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
|
||||||
|
return "POWERPC64";
|
||||||
|
#elif defined(__sparc__) || defined(__sparc)
|
||||||
|
return "SPARC";
|
||||||
|
#elif defined(__m68k__)
|
||||||
|
return "M68K";
|
||||||
|
#else
|
||||||
|
return "UNKNOWN";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void get_reason_and_solution(Exception::Type t) {
|
static void get_reason_and_solution(Exception::Type t) {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case Exception::ModLoaderError:
|
case Exception::ModLoaderError:
|
||||||
|
|
@ -139,8 +188,9 @@ void crash(Exception::Type t, const char *fmt, ...) {
|
||||||
get_reason_and_solution(t);
|
get_reason_and_solution(t);
|
||||||
show_crash_sceen = true;
|
show_crash_sceen = true;
|
||||||
//Protect against segfaults
|
//Protect against segfaults
|
||||||
if(is_ruby_initialized)
|
if(is_ruby_initialized){
|
||||||
ruby_stop(-1);
|
ruby_stop(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void crash_screen(SDL_Window* win){
|
void crash_screen(SDL_Window* win){
|
||||||
|
|
@ -179,30 +229,26 @@ void crash_screen(SDL_Window* win){
|
||||||
//collecting info and writing to crashdump
|
//collecting info and writing to crashdump
|
||||||
if (o.is_open()){
|
if (o.is_open()){
|
||||||
#ifdef DEVBUILD
|
#ifdef DEVBUILD
|
||||||
o << "EXPEREMENTAL BUILD" << endl;
|
o << "EXPEREMENTAL BUILD\n";
|
||||||
#endif
|
#endif
|
||||||
o << "VERSION: " << VERSION_STRING << endl;
|
o << "VERSION: " << VERSION_STRING << endl;
|
||||||
o << "REASON: " << crash_message << endl;
|
o << "REASON: " << crash_message << endl;
|
||||||
o << "Compiler info: " << COMPILER_NAME << " " << COMPILER_VER << endl << endl;
|
o << "Compiler info: " << COMPILER_NAME << " " << COMPILER_VER << endl << endl;
|
||||||
|
o << "[BOOST stacktrace()]\n\n";
|
||||||
o << "[BOOST stacktrace()]" << endl << endl;
|
|
||||||
o << boost::stacktrace::stacktrace() << endl;
|
o << boost::stacktrace::stacktrace() << endl;
|
||||||
|
|
||||||
o << "[LOG BUFFER]" << endl << endl;
|
o << "[LOG BUFFER]\n\n";
|
||||||
for (const auto& s : logs) {
|
for (const auto& s : logs) {
|
||||||
o << s << endl;
|
o << s << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
o << endl;
|
o << "\n[AUDIO]\n";
|
||||||
o << "[AUDIO]" << endl;
|
|
||||||
o << "Driver used: " << SDL_GetCurrentAudioDriver() << endl;
|
o << "Driver used: " << SDL_GetCurrentAudioDriver() << endl;
|
||||||
|
|
||||||
o << endl;
|
o << "\n[VIDEO]\n";
|
||||||
o << "[VIDEO]" << endl;
|
|
||||||
o << "Driver used: " << SDL_GetCurrentVideoDriver() << endl;
|
o << "Driver used: " << SDL_GetCurrentVideoDriver() << endl;
|
||||||
|
|
||||||
o << endl;
|
o << "\n[VERSIONS OF LIBS]\n";
|
||||||
o << "[VERSIONS OF LIBS]" << endl;
|
|
||||||
const static int sdlcompiled = SDL_VERSION;
|
const static int sdlcompiled = SDL_VERSION;
|
||||||
const static int sdllinked = SDL_GetVersion();
|
const static int sdllinked = SDL_GetVersion();
|
||||||
o << "SDL(compiled) version: " << SDL_VERSIONNUM_MAJOR(sdlcompiled) << "." << SDL_VERSIONNUM_MINOR(sdlcompiled) << "." << SDL_VERSIONNUM_MICRO(sdlcompiled) << endl;
|
o << "SDL(compiled) version: " << SDL_VERSIONNUM_MAJOR(sdlcompiled) << "." << SDL_VERSIONNUM_MINOR(sdlcompiled) << "." << SDL_VERSIONNUM_MICRO(sdlcompiled) << endl;
|
||||||
|
|
@ -214,8 +260,7 @@ void crash_screen(SDL_Window* win){
|
||||||
o << "Boost versino: " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << endl;
|
o << "Boost versino: " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << endl;
|
||||||
o << "Pixman version: " << PIXMAN_VERSION_STRING << endl;
|
o << "Pixman version: " << PIXMAN_VERSION_STRING << endl;
|
||||||
|
|
||||||
o << endl;
|
o << "\n[Platform specific]\n";
|
||||||
o << "[Platform specific]" << endl;
|
|
||||||
try{
|
try{
|
||||||
o << "Detected OS: " << SDL_GetPlatform() << endl;
|
o << "Detected OS: " << SDL_GetPlatform() << endl;
|
||||||
}catch(const std::exception& e){
|
}catch(const std::exception& e){
|
||||||
|
|
@ -228,9 +273,6 @@ void crash_screen(SDL_Window* win){
|
||||||
}
|
}
|
||||||
#elif android
|
#elif android
|
||||||
o << "Android API version: " << android_get_device_api_level() << endl;
|
o << "Android API version: " << android_get_device_api_level() << endl;
|
||||||
o << "Internal storage path: " << SDL_GetAndroidInternalStoragePath() << endl;
|
|
||||||
o << "External Storage path: " << SDL_GetAndroidExternalStoragePath() << endl;
|
|
||||||
o << "Cache path: " << SDL_GetAndroidCachePath() << endl;
|
|
||||||
if(!is_privacy_crashdump_enabled){
|
if(!is_privacy_crashdump_enabled){
|
||||||
o << "Is ChromeBook? " << SDL_IsChromebook() << endl;
|
o << "Is ChromeBook? " << SDL_IsChromebook() << endl;
|
||||||
o << "Is Phone? " << SDL_IsPhone() << endl;
|
o << "Is Phone? " << SDL_IsPhone() << endl;
|
||||||
|
|
@ -248,16 +290,15 @@ void crash_screen(SDL_Window* win){
|
||||||
o << "PSPdev MIPS Stack Trace: " << pspDebugGetStackTrace() << endl;
|
o << "PSPdev MIPS Stack Trace: " << pspDebugGetStackTrace() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
o << endl;
|
o << "\n[Hardware]\n";
|
||||||
o << "[Hardware]" << endl;
|
|
||||||
o << "number of logical CPU cores: " << SDL_GetNumLogicalCPUCores() << endl;
|
o << "number of logical CPU cores: " << SDL_GetNumLogicalCPUCores() << endl;
|
||||||
o << "System RAM size: " << SDL_GetSystemRAM() << " MiB" << endl;
|
o << "System RAM size: " << SDL_GetSystemRAM() << " MiB" << endl;
|
||||||
if(!is_privacy_crashdump_enabled){
|
if(!is_privacy_crashdump_enabled){
|
||||||
o << "L1 cache size: " << SDL_GetCPUCacheLineSize() << endl;
|
o << "L1 cache size: " << SDL_GetCPUCacheLineSize() << endl;
|
||||||
}
|
}
|
||||||
|
o << "CPU: " << get_processor() << endl;
|
||||||
|
|
||||||
o << endl;
|
o << "\n[OpenGL]\n";
|
||||||
o << "[OpenGL]" << endl;
|
|
||||||
try{
|
try{
|
||||||
o << "GL Vendor: " << glGetStringInt(GL_VENDOR) << endl;
|
o << "GL Vendor: " << glGetStringInt(GL_VENDOR) << endl;
|
||||||
o << "GL Renderer: " << glGetStringInt(GL_RENDERER) << endl;
|
o << "GL Renderer: " << glGetStringInt(GL_RENDERER) << endl;
|
||||||
|
|
@ -284,8 +325,7 @@ void crash_screen(SDL_Window* win){
|
||||||
(float)((winW - 100) / 2),
|
(float)((winW - 100) / 2),
|
||||||
(float)((winH - 100) / 2),
|
(float)((winH - 100) / 2),
|
||||||
(float)100,
|
(float)100,
|
||||||
(float)100
|
(float)100};
|
||||||
};
|
|
||||||
|
|
||||||
while (!quit) {
|
while (!quit) {
|
||||||
while (SDL_PollEvent(&e)) {
|
while (SDL_PollEvent(&e)) {
|
||||||
|
|
@ -328,7 +368,7 @@ void ErrorMsg(const char *fmt, ...) {
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
SDL_snprintf(crash_message, sizeof(crash_message), "%s", buf);
|
SDL_snprintf(crash_message, sizeof(crash_message), "%s", buf);
|
||||||
show_crash_sceen = true;
|
show_crash_screen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ErrorMsg(Exception::Type t, const char *fmt, ...) {
|
void ErrorMsg(Exception::Type t, const char *fmt, ...) {
|
||||||
|
|
@ -348,7 +388,8 @@ void ErrorMsg(Exception::Type t, const char *fmt, ...) {
|
||||||
|
|
||||||
SDL_snprintf(crash_message, sizeof(crash_message), "%s", buf);
|
SDL_snprintf(crash_message, sizeof(crash_message), "%s", buf);
|
||||||
get_reason_and_solution(t);
|
get_reason_and_solution(t);
|
||||||
show_crash_sceen = true;
|
show_crash_screen = true;
|
||||||
|
SDL_free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WarnMsg(const char *fmt, ...) {
|
void WarnMsg(const char *fmt, ...) {
|
||||||
|
|
@ -367,4 +408,5 @@ void WarnMsg(const char *fmt, ...) {
|
||||||
va_end(args);
|
va_end(args);
|
||||||
Debug() << "[WARNMSG]" << buf;
|
Debug() << "[WARNMSG]" << buf;
|
||||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Warning", buf, NULL);
|
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Warning", buf, NULL);
|
||||||
|
SDL_free(buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#elif android
|
#elif android
|
||||||
//idk
|
#include <SDL3/SDL_system.h>
|
||||||
#else
|
#else
|
||||||
#error "Operating system not detected or unsupported."
|
#error "Operating system not detected or unsupported."
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -263,6 +263,14 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : threadData(threadData){
|
||||||
|
|
||||||
// Get documents path
|
// Get documents path
|
||||||
const char* path = SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS);
|
const char* path = SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS);
|
||||||
|
if(path == NULL){
|
||||||
|
path = SDL_GetUserFolder(SDL_FOLDER_HOME);
|
||||||
|
if(path == NULL){
|
||||||
|
WarnMsg("Failed to get user dir's, using current sirectory as fallback.");
|
||||||
|
//use SDL instead this
|
||||||
|
path == ".";
|
||||||
|
}
|
||||||
|
}
|
||||||
p->docsPath = path;
|
p->docsPath = path;
|
||||||
#ifdef windows
|
#ifdef windows
|
||||||
p->gamePath = std::string(path) + "\\My Games";
|
p->gamePath = std::string(path) + "\\My Games";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue