Beispiel #1
0
static void _doc_traverse(struct VMGlobals* g, DocNode *n, PyrObject *parent, PyrSlot *slot)
{
    PyrObject *result = instantiateObject( g->gc, s_scdoc_node->u.classobj, 0, false, false );
    result->size = 0;
	SetObject(slot, result);
	if(parent) g->gc->GCWrite(parent, result);

    PyrSymbol *id = getsym(n->id);
    SetSymbol(result->slots+result->size++, id);

    if(n->text) {
        PyrObject *str = (PyrObject*) newPyrString(g->gc, n->text, 0, true);
        SetObject(result->slots+result->size++, str);
        g->gc->GCWrite(result, str);
    } else {
        SetNil(result->slots+result->size++);
    }

    if(n->n_childs) {
        PyrObject *array = newPyrArray(g->gc, n->n_childs, 0, true);
        array->size = 0;
        SetObject(result->slots+result->size++, array);
        g->gc->GCWrite(result, array);
        for(int i=0; i<n->n_childs; i++) {
            array->size++;
            _doc_traverse(g, n->children[i], array, array->slots+i);
        }
    } else {
        SetNil(result->slots+result->size++);
    }
    result->size += 3; // makeDiv, notPrivOnly, sort
}
Beispiel #2
0
void
makeObject(std::vector<std::vector<std::string> > &list, IObjContainer &ioc)
{
  std::string name;
  std::string param;
  int id;
  for( size_t i0=0 ; i0 < list.size() ; ++i0 )
  {
    (void) Parse::getListObj( list[i0][0], name, id, param);

    if( name == "X" )
      instantiateObject(ioc.an, name, id, param );
    else if( name == "CS" )
      instantiateObject(ioc.cS, name, id, param );
    else if( name == "CF" )
      instantiateObject(ioc.cF, name, id, param );
    else if( name == "FD" )
      instantiateObject(ioc.fDI, name, id,  param );
    else if( name == "IN" )
      instantiateObject(ioc.in, name, id,  param );
    else if( name == "OP" )
      instantiateObject(ioc.op, name, id,  param );
    else if( name == "OUT" )
      instantiateObject(ioc.out, name, id,  param );
    else if( name == "QA" )
      instantiateObject(ioc.qA, name, id,  param );
    else if( name == "TC" )
      instantiateObject(ioc.tC, name, id,  param );
  }

  // append the obj pointers to the list of IObj-casted pointers
  for( size_t i=0 ; i < ioc.an.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.an[i]) );
  for( size_t i=0 ; i < ioc.cS.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.cS[i]) );
  for( size_t i=0 ; i < ioc.cF.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.cF[i]) );
  for( size_t i=0 ; i < ioc.fDI.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.fDI[i]) );
  for( size_t i=0 ; i < ioc.in.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.in[i]) );
  for( size_t i=0 ; i < ioc.op.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.op[i]) );
  for( size_t i=0 ; i < ioc.out.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.out[i]) );
  for( size_t i=0 ; i < ioc.qA.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.qA[i]) );
  for( size_t i=0 ; i < ioc.tC.size() ; ++i )
    ioc.vIObj.push_back( &(ioc.tC[i]) );

  return;
}
Beispiel #3
0
PyrObject* ConvertReplyAddress(ReplyAddress *inReply)
{
    VMGlobals *g = gMainVMGlobals;
    PyrObject *obj = instantiateObject(g->gc, s_netaddr->u.classobj, 2, true, false);
    PyrSlot *slots = obj->slots;
    SetInt(slots+0, ntohl(inReply->mSockAddr.sin_addr.s_addr));
    SetInt(slots+1, ntohs(inReply->mSockAddr.sin_port));
    return obj;
}
Beispiel #4
0
void GAFObject::constructObject()
{
    cocos2d::Rect size = m_asset->getHeader().frameSize;

    setContentSize(cocos2d::Size(size.size.width + size.origin.x * 2, size.size.height + size.origin.y * 2));

    GAF_SAFE_RELEASE_ARRAY_WITH_NULL_CHECK(DisplayList_t, m_displayList);

    m_fps = m_asset->getSceneFps();

    m_animationsSelectorScheduled = false;

    instantiateObject(m_timeline->getAnimationObjects(), m_timeline->getAnimationMasks());
}