@@ -348,15 +348,51 @@ def on_draw(self) -> None:
348
348
349
349
class NoiseSample (Sample ):
350
350
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
+ ),
360
396
]
361
397
362
398
def __init__ (self ) -> None :
@@ -407,7 +443,7 @@ def on_draw(self) -> None:
407
443
self .img .put_pixel (x , y , (c // 2 , c // 2 , c ))
408
444
rectw = 24
409
445
recth = 13
410
- if self .implementation == tcod .noise .SIMPLE :
446
+ if self .implementation == tcod .noise .Implementation . SIMPLE :
411
447
recth = 10
412
448
sample_console .draw_semigraphics (self .img )
413
449
sample_console .draw_rect (
@@ -435,7 +471,7 @@ def on_draw(self) -> None:
435
471
sample_console .print (
436
472
2 , 11 , "Y/H : zoom (%2.1f)" % self .zoom , fg = WHITE , bg = None
437
473
)
438
- if self .implementation != tcod .noise .SIMPLE :
474
+ if self .implementation != tcod .noise .Implementation . SIMPLE :
439
475
sample_console .print (
440
476
2 ,
441
477
12 ,
0 commit comments