Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file modified app/src/main/assets/graphics_driver/extra_libs.tzst
Binary file not shown.
Binary file modified app/src/main/assets/graphics_driver/wrapper.tzst
Binary file not shown.
Binary file not shown.
33 changes: 33 additions & 0 deletions app/src/main/cpp/extras/vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,39 @@ Java_com_winlator_core_GPUInformation_getVulkanVersion(JNIEnv *env, jclass obj,
return versionString;
}

JNIEXPORT jint JNICALL
Java_com_winlator_core_GPUInformation_getVendorID(JNIEnv *env, jclass obj, jstring driverName, jobject context) {
VkPhysicalDeviceProperties props = {};
uint32_t vendorID = 0;

if (create_instance(driverName, env, context) != VK_SUCCESS) {
printf("Failed to create instance");
goto cleanup;
}

if (enumerate_physical_devices() != VK_SUCCESS) {
printf("Failed to query physical devices");
goto cleanup;
}

getPhysicalDeviceProperties(physicalDevice, &props);
vendorID = props.vendorID;

cleanup:
if (destroyInstance && instance != VK_NULL_HANDLE) {
destroyInstance(instance, NULL);
instance = VK_NULL_HANDLE;
}
physicalDevice = VK_NULL_HANDLE;

if (vulkan_handle) {
dlclose(vulkan_handle);
vulkan_handle = NULL;
}

return vendorID;
}

JNIEXPORT jstring JNICALL
Java_com_winlator_core_GPUInformation_getRenderer(JNIEnv *env, jclass obj, jstring driverName, jobject context) {
VkPhysicalDeviceProperties props = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package app.gamenative.ui.component.dialog

import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import app.gamenative.R
import app.gamenative.ui.component.settings.SettingsCPUList
import app.gamenative.ui.component.settings.SettingsListDropdown
import app.gamenative.ui.theme.settingsTileColors
import com.alorma.compose.settings.ui.SettingsGroup

@Composable
fun AdvancedTabContent(state: ContainerConfigState) {
val config = state.config.value
SettingsGroup() {
SettingsListDropdown(
colors = settingsTileColors(),
title = { Text(text = stringResource(R.string.startup_selection)) },
value = config.startupSelection.toInt().takeIf { it in state.getStartupSelectionOptions().indices } ?: 1,
items = state.getStartupSelectionOptions(),
onItemSelected = {
state.config.value = config.copy(startupSelection = it.toByte())
},
)
SettingsCPUList(
colors = settingsTileColors(),
title = { Text(text = stringResource(R.string.processor_affinity)) },
value = config.cpuList,
onValueChange = {
state.config.value = config.copy(cpuList = it)
},
)
SettingsCPUList(
colors = settingsTileColors(),
title = { Text(text = stringResource(R.string.processor_affinity_32bit)) },
value = config.cpuListWoW64,
onValueChange = { state.config.value = config.copy(cpuListWoW64 = it) },
)
}
}
1,797 changes: 249 additions & 1,548 deletions app/src/main/java/app/gamenative/ui/component/dialog/ContainerConfigDialog.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
package app.gamenative.ui.component.dialog

import androidx.compose.runtime.MutableIntState
import androidx.compose.runtime.MutableState
import app.gamenative.utils.ContainerUtils
import app.gamenative.utils.ManifestComponentHelper
import app.gamenative.utils.ManifestEntry
import com.winlator.box86_64.Box86_64Preset
import com.winlator.contents.ContentProfile
import com.winlator.container.ContainerData
import com.winlator.fexcore.FEXCorePreset

/**
* State holder for ContainerConfigDialog. Built inside the dialog and passed to each tab composable.
* Holds references to all mutable state and read-only data so tabs can read/write without 50+ parameters.
*/
class ContainerConfigState(
val config: MutableState<ContainerData>,
val graphicsDrivers: MutableState<MutableList<String>>,
val bionicWineEntries: MutableState<List<String>>,
val glibcWineEntries: MutableState<List<String>>,
val wrapperVersions: MutableState<List<String>>,
val dxvkVersionsAll: MutableState<List<String>>,
val componentAvailability: MutableState<ManifestComponentHelper.ComponentAvailability?>,
val showCustomResolutionDialog: MutableState<Boolean>,
val customResolutionValidationError: MutableState<String?>,
val vkMaxVersionIndex: MutableIntState,
val imageCacheIndex: MutableIntState,
val exposedExtIndices: MutableState<List<Int>>,
val maxDeviceMemoryIndex: MutableIntState,
val bionicDriverIndex: MutableIntState,
val wrapperVersionIndex: MutableIntState,
val presentModeIndex: MutableIntState,
val resourceTypeIndex: MutableIntState,
val bcnEmulationIndex: MutableIntState,
val bcnEmulationTypeIndex: MutableIntState,
val bcnEmulationCacheEnabled: MutableState<Boolean>,
val disablePresentWaitChecked: MutableState<Boolean>,
val syncEveryFrameChecked: MutableState<Boolean>,
val sharpnessEffectIndex: MutableIntState,
val sharpnessLevel: MutableIntState,
val sharpnessDenoise: MutableIntState,
val adrenotoolsTurnipChecked: MutableState<Boolean>,
val emulator64Index: MutableIntState,
val emulator32Index: MutableIntState,
val screenSizeIndex: MutableIntState,
val customScreenWidth: MutableState<String>,
val customScreenHeight: MutableState<String>,
val graphicsDriverIndex: MutableIntState,
val dxWrapperIndex: MutableIntState,
val dxvkVersionIndex: MutableIntState,
val graphicsDriverVersionIndex: MutableIntState,
val audioDriverIndex: MutableIntState,
val gpuNameIndex: MutableIntState,
val renderingModeIndex: MutableIntState,
val videoMemIndex: MutableIntState,
val mouseWarpIndex: MutableIntState,
val externalDisplayModeIndex: MutableIntState,
val languageIndex: MutableIntState,
val showEnvVarCreateDialog: MutableState<Boolean>,
val showAddDriveDialog: MutableState<Boolean>,
val selectedDriveLetter: MutableState<String>,
val pendingDriveLetter: MutableState<String>,
val driveLetterMenuExpanded: MutableState<Boolean>,
val screenSizes: List<String>,
val baseGraphicsDrivers: List<String>,
val dxWrappers: List<String>,
val dxvkVersionsBase: List<String>,
val vkd3dVersionsBase: List<String>,
val audioDrivers: List<String>,
val presentModes: List<String>,
val resourceTypes: List<String>,
val bcnEmulationEntries: List<String>,
val bcnEmulationTypeEntries: List<String>,
val sharpnessEffects: List<String>,
val sharpnessDisplayItems: List<String>,
val renderingModes: List<String>,
val videoMemSizes: List<String>,
val mouseWarps: List<String>,
val externalDisplayModes: List<String>,
val winCompOpts: List<String>,
val box64Versions: List<String>,
val wowBox64VersionsBase: List<String>,
val box64BionicVersionsBase: List<String>,
val fexcoreVersionsBase: List<String>,
val fexcoreTSOPresets: List<String>,
val fexcoreX87Presets: List<String>,
val fexcoreMultiblockValues: List<String>,
val startupSelectionEntries: List<String>,
val turnipVersions: List<String>,
val virglVersions: List<String>,
val zinkVersions: List<String>,
val vortekVersions: List<String>,
val adrenoVersions: List<String>,
val sd8EliteVersions: List<String>,
val containerVariants: List<String>,
val bionicWineEntriesBase: List<String>,
val glibcWineEntriesBase: List<String>,
val emulatorEntries: List<String>,
val bionicGraphicsDrivers: List<String>,
val baseWrapperVersions: List<String>,
val languages: List<String>,
val dxvkOptions: ManifestComponentHelper.VersionOptionList,
val vkd3dOptions: ManifestComponentHelper.VersionOptionList,
val box64Options: ManifestComponentHelper.VersionOptionList,
val box64BionicOptions: ManifestComponentHelper.VersionOptionList,
val wowBox64Options: ManifestComponentHelper.VersionOptionList,
val fexcoreOptions: ManifestComponentHelper.VersionOptionList,
val wrapperOptions: ManifestComponentHelper.VersionOptionList,
val bionicWineOptions: ManifestComponentHelper.VersionOptionList,
val glibcWineOptions: ManifestComponentHelper.VersionOptionList,
val dxvkManifestById: Map<String, ManifestEntry>,
val vkd3dManifestById: Map<String, ManifestEntry>,
val box64ManifestById: Map<String, ManifestEntry>,
val wowBox64ManifestById: Map<String, ManifestEntry>,
val fexcoreManifestById: Map<String, ManifestEntry>,
val wrapperManifestById: Map<String, ManifestEntry>,
val bionicWineManifestById: Map<String, ManifestEntry>,
val glibcWineManifestById: Map<String, ManifestEntry>,
val gpuCards: Map<Int, ContainerUtils.GpuInfo>,
val box64Presets: List<Box86_64Preset>,
val fexcorePresets: List<FEXCorePreset>,
val gpuExtensions: List<String>,
val inspectionMode: Boolean,
val isBionicVariant: Boolean,
val nonDeletableDriveLetters: Set<String>,
val availableDriveLetters: List<String>,
val launchManifestInstall: (ManifestEntry, String, Boolean, ContentProfile.ContentType?, () -> Unit) -> Unit,
val launchManifestContentInstall: (ManifestEntry, ContentProfile.ContentType, () -> Unit) -> Unit,
val launchManifestDriverInstall: (ManifestEntry, () -> Unit) -> Unit,
val getStartupSelectionOptions: () -> List<String>,
val launchFolderPicker: () -> Unit,
val getVersionsForDriver: () -> List<String>,
val getVersionsForBox64: () -> ManifestComponentHelper.VersionOptionList,
val applyScreenSizeToConfig: () -> Unit,
val vkd3dForcedVersion: () -> String,
val currentDxvkContext: () -> ManifestComponentHelper.DxvkContext,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package app.gamenative.ui.component.dialog

import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import app.gamenative.R
import app.gamenative.ui.component.settings.SettingsListDropdown
import app.gamenative.ui.theme.settingsTileColors
import app.gamenative.ui.theme.settingsTileColorsAlt
import com.alorma.compose.settings.ui.SettingsGroup
import com.alorma.compose.settings.ui.SettingsSwitch
import com.winlator.container.Container

@Composable
fun ControllerTabContent(state: ContainerConfigState, default: Boolean) {
val config = state.config.value
SettingsGroup() {
if (!default) {
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.use_sdl_api)) },
state = config.sdlControllerAPI,
onCheckedChange = { state.config.value = config.copy(sdlControllerAPI = it) },
)
}
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.use_steam_input)) },
state = config.useSteamInput,
onCheckedChange = { state.config.value = config.copy(useSteamInput = it) },
)
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.enable_xinput_api)) },
state = config.enableXInput,
onCheckedChange = { state.config.value = config.copy(enableXInput = it) },
)
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.enable_directinput_api)) },
state = config.enableDInput,
onCheckedChange = { state.config.value = config.copy(enableDInput = it) },
)
SettingsListDropdown(
colors = settingsTileColors(),
title = { Text(text = stringResource(R.string.directinput_mapper_type)) },
value = if (config.dinputMapperType == 1.toByte()) 0 else 1,
items = listOf("Standard", "XInput Mapper"),
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Dropdown labels are hardcoded strings. Move them to string resources and reference them via stringResource for localization.

(Based on your team's feedback about avoiding hardcoded UI strings or colors.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/ui/component/dialog/ControllerTab.kt, line 48:

<comment>Dropdown labels are hardcoded strings. Move them to string resources and reference them via stringResource for localization.

(Based on your team's feedback about avoiding hardcoded UI strings or colors.) </comment>

<file context>
@@ -0,0 +1,92 @@
+            colors = settingsTileColors(),
+            title = { Text(text = stringResource(R.string.directinput_mapper_type)) },
+            value = if (config.dinputMapperType == 1.toByte()) 0 else 1,
+            items = listOf("Standard", "XInput Mapper"),
+            onItemSelected = { index ->
+                state.config.value = config.copy(dinputMapperType = if (index == 0) 1 else 2)
</file context>
Fix with Cubic

onItemSelected = { index ->
state.config.value = config.copy(dinputMapperType = if (index == 0) 1 else 2)
},
)
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.disable_mouse_input)) },
state = config.disableMouseInput,
onCheckedChange = { state.config.value = config.copy(disableMouseInput = it) },
)
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.touchscreen_mode)) },
subtitle = { Text(text = stringResource(R.string.touchscreen_mode_description)) },
state = config.touchscreenMode,
onCheckedChange = { state.config.value = config.copy(touchscreenMode = it) },
)
SettingsListDropdown(
colors = settingsTileColors(),
title = { Text(text = stringResource(R.string.external_display_input)) },
subtitle = { Text(text = stringResource(R.string.external_display_input_subtitle)) },
value = state.externalDisplayModeIndex.value,
items = state.externalDisplayModes,
onItemSelected = { index ->
state.externalDisplayModeIndex.value = index
state.config.value = config.copy(
externalDisplayMode = when (index) {
1 -> Container.EXTERNAL_DISPLAY_MODE_TOUCHPAD
2 -> Container.EXTERNAL_DISPLAY_MODE_KEYBOARD
3 -> Container.EXTERNAL_DISPLAY_MODE_HYBRID
else -> Container.EXTERNAL_DISPLAY_MODE_OFF
},
)
},
)
SettingsSwitch(
colors = settingsTileColorsAlt(),
title = { Text(text = stringResource(R.string.external_display_swap)) },
subtitle = { Text(text = stringResource(R.string.external_display_swap_subtitle)) },
state = config.externalDisplaySwap,
onCheckedChange = { state.config.value = config.copy(externalDisplaySwap = it) },
)
}
}
Loading