-
-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vkd3d: add support of multi version vkd3d, add vkd3d-2.13
- Loading branch information
1 parent
a68797b
commit 7cb079e
Showing
9 changed files
with
163 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/src/main/java/com/winlator/contentdialog/VKD3DConfigDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.winlator.contentdialog; | ||
|
||
import android.content.Context; | ||
import android.view.View; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.Spinner; | ||
|
||
import com.winlator.R; | ||
import com.winlator.core.AppUtils; | ||
import com.winlator.core.DefaultVersion; | ||
import com.winlator.core.EnvVars; | ||
import com.winlator.core.KeyValueSet; | ||
import com.winlator.core.StringUtils; | ||
public class VKD3DConfigDialog extends ContentDialog { | ||
public static final String DEFAULT_CONFIG = DXVKConfigDialog.DEFAULT_CONFIG + | ||
",vkd3dVersion=" + DefaultVersion.VKD3D + ",vkd3dLevel=12_1"; | ||
public static final String[] VKD3D_FEATURE_LEVEL = {"12_0", "12_1", "12_2"}; | ||
|
||
public VKD3DConfigDialog(View anchor) { | ||
super(anchor.getContext(), R.layout.vkd3d_config_dialog); | ||
setIcon(R.drawable.icon_settings); | ||
setTitle("VKD3D "+anchor.getContext().getString(R.string.configuration)); | ||
|
||
final Spinner sVersion = findViewById(R.id.SVersion); | ||
final Spinner sFeatureLevel = findViewById(R.id.SFeatureLevel); | ||
|
||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, VKD3D_FEATURE_LEVEL); | ||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); | ||
sFeatureLevel.setAdapter(adapter); | ||
|
||
KeyValueSet config = parseConfig(anchor.getTag()); | ||
AppUtils.setSpinnerSelectionFromIdentifier(sVersion, config.get("vkd3dVersion")); | ||
AppUtils.setSpinnerSelectionFromIdentifier(sFeatureLevel, config.get("vkd3dLevel")); | ||
|
||
setOnConfirmCallback(() -> { | ||
config.put("vkd3dVersion", StringUtils.parseNumber(sVersion.getSelectedItem())); | ||
config.put("vkd3dLevel", sFeatureLevel.getSelectedItem().toString()); | ||
anchor.setTag(config.toString()); | ||
}); | ||
} | ||
|
||
public static KeyValueSet parseConfig(Object config) { | ||
String data = config != null && !config.toString().isEmpty() ? config.toString() : DEFAULT_CONFIG; | ||
return new KeyValueSet(data); | ||
} | ||
|
||
public static void setEnvVars(Context context, KeyValueSet config, EnvVars envVars) { | ||
envVars.put("VKD3D_FEATURE_LEVEL", config.get("vkd3dLevel")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="wrap_content" | ||
android:layout_height="200dp"> | ||
|
||
<LinearLayout | ||
android:layout_width="300dp" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/version" /> | ||
|
||
<Spinner | ||
style="@style/ComboBox" | ||
android:layout_width="match_parent" | ||
android:id="@+id/SVersion" | ||
android:entries="@array/vkd3d_version_entries" /> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/vkd3d_feature_level" /> | ||
|
||
<Spinner | ||
style="@style/ComboBox" | ||
android:layout_width="match_parent" | ||
android:id="@+id/SFeatureLevel" /> | ||
|
||
</LinearLayout> | ||
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters