--null-renderer

This commit is contained in:
lizzie 2026-06-10 00:06:37 +00:00
parent 9da56ebaba
commit 713b5f6bed
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.
- `--version/-v`: Display version and quit.
- `--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 <regex>
#include <string>
#include "common/settings_enums.h"
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@ -214,6 +215,7 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
std::optional<u16> override_gdb_port{};
bool use_multiplayer = false;
bool fullscreen = false;
bool force_null_render = false;
std::string nickname{};
std::string password{};
std::string address{};
@ -232,6 +234,7 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
{"user", required_argument, 0, 'u'},
{"version", no_argument, 0, 'v'},
{"input-profile", no_argument, 0, 'i'},
{"null-render", no_argument, 0, 'n'},
{0, 0, 0, 0},
// clang-format on
};
@ -302,6 +305,9 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
case 'v':
PrintVersion();
return SDL_APP_FAILURE;
case 'n':
force_null_render = true;
break;
}
} else {
#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;
}
if (force_null_render) {
Settings::values.renderer_backend = Settings::RendererBackend::Null;
}
#ifdef _WIN32
LocalFree(argv_w);
#endif

View file

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