--null-renderer

This commit is contained in:
lizzie 2026-06-10 00:06:37 +00:00
parent 6e32151d9c
commit de6e0ffd4c
3 changed files with 12 additions and 1 deletions

View file

@ -27,3 +27,4 @@ There are two main applications, an SDL-based app (`eden-cli`) and a Qt based ap
- `--user/-u`: Specify the user index. - `--user/-u`: Specify the user index.
- `--version/-v`: Display version and quit. - `--version/-v`: Display version and quit.
- `--input-profile/-i`: Specifies input profile name to use (for player #0 only). - `--input-profile/-i`: Specifies input profile name to use (for player #0 only).
- `--null-render/-n`: Forces the usage of the "Null" render backend irrespective of settings.

View file

@ -8,6 +8,7 @@
#include <memory> #include <memory>
#include <regex> #include <regex>
#include <string> #include <string>
#include "common/settings_enums.h"
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
#include <emscripten.h> #include <emscripten.h>
#endif #endif
@ -214,6 +215,7 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
std::optional<u16> override_gdb_port{}; std::optional<u16> override_gdb_port{};
bool use_multiplayer = false; bool use_multiplayer = false;
bool fullscreen = false; bool fullscreen = false;
bool force_null_render = false;
std::string nickname{}; std::string nickname{};
std::string password{}; std::string password{};
std::string address{}; std::string address{};
@ -232,6 +234,7 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
{"user", required_argument, 0, 'u'}, {"user", required_argument, 0, 'u'},
{"version", no_argument, 0, 'v'}, {"version", no_argument, 0, 'v'},
{"input-profile", no_argument, 0, 'i'}, {"input-profile", no_argument, 0, 'i'},
{"null-render", no_argument, 0, 'n'},
{0, 0, 0, 0}, {0, 0, 0, 0},
// clang-format on // clang-format on
}; };
@ -302,6 +305,9 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
case 'v': case 'v':
PrintVersion(); PrintVersion();
return SDL_APP_FAILURE; return SDL_APP_FAILURE;
case 'n':
force_null_render = true;
break;
} }
} else { } else {
#ifdef _WIN32 #ifdef _WIN32
@ -339,6 +345,10 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
Settings::values.gdbstub_port = *override_gdb_port; Settings::values.gdbstub_port = *override_gdb_port;
} }
if (force_null_render) {
Settings::values.renderer_backend = Settings::RendererBackend::Null;
}
#ifdef _WIN32 #ifdef _WIN32
LocalFree(argv_w); LocalFree(argv_w);
#endif #endif

View file

@ -48,7 +48,7 @@ var Module = { //do not prepend var
}; };
var tty_stdout = document.createElement('div'); var tty_stdout = document.createElement('div');
document.body.appendChild(tty_stdout); document.body.appendChild(tty_stdout);
Module.arguments = ['game.nro']; Module.arguments = ['--null-render', 'game.nro'];
var gameNroFileBuffer = {}; var gameNroFileBuffer = {};