mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[core/utils] Add version check to game workarounds
Also add more games to the list of optimizations being enabled by default. This will bring Pillars of Eternity down to around ~2 GiB shared memory, which is still too much but without implementing another workaround that adds a prefix filter I cannot really fix this. Certainly better than 24...
This commit is contained in:
parent
daeee2eb8d
commit
cb7ea25a18
|
@ -786,7 +786,7 @@ class LegendaryCore:
|
|||
if not max_shm:
|
||||
max_shm = self.lgd.config.getint('Legendary', 'max_memory', fallback=1024)
|
||||
|
||||
if dl_optimizations or is_opt_enabled(game.app_name):
|
||||
if dl_optimizations or is_opt_enabled(game.app_name, new_manifest.meta.build_version):
|
||||
self.log.info('Download order optimizations are enabled.')
|
||||
process_opt = True
|
||||
else:
|
||||
|
|
|
@ -1,13 +1,22 @@
|
|||
# coding: utf-8
|
||||
|
||||
# games where the download order optimizations are enabled by default
|
||||
# a set() of versions can be specified, empty set means all versions.
|
||||
_optimize_default = {
|
||||
'wombat', 'snapdragon'
|
||||
'wombat': {}, # world war z
|
||||
'snapdragon': {}, # metro exodus
|
||||
'honeycreeper': {}, # diabotical
|
||||
'bcc75c246fe04e45b0c1f1c3fd52503a': { # pillars of eternity
|
||||
'1.0.2' # problematic version
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def is_opt_enabled(app_name):
|
||||
return app_name.lower() in _optimize_default
|
||||
def is_opt_enabled(app_name, version):
|
||||
if (versions := _optimize_default.get(app_name.lower())) is not None:
|
||||
if version in versions or not versions:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
_cyberpunk_sdl = {
|
||||
|
|
Loading…
Reference in a new issue