include/GizegoEngine.h
//Adds a tile to the atlas.
Adds a tile to the atlas.
Adds a tile to the atlas .
void AddTile(Tile* tile)
		{	
			m_list.push_back(tile);
			for (int i = 0; i < tile->GetFrameCount(); i++)
			{
				for (unsigned int y = 0; y < m_height; y++)
				{
					for (unsigned int x = 0; x < m_width; x++)
					{						
						if (m_ocp[x][y] == false)
						{
							tile->SubmitLocation(x, y, i);
							Image* img = tile->GetImage(i);
							for (int a = 0; a < m_ts; a++)
								for (int b = 0; b < m_ts; b++)
									m_atlas->SetPixel(vec2(a + x * 32, b + y * 32), img->GetPixel(vec2(a, b)));
							m_ocp[x][y] = true;
							goto LABEL;
						}
					}
				}
				ThrowException(L"Unable to add tile to the tile atlas because it was full");
				return;
			LABEL:;
			}			
		}
void AddTile ( Tile * tile ) { m_list . push_back ( tile ) ; for ( int i = 0 ; i < tile -> GetFrameCount ( ) ; i ++ ) { for ( unsigned int y = 0 ; y < m_height ; y ++ ) { for ( unsigned int x = 0 ; x < m_width ; x ++ ) { if ( m_ocp [ x ] [ y ] == false ) { tile -> SubmitLocation ( x , y , i ) ; Image * img = tile -> GetImage ( i ) ; for ( int a = 0 ; a < m_ts ; a ++ ) for ( int b = 0 ; b < m_ts ; b ++ ) m_atlas -> SetPixel ( vec2 ( a + x * 32 , b + y * 32 ) , img -> GetPixel ( vec2 ( a , b ) ) ) ; m_ocp [ x ] [ y ] = true ; goto LABEL ; } } } ThrowException ( L" " ) ; return ; LABEL : ; } }
Adds a tile to the atlas.
Adds a tile to the atlas .