paint: move filter textures option to config

This commit is contained in:
luboslenco
2026-06-09 18:04:19 +02:00
parent e16e540d23
commit 1cd4467e67
6 changed files with 14 additions and 9 deletions
+4
View File
@@ -513,6 +513,10 @@ void base_init() {
}
}
if (!g_config->texture_filter) {
gpu_use_linear_sampling(false);
}
args_parse();
camera_init();
ui_base_init();
+2
View File
@@ -76,6 +76,7 @@ void config_save() {
json_encode_f32("rp_vignette", g_config->rp_vignette);
json_encode_f32("rp_grain", g_config->rp_grain);
json_encode_string("lut_path", g_config->lut_path);
json_encode_bool("texture_filter", g_config->texture_filter);
json_encode_string_array("recent_projects", g_config->recent_projects);
json_encode_string_array("bookmarks", g_config->bookmarks);
json_encode_string_array("plugins", g_config->plugins);
@@ -181,6 +182,7 @@ void config_init() {
g_config->rp_vignette = 0.2;
g_config->rp_grain = 0.09;
g_config->lut_path = "";
g_config->texture_filter = true;
#if defined(IRON_ANDROID) || defined(IRON_IOS)
g_config->rp_ssao = false;
#else
-1
View File
@@ -23,7 +23,6 @@ void context_init() {
g_context->envmap_angle = 0.0;
g_context->light_angle = 0.0;
g_context->cull_backfaces = true;
g_context->texture_filter = true;
g_context->format_type = TEXTURE_LDR_FORMAT_PNG;
g_context->format_quality = 100.0;
g_context->layers_destination = EXPORT_DESTINATION_DISK;
+1 -1
View File
@@ -89,6 +89,7 @@ typedef struct config {
f32 rp_vignette;
f32 rp_grain;
char *lut_path; // .cube
bool texture_filter;
// Application
struct string_array *recent_projects; // Recently opened projects
struct string_array *bookmarks; // Bookmarked folders in browser
@@ -207,7 +208,6 @@ typedef struct context {
f32 envmap_angle;
f32 light_angle;
bool cull_backfaces;
bool texture_filter;
texture_ldr_format_t format_type;
f32 format_quality;
export_destination_t layers_destination;
+7
View File
@@ -752,6 +752,13 @@ void box_preferences_viewport_tab() {
if (ui_icon_button("", ICON_FOLDER_OPEN, UI_ALIGN_CENTER)) {
ui_files_show("cube", false, false, &box_preferences_lut_picked);
}
ui_handle_t *filter_handle = ui_handle(__ID__);
filter_handle->b = g_config->texture_filter;
g_config->texture_filter = ui_check(filter_handle, string(" %s", tr("Filter Textures")), "");
if (filter_handle->changed) {
gpu_use_linear_sampling(g_config->texture_filter);
}
}
// ██╗ ██╗███████╗██╗ ██╗███╗ ███╗ █████╗ ██████╗
-7
View File
@@ -454,13 +454,6 @@ void ui_menubar_draw_category_items() {
make_material_parse_mesh_material();
}
ui_handle_t *filter_handle = ui_handle(__ID__);
filter_handle->b = g_context->texture_filter;
g_context->texture_filter = ui_check(filter_handle, string(" %s", tr("Filter Textures")), "");
if (filter_handle->changed) {
gpu_use_linear_sampling(g_context->texture_filter);
}
ui_handle_t *wireframe_handle = ui_handle(__ID__);
wireframe_handle->b = g_context->draw_wireframe;
g_context->draw_wireframe = ui_check(wireframe_handle, string(" %s", tr("Wireframe")), "");