Refactoring

Cleaned up a project, removed uneccessary includes.
Fixed few errors, nothing major.
This commit is contained in:
Piotr Krygier committed 2025-06-20 13:44:33 +02:00
1 parent 42dc4d6fcd
commit 1f585b4d8e
20 files changed
+39 -71

No files matched your search

+5 -5
View File
@@ -15,7 +15,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define IMAGE_TAKEN 1U
#define IMAGE_FREE 0U
@@ -208,7 +207,7 @@ static rse_err_t create_vulkan_image(uint32_t width,
uint32_t height,
VkFormat format,
unsigned char* pixels,
uint8_t* texture_id)
uint16_t* texture_id)
{
rse_err_t status = RSE_ERROR_NO_ERROR;
struct rse_vulkan_buffer_t staging_buffer = {0};
@@ -222,9 +221,10 @@ static rse_err_t create_vulkan_image(uint32_t width,
VkExtent3D image_extent = {0};
VkImageViewCreateInfo image_view_create_info = {0};
struct rse_vulkan_image_t* free_texture_image = NULL;
*texture_id = 0U;
while(free_texture_image == NULL || *texture_id > RSE_MAX_IMAGE_COUNT) {
while(free_texture_image == NULL && *texture_id < RSE_MAX_IMAGE_COUNT) {
if(g_texture_images[*texture_id].id_taken == IMAGE_FREE) {
free_texture_image = &g_texture_images[*texture_id];
} else {
@@ -399,7 +399,7 @@ rse_err_t init_vulkan_images()
return status;
}
rse_err_t rse_load_texture(const char* file_path, uint8_t* texture_id)
rse_err_t rse_load_texture(const char* file_path, uint16_t* texture_id)
{
rse_err_t status = RSE_ERROR_NO_ERROR;
int width = 0;
@@ -493,4 +493,4 @@ rse_err_t find_depth_format(VkFormat* found_format)
return status;
#undef formats_count
}
}