void CSettingsMonitor::SettingChangedHandler(const CEvent& event) const
{
    p_assert(event.Size() == 2);
    auto settingHash = variant::get<hashed_string>(event[0]);
    auto it = m_settings.find(settingHash);
    if (it != m_settings.end())
        it->second.get().set(event[1]);
}
Exemple #2
0
Platec::Rectangle Bounds::asRect() const 
{
    p_assert(_position.getX() > 0.0f && _position.getY() >= 0.0f, "(Bounds::asRect) Left and top must be positive");  
    const uint32_t ilft = leftAsUint();
    const uint32_t itop = topAsUint();
    const uint32_t irgt = ilft + _dimension.getWidth();
    const uint32_t ibtm = itop + _dimension.getHeight();

    return Platec::Rectangle(_worldDimension, ilft, irgt, itop, ibtm);     
}
Exemple #3
0
void Bounds::shift(float dx, float dy) {
    _position.shift(dx, dy, _worldDimension);
    p_assert(_worldDimension.contains(_position), "");
}
Exemple #4
0
uint32_t Bounds::topAsUint() const 
{
    p_assert(_position.getY() >= 0, "_position.getY() should be not negative");
    return _position.getY();
}   
Exemple #5
0
 void AssetChangedHandler(const CEvent& event)
 {
     p_assert(event.Size() == 1);
     auto handle = variant::get<phandle_t>(event[0]);
     m_device->InvalidateHandle(handle);
 }