This commit is contained in:
DepressedTWM 2026-08-11 18:16:12 +04:00
parent 3da029ef45
commit e9a6a18a47
5 changed files with 30 additions and 8 deletions

View file

@ -10,6 +10,8 @@ option(NATIVE "Use native instructions(for local use only)" OFF)
option(STATIC "Build more static build" OFF)
option(CPU_ARCH "CPU arch(x86, arm64, ia-64)" "x86")
option(USE_OPENGL_ES2 "GLES2_HEADER define" OFF)
set(VERSION_STRING "0.1.2" CACHE STRING "Version string")
option(DEVBUILD "Developoment build" OFF)
#Configuration
set(CMAKE_DISABLE_IN_SOURCE_BUILD TRUE)
@ -357,6 +359,13 @@ else()
)
endif()
if(DEVBUILD)
target_compile_definitions(${PROJECT_NAME} PRIVATE DEVBUILD)
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE
VERSION_STRING=\"${VERSION_STRING}\"
)
find_package(PkgConfig REQUIRED)
find_package(ZLIB REQUIRED)
find_package(SDL3 CONFIG)

View file

@ -59,6 +59,12 @@ void SunshineBindingInit(){
rb_const_set(module, rb_intern("SDLVersion_minor"), INT2NUM(SDL_MINOR_VERSION));
rb_const_set(module, rb_intern("SDLVersion_micro"), INT2NUM(SDL_MICRO_VERSION));
rb_const_set(module, rb_intern("SECURITYSTATE"), rb_str_new_cstr(securitystate));
rb_const_set(module, rb_intern("VERSION"), rb_str_new_cstr(VERSION_STRING));
#ifdef DEVBUILD
rb_const_set(module, rb_intern("DEVBUILD"), Qtrue);
#else
rb_const_set(module, rb_intern("DEVBUILD"), Qfalse);
#endif
rb_define_singleton_method(module, "crashprivacy", RUBY_METHOD_FUNC(sunshine_get_crash_privacy), 0);
rb_define_singleton_method(module, "crashprivacy=", RUBY_METHOD_FUNC(sunshine_set_crash_privacy), 1);
rb_define_singleton_method(module, "setSDLHint", RUBY_METHOD_FUNC(sunshine_set_hint), 2);

View file

@ -8,8 +8,7 @@ class Scene_Title
MENU_X = 150
MENU_Y = 100
ENTRY_HEIGHT = 25
SDLVer = "#{Sunshine::SDLVersion_major}.#{Sunshine::SDLVersion_minor}.#{Sunshine::SDLVersion_micro}"
SunshineVer = "0.1.2"
SDLVer = ""
#--------------------------------------------------------------------------
# * Main Processing
@ -50,7 +49,11 @@ class Scene_Title
if File.exist?("Graphics/Titles/#{translation_name}.png")
@sprite.bitmap = RPG::Cache.title(translation_name)
else
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
if Sunshine::DEVBUILD
@sprite.bitmap = RPG::Cache.title("dev.png")
else
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
end
end
@sprite.x = Graphics.width / 2
@ -185,9 +188,9 @@ class Scene_Title
end
@debug.bitmap.clear
@debug.bitmap.draw_text(0, 0, 200, ENTRY_HEIGHT, tr("Ruby") + " " + RUBY_VERSION)
@debug.bitmap.draw_text(0, ENTRY_HEIGHT, 200, ENTRY_HEIGHT, tr("SDL") + " " + SDLVer)
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 2, 200, ENTRY_HEIGHT, tr("Sunshine") + " " + SunshineVer)
@debug.bitmap.draw_text(0, 0, 200, ENTRY_HEIGHT, "Ruby #{RUBY_VERSION}")
@debug.bitmap.draw_text(0, ENTRY_HEIGHT, 200, ENTRY_HEIGHT, "SDL #{Sunshine::SDLVersion_major}.#{Sunshine::SDLVersion_minor}.#{Sunshine::SDLVersion_micro}")
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 2, 200, ENTRY_HEIGHT, "Sunshine #{Sunshine::VERSION}")
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 3, 200, ENTRY_HEIGHT, tr("sec_#{Sunshine::SECURITYSTATE}"))
if ModLoader::IS_ENABLED
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 4, 200, ENTRY_HEIGHT, tr("Mods loaded: ") + ModLoader::COUNT.to_s)

View file

@ -213,6 +213,7 @@ static void setGamePathInRegistry() {
//TODO handle this for Linux/Mac
}
int main(int argc, char *argv[]){
Debug() << VERSION_STRING;
startTime = boost::chrono::high_resolution_clock::now();
loadLanguageMetadata(); //there will be a segfault on fclose if I don't move it here
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");

View file

@ -148,9 +148,12 @@ void crash_screen(SDL_Window* win){
string file = "crash " + timeeeeee + ".txt";
SDL_snprintf(msg4, sizeof(msg4), "Path: %s%s", SDL_GetCurrentDirectory(), file.c_str());
o.open(file);
//collecting info and writing to crashdump
if (o.is_open()){
#ifdef DEVBUILD
o << "EXPEREMENTAL BUILD" << endl;
#endif
o << "VERSION: " << VERSION_STRING << endl;
o << "REASON: " << msg << endl;
o << "[BOOST stacktrace()]" << endl << endl;
o << boost::stacktrace::stacktrace() << endl;
@ -262,7 +265,7 @@ void crash_screen(SDL_Window* win){
SDL_SetRenderDrawColor(ren, 0, 0, 0, 255);
SDL_RenderClear(ren);
SDL_RenderTexture(ren, tex, NULL, &dst);
SDL_SetRenderDrawColor(ren, 255, 255, 255, 255);
SDL_SetRenderDrawColor(ren, 255, 255, 255, 255);
SDL_RenderDebugText(ren, 10, 10, "World machine crashed, crashdump created in game directory");
SDL_RenderDebugText(ren, 10, 20, msg);
SDL_RenderDebugText(ren, 10, 30, msg1);