From c3c0f8adf78a15ccc35945c7c99cc41f27e3d7d1 Mon Sep 17 00:00:00 2001 From: Sven Balzer <4653051+Kyuusokuna@users.noreply.github.com> Date: Sun, 28 Sep 2025 07:03:41 +0200 Subject: [PATCH] add F5 hotkey to reload tile assets --- src/main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 5e21371..428d749 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1941,6 +1941,23 @@ int main(int argc, char **argv) { SDL_free(map_path); } + if (event.key.key == SDLK_F5) { + recreate_tile_textures(); + WGPUBindGroupEntry world_bind_group_entries[] = { + { .binding = 0, .textureView = tile_textures_array_view }, + { .binding = 1, .sampler = pixel_sampler }, + { .binding = 2, .buffer = tint_color_buffer, .offset = 0, .size = WGPU_WHOLE_SIZE }, + }; + + WGPUBindGroupDescriptor world_bind_group_descriptor = { + .label = { .data = "world_bind_group", .length = WGPU_STRLEN }, + .layout = wgpuRenderPipelineGetBindGroupLayout(world_render_pipeline, 1), + .entryCount = SDL_arraysize(world_bind_group_entries), + .entries = world_bind_group_entries, + }; + world_bind_group = wgpuDeviceCreateBindGroup(device, &world_bind_group_descriptor); + } + if (event.key.key == SDLK_R) { if (selected_tile != -1 && selected_rotation != -1) { if (modifiers & SDL_KMOD_SHIFT) {