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; } }
txNodeSet::~txNodeSet() { delete [] mMarks; if (mStartBuffer) { destroyElements(mStart, mEnd); nsMemory::Free(mStartBuffer); } }
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(); }
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); }
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; }
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; }
AxisRenderable::~AxisRenderable() { delete mRenderOp.vertexData; destroyElements(); }