mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 15:07:43 +00:00
Removed view ownership (client should do this)
This commit is contained in:
@@ -12,8 +12,8 @@ void Button::Resources::init(boo::IGraphicsDataFactory* factory, const ThemeData
|
||||
}
|
||||
|
||||
Button::Button(ViewResources& res, View& parentView,
|
||||
std::unique_ptr<IButtonBinding>&& controlBinding, const std::string& text)
|
||||
: Control(res, parentView, std::move(controlBinding)), m_textStr(text)
|
||||
IButtonBinding* controlBinding, const std::string& text)
|
||||
: Control(res, parentView, controlBinding), m_textStr(text)
|
||||
{
|
||||
m_bBlockBuf = res.m_factory->newDynamicBuffer(boo::BufferUse::Uniform, sizeof(ViewBlock), 1);
|
||||
m_bVertsBuf = res.m_factory->newDynamicBuffer(boo::BufferUse::Vertex, sizeof(SolidShaderVert), 28);
|
||||
@@ -153,7 +153,7 @@ void Button::mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, b
|
||||
if (m_pressed && m_hovered)
|
||||
{
|
||||
Log.report(LogVisor::Info, "button '%s' activated", m_textStr.c_str());
|
||||
if (m_controlBinding && dynamic_cast<IButtonBinding*>(m_controlBinding.get()))
|
||||
if (m_controlBinding && dynamic_cast<IButtonBinding*>(m_controlBinding))
|
||||
static_cast<IButtonBinding&>(*m_controlBinding).pressed(coord);
|
||||
}
|
||||
m_pressed = false;
|
||||
|
||||
Reference in New Issue
Block a user