Commit Graph

389 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks fd0b79e97d utility-event: Remove unused event handler 2019-10-13 05:58:53 +02:00
Michael Fabian 'Xaymar' Dirks f1a376d44b cmake: Add commit to version.hpp template
Switches out the `const uint16_t` for actual defines, which are easier to deal with and work in C out of the box.
2019-10-13 05:54:20 +02:00
Michael Fabian 'Xaymar' Dirks e02225262c obs-source: Add noexcept try-catch to C facing callbacks 2019-09-07 21:35:32 +02:00
Michael Fabian 'Xaymar' Dirks d6f1979dee project: Fix missing returns 2019-09-07 21:28:54 +02:00
Michael Fabian 'Xaymar' Dirks 5a4d38d249 project: Fix a massive list of dangerous warnings
This is a massive improvement to stability and safety when using the plugin, as all exceptions should now no longer be leaked into C controlled code, which can't actually handle exceptions at all.

Warnings fixed:

* Potentially throwing exception during library load.
* Possibly throwing function passed to C.
* Statement does nothing.
* Variable is initialized but not referenced.
* Variable overloads variable in parent scope.
2019-09-05 18:42:28 +02:00
Michael Fabian 'Xaymar' Dirks 2a4a3bf501 util-memory: Cast to intptr_t 2019-09-05 18:09:33 +02:00
Michael Fabian 'Xaymar' Dirks 4c44496b87 source-mirror: Handle uncaught exceptions in C callbacks
Fixes various crashes and undefined behavior due to exceptions falling into C code where they now wreak havoc with the current stack.
2019-09-04 20:52:37 +02:00
Michael Fabian 'Xaymar' Dirks f65dfcbbf0 filter-blur: Don't throw exceptions into C code
It is extremely problematic to throw C++ exceptions into C code, especially because C code usually does not handle C++ exceptions at all. Therefore we have to prevent any exception from leaving the function and define it as noexcept.
2019-09-04 20:43:40 +02:00
Michael Fabian 'Xaymar' Dirks f61cdeb582 utility-event: Fix compile errors 2019-09-04 20:30:16 +02:00
Michael Fabian 'Xaymar' Dirks 29ab00633c utility-event: Safer event handling with proper lifetime
The util::event code suffers from the problem that it could call into a class that no longer exists, corrupting memory or even crashing. By tracking lifetime using std::weak_ptr<void> this can be avoided and the dead listeners can be automatically removed.
2019-09-04 16:36:32 +02:00
Michael Fabian 'Xaymar' Dirks da9124fc1a util-memory: Avoid MSVC specific C++ and use Std++ if available 2019-09-04 03:22:05 +02:00
Michael Fabian 'Xaymar' Dirks 82faab4380 project: Re-apply formatting 2019-09-04 03:03:41 +02:00
Michael Fabian 'Xaymar' Dirks ce7e4c97d4 project: Don't use non-standard strcmpi 2019-09-04 03:02:19 +02:00
Michael Fabian 'Xaymar' Dirks 03c704de1a project: Correct usage of exceptions and include stdexcept 2019-09-04 02:59:04 +02:00
Michael Fabian 'Xaymar' Dirks 4765c57828 filter-sdf-effects: Don't define structs in nameless unions 2019-09-04 02:49:04 +02:00
Michael Fabian 'Xaymar' Dirks f27320c6c9 project: Remove use of P_INITIALIZER
Does not support cross-platform very well and breaks on Apple for no apparent reason.

Add resolution scale to shader filter.
2019-09-04 02:47:27 +02:00
Michael Fabian 'Xaymar' Dirks 9ace96285d filter-dynamic-mask: Use snprintf instead of sprintf_s 2019-09-04 02:39:59 +02:00
Michael Fabian 'Xaymar' Dirks 2e98c2e754 color-grade: Fix and improve advanced options
These new options allow further control over the Tint tool in Color grading.
2019-09-04 02:18:40 +02:00
Michael Fabian 'Xaymar' Dirks 781307fbe6 color-grade: Add further Tint options 2019-09-04 01:41:15 +02:00
Michael Fabian 'Xaymar' Dirks deeb6719c4 project: Apply formatting 2019-08-24 12:59:32 +02:00
Michael Fabian 'Xaymar' Dirks 250dc97603 gfx-effect-source: enumerate child sources correctly 2019-08-07 20:40:04 +02:00
Michael Fabian 'Xaymar' Dirks a04d102568 gfx-effect-source: Support for textures and some crash resistance 2019-08-07 20:22:12 +02:00
Michael Fabian 'Xaymar' Dirks f945f08ab0 strings: Texture formats 2019-08-07 20:21:39 +02:00
Michael Fabian 'Xaymar' Dirks d7e66b17f1 filter-shader: Don't ignore all properties 2019-08-07 19:22:10 +02:00
Michael Fabian 'Xaymar' Dirks b8fc0d5284 source-shader: Fix rendering 2019-08-07 19:20:44 +02:00
Michael Fabian 'Xaymar' Dirks 7fdd9498a0 filter-shader: Fix blending 2019-08-07 19:20:32 +02:00
Michael Fabian 'Xaymar' Dirks 90699f6b6f gfx-effect-source: Implement defaults for bool, value and matrix 2019-08-07 19:19:56 +02:00
Michael Fabian 'Xaymar' Dirks 39e6959c67 source-shader: Fix rendering and reapply parameters on change 2019-08-07 18:43:34 +02:00
Michael Fabian 'Xaymar' Dirks 181df6e3d9 filter-shader: Reapply parameters if there was a change 2019-08-07 18:43:19 +02:00
Michael Fabian 'Xaymar' Dirks 9be36d5ec4 gfx-effect-source: Add function to get "default" value 2019-08-07 18:42:54 +02:00
Michael Fabian 'Xaymar' Dirks 2b2f87e6fc gfx-effect-source: Fix validity check
Had the check inverted oops.
2019-08-07 18:16:20 +02:00
Michael Fabian 'Xaymar' Dirks c88535c7ab gfx-effect-source: Remove/replace old defines 2019-08-07 18:11:46 +02:00
Michael Fabian 'Xaymar' Dirks c670ab60a1 source-shader: Use custom draw video_render 2019-08-07 18:10:44 +02:00
Michael Fabian 'Xaymar' Dirks 8cb2ddaa82 source-shader, cmake: 'Shader' source 2019-08-07 18:06:48 +02:00
Michael Fabian 'Xaymar' Dirks 1b34e5210a gfx-effect-source: Expose defines to set default file and technique 2019-08-07 18:06:24 +02:00
Michael Fabian 'Xaymar' Dirks 9ad93c0ee9 filter-shader: Rename from Custom shader 2019-08-07 18:05:49 +02:00
Michael Fabian 'Xaymar' Dirks 98a18480d0 gfx-effect-source: Fix UI mode detection 2019-08-07 17:45:32 +02:00
Michael Fabian 'Xaymar' Dirks 8ec8a22928 filter-custom-shader: Add new callbacks 2019-08-07 17:37:52 +02:00
Michael Fabian 'Xaymar' Dirks 335847945d gfx-effect-source: Allow overriding value and visibility of parameters 2019-08-07 17:37:34 +02:00
Michael Fabian 'Xaymar' Dirks ff4a556f3f filter-custom-shader: Update to use new gfx::effect_source::effect_source 2019-08-07 17:15:46 +02:00
Michael Fabian 'Xaymar' Dirks bde4e278bf gfx-effect-source: Further work on rewrite
This partially implements most behavior to an acceptable degree for use right now.
2019-08-07 17:14:44 +02:00
Michael Fabian 'Xaymar' Dirks 845a2cbb21 gs-effect: Don't include the null character in strings 2019-08-07 17:14:14 +02:00
Michael Fabian 'Xaymar' Dirks b88cc0fe01 gs-effect: Check correct size in get_default_string 2019-08-07 17:07:54 +02:00
Michael Fabian 'Xaymar' Dirks 8603fef897 gs-effect: Fix get_string and get_default_string 2019-08-07 16:41:26 +02:00
Michael Fabian 'Xaymar' Dirks c6559d84ba gs-effect: Check if effect is nullptr, not if its a valid ptr
Woops, that somehow went completely by me without checking.
2019-08-07 16:17:12 +02:00
Michael Fabian 'Xaymar' Dirks 7b0159947e gs-effect: Add helpers and fix bad enable_shared_from_this 2019-08-07 16:11:09 +02:00
Michael Fabian 'Xaymar' Dirks e59bc2fdd2 filter-custom-shader: Rewrite from scratch 2019-08-07 12:43:23 +02:00
Michael Fabian 'Xaymar' Dirks 1092dc1de1 gfx-effect-source: Complete rewrite from scratch 2019-08-07 12:42:25 +02:00
Michael Fabian 'Xaymar' Dirks 087cd79a7a filter-color-grade: Always return something in get_width/get_height 2019-08-07 12:41:34 +02:00
Michael Fabian 'Xaymar' Dirks f5b4c1f7a1 filter-color-grade: Fix crash if color-grade.effect is missing 2019-08-04 23:20:35 +02:00