WARNING: BREAKING: REMOVED: GenImagePerlinNoise()

raylib was using `stb_perlin.h` library to generate perlin noise, it seems that recently this library has been flagged as it could be infringing some algorythm patent. For security, it has been removed from raylib.
This commit is contained in:
raysan5 2021-10-06 21:20:36 +02:00
parent 700d448d75
commit 3e71232a04
4 changed files with 4 additions and 478 deletions

View file

@ -5,13 +5,13 @@
* This example has been created using raylib 1.8 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2O17 Wilhem Barbier (@nounoursheureux)
* Copyright (c) 2O17-2021 Wilhem Barbier (@nounoursheureux) and Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
#define NUM_TEXTURES 7 // Currently we have 7 generation algorithms
#define NUM_TEXTURES 6 // Currently we have 7 generation algorithms
int main(void)
{
@ -27,7 +27,6 @@ int main(void)
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK);
Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE);
Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f);
Image perlinNoise = GenImagePerlinNoise(screenWidth, screenHeight, 50, 50, 4.0f);
Image cellular = GenImageCellular(screenWidth, screenHeight, 32);
Texture2D textures[NUM_TEXTURES] = { 0 };
@ -37,8 +36,7 @@ int main(void)
textures[2] = LoadTextureFromImage(radialGradient);
textures[3] = LoadTextureFromImage(checked);
textures[4] = LoadTextureFromImage(whiteNoise);
textures[5] = LoadTextureFromImage(perlinNoise);
textures[6] = LoadTextureFromImage(cellular);
textures[5] = LoadTextureFromImage(cellular);
// Unload image data (CPU RAM)
UnloadImage(verticalGradient);
@ -46,7 +44,6 @@ int main(void)
UnloadImage(radialGradient);
UnloadImage(checked);
UnloadImage(whiteNoise);
UnloadImage(perlinNoise);
UnloadImage(cellular);
int currentTexture = 0;
@ -84,8 +81,7 @@ int main(void)
case 2: DrawText("RADIAL GRADIENT", 580, 10, 20, LIGHTGRAY); break;
case 3: DrawText("CHECKED", 680, 10, 20, RAYWHITE); break;
case 4: DrawText("WHITE NOISE", 640, 10, 20, RED); break;
case 5: DrawText("PERLIN NOISE", 630, 10, 20, RAYWHITE); break;
case 6: DrawText("CELLULAR", 670, 10, 20, RAYWHITE); break;
case 5: DrawText("CELLULAR", 670, 10, 20, RAYWHITE); break;
default: break;
}