Mercurial > hg > dmlib
view src/dmperlin.h @ 2571:bb44c48cffac
Add helper function for getting C64 chargen ROM path from environment
variable 'CHARGEN_ROM' and use it instead of the compile-time hardcoded
value.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 02 Mar 2022 23:23:05 +0200 |
parents | 85fab9d640ec |
children | 04c035342960 |
line wrap: on
line source
/* * DMLib * -- Perlin noise functionality * Programmed and designed by Matti 'ccr' Hamalainen * (C) Copyright 2012 Tecnic Software productions (TNSP) */ #ifndef DMPERLIN_H #define DMPERLIN_H #include "dmlib.h" #ifdef __cplusplus extern "C" { #endif #define DM_PLNS_B (0x100) #define DM_PLNS_BM (0x0ff) #define DM_PLNS_N (0x1000) typedef struct { int p[DM_PLNS_B + DM_PLNS_B + 2]; DMFloat g2[DM_PLNS_B + DM_PLNS_B + 2][2]; DMFloat g1[DM_PLNS_B + DM_PLNS_B + 2]; } DMPerlinContext; int dmPerlinInit(DMPerlinContext *ctx, const int seed); DMFloat dmPerlinNoise2D(const DMPerlinContext *ctx, DMFloat x, DMFloat y, DMFloat alpha, DMFloat beta, int n); #ifdef __cplusplus } #endif #endif // DMPERLIN_H