diff --git a/source/filters/filter-blur.cpp b/source/filters/filter-blur.cpp index 4ccba65a..e48ea229 100644 --- a/source/filters/filter-blur.cpp +++ b/source/filters/filter-blur.cpp @@ -147,8 +147,8 @@ filter::blur::blur_factory::blur_factory() // Translation Cache /// File Filter for Images _translation_map.insert({std::string("image-filter"), std::string(D_TRANSLATE(S_FILETYPE_IMAGES)) - + std::string(" (" S_FILEFILTERS_IMAGE ");;") - + std::string("* (*.*)")}); + + std::string(" (" S_FILEFILTERS_IMAGE ");;") + + std::string("* (*.*)")}); } filter::blur::blur_factory::~blur_factory() {} @@ -669,7 +669,8 @@ obs_properties_t* filter::blur::blur_instance::get_properties() obs_property_list_add_int(p, D_TRANSLATE(ST_MASK_TYPE_IMAGE), mask_type::Image); obs_property_list_add_int(p, D_TRANSLATE(ST_MASK_TYPE_SOURCE), mask_type::Source); /// Region - p = obs_properties_add_float_slider(pr, ST_MASK_REGION_LEFT, D_TRANSLATE(ST_MASK_REGION_LEFT), 0.0, 100.0, 0.01); + p = obs_properties_add_float_slider(pr, ST_MASK_REGION_LEFT, D_TRANSLATE(ST_MASK_REGION_LEFT), 0.0, 100.0, + 0.01); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_MASK_REGION_LEFT))); p = obs_properties_add_float_slider(pr, ST_MASK_REGION_TOP, D_TRANSLATE(ST_MASK_REGION_TOP), 0.0, 100.0, 0.01); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_MASK_REGION_TOP))); @@ -780,7 +781,7 @@ void filter::blur::blur_instance::update(obs_data_t* settings) break; } if ((_mask.type == mask_type::Image) || (_mask.type == mask_type::Source)) { - uint32_t color = static_cast(obs_data_get_int(settings, ST_MASK_COLOR)); + uint32_t color = static_cast(obs_data_get_int(settings, ST_MASK_COLOR)); _mask.color.r = ((color >> 0) & 0xFF) / 255.0f; _mask.color.g = ((color >> 8) & 0xFF) / 255.0f; _mask.color.b = ((color >> 16) & 0xFF) / 255.0f; diff --git a/source/filters/filter-dynamic-mask.cpp b/source/filters/filter-dynamic-mask.cpp index 9d3ddeb5..f563b97e 100644 --- a/source/filters/filter-dynamic-mask.cpp +++ b/source/filters/filter-dynamic-mask.cpp @@ -251,7 +251,7 @@ void filter::dynamic_mask::dynamic_mask_instance::update(obs_data_t* settings) this->_input = std::make_shared(obs_data_get_string(settings, ST_INPUT)); this->_input_capture = std::make_shared(this->_input, _self); this->_input->events.rename += std::bind(&filter::dynamic_mask::dynamic_mask_instance::input_renamed, this, - std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); } catch (...) { this->_input.reset(); this->_input_capture.reset(); @@ -477,7 +477,8 @@ void filter::dynamic_mask::dynamic_mask_instance::video_render(gs_effect_t* in_e obs_source_skip_video_filter(this->_self); return; } - if (!this->_filter_texture->get_object() || !this->_input_texture->get_object() || !this->_final_texture->get_object()) { + if (!this->_filter_texture->get_object() || !this->_input_texture->get_object() + || !this->_final_texture->get_object()) { obs_source_skip_video_filter(this->_self); return; } diff --git a/source/filters/filter-sdf-effects.cpp b/source/filters/filter-sdf-effects.cpp index d13a2e1c..8c9564cb 100644 --- a/source/filters/filter-sdf-effects.cpp +++ b/source/filters/filter-sdf-effects.cpp @@ -375,8 +375,8 @@ obs_properties_t* filter::sdf_effects::sdf_effects_instance::get_properties() obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADOW_OUTER_OFFSET_Y))); p = obs_properties_add_color(props, ST_SHADOW_OUTER_COLOR, D_TRANSLATE(ST_SHADOW_OUTER_COLOR)); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADOW_OUTER_COLOR))); - p = obs_properties_add_float_slider(props, ST_SHADOW_OUTER_ALPHA, D_TRANSLATE(ST_SHADOW_OUTER_ALPHA), 0.0, 100.0, - 0.1); + p = obs_properties_add_float_slider(props, ST_SHADOW_OUTER_ALPHA, D_TRANSLATE(ST_SHADOW_OUTER_ALPHA), 0.0, + 100.0, 0.1); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADOW_OUTER_ALPHA))); } @@ -398,8 +398,8 @@ obs_properties_t* filter::sdf_effects::sdf_effects_instance::get_properties() obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADOW_INNER_OFFSET_Y))); p = obs_properties_add_color(props, ST_SHADOW_INNER_COLOR, D_TRANSLATE(ST_SHADOW_INNER_COLOR)); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADOW_INNER_COLOR))); - p = obs_properties_add_float_slider(props, ST_SHADOW_INNER_ALPHA, D_TRANSLATE(ST_SHADOW_INNER_ALPHA), 0.0, 100.0, - 0.1); + p = obs_properties_add_float_slider(props, ST_SHADOW_INNER_ALPHA, D_TRANSLATE(ST_SHADOW_INNER_ALPHA), 0.0, + 100.0, 0.1); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_SHADOW_INNER_ALPHA))); } @@ -456,7 +456,8 @@ obs_properties_t* filter::sdf_effects::sdf_effects_instance::get_properties() p = obs_properties_add_float_slider(props, ST_OUTLINE_WIDTH, D_TRANSLATE(ST_OUTLINE_WIDTH), 0.0, 16.0, 0.01); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_OUTLINE_OFFSET))); - p = obs_properties_add_float_slider(props, ST_OUTLINE_OFFSET, D_TRANSLATE(ST_OUTLINE_OFFSET), -16.0, 16.0, 0.01); + p = obs_properties_add_float_slider(props, ST_OUTLINE_OFFSET, D_TRANSLATE(ST_OUTLINE_OFFSET), -16.0, 16.0, + 0.01); obs_property_set_long_description(p, D_TRANSLATE(D_DESC(ST_OUTLINE_SHARPNESS))); p = obs_properties_add_float_slider(props, ST_OUTLINE_SHARPNESS, D_TRANSLATE(ST_OUTLINE_SHARPNESS), 0.00, 100.0, @@ -492,7 +493,7 @@ void filter::sdf_effects::sdf_effects_instance::update(obs_data_t* data) uint8_t r, g, b, a; } c; }; - color = uint32_t(obs_data_get_int(data, ST_SHADOW_OUTER_COLOR)); + color = uint32_t(obs_data_get_int(data, ST_SHADOW_OUTER_COLOR)); this->_outer_shadow_color.x = float_t(c.r / 255.0); this->_outer_shadow_color.y = float_t(c.g / 255.0); this->_outer_shadow_color.z = float_t(c.b / 255.0); @@ -516,7 +517,7 @@ void filter::sdf_effects::sdf_effects_instance::update(obs_data_t* data) uint8_t r, g, b, a; } c; }; - color = uint32_t(obs_data_get_int(data, ST_SHADOW_INNER_COLOR)); + color = uint32_t(obs_data_get_int(data, ST_SHADOW_INNER_COLOR)); this->_inner_shadow_color.x = float_t(c.r / 255.0); this->_inner_shadow_color.y = float_t(c.g / 255.0); this->_inner_shadow_color.z = float_t(c.b / 255.0); @@ -540,7 +541,7 @@ void filter::sdf_effects::sdf_effects_instance::update(obs_data_t* data) uint8_t r, g, b, a; } c; }; - color = uint32_t(obs_data_get_int(data, ST_GLOW_OUTER_COLOR)); + color = uint32_t(obs_data_get_int(data, ST_GLOW_OUTER_COLOR)); this->_outer_glow_color.x = float_t(c.r / 255.0); this->_outer_glow_color.y = float_t(c.g / 255.0); this->_outer_glow_color.z = float_t(c.b / 255.0); @@ -566,7 +567,7 @@ void filter::sdf_effects::sdf_effects_instance::update(obs_data_t* data) uint8_t r, g, b, a; } c; }; - color = uint32_t(obs_data_get_int(data, ST_GLOW_INNER_COLOR)); + color = uint32_t(obs_data_get_int(data, ST_GLOW_INNER_COLOR)); this->_inner_glow_color.x = float_t(c.r / 255.0); this->_inner_glow_color.y = float_t(c.g / 255.0); this->_inner_glow_color.z = float_t(c.b / 255.0); @@ -582,7 +583,7 @@ void filter::sdf_effects::sdf_effects_instance::update(obs_data_t* data) { this->_outline = obs_data_get_bool(data, ST_OUTLINE) - && (obs_data_get_double(data, ST_OUTLINE_ALPHA) >= std::numeric_limits::epsilon()); + && (obs_data_get_double(data, ST_OUTLINE_ALPHA) >= std::numeric_limits::epsilon()); { union { uint32_t color; @@ -591,7 +592,7 @@ void filter::sdf_effects::sdf_effects_instance::update(obs_data_t* data) uint8_t r, g, b, a; } c; }; - color = uint32_t(obs_data_get_int(data, ST_OUTLINE_COLOR)); + color = uint32_t(obs_data_get_int(data, ST_OUTLINE_COLOR)); this->_outline_color.x = float_t(c.r / 255.0); this->_outline_color.y = float_t(c.g / 255.0); this->_outline_color.z = float_t(c.b / 255.0); @@ -801,7 +802,7 @@ void filter::sdf_effects::sdf_effects_instance::video_render(gs_effect_t* effect consumer_effect->get_parameter("pShadowMax")->set_float(this->_outer_shadow_range_max); consumer_effect->get_parameter("pShadowOffset") ->set_float2(this->_outer_shadow_offset_x / float_t(baseW), - this->_outer_shadow_offset_y / float_t(baseH)); + this->_outer_shadow_offset_y / float_t(baseH)); while (gs_effect_loop(consumer_effect->get_object(), "ShadowOuter")) { gs_draw_sprite(0, 0, 1, 1); } @@ -815,7 +816,7 @@ void filter::sdf_effects::sdf_effects_instance::video_render(gs_effect_t* effect consumer_effect->get_parameter("pShadowMax")->set_float(this->_inner_shadow_range_max); consumer_effect->get_parameter("pShadowOffset") ->set_float2(this->_inner_shadow_offset_x / float_t(baseW), - this->_inner_shadow_offset_y / float_t(baseH)); + this->_inner_shadow_offset_y / float_t(baseH)); while (gs_effect_loop(consumer_effect->get_object(), "ShadowInner")) { gs_draw_sprite(0, 0, 1, 1); } diff --git a/source/gfx/blur/gfx-blur-box-linear.cpp b/source/gfx/blur/gfx-blur-box-linear.cpp index b4b77f35..ee6a955d 100644 --- a/source/gfx/blur/gfx-blur-box-linear.cpp +++ b/source/gfx/blur/gfx-blur-box-linear.cpp @@ -39,7 +39,7 @@ gfx::blur::box_linear_data::box_linear_data() auto gctx = gs::context(); try { char* file = obs_module_file("effects/blur/box-linear.effect"); - _effect = std::make_shared<::gs::effect>(file); + _effect = std::make_shared<::gs::effect>(file); bfree(file); } catch (...) { P_LOG_ERROR(" Failed to load _effect."); @@ -174,7 +174,7 @@ std::shared_ptr<::gfx::blur::box_linear_data> gfx::blur::box_linear_factory::dat std::unique_lock ulock(_data_lock); std::shared_ptr<::gfx::blur::box_linear_data> data = _data.lock(); if (!data) { - data = std::make_shared<::gfx::blur::box_linear_data>(); + data = std::make_shared<::gfx::blur::box_linear_data>(); _data = data; } return data; diff --git a/source/gfx/blur/gfx-blur-box.cpp b/source/gfx/blur/gfx-blur-box.cpp index 603ecbaa..f3f2dbbd 100644 --- a/source/gfx/blur/gfx-blur-box.cpp +++ b/source/gfx/blur/gfx-blur-box.cpp @@ -39,7 +39,7 @@ gfx::blur::box_data::box_data() auto gctx = gs::context(); try { char* file = obs_module_file("effects/blur/box.effect"); - _effect = std::make_shared<::gs::effect>(file); + _effect = std::make_shared<::gs::effect>(file); bfree(file); } catch (...) { P_LOG_ERROR(" Failed to load _effect."); @@ -182,7 +182,7 @@ std::shared_ptr<::gfx::blur::box_data> gfx::blur::box_factory::data() std::unique_lock ulock(_data_lock); std::shared_ptr<::gfx::blur::box_data> data = _data.lock(); if (!data) { - data = std::make_shared<::gfx::blur::box_data>(); + data = std::make_shared<::gfx::blur::box_data>(); _data = data; } return data; @@ -196,7 +196,7 @@ std::shared_ptr<::gfx::blur::box_data> gfx::blur::box_factory::data() gfx::blur::box::box() : _data(::gfx::blur::box_factory::get().data()), _size(1.), _step_scale({1., 1.}) { - auto gctx = gs::context(); + auto gctx = gs::context(); _rendertarget = std::make_shared<::gs::rendertarget>(GS_RGBA, GS_ZS_NONE); _rendertarget2 = std::make_shared<::gs::rendertarget>(GS_RGBA, GS_ZS_NONE); } diff --git a/source/gfx/blur/gfx-blur-dual-filtering.cpp b/source/gfx/blur/gfx-blur-dual-filtering.cpp index 8b458758..b39e941f 100644 --- a/source/gfx/blur/gfx-blur-dual-filtering.cpp +++ b/source/gfx/blur/gfx-blur-dual-filtering.cpp @@ -55,7 +55,7 @@ gfx::blur::dual_filtering_data::dual_filtering_data() auto gctx = gs::context(); try { char* file = obs_module_file("effects/blur/dual-filtering.effect"); - _effect = std::make_shared<::gs::effect>(file); + _effect = std::make_shared<::gs::effect>(file); bfree(file); } catch (...) { P_LOG_ERROR(" Failed to load _effect."); @@ -167,7 +167,7 @@ std::shared_ptr<::gfx::blur::dual_filtering_data> gfx::blur::dual_filtering_fact std::unique_lock ulock(_data_lock); std::shared_ptr<::gfx::blur::dual_filtering_data> data = _data.lock(); if (!data) { - data = std::make_shared<::gfx::blur::dual_filtering_data>(); + data = std::make_shared<::gfx::blur::dual_filtering_data>(); _data = data; } return data; diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.cpp b/source/gfx/blur/gfx-blur-gaussian-linear.cpp index c0e7eb34..41034652 100644 --- a/source/gfx/blur/gfx-blur-gaussian-linear.cpp +++ b/source/gfx/blur/gfx-blur-gaussian-linear.cpp @@ -46,7 +46,7 @@ gfx::blur::gaussian_linear_data::gaussian_linear_data() { char* file = obs_module_file("effects/blur/gaussian-linear.effect"); - _effect = gs::effect::create(file); + _effect = gs::effect::create(file); bfree(file); } @@ -219,7 +219,7 @@ std::shared_ptr<::gfx::blur::gaussian_linear_data> gfx::blur::gaussian_linear_fa std::unique_lock ulock(_data_lock); std::shared_ptr<::gfx::blur::gaussian_linear_data> data = _data.lock(); if (!data) { - data = std::make_shared<::gfx::blur::gaussian_linear_data>(); + data = std::make_shared<::gfx::blur::gaussian_linear_data>(); _data = data; } return data; diff --git a/source/gfx/blur/gfx-blur-gaussian.cpp b/source/gfx/blur/gfx-blur-gaussian.cpp index eef687f6..00908393 100644 --- a/source/gfx/blur/gfx-blur-gaussian.cpp +++ b/source/gfx/blur/gfx-blur-gaussian.cpp @@ -46,7 +46,7 @@ gfx::blur::gaussian_data::gaussian_data() auto gctx = gs::context(); { char* file = obs_module_file("effects/blur/gaussian.effect"); - _effect = gs::effect::create(file); + _effect = gs::effect::create(file); bfree(file); } @@ -227,7 +227,7 @@ std::shared_ptr<::gfx::blur::gaussian_data> gfx::blur::gaussian_factory::data() std::unique_lock ulock(_data_lock); std::shared_ptr<::gfx::blur::gaussian_data> data = _data.lock(); if (!data) { - data = std::make_shared<::gfx::blur::gaussian_data>(); + data = std::make_shared<::gfx::blur::gaussian_data>(); _data = data; } return data; @@ -239,10 +239,9 @@ std::shared_ptr<::gfx::blur::gaussian_data> gfx::blur::gaussian_factory::data() return instance; } -gfx::blur::gaussian::gaussian() - : _data(::gfx::blur::gaussian_factory::get().data()), _size(1.), _step_scale({1., 1.}) +gfx::blur::gaussian::gaussian() : _data(::gfx::blur::gaussian_factory::get().data()), _size(1.), _step_scale({1., 1.}) { - auto gctx = gs::context(); + auto gctx = gs::context(); _rendertarget = std::make_shared(GS_RGBA, GS_ZS_NONE); _rendertarget2 = std::make_shared(GS_RGBA, GS_ZS_NONE); } diff --git a/source/gfx/gfx-source-texture.cpp b/source/gfx/gfx-source-texture.cpp index b138e9aa..a16b293a 100644 --- a/source/gfx/gfx-source-texture.cpp +++ b/source/gfx/gfx-source-texture.cpp @@ -32,8 +32,8 @@ gfx::source_texture::source_texture(obs_source_t* parent) if (!parent) { throw std::invalid_argument("_parent must not be null"); } - _parent = std::make_shared(parent, false, false); - _rt = std::make_shared(GS_RGBA, GS_ZS_NONE); + _parent = std::make_shared(parent, false, false); + _rt = std::make_shared(GS_RGBA, GS_ZS_NONE); } gfx::source_texture::source_texture(obs_source_t* _source, obs_source_t* _parent) : source_texture(_parent) @@ -72,9 +72,9 @@ gfx::source_texture::source_texture(std::shared_ptr pchild, std::sh if (!obs_source_add_active_child(pparent->get(), pchild->get())) { throw std::runtime_error("_parent is contained in _child"); } - this->_child = pchild; - this->_parent = pparent; - this->_rt = std::make_shared(GS_RGBA, GS_ZS_NONE); + this->_child = pchild; + this->_parent = pparent; + this->_rt = std::make_shared(GS_RGBA, GS_ZS_NONE); } gfx::source_texture::source_texture(std::shared_ptr _child, obs_source_t* _parent) diff --git a/source/obs/gs/gs-mipmapper.cpp b/source/obs/gs/gs-mipmapper.cpp index 8969ff43..25c25fc9 100644 --- a/source/obs/gs/gs-mipmapper.cpp +++ b/source/obs/gs/gs-mipmapper.cpp @@ -79,7 +79,7 @@ gs::mipmapper::~mipmapper() gs::mipmapper::mipmapper() { - _vb = std::make_unique(uint32_t(6u), uint8_t(1u)); + _vb = std::make_unique(uint32_t(6u), uint8_t(1u)); auto v0 = _vb->at(0); v0.position->x = 0; v0.position->y = 0; @@ -109,7 +109,7 @@ gs::mipmapper::mipmapper() _vb->update(); char* effect_file = obs_module_file("effects/mipgen.effect"); - _effect = std::make_unique(effect_file); + _effect = std::make_unique(effect_file); bfree(effect_file); } @@ -267,9 +267,8 @@ void gs::mipmapper::rebuild(std::shared_ptr source, std::shared_ptr #if defined(WIN32) || defined(WIN64) if (device_type == GS_DEVICE_DIRECT3D_11) { // Copy - ID3D11Texture2D* rt = - reinterpret_cast(gs_texture_get_obj(_rt->get_object())); - uint32_t level = uint32_t(D3D11CalcSubresource(UINT(mip), 0, UINT(mip_levels))); + ID3D11Texture2D* rt = reinterpret_cast(gs_texture_get_obj(_rt->get_object())); + uint32_t level = uint32_t(D3D11CalcSubresource(UINT(mip), 0, UINT(mip_levels))); dev->context->CopySubresourceRegion(target_t2, level, 0, 0, 0, rt, 0, NULL); } #endif diff --git a/source/obs/gs/gs-rendertarget.cpp b/source/obs/gs/gs-rendertarget.cpp index 46f75838..0f5576fc 100644 --- a/source/obs/gs/gs-rendertarget.cpp +++ b/source/obs/gs/gs-rendertarget.cpp @@ -42,7 +42,7 @@ gs::rendertarget::rendertarget(gs_color_format colorFormat, gs_zstencil_format z : _color_format(colorFormat), _zstencil_format(zsFormat) { _is_being_rendered = false; - auto gctx = gs::context(); + auto gctx = gs::context(); _render_target = gs_texrender_create(colorFormat, zsFormat); if (!_render_target) { throw std::runtime_error("Failed to create render target."); diff --git a/source/obs/gs/gs-sampler.cpp b/source/obs/gs/gs-sampler.cpp index 3bfd3ee9..1b00f8e0 100644 --- a/source/obs/gs/gs-sampler.cpp +++ b/source/obs/gs/gs-sampler.cpp @@ -21,7 +21,7 @@ gs::sampler::sampler() { - _dirty = true; + _dirty = true; _sampler_info = {GS_FILTER_LINEAR, GS_ADDRESS_WRAP, GS_ADDRESS_WRAP, GS_ADDRESS_WRAP, 1, 0}; _sampler_state = nullptr; } @@ -34,7 +34,7 @@ gs::sampler::~sampler() void gs::sampler::set_filter(gs_sample_filter v) { - _dirty = true; + _dirty = true; _sampler_info.filter = v; } @@ -45,7 +45,7 @@ gs_sample_filter gs::sampler::get_filter() void gs::sampler::set_address_mode_u(gs_address_mode v) { - _dirty = true; + _dirty = true; _sampler_info.address_u = v; } @@ -56,7 +56,7 @@ gs_address_mode gs::sampler::get_address_mode_u() void gs::sampler::set_address_mode_v(gs_address_mode v) { - _dirty = true; + _dirty = true; _sampler_info.address_v = v; } @@ -67,7 +67,7 @@ gs_address_mode gs::sampler::get_address_mode_v() void gs::sampler::set_address_mode_w(gs_address_mode v) { - _dirty = true; + _dirty = true; _sampler_info.address_w = v; } @@ -78,7 +78,7 @@ gs_address_mode gs::sampler::get_address_mode_w() void gs::sampler::set_max_anisotropy(int v) { - _dirty = true; + _dirty = true; _sampler_info.max_anisotropy = v; } @@ -89,13 +89,13 @@ int gs::sampler::get_max_anisotropy() void gs::sampler::set_border_color(uint32_t v) { - _dirty = true; + _dirty = true; _sampler_info.border_color = v; } void gs::sampler::set_border_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { - _dirty = true; + _dirty = true; _sampler_info.border_color = a << 24 | r << 16 | g << 8 | b; } @@ -121,7 +121,7 @@ gs_sampler_state* gs::sampler::refresh() { gs_samplerstate_destroy(_sampler_state); _sampler_state = gs_samplerstate_create(&_sampler_info); - _dirty = false; + _dirty = false; return _sampler_state; } diff --git a/source/obs/gs/gs-texture.cpp b/source/obs/gs/gs-texture.cpp index 70507167..e555e9c2 100644 --- a/source/obs/gs/gs-texture.cpp +++ b/source/obs/gs/gs-texture.cpp @@ -52,10 +52,10 @@ gs::texture::texture(uint32_t width, uint32_t height, gs_color_format format, ui } auto gctx = gs::context(); - _texture = gs_texture_create( - width, height, format, mip_levels, mip_data, - (((texture_flags & flags::Dynamic) == flags::Dynamic) ? GS_DYNAMIC : 0) - | (((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps) ? GS_BUILD_MIPMAPS : 0)); + _texture = gs_texture_create( + width, height, format, mip_levels, mip_data, + (((texture_flags & flags::Dynamic) == flags::Dynamic) ? GS_DYNAMIC : 0) + | (((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps) ? GS_BUILD_MIPMAPS : 0)); if (!_texture) throw std::runtime_error("Failed to create texture."); @@ -84,10 +84,10 @@ gs::texture::texture(uint32_t width, uint32_t height, uint32_t depth, gs_color_f } auto gctx = gs::context(); - _texture = gs_voltexture_create( - width, height, depth, format, mip_levels, mip_data, - (((texture_flags & flags::Dynamic) == flags::Dynamic) ? GS_DYNAMIC : 0) - | (((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps) ? GS_BUILD_MIPMAPS : 0)); + _texture = gs_voltexture_create( + width, height, depth, format, mip_levels, mip_data, + (((texture_flags & flags::Dynamic) == flags::Dynamic) ? GS_DYNAMIC : 0) + | (((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps) ? GS_BUILD_MIPMAPS : 0)); if (!_texture) throw std::runtime_error("Failed to create texture."); @@ -110,10 +110,10 @@ gs::texture::texture(uint32_t size, gs_color_format format, uint32_t mip_levels, } auto gctx = gs::context(); - _texture = gs_cubetexture_create( - size, format, mip_levels, mip_data, - (((texture_flags & flags::Dynamic) == flags::Dynamic) ? GS_DYNAMIC : 0) - | (((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps) ? GS_BUILD_MIPMAPS : 0)); + _texture = gs_cubetexture_create( + size, format, mip_levels, mip_data, + (((texture_flags & flags::Dynamic) == flags::Dynamic) ? GS_DYNAMIC : 0) + | (((texture_flags & flags::BuildMipMaps) == flags::BuildMipMaps) ? GS_BUILD_MIPMAPS : 0)); if (!_texture) throw std::runtime_error("Failed to create texture."); @@ -128,7 +128,7 @@ gs::texture::texture(std::string file) throw std::ios_base::failure(file); auto gctx = gs::context(); - _texture = gs_texture_create_from_file(file.c_str()); + _texture = gs_texture_create_from_file(file.c_str()); if (!_texture) throw std::runtime_error("Failed to load texture."); diff --git a/source/obs/gs/gs-vertexbuffer.cpp b/source/obs/gs/gs-vertexbuffer.cpp index da143a20..87640cd8 100644 --- a/source/obs/gs/gs-vertexbuffer.cpp +++ b/source/obs/gs/gs-vertexbuffer.cpp @@ -107,11 +107,10 @@ gs::vertex_buffer::vertex_buffer(uint32_t vertices, uint8_t uvlayers) _data->num_tex = _layers; if (_layers > 0) { - _data->tvarray = _layer_data = - (gs_tvertarray*)util::malloc_aligned(16, sizeof(gs_tvertarray) * _layers); + _data->tvarray = _layer_data = (gs_tvertarray*)util::malloc_aligned(16, sizeof(gs_tvertarray) * _layers); for (size_t n = 0; n < _layers; n++) { _layer_data[n].array = _uvs[n] = (vec4*)util::malloc_aligned(16, sizeof(vec4) * _capacity); - _layer_data[n].width = 4; + _layer_data[n].width = 4; memset(_uvs[n], 0, sizeof(vec4) * _capacity); } } else { @@ -119,8 +118,8 @@ gs::vertex_buffer::vertex_buffer(uint32_t vertices, uint8_t uvlayers) } // Allocate GPU - auto gctx = gs::context(); - _buffer = gs_vertexbuffer_create(_data, GS_DYNAMIC); + auto gctx = gs::context(); + _buffer = gs_vertexbuffer_create(_data, GS_DYNAMIC); memset(_data, 0, sizeof(gs_vb_data)); _data->num = _capacity; _data->num_tex = _layers; @@ -191,9 +190,9 @@ gs::vertex_buffer::vertex_buffer(vertex_buffer const&& other) for (size_t n = 0; n < MAXIMUM_UVW_LAYERS; n++) { _uvs[n] = other._uvs[n]; } - _data = other._data; + _data = other._data; _buffer = other._buffer; - _layer_data = other._layer_data; + _layer_data = other._layer_data; } void gs::vertex_buffer::operator=(vertex_buffer const&& other) @@ -249,9 +248,9 @@ void gs::vertex_buffer::operator=(vertex_buffer const&& other) for (size_t n = 0; n < MAXIMUM_UVW_LAYERS; n++) { _uvs[n] = other._uvs[n]; } - _data = other._data; + _data = other._data; _buffer = other._buffer; - _layer_data = other._layer_data; + _layer_data = other._layer_data; } void gs::vertex_buffer::resize(uint32_t new_size) @@ -337,8 +336,8 @@ gs_vertbuffer_t* gs::vertex_buffer::update(bool refreshGPU) throw std::out_of_range("size is larger than capacity"); // Update VertexBuffer data. - auto gctx = gs::context(); - _data = gs_vertexbuffer_get_data(_buffer); + auto gctx = gs::context(); + _data = gs_vertexbuffer_get_data(_buffer); memset(_data, 0, sizeof(gs_vb_data)); _data->num = _capacity; _data->points = _positions; diff --git a/source/obs/obs-source.cpp b/source/obs/obs-source.cpp index dfc6e81e..5f61f2c8 100644 --- a/source/obs/obs-source.cpp +++ b/source/obs/obs-source.cpp @@ -411,17 +411,17 @@ obs::source::source() #define auto_signal_c(SIGNAL) \ { \ this->events.SIGNAL.set_listen_callback([this] { \ - if (!this->_self) \ + if (!this->_self) \ return; \ - auto sh = obs_source_get_signal_handler(this->_self); \ + auto sh = obs_source_get_signal_handler(this->_self); \ if (sh) { \ signal_handler_connect(sh, "" #SIGNAL, obs::source::handle_##SIGNAL, this); \ } \ }); \ this->events.SIGNAL.set_silence_callback([this] { \ - if (!this->_self) \ + if (!this->_self) \ return; \ - auto sh = obs_source_get_signal_handler(this->_self); \ + auto sh = obs_source_get_signal_handler(this->_self); \ if (sh) { \ signal_handler_disconnect(sh, "" #SIGNAL, obs::source::handle_##SIGNAL, this); \ } \ diff --git a/source/sources/source-mirror.cpp b/source/sources/source-mirror.cpp index fad772de..a2c435ba 100644 --- a/source/sources/source-mirror.cpp +++ b/source/sources/source-mirror.cpp @@ -412,7 +412,7 @@ void source::mirror::mirror_instance::acquire_input(std::string source_name) // If everything worked fine, we now set everything up. this->_source = new_source; this->_source->events.rename += std::bind(&source::mirror::mirror_instance::on_source_rename, this, - std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); if ((obs_source_get_output_flags(this->_source->get()) & OBS_SOURCE_AUDIO) != 0) { this->_source->events.audio_data += std::bind(&source::mirror::mirror_instance::on_audio_data, this, std::placeholders::_1, @@ -580,8 +580,8 @@ void source::mirror::mirror_instance::video_tick(float time) } obs_sceneitem_set_info(this->_source_item, &info); obs_sceneitem_force_update_transform(this->_source_item); - obs_sceneitem_set_scale_filter(this->_source_item, this->_rescale_enabled ? this->_rescale_type - : obs_scale_type::OBS_SCALE_POINT); + obs_sceneitem_set_scale_filter(this->_source_item, + this->_rescale_enabled ? this->_rescale_type : obs_scale_type::OBS_SCALE_POINT); } _scene_rendered = false; @@ -742,7 +742,7 @@ void source::mirror::mirror_instance::on_audio_data(obs::source*, const audio_da memcpy(mad->data[plane].data(), audio->data[plane], audio->frames * sizeof(float_t)); mad->audio.data[plane] = reinterpret_cast(mad->data[plane].data()); } - mad->audio.format = aoi->format; + mad->audio.format = aoi->format; mad->audio.frames = audio->frames; mad->audio.timestamp = audio->timestamp; mad->audio.samples_per_sec = aoi->samples_per_sec; diff --git a/source/sources/source-shader.cpp b/source/sources/source-shader.cpp index 91f553ca..7bcefe35 100644 --- a/source/sources/source-shader.cpp +++ b/source/sources/source-shader.cpp @@ -256,7 +256,8 @@ bool source::shader::shader_instance::valid_param(std::shared_ptr effect) {} -void source::shader::shader_instance::enum_active_sources(obs_source_enum_proc_t r, void* p) { +void source::shader::shader_instance::enum_active_sources(obs_source_enum_proc_t r, void* p) +{ _fx->enum_active_sources(r, p); } diff --git a/source/utility.cpp b/source/utility.cpp index e89e2480..d03c44cc 100644 --- a/source/utility.cpp +++ b/source/utility.cpp @@ -71,7 +71,7 @@ const char* obs_module_recursive_text(const char* to_translate, size_t depth) translate_map.insert({key, out.str()}); } - + auto value = translate_map.find(key); if (value != translate_map.end()) { return value->second.c_str();