Merge branch 'master' of ssh://code.nikooneshot.ru:222/Sunshine/mkxp-sunshine

This commit is contained in:
DepressedTWM 2026-08-16 20:30:15 +04:00
commit e60aa1a4f8
9 changed files with 38 additions and 1388 deletions

View file

@ -8,7 +8,7 @@
#include <string>
#include <vector>
VALUE tp = Qnil;
static std::vector<uint64_t> call_stack; // Глобальный стек вместо thread-local
static std::vector<uint64_t> call_stack;
static uint64_t now_ns(void) {
timespec ts;
@ -35,12 +35,11 @@ static void tp_cb(VALUE tpval, void *) {
call_stack.pop_back();
uint64_t dur_ns = end_ns - start_ns;
// Сохраняем VALUE в переменные ПЕРЕД StringValuePtr
VALUE path_val = rb_tracearg_path(trace_arg);
VALUE class_val = rb_tracearg_defined_class(trace_arg);
const char *path = StringValuePtr(path_val);
const char *class_name = StringValuePtr(class_val);
const char *class_name = rb_class2name(class_val);
long line = FIX2LONG(rb_tracearg_lineno(trace_arg));
const char *method = rb_id2name((ID)rb_tracearg_method_id(trace_arg));
@ -49,7 +48,6 @@ static void tp_cb(VALUE tpval, void *) {
}
}
static VALUE profiler_set(VALUE, VALUE v) {
if (NIL_P(tp)) {
rb_raise(rb_eRuntimeError, "Profiler not initialized");
@ -66,12 +64,7 @@ static VALUE profiler_set(VALUE, VALUE v) {
void ProfilerInit() {
VALUE module = rb_define_module("Profiler");
tp = rb_tracepoint_new(
Qnil,
RUBY_EVENT_CALL | RUBY_EVENT_RETURN,
tp_cb,
nullptr
);
tp = rb_tracepoint_new(Qnil, RUBY_EVENT_CALL | RUBY_EVENT_RETURN, tp_cb, nullptr);
rb_gc_register_address(&tp);
rb_define_singleton_method(module, "set", RUBY_METHOD_FUNC(profiler_set), 1);

View file

@ -9,7 +9,7 @@
# relative to gameFolder and ignoring both RTPs and
# encrypted archives.
# Enable reset on F12 press and Ruby profiller
# Enable reset on F12 press and Ruby profiler
debugMode=false
# Start game in fullscreen mode,

View file

@ -58,7 +58,6 @@ set(scripts
Scene_Map.rb
Scene_Name.rb
Scene_Title.rb
Scene_OF.rb
Script.rb
Sprite_Character.rb
Sprite_Footprint.rb

View file

@ -50,12 +50,12 @@ module Settings
# Debug
:debug => false,
:debug_character => false,
:debug_text => false,
:debug_text_scene_title => true,
:debug_text => false,
:debug_picture_names => false,
:debug_lightmap => false,
:SDL_HINT_SHUTDOWN_DBUS_ON_QUIT => false,
:profiller => false,
:profiler => false,
}
reset_controls!
end
@ -579,9 +579,9 @@ class Window_Settings
},
{
:type => :bool,
:name => "Profiller",
:name => "Profiler",
:parameter => :profiler,
:icon => [1, 0],
:parameter => :profiller
},
{ :type => :sep },
{

File diff suppressed because it is too large Load diff

View file

@ -89,7 +89,7 @@ class Scene_Title
@debug.y = 5
@debug.z += 1
@debug.visible = Settings[:debug_text_scene_title] || false
@debug.bitmap = Bitmap.new(200, ENTRY_HEIGHT * 6)
@debug.bitmap = Bitmap.new(400, ENTRY_HEIGHT * 6)
redraw_debug
Language.register_text_sprite(self.class.name + "_contents", @menu)
@ -190,13 +190,13 @@ class Scene_Title
end
@debug.bitmap.clear
@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}"))
@debug.bitmap.draw_text(0, 0, 400, ENTRY_HEIGHT, "Ruby #{RUBY_VERSION}")
@debug.bitmap.draw_text(0, ENTRY_HEIGHT, 400, ENTRY_HEIGHT, "SDL #{Sunshine::SDLVersion_major}.#{Sunshine::SDLVersion_minor}.#{Sunshine::SDLVersion_micro}")
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 2, 400, ENTRY_HEIGHT, "Sunshine #{Sunshine::VERSION}")
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 3, 400, 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)
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 5, 200, ENTRY_HEIGHT, tr("PreloadScripts loaded: ") + ModLoader::PRELOAD_SCRIPTS_COUNT.to_s)
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 4, 400, ENTRY_HEIGHT, tr("Mods loaded: ") + ModLoader::COUNT.to_s)
@debug.bitmap.draw_text(0, ENTRY_HEIGHT * 5, 400, ENTRY_HEIGHT, tr("PreloadScripts loaded: ") + ModLoader::PRELOAD_SCRIPTS_COUNT.to_s)
end
end

View file

@ -850,6 +850,8 @@ class Window_Settings
redraw
end
end
# ----------------------------------------------------------------------------------------
class ActionParameter < BaseParameter
TYPE = :action
@ -881,6 +883,7 @@ class Window_Settings
end
end
# ----------------------------------------------------------------------------------------
class CustomParameter < BaseParameter
TYPE = :custom
def initialize(settings_content, screen_id, position, name, icon, parameter, init_value, callbacks)

View file

@ -97,9 +97,10 @@ module Settings
end
end
def profiller(value)
def profiler(value)
Profiler.set(value)
end
def wallpaper_mode(value)
if value == 0
Sunshine.wallpapermode="normal"

View file

@ -77,7 +77,6 @@ Scene_Name
Scene_Debug
Scene_Save
Scene_Load
Scene_OF
# Persistent data
Persistent