From 73dfb580cbed0dd9d2bdab65dac06ae4048f68c0 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 28 Nov 2020 23:32:51 +0100 Subject: [PATCH] filter/displacement: Fix unicode support Related: #359 --- source/filters/filter-displacement.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/source/filters/filter-displacement.cpp b/source/filters/filter-displacement.cpp index c9a79f90..9341d3a9 100644 --- a/source/filters/filter-displacement.cpp +++ b/source/filters/filter-displacement.cpp @@ -33,14 +33,7 @@ using namespace streamfx::filter::displacement; displacement_instance::displacement_instance(obs_data_t* data, obs_source_t* context) : obs::source_instance(data, context) { - std::string effect = ""; - { - char* buf = obs_module_file("effects/displace.effect"); - effect = buf; - bfree(buf); - } - - _effect = gs::effect::create(effect); + _effect = gs::effect::create(streamfx::data_file_path("effects/displace.effect").u8string()); update(data); } @@ -141,12 +134,8 @@ const char* displacement_factory::get_name() void displacement_factory::get_defaults2(obs_data_t* data) { - { - char* disp = obs_module_file("examples/normal-maps/neutral.png"); - obs_data_set_default_string(data, ST_FILE, disp); - bfree(disp); - } - + obs_data_set_default_string(data, ST_FILE, + streamfx::data_file_path("examples/normal-maps/neutral.png").u8string().c_str()); obs_data_set_default_double(data, ST_SCALE, 0.0); obs_data_set_default_double(data, ST_SCALE_TYPE, 0.0); } @@ -159,9 +148,7 @@ obs_properties_t* displacement_factory::get_properties2(displacement_instance* d if (data) { path = data->get_file(); } else { - char* buf = obs_module_file("examples/normal-maps/neutral.png"); - path = buf; - bfree(buf); + path = streamfx::data_file_path("examples/normal-maps/neutral.png").u8string(); } {