Skip to content

Commit

Permalink
gamemode
Browse files Browse the repository at this point in the history
  • Loading branch information
hitman249 committed May 29, 2020
1 parent 571f4e3 commit 72453e3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/src/components/Prefix/PopupEditConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@
type: 'bool',
required: false,
},
'wine.gamemode': {
tab: 'performance',
name: 'GameMode',
description: this.$t('prefix.form-config.gamemode-desc'),
type: 'bool',
required: false,
},
'wine.laa': {
tab: 'tweaks',
Expand Down
1 change: 1 addition & 0 deletions src/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default {
'esync-desc': 'Synchronization through file descriptors',
'fsync-desc': 'Improved synchronization trough file descriptors',
'aco-desc': 'Use an alternative ACO shader compiler in the RADV driver',
'gamemode-desc': 'Activates OS optimizations for maximum performance',
'laa-desc': 'Allocate to a 32-bit application more than 2 GB of RAM',
'mangohud-dlsym-desc': 'Some OpenGL games may need this to load MangoHud properly',
'use-wined3d': 'Use WineD3D (OpenGL) implementation instead.',
Expand Down
1 change: 1 addition & 0 deletions src/src/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default {
'esync-desc': 'Синхронизация через файловые дескрипторы',
'fsync-desc': 'Более быстрая синхронизация через файловые дескрипторы',
'aco-desc': 'Использовать в драйвере RADV альтернативный компилятор шейдеров ACO',
'gamemode-desc': 'Активирует оптимизации в ОС для максимальной производительности',
'laa-desc': 'Выделять 32 битному приложению больше 2 Гб ОЗУ',
'mangohud-dlsym-desc': 'Некоторым OpenGL играм это может понадобиться для правильной загрузки MangoHud',
'use-wined3d': 'Использовать вместо него WineD3D (OpenGL) реализацию.',
Expand Down
8 changes: 8 additions & 0 deletions src/src/modules/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default class Config {
esync: true,
fsync: true,
aco: false,
gamemode: false,
laa: true,
disable_nvapi: false,
mangohud_dlsym: false,
Expand Down Expand Up @@ -421,6 +422,13 @@ export default class Config {
return Boolean((null === exportValue && configValue) || exportValue);
}

/**
* @return {boolean}
*/
isGameMode() {
return Boolean(_.get(this.config, 'wine.gamemode', false));
}

/**
* @return {boolean|null}
*/
Expand Down
7 changes: 7 additions & 0 deletions src/src/modules/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,13 @@ export default class System {
return this.existsCommand('AppImageLauncher');
}

/**
* @returns {boolean}
*/
isGameMode() {
return this.existsCommand('gamemoderun');
}

/**
* @returns {number}
*/
Expand Down
7 changes: 6 additions & 1 deletion src/src/modules/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ export default class Task {
let fileName = this.config.getGameExe();
let args = this.config.getGameArguments().split("'").join('"');
let desktop = this.desktop();
let gamemode = '';

return `cd "${path}" && "${wine}" ${desktop} "${fileName}" ${args}`;
if (this.config.isGameMode() && this.system.isGameMode()) {
gamemode = 'gamemoderun';
}

return `cd "${path}" && ${gamemode} "${wine}" ${desktop} "${fileName}" ${args}`;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/src/modules/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const fs = require('fs');

export default class Update {

version = '1.4.12';
version = '1.4.13';

/**
* @type {string}
Expand Down

0 comments on commit 72453e3

Please sign in to comment.