Beispiel #1
0
//----------------------------------------------------------------------------//
float OperatorDim::getValue(const Window& wnd, const Rectf& container) const
{
    const float lval = d_left ? d_left->getValue(wnd, container) : 0.0f;
    const float rval = d_right ? d_right->getValue(wnd, container) : 0.0f;

    return getValueImpl(lval, rval);
}
Beispiel #2
0
HOT_FUNC
CVarRef SharedMap::getValueRef(ssize_t pos) const {
  SharedVariant *sv = getValueImpl(pos);
  DataType t = sv->getType();
  if (!IS_REFCOUNTED_TYPE(t)) return sv->asCVarRef();
  if (LIKELY(m_localCache != nullptr)) {
    assert(unsigned(pos) < size());
    TypedValue* tv = &m_localCache[pos];
    if (tv->m_type != KindOfUninit) return tvAsCVarRef(tv);
  } else {
    static_assert(KindOfUninit == 0, "must be 0 since we use smart_calloc");
    m_localCache = (TypedValue*) smart_calloc(size(), sizeof(TypedValue));
  }
  TypedValue* tv = &m_localCache[pos];
  tvAsVariant(tv) = sv->toLocal();
  assert(tv->m_type != KindOfUninit);
  return tvAsCVarRef(tv);
}
 //-----------------------------------------------------------------------
 Real LodStrategy::getValue(const MovableObject *movableObject, const Camera *camera) const
 {
     // Just return implementation with lod camera
     return getValueImpl(movableObject, camera->getLodCamera());
 }