staging-helper.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. From 292a2474457aebe491984f07d952f53bf8ec77dc Mon Sep 17 00:00:00 2001
  2. From: Nick Sarnie <commendsarnex@gmail.com>
  3. Date: Sun, 5 Nov 2017 22:30:35 -0500
  4. Subject: [PATCH 1/2] Staging Helper
  5. Signed-off-by: Nick Sarnie <commendsarnex@gmail.com>
  6. ---
  7. dlls/ntdll/loadorder.c | 2 ++
  8. programs/winecfg/resource.h | 1 +
  9. programs/winecfg/staging.c | 29 +++++++++++++++++++++++++++++
  10. programs/winecfg/winecfg.rc | 1 +
  11. 4 files changed, 33 insertions(+)
  12. diff --git a/dlls/ntdll/loadorder.c b/dlls/ntdll/loadorder.c
  13. index 3668d73643..24e8a6f109 100644
  14. --- a/dlls/ntdll/loadorder.c
  15. +++ b/dlls/ntdll/loadorder.c
  16. @@ -633,8 +633,10 @@ WCHAR* get_redirect( const WCHAR *app_name, const WCHAR *path, BYTE *buffer, ULO
  17. goto done;
  18. /* then module basename without '*' (only if explicit path) */
  19. + /*
  20. if (basename != module+1 && (ret = get_redirect_value( std_key, app_key, basename, buffer, size )))
  21. goto done;
  22. + */
  23. /* and last the hard-coded default */
  24. ret = NULL;
  25. diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h
  26. index b94e773b60..028dbb730b 100644
  27. --- a/programs/winecfg/resource.h
  28. +++ b/programs/winecfg/resource.h
  29. @@ -218,6 +218,7 @@
  30. #define IDC_ENABLE_EAX 9003
  31. #define IDC_ENABLE_HIDEWINE 9004
  32. #define IDC_ENABLE_GTK3 9005
  33. +#define IDC_ENABLE_NATIVE_D3D9 9006
  34. /* About tab */
  35. #define IDC_ABT_OWNER 8432
  36. diff --git a/programs/winecfg/staging.c b/programs/winecfg/staging.c
  37. index a96bdcaab4..7eec5e9608 100644
  38. --- a/programs/winecfg/staging.c
  39. +++ b/programs/winecfg/staging.c
  40. @@ -122,6 +122,23 @@ static void gtk3_set(BOOL status)
  41. #endif
  42. }
  43. +/*
  44. + * Gallium nine
  45. + */
  46. +static BOOL nine_get(void)
  47. +{
  48. + BOOL ret;
  49. + char *value = get_reg_key(config_key, keypath("DllRedirects"), "d3d9", NULL);
  50. + ret = (value && !strcmp(value, "d3d9-nine.dll"));
  51. + HeapFree(GetProcessHeap(), 0, value);
  52. + return ret;
  53. +}
  54. +
  55. +static void nine_set(BOOL status)
  56. +{
  57. + set_reg_key(config_key, keypath("DllRedirects"), "d3d9", status ? "d3d9-nine.dll" : NULL);
  58. +}
  59. +
  60. static void load_staging_settings(HWND dialog)
  61. {
  62. CheckDlgButton(dialog, IDC_ENABLE_CSMT, csmt_get() ? BST_CHECKED : BST_UNCHECKED);
  63. @@ -129,6 +146,7 @@ static void load_staging_settings(HWND dialog)
  64. CheckDlgButton(dialog, IDC_ENABLE_EAX, eax_get() ? BST_CHECKED : BST_UNCHECKED);
  65. CheckDlgButton(dialog, IDC_ENABLE_HIDEWINE, hidewine_get() ? BST_CHECKED : BST_UNCHECKED);
  66. CheckDlgButton(dialog, IDC_ENABLE_GTK3, gtk3_get() ? BST_CHECKED : BST_UNCHECKED);
  67. + CheckDlgButton(dialog, IDC_ENABLE_NATIVE_D3D9, nine_get() ? BST_CHECKED : BST_UNCHECKED);
  68. #ifndef HAVE_VAAPI
  69. disable(IDC_ENABLE_VAAPI);
  70. @@ -136,6 +154,9 @@ static void load_staging_settings(HWND dialog)
  71. #ifndef HAVE_GTK3
  72. disable(IDC_ENABLE_GTK3);
  73. #endif
  74. +#if !defined(HAVE_D3D9NINE)
  75. + disable(IDC_ENABLE_NATIVE_D3D9);
  76. +#endif
  77. }
  78. INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
  79. @@ -163,6 +184,8 @@ INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
  80. {
  81. case IDC_ENABLE_CSMT:
  82. csmt_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_CSMT) == BST_CHECKED);
  83. + nine_set(FALSE);
  84. + CheckDlgButton(hDlg, IDC_ENABLE_NATIVE_D3D9, BST_UNCHECKED);
  85. SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  86. return TRUE;
  87. case IDC_ENABLE_VAAPI:
  88. @@ -181,6 +204,12 @@ INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
  89. gtk3_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_GTK3) == BST_CHECKED);
  90. SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  91. return TRUE;
  92. + case IDC_ENABLE_NATIVE_D3D9:
  93. + nine_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_NATIVE_D3D9) == BST_CHECKED);
  94. + csmt_set(FALSE);
  95. + CheckDlgButton(hDlg, IDC_ENABLE_CSMT, BST_UNCHECKED);
  96. + SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
  97. + return TRUE;
  98. }
  99. break;
  100. }
  101. diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc
  102. index 314e9858ea..596dc27447 100644
  103. --- a/programs/winecfg/winecfg.rc
  104. +++ b/programs/winecfg/winecfg.rc
  105. @@ -320,6 +320,7 @@ BEGIN
  106. CONTROL "Enable Environmental Audio E&xtensions (EAX)",IDC_ENABLE_EAX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,230,8
  107. CONTROL "&Hide Wine version from applications",IDC_ENABLE_HIDEWINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,85,230,8
  108. CONTROL "Enable &GTK3 Theming",IDC_ENABLE_GTK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,100,230,8
  109. + CONTROL "Enable Gallium &Nine for better D3D9 graphic performance",IDC_ENABLE_NATIVE_D3D9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,115,230,8
  110. END
  111. LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
  112. --
  113. 2.15.0