예제 #1
0
void Game::askGodToDo(Map & map, int & wait)
	{
		unsigned int x, y;
		int tBdstr = _god.makeStep((*this),x,y);	//Ile zostanie zniszczonych
		if(tBdstr>0)
		{
			_printer.printMessage(GOD_DECIDE_TO_DO,cout);
			int result = putBlock(x,y,_map,PS_GOD_BLOCK);
			prepareWeights(_map);
			list<ElementData *> * path = testWeight(_map);
			if(path->size() > 0)
			{
				if(_map(x,y,DIM_WHO_TAB) != path->back()->operator [](DIM_WHO_TAB))
				{
					_destroyedBlocks += destroyElements(path);
					_printer.printMessage(GOD_SAY_OMG,cout);
					_printer.makeBoomConsole();
				}
				else
					_printer.printMessage(GOD_BLESS_YOU, cout);
				wait++;	
			}
			delete path;
		}
	}
예제 #2
0
txNodeSet::~txNodeSet()
{
    delete [] mMarks;

    if (mStartBuffer) {
        destroyElements(mStart, mEnd);

        nsMemory::Free(mStartBuffer);
    }
}
예제 #3
0
void Game::askWindToDo(Map & map, int & wait)
{
	list<ElementData *> * toDestroy = testWind(map,_wind);
	if(toDestroy->size() > 0)		//Jesli udalo sie cos zniszczyc
	{
		_destroyedBlocks += destroyElements(toDestroy);
		_printer.printMessage(GAME_SAY_WIND_DESTROYED, cout);
		_printer.makeBoomConsole();
		wait ++ ;
	}
	_wind.addWind();
}
예제 #4
0
	void generateSceneElements()
	{
		destroyElements();

		/* Only generate elements for non-emtpy scanrows */
		std::vector<int> scanrowInd;

		for (size_t i = 0; i < scanrowCount; ++i)
			if (scanrowVert[i].v[0].size() > 0)
				scanrowInd.push_back(i);

		generateElements(scanrowInd);
	}
예제 #5
0
void
txNodeSet::clear()
{
    destroyElements(mStart, mEnd);
#ifdef TX_DONT_RECYCLE_BUFFER
    if (mStartBuffer) {
        nsMemory::Free(mStartBuffer);
        mStartBuffer = mEndBuffer = nsnull;
    }
#endif
    mStart = mEnd = mStartBuffer;
    delete [] mMarks;
    mMarks = nsnull;
    mDirection = kForward;
}
예제 #6
0
	void prepare()
	{
		if (!verifyResources())
		{
			if (elem.ground)
				destroyElements();
			tilemapReady = false;
			return;
		}

		if (atlasSizeDirty)
		{
			allocateAtlas();
			atlasSizeDirty = false;
		}

		if (atlasDirty)
		{
			buildAtlas();
			atlasDirty = false;
		}

		if (buffersDirty)
		{
			buildQuadArray();
			uploadBuffers();
			generateSceneElements();
			buffersDirty = false;
		}

		if (flashDirty)
		{
			updateFlash();
			flashDirty = false;
		}

		if (zOrderDirty)
		{
			updateZOrder();
			zOrderDirty = false;
		}

		prepareScanrowBatches();

		tilemapReady = true;
	}
예제 #7
0
파일: Axis3d.cpp 프로젝트: gitrider/wxsj2
 AxisRenderable::~AxisRenderable() 
 {
    delete mRenderOp.vertexData;
    destroyElements();
 }