From 82faab438010b7cd5d12641013da883ea02b1959 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 4 Sep 2019 03:03:41 +0200 Subject: [PATCH] project: Re-apply formatting --- source/filters/filter-blur.cpp | 2 +- source/filters/filter-color-grade.cpp | 28 ++++++++++++++++--------- source/filters/filter-dynamic-mask.cpp | 2 +- source/gfx/blur/gfx-blur-box-linear.cpp | 2 +- source/gfx/blur/gfx-blur-box.cpp | 2 +- source/gfx/gfx-effect-source.cpp | 2 +- source/obs/obs-tools.cpp | 2 +- source/plugin.cpp | 2 +- source/sources/source-mirror.cpp | 2 +- source/util-math.cpp | 2 +- source/util-memory.cpp | 2 +- source/utility.cpp | 2 +- 12 files changed, 29 insertions(+), 21 deletions(-) diff --git a/source/filters/filter-blur.cpp b/source/filters/filter-blur.cpp index e682828f..97cebf27 100644 --- a/source/filters/filter-blur.cpp +++ b/source/filters/filter-blur.cpp @@ -18,11 +18,11 @@ */ #include "filter-blur.hpp" -#include #include #include #include #include +#include #include "gfx/blur/gfx-blur-box-linear.hpp" #include "gfx/blur/gfx-blur-box.hpp" #include "gfx/blur/gfx-blur-dual-filtering.hpp" diff --git a/source/filters/filter-color-grade.cpp b/source/filters/filter-color-grade.cpp index 8dedecea..35daec38 100644 --- a/source/filters/filter-color-grade.cpp +++ b/source/filters/filter-color-grade.cpp @@ -74,7 +74,6 @@ #define MODE_LOG Log #define MODE_LOG10 Log10 - const char* get_name(void*) { return D_TRANSLATE(ST); @@ -319,58 +318,67 @@ obs_properties_t* get_properties(void*) return pr; } -void* create(obs_data_t* data, obs_source_t* source) try { +void* create(obs_data_t* data, obs_source_t* source) +try { return new filter::color_grade::color_grade_instance(data, source); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to create: %s", obs_source_get_name(source), ex.what()); return nullptr; } -void destroy(void* ptr) try { +void destroy(void* ptr) +try { delete reinterpret_cast(ptr); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to destroy: %s", ex.what()); } -uint32_t get_width(void* ptr) try { +uint32_t get_width(void* ptr) +try { return reinterpret_cast(ptr)->get_width(); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to get width: %s", ex.what()); return 0; } -uint32_t get_height(void* ptr) try { +uint32_t get_height(void* ptr) +try { return reinterpret_cast(ptr)->get_height(); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to get height: %s", ex.what()); return 0; } -void update(void* ptr, obs_data_t* data) try { +void update(void* ptr, obs_data_t* data) +try { reinterpret_cast(ptr)->update(data); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to update: %s", ex.what()); } -void activate(void* ptr) try { +void activate(void* ptr) +try { reinterpret_cast(ptr)->activate(); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to activate: %s", ex.what()); } -void deactivate(void* ptr) try { +void deactivate(void* ptr) +try { reinterpret_cast(ptr)->deactivate(); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to deactivate: %s", ex.what()); } -void video_tick(void* ptr, float time) try { +void video_tick(void* ptr, float time) +try { reinterpret_cast(ptr)->video_tick(time); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to tick video: %s", ex.what()); } -void video_render(void* ptr, gs_effect_t* effect) try { +void video_render(void* ptr, gs_effect_t* effect) +try { reinterpret_cast(ptr)->video_render(effect); } catch (std::exception& ex) { P_LOG_ERROR(" Failed to render video: %s", ex.what()); diff --git a/source/filters/filter-dynamic-mask.cpp b/source/filters/filter-dynamic-mask.cpp index 00e7f5f9..c0c1b523 100644 --- a/source/filters/filter-dynamic-mask.cpp +++ b/source/filters/filter-dynamic-mask.cpp @@ -18,8 +18,8 @@ */ #include "filter-dynamic-mask.hpp" -#include #include +#include #include "strings.hpp" // Filter to allow dynamic masking diff --git a/source/gfx/blur/gfx-blur-box-linear.cpp b/source/gfx/blur/gfx-blur-box-linear.cpp index 4085e297..7b4b35af 100644 --- a/source/gfx/blur/gfx-blur-box-linear.cpp +++ b/source/gfx/blur/gfx-blur-box-linear.cpp @@ -16,9 +16,9 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-blur-box-linear.hpp" -#include #include #include +#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util-math.hpp" diff --git a/source/gfx/blur/gfx-blur-box.cpp b/source/gfx/blur/gfx-blur-box.cpp index b86f1358..e055c15c 100644 --- a/source/gfx/blur/gfx-blur-box.cpp +++ b/source/gfx/blur/gfx-blur-box.cpp @@ -16,9 +16,9 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-blur-box.hpp" -#include #include #include +#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util-math.hpp" diff --git a/source/gfx/gfx-effect-source.cpp b/source/gfx/gfx-effect-source.cpp index 17f8f9b4..0d41e5e7 100644 --- a/source/gfx/gfx-effect-source.cpp +++ b/source/gfx/gfx-effect-source.cpp @@ -16,12 +16,12 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-effect-source.hpp" -#include #include #include #include #include #include +#include #include #include "obs/gs/gs-helper.hpp" #include "obs/obs-source-tracker.hpp" diff --git a/source/obs/obs-tools.cpp b/source/obs/obs-tools.cpp index 763521e8..5909c0c0 100644 --- a/source/obs/obs-tools.cpp +++ b/source/obs/obs-tools.cpp @@ -18,8 +18,8 @@ */ #include "obs-tools.hpp" -#include #include +#include struct scs_searchdata { obs_source_t* source; diff --git a/source/plugin.cpp b/source/plugin.cpp index 62bfdaee..cda60636 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -19,7 +19,6 @@ #include "plugin.hpp" #include -#include "obs/obs-source-tracker.hpp" #include "filters/filter-blur.hpp" #include "filters/filter-color-grade.hpp" #include "filters/filter-displacement.hpp" @@ -27,6 +26,7 @@ #include "filters/filter-sdf-effects.hpp" #include "filters/filter-shader.hpp" #include "filters/filter-transform.hpp" +#include "obs/obs-source-tracker.hpp" #include "sources/source-mirror.hpp" #include "sources/source-shader.hpp" diff --git a/source/sources/source-mirror.cpp b/source/sources/source-mirror.cpp index 54c96f40..1a2a5a69 100644 --- a/source/sources/source-mirror.cpp +++ b/source/sources/source-mirror.cpp @@ -18,11 +18,11 @@ */ #include "source-mirror.hpp" -#include #include #include #include #include +#include #include #include "obs/obs-source-tracker.hpp" #include "obs/obs-tools.hpp" diff --git a/source/util-math.cpp b/source/util-math.cpp index 6c6530c4..68e23270 100644 --- a/source/util-math.cpp +++ b/source/util-math.cpp @@ -18,9 +18,9 @@ */ #include "util-math.hpp" -#include #include #include +#include #include "util-memory.hpp" void* util::vec2a::operator new(size_t count) diff --git a/source/util-memory.cpp b/source/util-memory.cpp index 0e8d10cb..19838ff1 100644 --- a/source/util-memory.cpp +++ b/source/util-memory.cpp @@ -18,8 +18,8 @@ */ #include "util-memory.hpp" -#include #include +#include #define USE_STD_ALLOC_FREE diff --git a/source/utility.cpp b/source/utility.cpp index 839542a0..ac6f845f 100644 --- a/source/utility.cpp +++ b/source/utility.cpp @@ -18,8 +18,8 @@ */ #include "utility.hpp" -#include #include +#include #include "plugin.hpp" // OBS