project: Remove unused parameters and fix additional warnings

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2019-01-14 23:52:57 +01:00 committed by Michael Fabian Dirks
parent f0fa36a19e
commit 5a54a67946
9 changed files with 31 additions and 38 deletions

View file

@ -18,12 +18,12 @@
*/ */
#include "filter-blur.hpp" #include "filter-blur.hpp"
#include <cmath> #include <cfloat>
#include <cinttypes> #include <cinttypes>
#include <cmath>
#include <map> #include <map>
#include "strings.hpp" #include "strings.hpp"
#include "util-math.hpp" #include "util-math.hpp"
#include <cfloat>
// OBS // OBS
#ifdef _MSC_VER #ifdef _MSC_VER
@ -205,12 +205,9 @@ bool filter::blur::blur_instance::apply_mask_parameters(std::shared_ptr<gs::effe
return true; return true;
} }
bool filter::blur::blur_instance::modified_properties(void* ptr, obs_properties_t* props, obs_property* prop, bool filter::blur::blur_instance::modified_properties(void*, obs_properties_t* props, obs_property*,
obs_data_t* settings) obs_data_t* settings)
{ {
prop;
ptr;
// bilateral blur // bilateral blur
bool show_bilateral = (obs_data_get_int(settings, P_TYPE) == type::Bilateral); bool show_bilateral = (obs_data_get_int(settings, P_TYPE) == type::Bilateral);
obs_property_set_visible(obs_properties_get(props, P_BILATERAL_SMOOTHING), show_bilateral); obs_property_set_visible(obs_properties_get(props, P_BILATERAL_SMOOTHING), show_bilateral);
@ -512,7 +509,8 @@ void filter::blur::blur_instance::video_render(gs_effect_t* effect)
obs_source_t* target = obs_filter_get_target(this->m_source); obs_source_t* target = obs_filter_get_target(this->m_source);
uint32_t baseW = obs_source_get_base_width(target); uint32_t baseW = obs_source_get_base_width(target);
uint32_t baseH = obs_source_get_base_height(target); uint32_t baseH = obs_source_get_base_height(target);
vec4 black = {0}; vec4 black;
vec4_set(&black, 0, 0, 0, 0);
bool failed = false; bool failed = false;
@ -529,8 +527,8 @@ void filter::blur::blur_instance::video_render(gs_effect_t* effect)
} }
if ((baseW == 0) || (baseH == 0)) { if ((baseW == 0) || (baseH == 0)) {
if (this->can_log()) { if (this->can_log()) {
P_LOG_ERROR("<filter-blur:%s> Invalid base size from '%s': %lux%lu.", obs_source_get_name(this->m_source), P_LOG_ERROR("<filter-blur:%s> Invalid base size from '%s': %" PRIu32 "x%" PRIu32 ".",
obs_source_get_name(target), baseW, baseH); obs_source_get_name(this->m_source), obs_source_get_name(target), baseW, baseH);
} }
obs_source_skip_video_filter(this->m_source); obs_source_skip_video_filter(this->m_source);
return; return;
@ -1072,9 +1070,8 @@ void filter::blur::blur_factory::update(void* inptr, obs_data_t* settings)
reinterpret_cast<filter::blur::blur_instance*>(inptr)->update(settings); reinterpret_cast<filter::blur::blur_instance*>(inptr)->update(settings);
} }
const char* filter::blur::blur_factory::get_name(void* inptr) const char* filter::blur::blur_factory::get_name(void*)
{ {
inptr;
return P_TRANSLATE(SOURCE_NAME); return P_TRANSLATE(SOURCE_NAME);
} }
@ -1130,9 +1127,8 @@ void filter::blur::blur_factory::scene_destroy_handler(void* ptr, calldata_t* da
} }
} }
std::shared_ptr<gs::effect> filter::blur::blur_factory::get_effect(filter::blur::type type) std::shared_ptr<gs::effect> filter::blur::blur_factory::get_effect(filter::blur::type)
{ {
type;
return blur_effect; return blur_effect;
} }

View file

@ -360,7 +360,7 @@ bool filter::CustomShader::Instance::is_special_parameter(std::string name, gs::
return false; return false;
} }
bool filter::CustomShader::Instance::apply_special_parameters(uint32_t viewW, uint32_t viewH) bool filter::CustomShader::Instance::apply_special_parameters(uint32_t, uint32_t)
{ {
std::unique_ptr<gs::texture> imageTexture; std::unique_ptr<gs::texture> imageTexture;
m_renderTarget->get_texture(imageTexture); m_renderTarget->get_texture(imageTexture);
@ -385,7 +385,7 @@ bool filter::CustomShader::Instance::apply_special_parameters(uint32_t viewW, ui
return true; return true;
} }
bool filter::CustomShader::Instance::video_tick_impl(float_t time) bool filter::CustomShader::Instance::video_tick_impl(float_t)
{ {
return true; return true;
} }

View file

@ -154,7 +154,7 @@ void filter::shadow_sdf::shadow_sdf_instance::update(obs_data_t* data)
} }
this->m_inner_offset_x = float_t(obs_data_get_double(data, P_INNER_OFFSET_X)); this->m_inner_offset_x = float_t(obs_data_get_double(data, P_INNER_OFFSET_X));
this->m_inner_offset_y = float_t(obs_data_get_double(data, P_INNER_OFFSET_Y)); this->m_inner_offset_y = float_t(obs_data_get_double(data, P_INNER_OFFSET_Y));
this->m_inner_color = obs_data_get_int(data, P_INNER_COLOR) & 0x00FFFFFF this->m_inner_color = (obs_data_get_int(data, P_INNER_COLOR) & 0x00FFFFFF)
| (int32_t(obs_data_get_double(data, P_INNER_ALPHA) * 2.55) << 24); | (int32_t(obs_data_get_double(data, P_INNER_ALPHA) * 2.55) << 24);
this->m_outer_shadow = obs_data_get_bool(data, P_OUTER); this->m_outer_shadow = obs_data_get_bool(data, P_OUTER);
@ -165,7 +165,7 @@ void filter::shadow_sdf::shadow_sdf_instance::update(obs_data_t* data)
} }
this->m_outer_offset_x = float_t(obs_data_get_double(data, P_OUTER_OFFSET_X)); this->m_outer_offset_x = float_t(obs_data_get_double(data, P_OUTER_OFFSET_X));
this->m_outer_offset_y = float_t(obs_data_get_double(data, P_OUTER_OFFSET_Y)); this->m_outer_offset_y = float_t(obs_data_get_double(data, P_OUTER_OFFSET_Y));
this->m_outer_color = obs_data_get_int(data, P_OUTER_COLOR) & 0x00FFFFFF this->m_outer_color = (obs_data_get_int(data, P_OUTER_COLOR) & 0x00FFFFFF)
| (int32_t(obs_data_get_double(data, P_OUTER_ALPHA) * 2.55) << 24); | (int32_t(obs_data_get_double(data, P_OUTER_ALPHA) * 2.55) << 24);
} }
@ -194,8 +194,9 @@ void filter::shadow_sdf::shadow_sdf_instance::video_render(gs_effect_t*)
obs_source_t* target = obs_filter_get_target(this->m_self); obs_source_t* target = obs_filter_get_target(this->m_self);
uint32_t baseW = obs_source_get_base_width(target); uint32_t baseW = obs_source_get_base_width(target);
uint32_t baseH = obs_source_get_base_height(target); uint32_t baseH = obs_source_get_base_height(target);
vec4 color_transparent = {0};
gs_effect_t* default_effect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT); gs_effect_t* default_effect = obs_get_base_effect(obs_base_effect::OBS_EFFECT_DEFAULT);
vec4 color_transparent;
vec4_zero(&color_transparent);
if (!parent || !target || (baseW == 0) || (baseH == 0)) { if (!parent || !target || (baseW == 0) || (baseH == 0)) {
obs_source_skip_video_filter(this->m_self); obs_source_skip_video_filter(this->m_self);
@ -436,9 +437,8 @@ void filter::shadow_sdf::shadow_sdf_factory::update(void* inptr, obs_data_t* set
reinterpret_cast<filter::shadow_sdf::shadow_sdf_instance*>(inptr)->update(settings); reinterpret_cast<filter::shadow_sdf::shadow_sdf_instance*>(inptr)->update(settings);
} }
const char* filter::shadow_sdf::shadow_sdf_factory::get_name(void* inptr) const char* filter::shadow_sdf::shadow_sdf_factory::get_name(void*)
{ {
inptr;
return P_TRANSLATE(SOURCE_NAME); return P_TRANSLATE(SOURCE_NAME);
} }

View file

@ -77,7 +77,6 @@ namespace filter {
private: private:
obs_source_t* context; obs_source_t* context;
gs_effect_t* customEffect;
gs::vertex_buffer* m_vertexHelper; gs::vertex_buffer* m_vertexHelper;
gs_vertbuffer_t* m_vertexBuffer; gs_vertbuffer_t* m_vertexBuffer;
gs_draw_mode drawmode; gs_draw_mode drawmode;

View file

@ -71,7 +71,6 @@ INITIALIZER(FilterTransformInit)
static const float farZ = 2097152.0f; // 2 pow 21 static const float farZ = 2097152.0f; // 2 pow 21
static const float nearZ = 1.0f / farZ; static const float nearZ = 1.0f / farZ;
static const float valueLimit = 65536.0f;
enum class CameraMode : int32_t { Orthographic, Perspective }; enum class CameraMode : int32_t { Orthographic, Perspective };

View file

@ -96,19 +96,14 @@ bool gfx::effect_source::property_texture_type_modified(void* priv, obs_properti
return true; return true;
} }
bool gfx::effect_source::property_texture_input_modified(void* priv, obs_properties_t* props, obs_property_t* prop, bool gfx::effect_source::property_texture_input_modified(void*, obs_properties_t*, obs_property_t*,
obs_data_t* sett) obs_data_t*)
{ {
priv;
props;
prop;
sett;
return false; return false;
} }
gfx::effect_source::effect_source(obs_data_t* data, obs_source_t* owner) gfx::effect_source::effect_source(obs_data_t*, obs_source_t* owner)
{ {
data;
m_source = owner; m_source = owner;
m_timeExisting = 0; m_timeExisting = 0;
m_timeActive = 0; m_timeActive = 0;
@ -520,6 +515,8 @@ void gfx::effect_source::apply_parameters()
case gs::effect_parameter::type::Integer4: case gs::effect_parameter::type::Integer4:
param->param->set_int4(param->value[0], param->value[1], param->value[2], param->value[3]); param->param->set_int4(param->value[0], param->value[1], param->value[2], param->value[3]);
break; break;
default:
break;
} }
} else if (prm.first.second >= gs::effect_parameter::type::Float } else if (prm.first.second >= gs::effect_parameter::type::Float
&& prm.first.second <= gs::effect_parameter::type::Float4) { && prm.first.second <= gs::effect_parameter::type::Float4) {
@ -537,6 +534,8 @@ void gfx::effect_source::apply_parameters()
case gs::effect_parameter::type::Float4: case gs::effect_parameter::type::Float4:
param->param->set_float4(param->value[0], param->value[1], param->value[2], param->value[3]); param->param->set_float4(param->value[0], param->value[1], param->value[2], param->value[3]);
break; break;
default:
break;
} }
} }
} }

View file

@ -151,14 +151,14 @@ void gs::mipmapper::rebuild(std::shared_ptr<gs::texture> source, std::shared_ptr
} }
// Render // Render
graphics_t* ctx = gs_get_context(); graphics_t* ctx = gs_get_context();
#if defined(WIN32) || defined(WIN64) #if defined(WIN32) || defined(WIN64)
gs_d3d11_device* dev = reinterpret_cast<gs_d3d11_device*>(ctx->device); gs_d3d11_device* dev = reinterpret_cast<gs_d3d11_device*>(ctx->device);
#endif #endif
int device_type = gs_get_device_type(); int device_type = gs_get_device_type();
void* sobj = gs_texture_get_obj(source->get_object()); void* sobj = gs_texture_get_obj(source->get_object());
void* tobj = gs_texture_get_obj(target->get_object()); void* tobj = gs_texture_get_obj(target->get_object());
std::string technique = "Draw"; std::string technique = "Draw";
switch (generator) { switch (generator) {
case generator::Point: case generator::Point:

View file

@ -21,7 +21,7 @@
#include "util-memory.hpp" #include "util-memory.hpp"
gs::vertex::vertex() gs::vertex::vertex()
: hasStore(true), store(nullptr), position(nullptr), normal(nullptr), tangent(nullptr), color(nullptr) : position(nullptr), normal(nullptr), tangent(nullptr), color(nullptr), hasStore(true), store(nullptr)
{ {
store = util::malloc_aligned(16, sizeof(vec3) * 3 + sizeof(uint32_t) + sizeof(vec4) * MAXIMUM_UVW_LAYERS); store = util::malloc_aligned(16, sizeof(vec3) * 3 + sizeof(uint32_t) + sizeof(vec4) * MAXIMUM_UVW_LAYERS);

View file

@ -106,7 +106,7 @@ namespace util {
// Returns true if and only if storage allocated from *this // Returns true if and only if storage allocated from *this
// can be deallocated from other, and vice versa. // can be deallocated from other, and vice versa.
// Always returns true for stateless allocators. // Always returns true for stateless allocators.
bool operator==(const AlignmentAllocator<T, N>& other) const bool operator==(const AlignmentAllocator<T, N>& ) const
{ {
return true; return true;
} }