mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-22 22:58:12 +03:00
Add -fullscreen option
This commit is contained in:
@@ -55,6 +55,9 @@ track.
|
||||
By default, system3-sdl2 uses MIDI sound if available. This option forces FM
|
||||
tone generator emulation.
|
||||
|
||||
#### `-fullscreen`
|
||||
Starts the game in fullscreen mode.
|
||||
|
||||
#### `-mididevice` _number_
|
||||
Specifies the MIDI device number to use. If not specified, the first available
|
||||
device is used.
|
||||
|
||||
@@ -154,6 +154,8 @@ Config::Config(int argc, char *argv[])
|
||||
title = argv[++i];
|
||||
else if (strcmp(argv[i], "-scanline") == 0)
|
||||
scanline = true;
|
||||
else if (strcmp(argv[i], "-fullscreen") == 0)
|
||||
fullscreen = true;
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
else if (strcmp(argv[i], "-debugger") == 0)
|
||||
debugger_mode = parse_debugger_mode(argv[++i]);
|
||||
@@ -224,6 +226,8 @@ void Config::load_ini()
|
||||
title = val;
|
||||
else if (!strcasecmp(key, "scanline"))
|
||||
scanline = to_bool(val, lineno);
|
||||
else if (!strcasecmp(key, "fullscreen"))
|
||||
fullscreen = to_bool(val, lineno);
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
else if (!strcasecmp(key, "debugger"))
|
||||
debugger_mode = parse_debugger_mode(val, lineno);
|
||||
|
||||
@@ -47,6 +47,7 @@ struct Config {
|
||||
bool use_fm = false;
|
||||
bool no_antialias = false;
|
||||
bool scanline = false;
|
||||
bool fullscreen = false;
|
||||
TexthookMode texthook_mode = TexthookMode::NONE;
|
||||
DebuggerMode debugger_mode = DebuggerMode::DISABLED;
|
||||
std::string texthook_suppressions;
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ std::unique_ptr<NACT> g_nact;
|
||||
|
||||
namespace {
|
||||
|
||||
SDL_Window* create_window(const GameId& game_id)
|
||||
SDL_Window* create_window(const Config& config, const GameId& game_id)
|
||||
{
|
||||
std::string title = "System3-sdl2 " SYSTEM3_VERSION;
|
||||
if (game_id.title) {
|
||||
@@ -48,7 +48,7 @@ SDL_Window* create_window(const GameId& game_id)
|
||||
SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
|
||||
Uint32 flags = SDL_WINDOW_FULLSCREEN;
|
||||
#else
|
||||
Uint32 flags = SDL_WINDOW_RESIZABLE;
|
||||
Uint32 flags = config.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE;
|
||||
#endif
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
GameId game_id(config);
|
||||
|
||||
g_window = create_window(game_id);
|
||||
g_window = create_window(config, game_id);
|
||||
g_renderer = SDL_CreateRenderer(g_window, -1, 0);
|
||||
sdl_custom_event_type = SDL_RegisterEvents(1);
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ playlist = bgm/playlist.txt
|
||||
; Force FM tone generator emulation even if MIDI is available.
|
||||
fm = true
|
||||
|
||||
; If set to true, the game starts in fullscreen mode.
|
||||
;fullscreen = true
|
||||
|
||||
; MIDI device number to use for music playback.
|
||||
mididevice = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user