diff --git a/paint/plugins/plugins.c b/paint/plugins/plugins.c index ea77a463..2e6b350c 100644 --- a/paint/plugins/plugins.c +++ b/paint/plugins/plugins.c @@ -29,7 +29,7 @@ extern any_map_t *import_texture_importers; extern string_array_t *_path_texture_formats; string_array_t *path_texture_formats(void); extern any_map_t *util_mesh_unwrappers; -extern any_map_t *data_cached_images; +extern any_map_t *data_cached_textures; void import_texture_run(char *path, bool hdr_as_envmap); any_array_t *project_get_assets(void); void tab_textures_delete_texture(asset_t *asset); @@ -39,7 +39,7 @@ int plugins_split_by = 0; void io_psd_import_layer(char *file_name, char *layer_name, void *tex) { char *path = string("%s.%s.png", file_name, layer_name); - any_map_set(data_cached_images, path, tex); + any_map_set(data_cached_textures, path, tex); import_texture_run(path, false); } diff --git a/paint/sources/base.c b/paint/sources/base.c index 3123088e..c436ae86 100644 --- a/paint/sources/base.c +++ b/paint/sources/base.c @@ -497,10 +497,10 @@ void base_init() { g_font = data_get_font("font.ttf"); gc_root(g_font); - base_color_wheel = data_get_image("color_wheel.k"); + base_color_wheel = data_get_texture("color_wheel.k"); gc_root(base_color_wheel); - base_color_wheel_gradient = data_get_image("color_wheel_gradient.k"); + base_color_wheel_gradient = data_get_texture("color_wheel_gradient.k"); gc_root(base_color_wheel_gradient); config_load_theme(g_config->theme, false); base_default_element_w = g_theme->ELEMENT_W; @@ -523,7 +523,7 @@ void base_init() { } ui_nodes_enum_texts = base_combo_enum_texts; - ui_nodes_enum_images = base_combo_enum_images; + ui_nodes_enum_textures = base_combo_enum_textures; gc_root(ui_nodes_enum_texts); // Init plugins @@ -791,7 +791,7 @@ string_array_t *base_combo_enum_texts(char *node_type) { return NULL; } -any_array_t *base_combo_enum_images(char *node_type) { +any_array_t *base_combo_enum_textures(char *node_type) { if (string_equals(node_type, "TEX_IMAGE")) { any_array_t *ar = any_array_create(0); for (i32 i = 0; i < g_project->_->assets->length; ++i) { diff --git a/paint/sources/context.c b/paint/sources/context.c index 41a260d6..d5ac20cb 100644 --- a/paint/sources/context.c +++ b/paint/sources/context.c @@ -461,7 +461,7 @@ void context_load_envmap() { if (!g_context->envmap_loaded) { // TODO: Unable to share texture for both radiance and envmap - reload image g_context->envmap_loaded = true; - map_delete(data_cached_images, "World_radiance.k"); + map_delete(data_cached_textures, "World_radiance.k"); } world_data_load_envmap(scene_world); if (g_context->saved_envmap == NULL) { diff --git a/paint/sources/functions.h b/paint/sources/functions.h index ab433a59..6fe2a813 100644 --- a/paint/sources/functions.h +++ b/paint/sources/functions.h @@ -175,7 +175,7 @@ void base_update_workspace(); void base_update_workflow(); void base_run_in_player(); string_array_t *base_combo_enum_texts(char *node_type); -any_array_t *base_combo_enum_images(char *node_type); +any_array_t *base_combo_enum_textures(char *node_type); i32 base_get_asset_index(char *file_name); void base_toggle_fullscreen(); bool base_is_decal_layer(); diff --git a/paint/sources/io/export_texture.c b/paint/sources/io/export_texture.c index f9156da8..b2303294 100644 --- a/paint/sources/io/export_texture.c +++ b/paint/sources/io/export_texture.c @@ -32,7 +32,7 @@ static void export_texture_write_texture(char *file, buffer_t *pixels, i32 type, } #endif gpu_texture_t *image = gpu_create_texture_from_bytes(pixels, res_x, res_y, GPU_TEXTURE_FORMAT_RGBA32); - any_map_set(data_cached_images, file, image); + any_map_set(data_cached_textures, file, image); string_array_t *ar = string_split(file, PATH_SEP); char *name = ar->buffer[ar->length - 1]; asset_t *asset = GC_ALLOC_INIT(asset_t, {.name = name, .file = file, .id = g_project->_->next_asset_id++}); diff --git a/paint/sources/io/import_arm.c b/paint/sources/io/import_arm.c index 922e71cb..6d18de6d 100644 --- a/paint/sources/io/import_arm.c +++ b/paint/sources/io/import_arm.c @@ -96,7 +96,7 @@ void import_arm_make_pink(char *abs) { b->buffer[2] = 255; b->buffer[3] = 255; gpu_texture_t *pink = gpu_create_texture_from_bytes(b, 1, 1, GPU_TEXTURE_FORMAT_RGBA32); - any_map_set(data_cached_images, abs, pink); + any_map_set(data_cached_textures, abs, pink); } void import_arm_init_nodes(ui_node_t_array_t *nodes) { @@ -136,7 +136,7 @@ void import_arm_unpack_asset(project_t *project, char *abs, char *file, bool gc_ any_array_push(g_project->packed_assets, pa); } gpu_texture_t *image = gpu_create_texture_from_encoded_bytes(pa->bytes, ends_with(pa->name, ".jpg") ? ".jpg" : ".png"); - any_map_set(data_cached_images, abs, image); + any_map_set(data_cached_textures, abs, image); break; } } @@ -157,7 +157,7 @@ void import_arm_run_material_from_project(project_t *project, char *path) { abs = string_copy(path_normalize(abs)); import_arm_unpack_asset(project, abs, file, true); } - if (any_map_get(data_cached_images, abs) == NULL && !iron_file_exists(abs)) { + if (any_map_get(data_cached_textures, abs) == NULL && !iron_file_exists(abs)) { import_arm_make_pink(abs); } import_texture_run(abs, true); @@ -336,7 +336,7 @@ void import_arm_run_project(char *path) { abs = string_copy(path_normalize(abs)); import_arm_unpack_asset(g_project, abs, file, false); } - if (any_map_get(data_cached_images, abs) == NULL && !iron_file_exists(abs)) { + if (any_map_get(data_cached_textures, abs) == NULL && !iron_file_exists(abs)) { import_arm_make_pink(abs); } bool hdr_as_envmap = ends_with(abs, ".hdr") && string_equals(g_project->envmap, abs); @@ -694,7 +694,7 @@ void import_arm_run_brush_from_project(project_t *project, char *path) { abs = string_copy(path_normalize(abs)); import_arm_unpack_asset(project, abs, file, true); } - if (any_map_get(data_cached_images, abs) == NULL && !iron_file_exists(abs)) { + if (any_map_get(data_cached_textures, abs) == NULL && !iron_file_exists(abs)) { import_arm_make_pink(abs); } import_texture_run(abs, true); diff --git a/paint/sources/io/import_envmap.c b/paint/sources/io/import_envmap.c index ce439dd6..9664ea9b 100644 --- a/paint/sources/io/import_envmap.c +++ b/paint/sources/io/import_envmap.c @@ -29,7 +29,7 @@ void import_envmap_get_radiance_mip(gpu_texture_t *mip, i32 level, gpu_texture_t import_envmap_params.w = i; gpu_set_float4(import_envmap_params_loc, import_envmap_params.x, import_envmap_params.y, import_envmap_params.z, import_envmap_params.w); gpu_set_texture(import_envmap_radiance_loc, radiance); - gpu_texture_t *noise = data_get_image("bnoise256.k"); + gpu_texture_t *noise = data_get_texture("bnoise256.k"); gpu_set_texture(import_envmap_noise_loc, noise); gpu_draw(); gpu_end(); diff --git a/paint/sources/io/import_texture.c b/paint/sources/io/import_texture.c index e9356845..61cbdf41 100644 --- a/paint/sources/io/import_texture.c +++ b/paint/sources/io/import_texture.c @@ -7,7 +7,7 @@ typedef struct import_texture_data { } import_texture_data_t; gpu_texture_t *import_texture_default_importer(char *path) { - return data_get_image(path); + return data_get_texture(path); } void import_texture_run_on_next_frame(import_texture_data_t *itd) { @@ -28,7 +28,7 @@ void import_texture_run(char *path, bool hdr_as_envmap) { if (string_equals(a->file, path)) { // Set as envmap if (hdr_as_envmap && ends_with(to_lower_case(path), ".hdr")) { - gpu_texture_t *image = data_get_image(path); + gpu_texture_t *image = data_get_texture(path); import_texture_data_t *itd = GC_ALLOC_INIT(import_texture_data_t, {.path = path, .image = image}); sys_notify_on_next_frame(&import_texture_run_on_next_frame, itd); // Make sure file browser process did finish } @@ -40,7 +40,7 @@ void import_texture_run(char *path, bool hdr_as_envmap) { char *ext = substring(path, string_last_index_of(path, ".") + 1, string_length(path)); gpu_texture_t *(*importer)(char *path) = any_map_get(import_texture_importers, ext); - bool cached = any_map_get(data_cached_images, path) != NULL; // Already loaded or pink texture for missing file + bool cached = any_map_get(data_cached_textures, path) != NULL; // Already loaded or pink texture for missing file gpu_texture_t *image; if (importer == NULL || cached) { image = import_texture_default_importer(path); @@ -53,7 +53,7 @@ void import_texture_run(char *path, bool hdr_as_envmap) { return; } - any_map_set(data_cached_images, path, image); + any_map_set(data_cached_textures, path, image); string_array_t *ar = string_split(path, PATH_SEP); char *name = ar->buffer[ar->length - 1]; asset_t *asset = GC_ALLOC_INIT(asset_t, {.name = name, .file = path, .id = g_project->_->next_asset_id++}); diff --git a/paint/sources/minic_api.c b/paint/sources/minic_api.c index 12c12065..23af4976 100644 --- a/paint/sources/minic_api.c +++ b/paint/sources/minic_api.c @@ -812,13 +812,13 @@ void minic_register_builtins() { R(data_get_world, "p(p,p)"); R(data_get_shader, "p(p,p)"); R(data_get_scene_raw, "p(p)"); - R(data_get_image, "p(p)"); + R(data_get_texture, "p(p)"); R(data_get_blob, "p(p)"); R(data_get_video, "p(p)"); R(data_get_font, "p(p)"); R(data_delete_mesh, "v(p)"); R(data_delete_blob, "v(p)"); - R(data_delete_image, "v(p)"); + R(data_delete_texture, "v(p)"); R(data_delete_video, "v(p)"); R(data_delete_font, "v(p)"); R(data_is_abs, "b(p)"); diff --git a/paint/sources/nodes_material/bake_texture_node.c b/paint/sources/nodes_material/bake_texture_node.c index 8f48535f..3a475c48 100644 --- a/paint/sources/nodes_material/bake_texture_node.c +++ b/paint/sources/nodes_material/bake_texture_node.c @@ -254,7 +254,7 @@ static char *bake_texture_node_vector(ui_node_t *node, ui_node_socket_t *socket) if (rt == NULL || bake_texture_node_baking) { return "float3(0.0, 0.0, 0.0)"; } - any_map_set(data_cached_images, rt_name, rt->_image); + any_map_set(data_cached_textures, rt_name, rt->_image); bind_tex_t *tex = parser_material_make_bind_tex(rt_name, rt_name); char *texstore = parser_material_texture_store(node, tex, rt_name, COLOR_SPACE_AUTO); return string("%s.rgb", texstore); diff --git a/paint/sources/nodes_material/text_texture_node.c b/paint/sources/nodes_material/text_texture_node.c index 58c61120..f3ad0c18 100644 --- a/paint/sources/nodes_material/text_texture_node.c +++ b/paint/sources/nodes_material/text_texture_node.c @@ -9,13 +9,13 @@ void _parser_material_cache_tex_text_node_on_next_frame(char *text) { util_render_make_text_preview(); char *file = string("tex_text_%s", text); // TODO: remove old cache - any_map_set(data_cached_images, file, g_context->text_tool_image); + any_map_set(data_cached_textures, file, g_context->text_tool_image); g_context->text_tool_text = string_copy(_text_tool_text); g_context->text_tool_image = _text_tool_image; } void _parser_material_cache_tex_text_node(char *file, char *text) { - if (any_map_get(data_cached_images, file) == NULL) { + if (any_map_get(data_cached_textures, file) == NULL) { sys_notify_on_next_frame(&_parser_material_cache_tex_text_node_on_next_frame, text); } } diff --git a/paint/sources/nodes_neural/image_to_pbr_node.c b/paint/sources/nodes_neural/image_to_pbr_node.c index a6551c51..7e46a3fa 100644 --- a/paint/sources/nodes_neural/image_to_pbr_node.c +++ b/paint/sources/nodes_neural/image_to_pbr_node.c @@ -21,7 +21,7 @@ char *image_to_pbr_node_vector(ui_node_t *node, ui_node_socket_t *socket) { return "float3(0.0, 0.0, 0.0)"; } char *tex_name = string("%s%s", parser_material_node_name(node, NULL), i32_to_string(socket->id)); - any_map_set(data_cached_images, tex_name, result); + any_map_set(data_cached_textures, tex_name, result); bind_tex_t *tex = parser_material_make_bind_tex(tex_name, tex_name); char *texstore = parser_material_texture_store(node, tex, tex_name, COLOR_SPACE_AUTO); return string("%s.rgb", texstore); @@ -44,7 +44,7 @@ char *image_to_pbr_node_value(ui_node_t *node, ui_node_socket_t *socket) { } char *tex_name = string("%s%s", parser_material_node_name(node, NULL), i32_to_string(socket->id)); - any_map_set(data_cached_images, tex_name, result); + any_map_set(data_cached_textures, tex_name, result); bind_tex_t *tex = parser_material_make_bind_tex(tex_name, tex_name); char *texstore = parser_material_texture_store(node, tex, tex_name, COLOR_SPACE_AUTO); return string("%s.r", texstore); diff --git a/paint/sources/nodes_neural/neural_node.c b/paint/sources/nodes_neural/neural_node.c index 77c1ea5c..5c57fd9e 100644 --- a/paint/sources/nodes_neural/neural_node.c +++ b/paint/sources/nodes_neural/neural_node.c @@ -7,7 +7,7 @@ char *neural_node_vector(ui_node_t *node, ui_node_socket_t *socket) { return "float3(0.0, 0.0, 0.0)"; } char *tex_name = parser_material_node_name(node, NULL); - any_map_set(data_cached_images, tex_name, result); + any_map_set(data_cached_textures, tex_name, result); bind_tex_t *tex = parser_material_make_bind_tex(tex_name, tex_name); char *texstore = parser_material_texture_store(node, tex, tex_name, COLOR_SPACE_AUTO); return string("%s.rgb", texstore); @@ -19,7 +19,7 @@ char *neural_node_value(ui_node_t *node, ui_node_socket_t *socket) { return "0.0"; } char *tex_name = parser_material_node_name(node, NULL); - any_map_set(data_cached_images, tex_name, result); + any_map_set(data_cached_textures, tex_name, result); bind_tex_t *tex = parser_material_make_bind_tex(tex_name, tex_name); char *texstore = parser_material_texture_store(node, tex, tex_name, COLOR_SPACE_AUTO); return string("%s.r", texstore); diff --git a/paint/sources/nodes_neural/texture_mesh_node.c b/paint/sources/nodes_neural/texture_mesh_node.c index aece6e22..f53dae82 100644 --- a/paint/sources/nodes_neural/texture_mesh_node.c +++ b/paint/sources/nodes_neural/texture_mesh_node.c @@ -270,7 +270,7 @@ static void texture_mesh_node_project(ui_node_t *node) { gpu_texture_t *sd_tex = iron_load_texture(output); any_imap_set(neural_node_results, node->outputs->buffer[0]->id, sd_tex); - any_map_set(data_cached_images, node_name, sd_tex); + any_map_set(data_cached_textures, node_name, sd_tex); texture_mesh_node_set_view(v); camera_object_build_mat(scene_camera); diff --git a/paint/sources/project.c b/paint/sources/project.c index e57b198c..96c44070 100644 --- a/paint/sources/project.c +++ b/paint/sources/project.c @@ -102,7 +102,7 @@ void project_cleanup() { for (i32 i = 0; i < g_project->_->assets->length; ++i) { asset_t *a = g_project->_->assets->buffer[i]; - data_delete_image(a->file); + data_delete_texture(a->file); } } @@ -450,7 +450,7 @@ void project_reimport_texture_load_on_next_frame(void *_) { void project_reimport_texture_load(char *path, asset_t *asset) { asset->file = string_copy(path); i32 i = array_index_of(g_project->_->assets, asset); - data_delete_image(asset->file); + data_delete_texture(asset->file); asset_t *old_asset = g_project->_->assets->buffer[i]; array_splice(g_project->_->assets, i, 1); import_texture_run(asset->file, true); diff --git a/paint/sources/resource.c b/paint/sources/resource.c index 039c0fc2..69d57cea 100644 --- a/paint/sources/resource.c +++ b/paint/sources/resource.c @@ -4,7 +4,7 @@ void resource_load(string_array_t *names) { for (i32 i = 0; i < names->length; ++i) { char *s = names->buffer[i]; - gpu_texture_t *image = data_get_image(s); + gpu_texture_t *image = data_get_texture(s); any_map_set(resource_bundled, s, image); } } diff --git a/paint/sources/ui/box_projects.c b/paint/sources/ui/box_projects.c index 6a5141d8..a928126a 100644 --- a/paint/sources/ui/box_projects.c +++ b/paint/sources/ui/box_projects.c @@ -28,7 +28,7 @@ void box_projects_tab_on_next_frame(char *path) { } void box_projects_draw_badge() { - gpu_texture_t *img = data_get_image("badge.k"); + gpu_texture_t *img = data_get_texture("badge.k"); ui_image(img, 0xffffffff, -1.0); ui_end_element(); } @@ -112,7 +112,7 @@ void box_projects_tab() { } gpu_texture_t *icon = any_map_get(box_projects_icon_map, icon_path); if (icon == NULL) { - gpu_texture_t *image = data_get_image(icon_path); + gpu_texture_t *image = data_get_texture(icon_path); icon = image; any_map_set(box_projects_icon_map, icon_path, icon); } @@ -218,7 +218,7 @@ void box_projects_show() { string_array_t *keys = map_keys(box_projects_icon_map); for (i32 i = 0; i < keys->length; ++i) { char *handle = keys->buffer[i]; - data_delete_image(handle); + data_delete_texture(handle); } gc_unroot(box_projects_icon_map); box_projects_icon_map = NULL; diff --git a/paint/sources/ui/tab_textures.c b/paint/sources/ui/tab_textures.c index 3d42296d..e221be2f 100644 --- a/paint/sources/ui/tab_textures.c +++ b/paint/sources/ui/tab_textures.c @@ -86,7 +86,7 @@ void tab_textures_delete_texture(asset_t *asset) { ui_toolbar_handle->redraws = 1; } - if (data_get_image(asset->file) == scene_world->_->envmap) { + if (data_get_texture(asset->file) == scene_world->_->envmap) { project_set_default_envmap(); } @@ -100,7 +100,7 @@ void tab_textures_delete_texture(asset_t *asset) { } } - data_delete_image(asset->file); + data_delete_texture(asset->file); array_splice(g_project->_->assets, index, 1); sys_notify_on_next_frame(&tab_textures_delete_texture_on_next_frame, NULL); diff --git a/paint/sources/ui/ui_base.c b/paint/sources/ui/ui_base.c index 8c138f16..95787f5a 100644 --- a/paint/sources/ui/ui_base.c +++ b/paint/sources/ui/ui_base.c @@ -281,7 +281,7 @@ void ui_base_update(void *_) { // Nothing to display in the main area if (!base_view3d_show && !ui_nodes_show && !ui_view2d_show) { draw_begin(NULL, true, g_theme->SEPARATOR_COL); - gpu_texture_t *img = data_get_image("badge_bw.k"); + gpu_texture_t *img = data_get_texture("badge_bw.k"); draw_set_color(0x22ffffff); draw_image(img, base_view3d_w() / 2.0 - img->width / 2.0, base_h() / 2.0 - img->height / 2.0); draw_end(); diff --git a/paint/sources/ui/ui_files.c b/paint/sources/ui/ui_files.c index 225f6d71..5ac50a50 100644 --- a/paint/sources/ui/ui_files.c +++ b/paint/sources/ui/ui_files.c @@ -102,7 +102,7 @@ void ui_files_file_browser_on_cache_cloud_done_on_next_frame(draw_cloud_icon_dat void ui_files_file_browser_on_cache_cloud_done(char *abs) { if (abs != NULL) { - gpu_texture_t *image = data_get_image(string_copy(abs)); + gpu_texture_t *image = data_get_texture(string_copy(abs)); if (image != NULL) { #ifdef IRON_WINDOWS abs = string_copy(string_replace_all(abs, "\\", "/")); @@ -155,7 +155,7 @@ static void ui_files_clear_icon_map(void) { char *icon_file = ui_files_icon_file_map->keys->buffer[i]; if (icon_file != NULL) { char *path = string("%s%s%s%s", dest, ui_files_last_path, PATH_SEP, icon_file); - data_delete_image(path); + data_delete_texture(path); } } } @@ -187,7 +187,7 @@ void ui_files_make_icon(ui_files_make_icon_t *args) { } if (!found) { - data_delete_image(args->shandle); // The big image is not needed anymore + data_delete_texture(args->shandle); // The big image is not needed anymore } } @@ -463,7 +463,7 @@ char *ui_files_file_browser(ui_handle_t *handle, bool drag_files, char *search, render_target_t *rt = any_map_get(render_path_render_targets, "empty_black"); gpu_texture_t *empty = rt->_image; any_map_set(ui_files_icon_map, shandle, empty); - gpu_texture_t *image = data_get_image(shandle); + gpu_texture_t *image = data_get_texture(shandle); if (image != NULL) { ui_files_make_icon_t *args = GC_ALLOC_INIT(ui_files_make_icon_t, {.image = image, .shandle = shandle, .w = w}); diff --git a/paint/sources/ui/ui_header.c b/paint/sources/ui/ui_header.c index 1c63a396..9150b8e4 100644 --- a/paint/sources/ui/ui_header.c +++ b/paint/sources/ui/ui_header.c @@ -172,7 +172,7 @@ void ui_header_draw_tool_properties() { colorid_handle->i = g_context->colorid; g_context->colorid = ui_combo(colorid_handle, base_combo_enum_texts("TEX_IMAGE"), tr("Color ID"), false, UI_ALIGN_LEFT, true); if (colorid_handle == g_ui->combo_selected_handle) { - g_ui->combo_selected_images = base_combo_enum_images("TEX_IMAGE"); + g_ui->combo_selected_images = base_combo_enum_textures("TEX_IMAGE"); } if (colorid_handle->changed) { g_context->ddirty = 2; diff --git a/paint/sources/ui/ui_menubar.c b/paint/sources/ui/ui_menubar.c index ddb644a5..711856cd 100644 --- a/paint/sources/ui/ui_menubar.c +++ b/paint/sources/ui/ui_menubar.c @@ -109,7 +109,7 @@ void ui_menubar_draw_tab_header() { } void ui_menubar_draw_category_items_about_box() { - gpu_texture_t *img = data_get_image("badge.k"); + gpu_texture_t *img = data_get_texture("badge.k"); ui_image(img, 0xffffffff, -1.0); ui_end_element(); diff --git a/paint/sources/ui/ui_nodes.c b/paint/sources/ui/ui_nodes.c index 849103dc..647291f0 100644 --- a/paint/sources/ui/ui_nodes.c +++ b/paint/sources/ui/ui_nodes.c @@ -1220,8 +1220,8 @@ void ui_nodes_accept_swatch_drop(swatch_color_t *swatch) { } void ui_viewnodes_init() { - ui_nodes_preview_image = ui_nodes_get_node_preview_image; - gc_root(ui_nodes_preview_image); + ui_nodes_preview_texture = ui_nodes_get_node_preview_image; + gc_root(ui_nodes_preview_texture); ui_nodes_on_link_drag = ui_viewnodes_on_link_drag; gc_root(ui_nodes_on_link_drag); diff --git a/paint/sources/util/util_texture.c b/paint/sources/util/util_texture.c index 31fb36f9..dfdd9ade 100644 --- a/paint/sources/util/util_texture.c +++ b/paint/sources/util/util_texture.c @@ -33,6 +33,6 @@ void util_texture_capture_output(gpu_texture_t *img, char *basename, bool bgra) packed_asset_t *pa = GC_ALLOC_INIT(packed_asset_t, {.name = abs, .bytes = bytes}); any_array_push(g_project->packed_assets, pa); gpu_texture_t *copy = gpu_create_texture_from_encoded_bytes(bytes, ".png"); - any_map_set(data_cached_images, abs, copy); + any_map_set(data_cached_textures, abs, copy); import_texture_run(abs, true); } diff --git a/paint/sources/viewport.c b/paint/sources/viewport.c index a74e7157..43095b58 100644 --- a/paint/sources/viewport.c +++ b/paint/sources/viewport.c @@ -112,7 +112,7 @@ void viewport_save_texture(gpu_texture_t *screenshot) { packed_asset_t *pa = GC_ALLOC_INIT(packed_asset_t, {.name = abs, .bytes = iron_encode_png(gpu_get_texture_pixels(screenshot), screenshot->width, screenshot->height, 0)}); any_array_push(g_project->packed_assets, pa); - any_map_set(data_cached_images, abs, screenshot); + any_map_set(data_cached_textures, abs, screenshot); import_texture_run(abs, true); }