@@ -348,15 +348,51 @@ def on_draw(self) -> None:
348348
349349class NoiseSample (Sample ):
350350 NOISE_OPTIONS = [ # (name, algorithm, implementation)
351- ("perlin noise" , tcod .NOISE_PERLIN , tcod .noise .SIMPLE ),
352- ("simplex noise" , tcod .NOISE_SIMPLEX , tcod .noise .SIMPLE ),
353- ("wavelet noise" , tcod .NOISE_WAVELET , tcod .noise .SIMPLE ),
354- ("perlin fbm" , tcod .NOISE_PERLIN , tcod .noise .FBM ),
355- ("perlin turbulence" , tcod .NOISE_PERLIN , tcod .noise .TURBULENCE ),
356- ("simplex fbm" , tcod .NOISE_SIMPLEX , tcod .noise .FBM ),
357- ("simplex turbulence" , tcod .NOISE_SIMPLEX , tcod .noise .TURBULENCE ),
358- ("wavelet fbm" , tcod .NOISE_WAVELET , tcod .noise .FBM ),
359- ("wavelet turbulence" , tcod .NOISE_WAVELET , tcod .noise .TURBULENCE ),
351+ (
352+ "perlin noise" ,
353+ tcod .noise .Algorithm .PERLIN ,
354+ tcod .noise .Implementation .SIMPLE ,
355+ ),
356+ (
357+ "simplex noise" ,
358+ tcod .noise .Algorithm .SIMPLEX ,
359+ tcod .noise .Implementation .SIMPLE ,
360+ ),
361+ (
362+ "wavelet noise" ,
363+ tcod .noise .Algorithm .WAVELET ,
364+ tcod .noise .Implementation .SIMPLE ,
365+ ),
366+ (
367+ "perlin fbm" ,
368+ tcod .noise .Algorithm .PERLIN ,
369+ tcod .noise .Implementation .FBM ,
370+ ),
371+ (
372+ "perlin turbulence" ,
373+ tcod .noise .Algorithm .PERLIN ,
374+ tcod .noise .Implementation .TURBULENCE ,
375+ ),
376+ (
377+ "simplex fbm" ,
378+ tcod .noise .Algorithm .SIMPLEX ,
379+ tcod .noise .Implementation .FBM ,
380+ ),
381+ (
382+ "simplex turbulence" ,
383+ tcod .noise .Algorithm .SIMPLEX ,
384+ tcod .noise .Implementation .TURBULENCE ,
385+ ),
386+ (
387+ "wavelet fbm" ,
388+ tcod .noise .Algorithm .WAVELET ,
389+ tcod .noise .Implementation .FBM ,
390+ ),
391+ (
392+ "wavelet turbulence" ,
393+ tcod .noise .Algorithm .WAVELET ,
394+ tcod .noise .Implementation .TURBULENCE ,
395+ ),
360396 ]
361397
362398 def __init__ (self ) -> None :
@@ -407,7 +443,7 @@ def on_draw(self) -> None:
407443 self .img .put_pixel (x , y , (c // 2 , c // 2 , c ))
408444 rectw = 24
409445 recth = 13
410- if self .implementation == tcod .noise .SIMPLE :
446+ if self .implementation == tcod .noise .Implementation . SIMPLE :
411447 recth = 10
412448 sample_console .draw_semigraphics (self .img )
413449 sample_console .draw_rect (
@@ -435,7 +471,7 @@ def on_draw(self) -> None:
435471 sample_console .print (
436472 2 , 11 , "Y/H : zoom (%2.1f)" % self .zoom , fg = WHITE , bg = None
437473 )
438- if self .implementation != tcod .noise .SIMPLE :
474+ if self .implementation != tcod .noise .Implementation . SIMPLE :
439475 sample_console .print (
440476 2 ,
441477 12 ,
0 commit comments