Bugfix; correcting introduced bug with RenderSource and new Session

resolution.
This commit is contained in:
brunoherbelin
2021-02-11 20:28:57 +01:00
parent d45554e162
commit dca3033c06
4 changed files with 24 additions and 8 deletions

View File

@@ -668,8 +668,9 @@ void Mixer::groupSelection()
// set depth at given location
group->group(View::LAYER)->translation_.z = d;
// scale alpha
group->setAlpha( 1.f );
// set alpha to full opacity
group->group(View::MIXING)->translation_.x = 0.f;
group->group(View::MIXING)->translation_.y = 0.f;
// Add source to Session
session_->addSource(group);

View File

@@ -74,10 +74,8 @@ void Session::update(float dt)
// ensure the RenderSource is rendering this session
RenderSource *s = dynamic_cast<RenderSource *>( *it );
if ( s!= nullptr ){
if ( s->session() != this /*|| s->session()->frame()->resolution() != frame()->resolution()*/)
s->setSession(nullptr); // RenderSource will fail and be replaced
}
if ( s!= nullptr && s->session() != this )
s->setSession(this);
if ( (*it)->failed() ) {
failedSource_ = (*it);
@@ -198,8 +196,10 @@ Source *Session::popSource()
void Session::setResolution(glm::vec3 resolution, bool useAlpha)
{
// setup the render view: if not specified the default config resulution will be used
render_.setResolution( resolution, useAlpha );
config_[View::RENDERING]->scale_ = resolution;
// store the actual resolution set in the render view
config_[View::RENDERING]->scale_ = render_.resolution();
}
void Session::setFading(float f, bool forcenow)

View File

@@ -329,7 +329,10 @@ RenderSource::RenderSource() : Source(), session_(nullptr)
bool RenderSource::failed() const
{
return (initialized_ && session_ == nullptr);
if (initialized_ && session_!=nullptr)
return renderbuffer_->resolution() != session_->frame()->resolution();
return false;
}
uint RenderSource::texture() const
@@ -365,6 +368,16 @@ void RenderSource::init()
}
glm::vec3 RenderSource::resolution() const
{
if (initialized_)
return renderbuffer_->resolution();
else if (session_ && session_->frame())
return session_->frame()->resolution();
else
return glm::vec3(0.f);
}
void RenderSource::accept(Visitor& v)
{
Source::accept(v);

View File

@@ -89,6 +89,8 @@ public:
inline Session *session () const { return session_; }
inline void setSession (Session *se) { session_ = se; }
glm::vec3 resolution() const;
glm::ivec2 icon() const override { return glm::ivec2(0, 2); }
protected: