1 /***************************************
  2  * Copyright 2011, 2012 GlobWeb contributors.
  3  *
  4  * This file is part of GlobWeb.
  5  *
  6  * GlobWeb is free software: you can redistribute it and/or modify
  7  * it under the terms of the GNU Lesser General Public License as published by
  8  * the Free Software Foundation, version 3 of the License, or
  9  * (at your option) any later version.
 10  *
 11  * GlobWeb is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 14  * GNU Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU General Public License
 17  * along with GlobWeb. If not, see <http://www.gnu.org/licenses/>.
 18  ***************************************/
 19 
 20 define( function() {
 21 
 22 /**************************************************************************************************************/
 23 
 24 /** @constructor
 25 	RendererTileData constructor
 26 	Contains a list of renderables for the tiles
 27  */
 28 var RendererTileData = function()
 29 {
 30 	this.renderables = [];
 31 	this.frameNumber = -1;
 32 }
 33 
 34 /**************************************************************************************************************/
 35 
 36 /**
 37 	Get a renderable from the tile, given the bucket
 38  */
 39 RendererTileData.prototype.getRenderable = function(bucket)
 40 {
 41 	for ( var i=0; i < this.renderables.length; i++ )
 42 	{
 43 		if ( bucket == this.renderables[i].bucket )
 44 		{
 45 			return this.renderables[i];
 46 		}
 47 	}
 48 	return null;
 49 }
 50 
 51 /**************************************************************************************************************/
 52 
 53 /**
 54 	Dispose renderable data from tile
 55  */
 56 RendererTileData.prototype.dispose = function(renderContext,tilePool)
 57 {
 58 	for ( var i=0; i < this.renderables.length; i++ )
 59 	{
 60 		this.renderables[i].dispose(renderContext,tilePool);
 61 	}
 62 	this.renderables.length = 0;
 63 }
 64 
 65 /**************************************************************************************************************/
 66 
 67 return RendererTileData;
 68 
 69 });