void CamadaDeObjetosTileMap::adicionarObjeto(ObjetoTileMap* obj) { obj->setCamada(this); obj->_indiceNaCamada = objetos.size(); objetos.push_back(obj); if (obj->getSprite()) getTileMap()->adicionarObjetoNaRenderQueue(obj); }
/** * Draws some digits using galaxy style */ void GsGraphics::drawDigits(const std::string& text, Uint16 x, Uint16 y, SDL_Surface *blitsurface) { GsTilemap &Tilemap = getTileMap(2); for(Uint16 i=0 ; i<text.size() ; i++) { const char c = text[i]; Tilemap.drawTile(blitsurface, x+i*8, y, (c != ' ') ? 43+c-'1' : 41); } }
void ObjetoTileMap::setSprite(Sprite *spr) { // Se já tem um Sprite, já está na render queue; // Então não adiciona novamente. if (this->spr) { this->spr = spr; // Se se o novo Sprite não for válido, remove da render queue. if (!spr && getTileMap()) getTileMap()->removerObjetoDaRenderQueue(this); return; } // Se não estava na render queue, // adiciona se sprite for válido this->spr = spr; if (spr && getTileMap()) getTileMap()->adicionarObjetoNaRenderQueue(this); }
/** * Draw one digits using galaxy style */ void GsGraphics::drawDigit(const char c, const Uint16 x, const Uint16 y, SDL_Surface *blitsurface) { GsTilemap &Tilemap = getTileMap(2); Tilemap.drawTile(blitsurface, x, y, c); }
/** * Draw one digits using galaxy style */ void CGfxEngine::drawDigit(const char c, const Uint16 x, const Uint16 y, SDL_Surface *blitsurface) { CTilemap &Tilemap = getTileMap(2); Tilemap.drawTile(blitsurface, x, y, c); }