bool Place(Content<_T> content) { Sort(); for( Coord::List::iterator itor = topLefts.begin(); itor != topLefts.end(); itor++ ) { content.coord = *itor; if( Fits( content ) ) { Use( content ); topLefts.erase( itor ); return true; } } // EXPERIMENTAL - TRY ROTATED? content.Rotate(); for( Coord::List::iterator itor = topLefts.begin(); itor != topLefts.end(); itor++ ) { content.coord = *itor; if( Fits( content ) ) { Use( content ); topLefts.erase( itor ); return true; } } //////////////////////////////// return false; }
bool Place(Content<_T> content) { Sort(); for( Coord::List::iterator itor = topLefts.begin(); itor != topLefts.end(); itor++ ) { content.coord = *itor; if( Fits( content ) ) { Use( content ); topLefts.erase( itor ); return true; } } return false; // yvt: BitmapAtlasGenerator doesn't support rotated contents. // EXPERIMENTAL - TRY ROTATED? // content.Rotate(); // for(Coord::List::iterator itor = topLefts.begin(); itor != topLefts.end(); itor++) // { // content.coord = *itor; // if( Fits( content ) ) // { // Use( content ); // topLefts.erase( itor ); // return true; // } // } // //////////////////////////////// // return false; }