mirror of
https://github.com/lutris/lutris
synced 2024-11-02 10:19:50 +00:00
Create method to return MAME shaders
This commit is contained in:
parent
4980ef1a9a
commit
b8f879fbb6
1 changed files with 13 additions and 8 deletions
|
@ -278,6 +278,18 @@ class mame(Runner): # pylint: disable=invalid-name
|
|||
)
|
||||
return True
|
||||
|
||||
def get_shader_params(self, shader_dir, shaders):
|
||||
"""Returns a list of CLI parameters to apply a list of shaders"""
|
||||
params = []
|
||||
shader_path = os.path.join(self.working_dir, "shaders", shader_dir)
|
||||
for index, shader in enumerate(shaders):
|
||||
params += [
|
||||
"-gl_glsl",
|
||||
"-glsl_shader_mame%s" % index,
|
||||
os.path.join(shader_path, shader)
|
||||
]
|
||||
return params
|
||||
|
||||
def play(self):
|
||||
command = [self.get_executable(), "-skip_gameinfo", "-inipath", self.config_dir]
|
||||
if self.runner_config.get("video"):
|
||||
|
@ -290,14 +302,7 @@ class mame(Runner): # pylint: disable=invalid-name
|
|||
command += ["-uimodekey", self.runner_config["uimodekey"]]
|
||||
|
||||
if self.runner_config.get("crt"):
|
||||
shader_path = os.path.join(self.working_dir, "shaders/CRT-geom")
|
||||
shaders = ["Gaussx", "Gaussy", "CRT-geom-halation"]
|
||||
for index, shader in enumerate(shaders):
|
||||
command += [
|
||||
"-gl_glsl",
|
||||
"-glsl_shader_mame%s" % index,
|
||||
os.path.join(shader_path, shader)
|
||||
]
|
||||
command += self.get_shader_params("CRT-geom", ["Gaussx", "Gaussy", "CRT-geom-halation"])
|
||||
command += ["-nounevenstretch"]
|
||||
|
||||
if self.game_config.get("machine"):
|
||||
|
|
Loading…
Reference in a new issue