/** * \brief Process a collision with a tar. * \param that The other item of the collision. * \param info Some informations about the collision. * \return Return True if the collision is with a tar. */ bool rp::zeppelin::collision_with_tar ( bear::engine::base_item& that, bear::universe::collision_info& info ) { bool result = false; tar* t = dynamic_cast<tar*>(&that); if ( t != NULL ) { if ( ( info.get_collision_side() == bear::universe::zone::top_zone ) && ( t->get_current_action_name() != "explose" ) && ( t->get_current_action_name() != "on_rail" ) ) { if ( t->get_combo_value() != 0 ) set_combo_value(t->get_combo_value()+1); t->explose(); drop(); make_dirty(); } default_collision(info); result = true; } return result; } // zeppelin::collision_with_tar()
const glm::uvec2& Indigo::UIWidget::size(const glm::uvec2& sz) { if (m_size != sz) { glm::uvec2 prev_size = m_size; glm::uvec2 new_size = glm::max(sz,this->min_size()); if (prev_size != new_size) { on_size(new_size); if (new_size != prev_size) { m_size = new_size; if (m_render_group) { render_pipe()->post(OOBase::make_delegate<OOBase::ThreadLocalAllocator>(static_cast<Render::UIDrawable*>(m_render_group),&Render::UIDrawable::size),m_size); make_dirty(); } } } } return m_size; }
Indigo::UIWidget::UIWidget(UIGroup* parent, const CreateParams& params) : m_parent(parent), m_render_group(NULL), m_state(params.m_state), m_position(params.m_position), m_size(params.m_size) { if (m_parent) make_dirty(); }
void Indigo::UIWidget::on_state_change(OOBase::uint32_t state, OOBase::uint32_t change_mask) { if (change_mask & eWS_visible) { bool visible = (state & eWS_visible) == eWS_visible; if (m_render_group) { render_pipe()->post(OOBase::make_delegate<OOBase::ThreadLocalAllocator>(static_cast<Render::UIDrawable*>(m_render_group),&Render::UIDrawable::show),visible); make_dirty(); } } }
void Indigo::UIWidget::position(const glm::ivec2& pos) { if (m_position != pos) { m_position = pos; if (m_render_group) { render_pipe()->post(OOBase::make_delegate<OOBase::ThreadLocalAllocator>(static_cast<Render::UIDrawable*>(m_render_group),&Render::UIDrawable::position),pos); make_dirty(); } } }