#NEWLINE# def find_and_reserve_region( self , tile_width , tile_height ) : #NEWLINE# #INDENT# for x in range ( ( ( self . _num_tiles - tile_height ) + 1 ) ) : #NEWLINE# #INDENT# for y in range ( ( ( self . _num_tiles - tile_width ) + 1 ) ) : #NEWLINE# #INDENT# if self . region_is_free ( x , y , tile_width , tile_height ) : #NEWLINE# #INDENT# self . reserve_region ( x , y , tile_width , tile_height ) #NEWLINE# return LVecBase4i ( x , y , tile_width , tile_height ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# print ( 'Failed to find a free region of size' , tile_width , 'x' , tile_height ) #NEWLINE# return LVecBase4i ( ( - 1 ) )