mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-17 16:17:02 +08:00
fix: can't load image
This commit is contained in:
@@ -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"
|
|
||||||
)
|
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user