[Scummvm-git-logs] scummvm master -> 682928193773377be98bde39f2136f056cfb321e
sev-
noreply at scummvm.org
Wed Feb 12 16:22:29 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6829281937 Add support to select shader from the command line (#6429)
Commit: 682928193773377be98bde39f2136f056cfb321e
https://github.com/scummvm/scummvm/commit/682928193773377be98bde39f2136f056cfb321e
Author: naatje80 (spekbukkem at gmail.com)
Date: 2025-02-12T17:22:24+01:00
Commit Message:
Add support to select shader from the command line (#6429)
* Add support to select shader from the command line
Changed paths:
base/commandLine.cpp
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index dd0993e4893..44507806144 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -39,6 +39,7 @@
#include "common/system.h"
#include "common/textconsole.h"
#include "common/tokenizer.h"
+#include "common/zip-set.h"
#include "gui/ThemeEngine.h"
@@ -113,6 +114,9 @@ static const char HELP_STRING1[] =
" -f, --fullscreen Force full-screen mode\n"
" -F, --no-fullscreen Force windowed mode\n"
" -g, --gfx-mode=MODE Select graphics mode\n"
+#ifdef USE_OPENGL
+ " --shader=PATH Name of internal shader or path to shader file (OpenGL only)\n"
+#endif
" --stretch-mode=MODE Select stretch mode (center, pixel-perfect, even-pixels,\n"
" fit, stretch, fit_force_aspect)\n"
" --scaler=MODE Select graphics scaler (normal,hq,edge,advmame,sai,\n"
@@ -885,7 +889,6 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
DO_LONG_OPTION_BOOL("disable-sdl-audio")
END_OPTION
#endif
-
DO_LONG_OPTION_BOOL("multi-midi")
END_OPTION
@@ -966,6 +969,21 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
DO_LONG_OPTION_PATH("themepath")
END_OPTION
+ DO_LONG_OPTION("shader")
+ Common::SearchSet _shaderSet;
+ Common::generateZipSet(_shaderSet, "shaders.dat", "shaders*.dat");
+ Common::FSNode path(Common::Path::fromCommandLine(option));
+
+ if (!_shaderSet.hasFile(Common::Path::fromCommandLine(option))) {
+ if (!path.exists()) {
+ usage("Non-existent shader path '%s' or internal shader", option);
+ } else if (!path.isReadable()) {
+ usage("Non-readable shader path '%s'", option);
+ }
+ }
+ settings["shader"] = path.getPath().toConfig();
+ END_OPTION
+
DO_LONG_COMMAND("list-themes")
END_COMMAND
@@ -2105,6 +2123,7 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
"stretch-mode",
"scaler",
"scale-factor",
+ "shader",
"filtering",
"gui-theme",
"themepath",
More information about the Scummvm-git-logs
mailing list