mirror of
https://git.checksum.fail/alec/erythros
synced 2025-12-10 13:09:55 +02:00
System: Use Settings/config.json for debug options
This commit is contained in:
6
Settings/config.json
Normal file
6
Settings/config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"debug": {
|
||||
"show_compositor_overlay": true,
|
||||
"show_system_log_messages": true
|
||||
}
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ U0 @compositor_task()
|
||||
// Debug stuff
|
||||
I64 debug_row;
|
||||
|
||||
if (KeyDown(SC_F12)) {
|
||||
if (KeyDown(SC_F12) || (config->o("debug") && config->o("debug")->@("show_compositor_overlay"))) {
|
||||
debug_row = 32;
|
||||
|
||||
total_mem = sys_code_bp->alloced_u8s;
|
||||
|
||||
@@ -51,6 +51,10 @@ U8* @system_build_info() { return System.build_info; }
|
||||
|
||||
U0 @system_log(CTask* task, U8* fmt, ...)
|
||||
{
|
||||
if (!config->o("debug"))
|
||||
return;
|
||||
if (!config->o("debug")->@("show_system_log_messages"))
|
||||
return;
|
||||
U8* buf = StrPrintJoin(NULL, fmt, argc, argv);
|
||||
U8* str = buf;
|
||||
U32 color;
|
||||
|
||||
@@ -52,13 +52,17 @@ load_elf("M:/build/bin/tlse");
|
||||
|
||||
// Erythros system libraries
|
||||
"libraries: { ";
|
||||
#include "Libraries/Json";
|
||||
|
||||
// Load system-wide config values
|
||||
JsonObject* config = Json.Parse(FileRead("M:/Settings/config.json"), erythros_mem_task);
|
||||
|
||||
#include "Libraries/Function";
|
||||
#include "Libraries/Base64";
|
||||
#include "Libraries/String";
|
||||
#include "Libraries/BitmapFont";
|
||||
#include "Libraries/Display";
|
||||
#include "Libraries/FileSystem";
|
||||
#include "Libraries/Json";
|
||||
#include "Libraries/Graphics2D";
|
||||
#include "Libraries/Animation2D";
|
||||
#include "Libraries/Image";
|
||||
@@ -78,6 +82,7 @@ load_elf("M:/build/bin/tlse");
|
||||
#include "Libraries/Widget";
|
||||
#include "Libraries/Theme";
|
||||
|
||||
|
||||
@http_init_tmp_and_cache_directories;
|
||||
|
||||
#include "Libraries/Css/Tokenizer";
|
||||
|
||||
Reference in New Issue
Block a user