コード例 #1
0
 void partitionedGenerateLevels( uint32_t seed, const uint32_t partitionStartIndex,
                                 const uint32_t partitionEndIndex ) {
     OcclusionBuffer occ(TILE_DIM, TILE_DIM);
     for( uint32_t i = partitionStartIndex ; i < partitionEndIndex ; ++i ) {
         occ.Clear();
         uint32_t roomsAdded = 0;
         for( uint32_t ii = 0 ; ii < 50000 ; ii++ ) {
             roomsAdded += static_cast<size_t>(makeRoomSilentlyFail( levels_[i], seed, occ ));
             if (roomsAdded == 99) break;
         }
         levels_[i].fillTiles();
     }
 }
コード例 #2
0
ファイル: CPP.cpp プロジェクト: axaxs/levgen-benchmarks
 void generateLevels()
 {
     levels_ = std::vector<Level>( 100 );
     for( std::size_t i = 0 ; i < 100 ; i++ )
     {
         Level level;
         for( std::size_t ii = 0 ; ii < 50000 ; ii++ )
         {
             makeRoomSilentlyFail( level );
             if( level.rooms.size() == 99 )
             {
                 break;
             }
         }
         level.fillTiles();
         levels_.push_back( level );
     }
 }