Example #1
0
int ActionNode::getLastFrameIndex()
{
	int frameindex = -1;
	bool bFindFrame = false;
	for (int n = 0; n < _frameArrayNum; n++)
	{
		Array* cArray = (Array*)(_frameArray->getObjectAtIndex(n));
		if (cArray == NULL || cArray->count() <= 0)
		{
			continue;
		}
		bFindFrame = true;
		int lastInex = cArray->count() - 1;
		ActionFrame* frame = (ActionFrame*)(cArray->getObjectAtIndex(lastInex));
		int iFrameIndex = frame->getFrameIndex();

		if (frameindex < iFrameIndex)
		{
			frameindex = iFrameIndex;
		}
	}
	if (!bFindFrame)
	{
		frameindex = 0;
	}
	return frameindex;
}
Example #2
0
File: VM.cpp Project: relrod/magpie
  int VM::addRecordType(const Array<int>& fields)
  {
    // TODO(bob): Should use a hash table or something more optimal.
    // See if we already have a type for this signature.
    for (int i = 0; i < recordTypes_.count(); i++)
    {
      RecordType& type = *recordTypes_[i];

      // See if this record type matches what we're looking for.
      if (fields.count() != type.numFields()) continue;

      bool found = true;
      for (int j = 0; j < fields.count(); j++)
      {
        // Compare the symbol IDs of the records.
        // TODO(bob): Note, assumes symbols are sorted in both records.
        if (type.getSymbol(j) != fields[j]) {
          found = false;
          break;
        }
      }

      if (found) return i;
    }

    // It's a new type, so add it.
    gc<RecordType> type = RecordType::create(fields);
    recordTypes_.add(type);
    return recordTypes_.count() - 1;
  }
Example #3
0
static void fillTemplateDictionaryFromMCHashMap(ctemplate::TemplateDictionary * dict, HashMap * mcHashMap)
{
    Array * keys = mcHashMap->allKeys();

    for(unsigned int i = 0 ; i < keys->count() ; i ++) {
        String * key = (String *) keys->objectAtIndex(i);
        Object * value;

        value = mcHashMap->objectForKey(key);
        if (value->className()->isEqual(MCSTR("mailcore::String"))) {
            String * str;

            str = (String *) value;
            dict->SetValue(key->UTF8Characters(), str->UTF8Characters());
        }
        else if (value->className()->isEqual(MCSTR("mailcore::Array"))) {
            Array * array;

            array = (Array *) value;
            for(unsigned int k = 0 ; k < array->count() ; k ++) {
                HashMap * item = (HashMap *) array->objectAtIndex(k);
                ctemplate::TemplateDictionary * subDict = dict->AddSectionDictionary(key->UTF8Characters());
                fillTemplateDictionaryFromMCHashMap(subDict, item);
            }
        }
        else if (value->className()->isEqual(MCSTR("mailcore::HashMap"))) {
            ctemplate::TemplateDictionary * subDict;
            HashMap * item;

            item = (HashMap *) value;
            subDict = dict->AddSectionDictionary(key->UTF8Characters());
            fillTemplateDictionaryFromMCHashMap(subDict, item);
        }
    }
}
Example #4
0
 void ArrayTests::grow()
 {
   Array<Int> array;
   array.add(1);
   array.add(2);
   
   // Grow to a smaller size does nothing.
   array.grow(1);    
   EXPECT_EQUAL(2, array.count());
   EXPECT_EQUAL(1, array[0]);
   EXPECT_EQUAL(2, array[1]);
   
   // Grow to same size does nothing.
   array.grow(2);
   EXPECT_EQUAL(2, array.count());
   EXPECT_EQUAL(1, array[0]);
   EXPECT_EQUAL(2, array[1]);
   
   // Grow.
   array.grow(4);
   EXPECT_EQUAL(4, array.count());
   EXPECT_EQUAL(1, array[0]);
   EXPECT_EQUAL(2, array[1]);
   EXPECT_EQUAL(-1, array[2]);
   EXPECT_EQUAL(-1, array[3]);
 }
Example #5
0
  void ArrayTests::truncate()
  {
    Array<char> array;
    array.add('a');
    array.add('b');
    array.add('c');
    array.add('d');
    array.add('e');
    
    EXPECT_EQUAL(5, array.count());
    
    // Truncate to greater size does nothing.
    array.truncate(7);
    EXPECT_EQUAL(5, array.count());
    
    // Truncate to same size does nothing.
    array.truncate(5);
    EXPECT_EQUAL(5, array.count());
    
    array.truncate(3);
    EXPECT_EQUAL(3, array.count());
    EXPECT_EQUAL('a', array[0]);
    EXPECT_EQUAL('b', array[1]);
    EXPECT_EQUAL('c', array[2]);

    array.truncate(0);
    EXPECT_EQUAL(0, array.count());
  }
KDvoid SampleLayer::addCharacter ( KDvoid )
{
	// plist 에서 달리기 애니매이션 로딩
	SpriteFrameCache*	pFrameCache = SpriteFrameCache::getInstance ( );
	pFrameCache->addSpriteFramesWithFile ( "ch01.plist" );

	Dictionary*		pDictionary = Dictionary::createWithContentsOfFile ( "ch01_1_aniinfo.plist" );
	Array*			pAnimationList = (Array*) pDictionary->objectForKey ( "animationlist" );
	Array*			pFrameList = (Array*) pDictionary->objectForKey ( "framelist" );
	String*			pName = (String*) pDictionary->objectForKey ( "name" );
	String*			pTexture = (String*) pDictionary->objectForKey ( "texture" );
	String*			pType = (String*) pDictionary->objectForKey ( "type" );

	Dictionary*		pAnimationItem = (Dictionary*) pAnimationList->getObjectAtIndex ( 12 );

	Array*			pTemp = (Array*) pAnimationItem->objectForKey ( "FrameList" );
	KDfloat			fTemp = ( (String*) pAnimationItem->objectForKey ( "FPS" ) )->floatValue ( );

	Array*			pArraySpriteFrame = Array::createWithCapacity ( pTemp->count ( ) );

	Animation*		pAnimation = Animation::create ( );

	for ( KDint32 i = 0; i < pTemp->count ( ); i++ )
	{
		KDint		ii = ( (String*) pTemp->getObjectAtIndex ( i ) )->intValue ( );
		String*		pString = (String*) pFrameList->getObjectAtIndex ( ii );
		pAnimation->addSpriteFrame ( pFrameCache->getSpriteFrameByName ( pString->getCString ( ) ) );
	}
	pAnimation->setDelayPerUnit ( fTemp );

	Sprite*			pSprite = Sprite::createWithSpriteFrameName ( ( (String*) pFrameList->getObjectAtIndex ( 21 ) )->getCString ( ) );
	Point			tPoint = Point ( Point ( 100, 200 ) );
	Point tOffset = pSprite->getDisplayFrame ( )->getOffset ( );
	pSprite->setPosition ( tPoint - tOffset );
	
	pSprite->runAction ( RepeatForever::create ( Animate::create ( pAnimation ) ) );
	pSprite->setTag ( 10 );
	this->addChild ( pSprite );

	// Box2D body setting
	b2BodyDef		tBodyDef;
	tBodyDef.type = b2_dynamicBody;
	tBodyDef.position.Set ( tPoint.x / PTM_RATIO, tPoint.y / PTM_RATIO );
	tBodyDef.userData = pSprite;

	b2PolygonShape	tDynamicBox;
	Size tSize = pSprite->getDisplayFrame ( )->getRect ( ).size;
	tDynamicBox.SetAsBox ( tSize.width / 2 / PTM_RATIO, tSize.height / 2 / PTM_RATIO );

	m_pBody = m_pWorld->CreateBody ( &tBodyDef );

	b2FixtureDef	tFixtureDef;
	tFixtureDef.shape = &tDynamicBox;
	tFixtureDef.density = 1.0f;
	tFixtureDef.friction = 0.0f;

	m_pBody->CreateFixture ( &tFixtureDef );
}
Example #7
0
 RecordType::RecordType(const Array<int>& fields)
 : numFields_(fields.count())
 {
   // Initialize the fields.
   for (int i = 0; i < fields.count(); i++)
   {
     names_[i] = fields[i];
   }
 }
Example #8
0
void updatePointSet(const Array<float> & exposures, Array<float> & errors, GooglePointSet & pointSet)
{
    uint pointCount = exposures.count();
    nvDebugCheck(pointCount == errors.count());

    pointSet.points.resize(pointCount);

    for (uint i = 0; i < pointCount; i++) {
        pointSet.points[i].x = exposures[i];
        pointSet.points[i].y = errors[i];
    }
}
MeshOptimizer::MeshOptimizer(uint vertexCount, const Array<uint> & indices, uint primitiveSize, uint cacheSize, VertexCache::Mode cacheMode) :
	m_indices(indices),	
	m_primitiveSize(primitiveSize), 
	m_primitiveCount(indices.count()/primitiveSize), 
	m_cacheSize(cacheSize),
	m_cacheMode(cacheMode),
	m_mesh(vertexCount, indices, primitiveSize),
	m_state(NULL)
{
	nvCheck(primitiveSize <= m_cacheSize);
	nvCheck(indices.count()	% primitiveSize	== 0);
}
Example #10
0
Spawn * ActionNode::refreshActionProperty()
{
	if ( _object == NULL )
	{
		return NULL;
	}
	Array* cSpawnArray = Array::create();
	for (int n = 0; n < _frameArrayNum; n++)
	{
		Array* cArray = (Array*)(_frameArray->getObjectAtIndex(n));
		if (cArray == NULL || cArray->count() <= 0)
		{
			continue;
		}

		Array* cSequenceArray = Array::create();
		int frameCount = cArray->count();
		for (int i = 0; i < frameCount; i++)
		{
			ActionFrame* frame = (ActionFrame*)(cArray->getObjectAtIndex(i));
			if (i == 0)
			{
			}
			else
			{
				ActionFrame* srcFrame = (ActionFrame*)(cArray->getObjectAtIndex(i-1));
				float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime();
				Action* cAction = frame->getAction(duration);
				cSequenceArray->addObject(cAction);
			}
		}
		Sequence* cSequence = Sequence::create(cSequenceArray);
		if (cSequence != NULL)
		{
			cSpawnArray->addObject(cSequence);
		}
	}

	if (_action == NULL)
	{
		CC_SAFE_RELEASE_NULL(_actionSpawn);
	}
	else
	{
		CC_SAFE_RELEASE_NULL(_action);
	}

	_actionSpawn = Spawn::create(cSpawnArray);
	CC_SAFE_RETAIN(_actionSpawn);
	return _actionSpawn;
}
void AnimationCache::parseVersion1(Dictionary* animations)
{
    SpriteFrameCache *frameCache = SpriteFrameCache::sharedSpriteFrameCache();

    DictElement* pElement = NULL;
    CCDICT_FOREACH(animations, pElement)
    {
        Dictionary* animationDict = (Dictionary*)pElement->getObject();
        Array* frameNames = (Array*)animationDict->objectForKey("frames");
        float delay = animationDict->valueForKey("delay")->floatValue();
        Animation* animation = NULL;

        if ( frameNames == NULL ) 
        {
            CCLOG("cocos2d: AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to animation cache.", pElement->getStrKey());
            continue;
        }

        Array* frames = Array::createWithCapacity(frameNames->count());
        frames->retain();

        Object* pObj = NULL;
        CCARRAY_FOREACH(frameNames, pObj)
        {
            const char* frameName = ((String*)pObj)->getCString();
            SpriteFrame* spriteFrame = frameCache->spriteFrameByName(frameName);

            if ( ! spriteFrame ) {
                CCLOG("cocos2d: AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the SpriteFrameCache. This frame will not be added to the animation.", pElement->getStrKey(), frameName);

                continue;
            }

            AnimationFrame* animFrame = new AnimationFrame();
            animFrame->initWithSpriteFrame(spriteFrame, 1, NULL);
            frames->addObject(animFrame);
            animFrame->release();
        }

        if ( frames->count() == 0 ) {
            CCLOG("cocos2d: AnimationCache: None of the frames for animation '%s' were found in the SpriteFrameCache. Animation is not being added to the Animation Cache.", pElement->getStrKey());
            continue;
        } else if ( frames->count() != frameNames->count() ) {
            CCLOG("cocos2d: AnimationCache: An animation in your dictionary refers to a frame which is not in the SpriteFrameCache. Some or all of the frames for the animation '%s' may be missing.", pElement->getStrKey());
        }

        animation = Animation::create(frames, delay, 1);

        AnimationCache::sharedAnimationCache()->addAnimation(animation, pElement->getStrKey());
        frames->release();
    }    
Example #12
0
void AccountValidator::resolveMX()
{
    Array * components;
    String * domain;
    
    components = mEmail->componentsSeparatedByString(MCSTR("@"));
    if (components->count() >= 2) {
        performMethodAfterDelay((Object::Method) &AccountValidator::resolveMXTimeout, NULL, 30.0);

        domain = (String *) components->lastObject();
        mResolveMX = new MXRecordResolverOperation();
        mResolveMX->setHostname(domain);
        mResolveMX->setCallback((OperationCallback *)this);
        
        mQueue = new OperationQueue();
        mQueue->addOperation(mResolveMX);
    }
    else {
        mImapError = ErrorNoValidServerFound;
        mPopError = ErrorNoValidServerFound;
        mSmtpError = ErrorNoValidServerFound;
        
        callback()->operationFinished(this);
    }
}
// Builds meshconnectivity in o(n^2)
MeshConnectivity::MeshConnectivity(uint vertexCount, const Array<uint> & indices, uint primitiveSize) :
	m_primitiveSize(primitiveSize)
{
	m_vertexArray.resize(vertexCount);

	const uint primitiveCount = indices.count() / m_primitiveSize;
	m_primitiveArray.resize(primitiveCount);

	// Build primitives.
	for (uint i = 0; i < primitiveCount; i++)
	{
		m_primitiveArray[i] = new Primitive(i, indices, i * m_primitiveSize, m_primitiveSize);
	}

	// Build vertices.
	for (uint i = 0; i < vertexCount; i++)
	{
		m_vertexArray[i] = new Vertex(i);
	}

	// Build vertex adjacency.
	for (uint i = 0; i < primitiveCount; i++)
	{
		const Primitive * primitive = m_primitiveArray[i];

		const uint indexCount = primitive->indexArray.count();
		for (uint j = 0; j < indexCount; j++)
		{
			uint idx = primitive->indexArray[j];

			m_vertexArray[idx]->add(primitive);
		}
	}
}
	virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent){
		if(!isVisible()){
			return;
		}
		CCTableViewCell *cell = cellForTouch(pTouch);
		if(cell){
			CCTableViewDelegate *dele = getTableViewDelegate();
			LuaEventHandler *h = dynamic_cast<LuaEventHandler *>(dele);
#if COCOS2D_VERSION >= 0x00030000
			Array *touches = _touches;
#else
			CCArray *touches = m_pTouches;
#endif
			if(touches->count() == 1 && !isTouchMoved()){
				if(h){	h->tableCellTouched(this, cell, pTouch);}
				else{	dele->tableCellTouched(this, cell);}
				dele->tableCellUnhighlight(this, cell);
			}else if(h){
				h->tableCellTouchEnded(this, cell, pTouch);
			}
		}else{
			printf("LuaTableView.touchEnded cell is null %f,%f\n", pTouch->getLocation().x, pTouch->getLocation().y);
		}
		CCScrollView::ccTouchEnded(pTouch, pEvent);
	}
void ELFMainMenuItem::autoexec()
{
    /*
     * This entire function has no effect on physical hardware.
     * In simulation, we check to see if exactly one game volume
     * is installed. If so, we silently run that game.
     */

    if (!System::isSimDebug())
        return;

    if (Volume::previous())
        return;

    Array<Volume, 2> volumes;
    Volume::list(Volume::T_GAME, volumes);
    if (volumes.count() != 1)
        return;

    ELFMainMenuItem &inst = instances[0];
    if (!inst.init(volumes[0]))
        return;

    LOG("LAUNCHER: Automatically executing single game\n");

    // Wait a little bit to allow all cube connection events to process
    while (SystemTime::now().uptimeMS() < 500)
        System::yield();

    AssetLoaderBypassDelegate delegate;
    inst.getCubeRange().set();
    inst.bootstrap(CubeSet::connected(), delegate);
    inst.exec();
}
Example #16
0
  void Compiler::declareClass(DefClassExpr& classExpr, Module* module)
  {
    declareVariable(classExpr.pos(), classExpr.name(), module);

    // Native classes have no fields or synthesized members.
    if (classExpr.isNative()) return;

    // Synthesize the constructor and field accessors.
    Array<gc<DefExpr> > synthesizedMethods;
    synthesizedMethods.add(synthesizeConstructor(classExpr));

    // Create getters and setters for fields.
    for (int i = 0; i < classExpr.fields().count(); i++)
    {
      synthesizedMethods.add(synthesizeGetter(classExpr, i));
      if (classExpr.fields()[i]->isMutable())
      {
        synthesizedMethods.add(synthesizeSetter(classExpr, i));
      }
    }

    // TODO(bob): Stuffing this back in the AST is a bit gross. An intermediate
    // representation would help here.
    classExpr.setSynthesizedMethods(synthesizedMethods);

    // Declare the automatically-generated methods.
    for (int i = 0; i < synthesizedMethods.count(); i++)
    {
      declareMultimethod(SignatureBuilder::build(*synthesizedMethods[i]));
    }
  }
// Abnormal termination. Create mini dump and output call stack.
void debug::terminate(int code)
{
#if NV_OS_WIN32
    EnterCriticalSection(&s_handler_critical_section);

    writeMiniDump(NULL);

    const int max_stack_size = 64;
    void * trace[max_stack_size];
    int size = backtrace(trace, max_stack_size);

    // @@ Use win32's CreateFile?
    FILE * fp = fileOpen("crash.txt", "wb");
    if (fp != NULL) {
        Array<const char *> lines;
        writeStackTrace(trace, size, 0, lines);

        for (uint i = 0; i < lines.count(); i++) {
            fputs(lines[i], fp);
            delete lines[i];
        }

        // @@ Add more info to crash.txt?

        fclose(fp);
    }

    LeaveCriticalSection(&s_handler_critical_section);
#endif

    exit(code);
}
void mnuCommandLinesAndParams(ArchiveManagerConfig* pCfg)
{
	Array<ArchiveFormat*> formats;
	pManager->GetFormats(formats);

	FarMenu menu(_M(MCommandLinesAndParamsArchiveFormat));

	for (unsigned int i = 0; i < formats.count(); i++)
	{
		ArchiveFormat* pFormat = formats[i];

		if ( pFormat->QueryCapability(AFF_SUPPORT_DEFAULT_COMMANDS) )
			menu.Add(pFormat->GetName(), 0, (void*)pFormat);
	}

	while ( true )
	{
		int nResult = menu.Run();

		if ( nResult != -1 )
		{
			ArchiveFormat* pFormat = (ArchiveFormat*)menu.GetData(nResult);
			dlgCommandLinesAndParams(pCfg, pFormat);
		}
		else
			break;
	}
}
Example #19
0
	unsigned int Add(const TCHAR *lpStr, DWORD dwFlags = 0, void *UserData = NULL)
	{
		FarMenuItemEx *item = m_items.add();

		if ( item )
		{
			size_t length = _tcslen(lpStr);

			item->Flags = dwFlags;

#ifndef UNICODE
			item->Flags |= MIF_USETEXTPTR;
#endif

			UserDataStruct *uds = new UserDataStruct;

			uds->Text = new TCHAR[length+1];
			_tcscpy(uds->Text, lpStr);
			uds->UserData = UserData;

#ifdef UNICODE
			item->Text = uds->Text;
#else
			item->Text.TextPtr = uds->Text;
#endif

			item->UserData = (DWORD_PTR)uds;

			return m_items.count()-1;
		}

		return (unsigned int)-1;
	}
Example #20
0
void Camera::setUp(Array<double> up)
{
	if (up.count() != 4)
	{
		CameraWrongVectorSettingsError();
	}
	this->up = up;
}
Example #21
0
void Camera::setDirection(Array<double> direction)
{
	if (direction.count() != 4)
	{
		CameraWrongVectorSettingsError();
	}
	this->direction = direction;
}
Example #22
0
void StringModel::setValues(const Array<QString> &values)
{
	m_values = values;

	qDebug() << "setValues" << values.count();

	emit layoutChanged();
}
Example #23
0
void Camera::setPosition(Array<double> position)
{
	if (position.count() != 4)
	{
		CameraWrongVectorSettingsError();
	}
	this->position = position;
}
Example #24
0
void Camera::setRight(Array<double> right)
{
	if (right.count() != 4)
	{
		CameraWrongVectorSettingsError();
	}
	this->right = right;
}
Example #25
0
void Camera::setTarget(Array<double> target)
{
	if (target.count() != 4)
	{
		CameraWrongVectorSettingsError();
	}
	this->target = target;
}
Example #26
0
Range mailcore::RangeFromString(String * rangeString)
{
    Array * components = rangeString->componentsSeparatedByString(MCSTR("-"));
    if (components->count() != 2)
        return RangeEmpty;
    String * locationString = (String *) components->objectAtIndex(0);
    String * lengthString = (String *) components->objectAtIndex(1);
    return RangeMake(locationString->unsignedLongLongValue(), lengthString->unsignedLongLongValue());
}
Example #27
0
bool Chart::closeLoop(uint start, const Array<HalfEdge::Edge *> & loop)
{
    const uint vertexCount = loop.count() - start;

    nvDebugCheck(vertexCount >= 3);
    if (vertexCount < 3) return false;

    nvDebugCheck(loop[start]->vertex->isColocal(loop[start+vertexCount-1]->to()));

    // If the hole is planar, then we add a single face that will be properly triangulated later.
    // If the hole is not planar, we add a triangle fan with a vertex at the hole centroid.
    // This is still a bit of a hack. There surely are better hole filling algorithms out there.

    Array<Vector3> points;
    points.resize(vertexCount);
    for (uint i = 0; i < vertexCount; i++) {
        points[i] = loop[start+i]->vertex->pos;
    }

    bool isPlanar = Fit::isPlanar(vertexCount, points.buffer());

    if (isPlanar) {
        // Add face and connect edges.
        HalfEdge::Face * face = m_unifiedMesh->addFace();
        for (uint i = 0; i < vertexCount; i++) {
            HalfEdge::Edge * edge = loop[start + i];
            
            edge->face = face;
            edge->setNext(loop[start + (i + 1) % vertexCount]);
        }
        face->edge = loop[start];

        nvDebugCheck(face->isValid());
    }
    else {
        // If the polygon is not planar, we just cross our fingers, and hope this will work:

        // Compute boundary centroid:
        Vector3 centroidPos(0);

        for (uint i = 0; i < vertexCount; i++) {
            centroidPos += points[i];
        }

        centroidPos *= (1.0f / vertexCount);

        HalfEdge::Vertex * centroid = m_unifiedMesh->addVertex(centroidPos);

        // Add one pair of edges for each boundary vertex.
        for (uint j = vertexCount-1, i = 0; i < vertexCount; j = i++) {
            HalfEdge::Face * face = m_unifiedMesh->addFace(centroid->id, loop[start+j]->vertex->id, loop[start+i]->vertex->id);
            nvDebugCheck(face != NULL);
        }
    }

    return true;
}
Example #28
0
  gc<RecordType> RecordType::create(const Array<int>& fields)
  {
    // Allocate enough memory for the record and its fields.
    void* mem = Memory::allocate(sizeof(RecordType) +
                                 sizeof(int) * (fields.count() - 1));

    // Construct it by calling global placement new.
    return ::new(mem) RecordType(fields);
  }
Example #29
0
static unsigned populate(Array<MainMenuItem*, Shared::MAX_ITEMS> &items)
{
    ELFMainMenuItem::findGames(items);
    unsigned numGames = items.count();

    GetGamesApplet::add(items);
    StatusApplet::add(items);

    return numGames;
}
Example #30
0
void MySnake::changeRandomSpritePozition()
{
    Array *totalArray = Array::createWithCapacity(col_num * row_num);
    for (int i=0; i<totalArray->capacity(); i++) {
        totalArray->addObject(Integer::create(i));
    }
    
    for (int i=0; i < getChildrenCount()-1; i++) {
        MySprite *sprite = (MySprite *)getChildByTag(i+batchNodeStartTag);
        
        totalArray->removeObjectAtIndex(sprite->getIndex());
    }
    
    int randIndex = (CCRANDOM_0_1()+1) * totalArray->count();
    randIndex = CCRANDOM_0_1() * totalArray->count();
    Integer* pozitionIndex = (Integer *)totalArray->getObjectAtIndex(randIndex);
 
    randomSprite->setIndex(pozitionIndex->getValue());
}