• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dub_checksdata_n函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dub_checksdata_n函数的典型用法代码示例。如果您正苦于以下问题:C++ dub_checksdata_n函数的具体用法?C++ dub_checksdata_n怎么用?C++ dub_checksdata_n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dub_checksdata_n函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: b2SolverData__set_

/** Set attributes (key, value)
 * 
 */
static int b2SolverData__set_(lua_State *L) {

  b2SolverData *self = *((b2SolverData **)dub_checksdata_n(L, 1, "b2.SolverData"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 4);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "step")) break;
      self->step = **((b2TimeStep **)dub_checksdata_n(L, 3, "b2.TimeStep"));
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "positions")) break;
      dub_protect(L, 1, 3, "positions");
      self->positions = *((b2Position **)dub_checksdata_n(L, 3, "b2.Position"));
      return 0;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "velocities")) break;
      dub_protect(L, 1, 3, "velocities");
      self->velocities = *((b2Velocity **)dub_checksdata_n(L, 3, "b2.Velocity"));
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_SolverData.cpp


示例2: b2Manifold__set_

/** Set attributes (key, value)
 * 
 */
static int b2Manifold__set_(lua_State *L) {

  b2Manifold *self = *((b2Manifold **)dub_checksdata_n(L, 1, "b2.Manifold"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 9);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "localNormal")) break;
      self->localNormal = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 8: {
      if (DUB_ASSERT_KEY(key, "localPoint")) break;
      self->localPoint = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      self->type = (b2Manifold::Type)luaL_checkint(L, 3);
      return 0;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "pointCount")) break;
      self->pointCount = luaL_checkint(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:37,代码来源:b2_Manifold.cpp


示例3: b2CircleShape__set_

/** Set attributes (key, value)
 * 
 */
static int b2CircleShape__set_(lua_State *L) {

  b2CircleShape *self = *((b2CircleShape **)dub_checksdata_n(L, 1, "b2.CircleShape"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 7);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "m_p")) break;
      self->m_p = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "m_type")) break;
      self->m_type = (b2Shape::Type)luaL_checkint(L, 3);
      return 0;
    }
    case 4: {
      if (DUB_ASSERT_KEY(key, "m_radius")) break;
      self->m_radius = luaL_checknumber(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:32,代码来源:b2_CircleShape.cpp


示例4: ofKeyEventArgs__get_

/** Get attributes (key)
 * 
 */
static int ofKeyEventArgs__get_(lua_State *L) {

  ofKeyEventArgs *self = *((ofKeyEventArgs **)dub_checksdata_n(L, 1, "ofKeyEventArgs", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "type")) break;
      dub_pushudata(L, &self->type, "enum ofKeyEventArgs::Type", false);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      lua_pushnumber(L, self->key);
      return 1;
    }
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:34,代码来源:ofKeyEventArgs.cpp


示例5: lua_pushnumber

QVariant DataSource::headerData(int section, Qt::Orientation orientation, int role) const {
  lua_State *L = const_cast<lua_State*>(dub_L);
  if (role == Qt::DisplayRole) {
    if (!dub_pushcallback("header")) return QVariant();
    lua_pushnumber(L, section + 1);
    lua_pushnumber(L, orientation);
    // <func> <self> <section> <orientation>
    if (!dub_call(3, 1)) {
      return QVariant();
    }
    QVariant res = variantFromLua(L, -1);
    lua_pop(L, 1);
    return res;
  } else if (role == Qt::BackgroundRole || role == Qt::ForegroundRole) {
    if (!dub_pushcallback(
         role == Qt::BackgroundRole ? "background" : "foreground"
        )) return QVariant();
    lua_pushnumber(L, section + 1);
    // <func> <self> <section>
    if (!dub_call(2, 1)) {
      return QVariant();
    }
    if (!lua_isnil(L, -1)) {
      try {
        Color *color = *((Color **)dub_checksdata_n(L, -1, "mimas.Color"));
        QVariant res = *color;
        lua_pop(L, 1);
        return res;
      } catch(dub::Exception) {
        return QVariant();
      }
    }
  }
  return QVariant();
}
开发者ID:lubyk,项目名称:mimas,代码行数:35,代码来源:DataSource.cpp


示例6: b2Color__set_

/** Set attributes (key, value)
 *
 */
static int b2Color__set_(lua_State *L) {

    b2Color *self = *((b2Color **)dub_checksdata_n(L, 1, "b2.Color"));
    const char *key = luaL_checkstring(L, 2);
    int key_h = dub_hash(key, 3);
    switch(key_h) {
    case 0: {
        if (DUB_ASSERT_KEY(key, "r")) break;
        self->r = luaL_checknumber(L, 3);
        return 0;
    }
    case 1: {
        if (DUB_ASSERT_KEY(key, "g")) break;
        self->g = luaL_checknumber(L, 3);
        return 0;
    }
    case 2: {
        if (DUB_ASSERT_KEY(key, "b")) break;
        self->b = luaL_checknumber(L, 3);
        return 0;
    }
    }
    if (lua_istable(L, 1)) {
        lua_rawset(L, 1);
    } else {
        luaL_error(L, KEY_EXCEPTION_MSG, key);
    }
    return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:32,代码来源:b2_Color.cpp


示例7: TableView__cast_

/** Cast (class_name)
 * 
 */
static int TableView__cast_(lua_State *L) {

  TableView *self = *((TableView **)dub_checksdata_n(L, 1, "mimas.TableView"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 3);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "mimas.QTableView")) break;
      *retval__ = static_cast<QTableView *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "mimas.QWidget")) break;
      *retval__ = static_cast<QWidget *>(self);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:mimas,代码行数:28,代码来源:mimas_TableView.cpp


示例8: ofVideoGrabber__cast_

/** Cast (class_name)
 * 
 */
static int ofVideoGrabber__cast_(lua_State *L) {

  ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata_n(L, 1, "ofVideoGrabber"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 7);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideoGrabber")) break;
      *retval__ = static_cast<ofBaseVideoGrabber *>(self);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideo")) break;
      *retval__ = static_cast<ofBaseVideo *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "ofBaseUpdates")) break;
      *retval__ = static_cast<ofBaseUpdates *>(self);
      return 1;
    }
    case 6: {
      if (DUB_ASSERT_KEY(key, "ofBaseVideoDraws")) break;
      *retval__ = static_cast<ofBaseVideoDraws *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:33,代码来源:ofVideoGrabber.cpp


示例9: MenuBar__cast_

/** Cast (class_name)
 * 
 */
static int MenuBar__cast_(lua_State *L) {

  MenuBar *self = *((MenuBar **)dub_checksdata_n(L, 1, "mimas.MenuBar"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 6: {
      if (DUB_ASSERT_KEY(key, "mimas.QMenuBar")) break;
      *retval__ = static_cast<QMenuBar *>(self);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "mimas.QWidget")) break;
      *retval__ = static_cast<QWidget *>(self);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:mimas,代码行数:28,代码来源:mimas_MenuBar.cpp


示例10: b2ClipVertex__get_

/** Get attributes (key)
 * 
 */
static int b2ClipVertex__get_(lua_State *L) {

  b2ClipVertex *self = *((b2ClipVertex **)dub_checksdata_n(L, 1, "b2.ClipVertex", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "v")) break;
      dub_pushudata(L, &self->v, "b2.Vec2", false);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "id")) break;
      dub_pushudata(L, &self->id, "b2.ContactID", false);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_ClipVertex.cpp


示例11: ofVideoGrabber__get_

/** Get attributes (key)
 * 
 */
static int ofVideoGrabber__get_(lua_State *L) {

  ofVideoGrabber *self = *((ofVideoGrabber **)dub_checksdata_n(L, 1, "ofVideoGrabber", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 2);
  switch(key_h) {
    case 1: {
      if (DUB_ASSERT_KEY(key, "height")) break;
      lua_pushnumber(L, self->height);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "width")) break;
      lua_pushnumber(L, self->width);
      return 1;
    }
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:34,代码来源:ofVideoGrabber.cpp


示例12: b2Shape__get_

/** Get attributes (key)
 * 
 */
static int b2Shape__get_(lua_State *L) {

  b2Shape *self = *((b2Shape **)dub_checksdata_n(L, 1, "b2.Shape", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 2: {
      if (DUB_ASSERT_KEY(key, "m_type")) break;
      lua_pushnumber(L, self->m_type);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "m_radius")) break;
      lua_pushnumber(L, self->m_radius);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_Shape.cpp


示例13: HBoxLayout__cast_

/** Cast (class_name)
 * 
 */
static int HBoxLayout__cast_(lua_State *L) {

  HBoxLayout *self = *((HBoxLayout **)dub_checksdata_n(L, 1, "mimas.HBoxLayout"));
  const char *key = luaL_checkstring(L, 2);
  void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
  int key_h = dub_hash(key, 4);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "mimas.QBoxLayout")) break;
      *retval__ = static_cast<QBoxLayout *>(self);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "mimas.QLayout")) break;
      *retval__ = static_cast<QLayout *>(self);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "mimas.QObject")) break;
      *retval__ = static_cast<QObject *>(self);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:mimas,代码行数:28,代码来源:mimas_HBoxLayout.cpp


示例14: b2ContactID__get_

/** Get attributes (key)
 * 
 */
static int b2ContactID__get_(lua_State *L) {

  b2ContactID *self = *((b2ContactID **)dub_checksdata_n(L, 1, "b2.ContactID", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 5);
  switch(key_h) {
    case 3: {
      if (DUB_ASSERT_KEY(key, "cf")) break;
      dub_pushudata(L, &self->cf, "b2.ContactFeature", false);
      return 1;
    }
    case 0: {
      if (DUB_ASSERT_KEY(key, "key")) break;
      lua_pushnumber(L, self->key);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:34,代码来源:b2_ContactID.cpp


示例15: btPolyhedralConvexShape__cast_

/** Cast (class_name)
 *
 */
static int btPolyhedralConvexShape__cast_(lua_State *L) {

    btPolyhedralConvexShape *self = *((btPolyhedralConvexShape **)dub_checksdata_n(L, 1, "bt.PolyhedralConvexShape"));
    const char *key = luaL_checkstring(L, 2);
    void **retval__ = (void**)lua_newuserdata(L, sizeof(void*));
    int key_h = dub_hash(key, 3);
    switch(key_h) {
    case 0: {
        if (DUB_ASSERT_KEY(key, "bt.ConvexInternalShape")) break;
        *retval__ = static_cast<btConvexInternalShape *>(self);
        return 1;
    }
    case 1: {
        if (DUB_ASSERT_KEY(key, "bt.ConvexShape")) break;
        *retval__ = static_cast<btConvexShape *>(self);
        return 1;
    }
    case 2: {
        if (DUB_ASSERT_KEY(key, "bt.CollisionShape")) break;
        *retval__ = static_cast<btCollisionShape *>(self);
        return 1;
    }
    }
    return 0;
}
开发者ID:lubyk,项目名称:old_bt,代码行数:28,代码来源:bt_PolyhedralConvexShape.cpp


示例16: b2ContactManager__get_

/** Get attributes (key)
 * 
 */
static int b2ContactManager__get_(lua_State *L) {

  b2ContactManager *self = *((b2ContactManager **)dub_checksdata_n(L, 1, "b2.ContactManager", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 14);
  switch(key_h) {
    case 5: {
      if (DUB_ASSERT_KEY(key, "m_broadPhase")) break;
      dub_pushudata(L, &self->m_broadPhase, "b2.BroadPhase", false);
      return 1;
    }
    case 12: {
      if (DUB_ASSERT_KEY(key, "m_contactList")) break;
      b2Contact *retval__ = self->m_contactList;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "Contact", false);
      return 1;
    }
    case 13: {
      if (DUB_ASSERT_KEY(key, "m_contactCount")) break;
      lua_pushnumber(L, self->m_contactCount);
      return 1;
    }
    case 10: {
      if (DUB_ASSERT_KEY(key, "m_contactFilter")) break;
      b2ContactFilter *retval__ = self->m_contactFilter;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "b2.ContactFilter", false);
      return 1;
    }
    case 8: {
      if (DUB_ASSERT_KEY(key, "m_contactListener")) break;
      b2ContactListener *retval__ = self->m_contactListener;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "b2.ContactListener", false);
      return 1;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "m_allocator")) break;
      b2BlockAllocator *retval__ = self->m_allocator;
      if (!retval__) return 0;
      dub_pushudata(L, retval__, "b2.BlockAllocator", false);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:62,代码来源:b2_ContactManager.cpp


示例17: b2Sweep__set_

/** Set attributes (key, value)
 * 
 */
static int b2Sweep__set_(lua_State *L) {

  b2Sweep *self = *((b2Sweep **)dub_checksdata_n(L, 1, "b2.Sweep"));
  const char *key = luaL_checkstring(L, 2);
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "localCenter")) break;
      self->localCenter = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "c0")) break;
      self->c0 = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "c")) break;
      self->c = **((b2Vec2 **)dub_checksdata_n(L, 3, "b2.Vec2"));
      return 0;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "a0")) break;
      self->a0 = luaL_checknumber(L, 3);
      return 0;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "a")) break;
      self->a = luaL_checknumber(L, 3);
      return 0;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "alpha0")) break;
      self->alpha0 = luaL_checknumber(L, 3);
      return 0;
    }
  }
  if (lua_istable(L, 1)) {
    lua_rawset(L, 1);
  } else {
    luaL_error(L, KEY_EXCEPTION_MSG, key);
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:47,代码来源:b2_Sweep.cpp


示例18: btMatrix3x3__get_

/** btVector3& btMatrix3x3::operator[](int i)
 * src/vendor/bullet/src/LinearMath/btMatrix3x3.h:146
 */
static int btMatrix3x3__get_(lua_State *L) {

  btMatrix3x3 *self = *((btMatrix3x3 **)dub_checksdata_n(L, 1, "bt.Matrix3x3", true));
  if (lua_type(L, 2) != LUA_TSTRING) {
    int i = luaL_checkint(L, 2);
    dub_pushudata(L, const_cast<btVector3*>(&self->operator[](i)), "bt.Vector3", false);
    return 1;
  }
  return 0;
}
开发者ID:lubyk,项目名称:old_bt,代码行数:13,代码来源:bt_Matrix3x3.cpp


示例19: ofPolyline__get_

/** const ofPoint& ofPolyline::operator[](int index) const
 * api/openFrameworks/graphics/ofPolyline.h:114
 */
static int ofPolyline__get_(lua_State *L) {

  ofPolyline *self = *((ofPolyline **)dub_checksdata_n(L, 1, "ofPolyline", true));
  if (lua_type(L, 2) != LUA_TSTRING) {
    int index = luaL_checkint(L, 2);
    dub_pushudata(L, &self->operator[](index), "ofVec3f", false);
    return 1;
  }
  return 0;
}
开发者ID:cigraphics,项目名称:ofxMoonLight,代码行数:13,代码来源:ofPolyline.cpp


示例20: b2Sweep__get_

/** Get attributes (key)
 * 
 */
static int b2Sweep__get_(lua_State *L) {

  b2Sweep *self = *((b2Sweep **)dub_checksdata_n(L, 1, "b2.Sweep", true));
  const char *key = luaL_checkstring(L, 2);
  // <self> "key" <mt>
  // rawget(mt, key)
  lua_pushvalue(L, 2);
  // <self> "key" <mt> "key"
  lua_rawget(L, -2);
  if (!lua_isnil(L, -1)) {
    // Found method.
    return 1;
  } else {
    // Not in mt = attribute access.
    lua_pop(L, 2);
  }
  int key_h = dub_hash(key, 8);
  switch(key_h) {
    case 0: {
      if (DUB_ASSERT_KEY(key, "localCenter")) break;
      dub_pushudata(L, &self->localCenter, "b2.Vec2", false);
      return 1;
    }
    case 5: {
      if (DUB_ASSERT_KEY(key, "c0")) break;
      dub_pushudata(L, &self->c0, "b2.Vec2", false);
      return 1;
    }
    case 3: {
      if (DUB_ASSERT_KEY(key, "c")) break;
      dub_pushudata(L, &self->c, "b2.Vec2", false);
      return 1;
    }
    case 7: {
      if (DUB_ASSERT_KEY(key, "a0")) break;
      lua_pushnumber(L, self->a0);
      return 1;
    }
    case 1: {
      if (DUB_ASSERT_KEY(key, "a")) break;
      lua_pushnumber(L, self->a);
      return 1;
    }
    case 2: {
      if (DUB_ASSERT_KEY(key, "alpha0")) break;
      lua_pushnumber(L, self->alpha0);
      return 1;
    }
  }
  return 0;
}
开发者ID:lubyk,项目名称:b2,代码行数:54,代码来源:b2_Sweep.cpp



注:本文中的dub_checksdata_n函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ duk_call函数代码示例发布时间:2022-05-30
下一篇:
C++ dub_checksdata函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap