fix: can't load image

This commit is contained in:
2026-04-16 13:00:19 +08:00
parent cd107fa35d
commit ecc1595a39
2 changed files with 1 additions and 9 deletions

View File

@@ -151,11 +151,3 @@ if (UNIX AND NOT APPLE)
target_compile_options(${PROJECT_NAME} PRIVATE ${EGL_CFLAGS_OTHER} ${Wayland_CFLAGS_OTHER}) target_compile_options(${PROJECT_NAME} PRIVATE ${EGL_CFLAGS_OTHER} ${Wayland_CFLAGS_OTHER})
endif() endif()
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PROJECT_SOURCE_DIR}/src/shaders"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/shaders"
COMMENT "Copying shaders to output directory"
)

View File

@@ -125,7 +125,7 @@ namespace Tools {
CUBED_ASSERT_MSG(fs::is_regular_file(path), path.c_str()); CUBED_ASSERT_MSG(fs::is_regular_file(path), path.c_str());
unsigned char* data = nullptr; unsigned char* data = nullptr;
int width, height, channels; int width, height, channels;
data = SOIL_load_image(path.c_str(), &width, &height, &channels, SOIL_LOAD_AUTO); data = SOIL_load_image(path.string().c_str(), &width, &height, &channels, SOIL_LOAD_AUTO);
CUBED_ASSERT_MSG(data, "Could not load texture" + path.string()); CUBED_ASSERT_MSG(data, "Could not load texture" + path.string());
return data; return data;