Skip to content

Commit

Permalink
Merge pull request #54 from greenfork/raylib-5.0
Browse files Browse the repository at this point in the history
Upgrade to Raylib 5.0
  • Loading branch information
bakpakin authored Nov 18, 2023
2 parents 3be68f8 + 19ce79b commit 51e88ff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@

// Image generation functions
[x] Image GenImageColor(int width, int height, Color color)
[x] Image GenImageGradientV(int width, int height, Color top, Color bottom)
[x] Image GenImageGradientH(int width, int height, Color left, Color right)
[x] Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end)
[x] Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer)
[x] Image GenImageGradientSquare(int width, int height, float density, Color inner, Color outer)
[x] Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2)
[x] Image GenImageWhiteNoise(int width, int height, float factor)
[x] Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale)
Expand Down
2 changes: 1 addition & 1 deletion raylib
Submodule raylib updated 216 files
40 changes: 21 additions & 19 deletions src/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,37 +509,39 @@ static Janet cfun_GenImageColor(int32_t argc, Janet *argv) {
return janet_wrap_abstract(image);
}

static Janet cfun_GenImageGradientV(int32_t argc, Janet *argv) {
janet_fixarity(argc, 4);
static Janet cfun_GenImageGradientLinear(int32_t argc, Janet *argv) {
janet_fixarity(argc, 5);
int width = janet_getinteger(argv, 0);
int height = janet_getinteger(argv, 1);
Color c1 = jaylib_getcolor(argv, 2);
Color c2 = jaylib_getcolor(argv, 3);
int direction = janet_getinteger(argv, 2);
Color start = jaylib_getcolor(argv, 3);
Color end = jaylib_getcolor(argv, 4);
Image *image = janet_abstract(&AT_Image, sizeof(Image));
*image = GenImageGradientV(width, height, c1, c2);
*image = GenImageGradientLinear(width, height, direction, start, end);
return janet_wrap_abstract(image);
}

static Janet cfun_GenImageGradientH(int32_t argc, Janet *argv) {
janet_fixarity(argc, 4);
static Janet cfun_GenImageGradientRadial(int32_t argc, Janet *argv) {
janet_fixarity(argc, 5);
int width = janet_getinteger(argv, 0);
int height = janet_getinteger(argv, 1);
Color c1 = jaylib_getcolor(argv, 2);
Color c2 = jaylib_getcolor(argv, 3);
float density = (float) janet_getnumber(argv, 2);
Color inner = jaylib_getcolor(argv, 3);
Color outer = jaylib_getcolor(argv, 4);
Image *image = janet_abstract(&AT_Image, sizeof(Image));
*image = GenImageGradientH(width, height, c1, c2);
*image = GenImageGradientRadial(width, height, density, inner, outer);
return janet_wrap_abstract(image);
}

static Janet cfun_GenImageGradientRadial(int32_t argc, Janet *argv) {
static Janet cfun_GenImageGradientSquare(int32_t argc, Janet *argv) {
janet_fixarity(argc, 5);
int width = janet_getinteger(argv, 0);
int height = janet_getinteger(argv, 1);
float density = (float) janet_getnumber(argv, 2);
Color inner = jaylib_getcolor(argv, 3);
Color outer = jaylib_getcolor(argv, 4);
Image *image = janet_abstract(&AT_Image, sizeof(Image));
*image = GenImageGradientRadial(width, height, density, inner, outer);
*image = GenImageGradientSquare(width, height, density, inner, outer);
return janet_wrap_abstract(image);
}

Expand Down Expand Up @@ -876,18 +878,18 @@ static const JanetReg image_cfuns[] = {
"(gen-image-color width height color)\n\n"
"Generate image: plain color"
},
{"gen-image-gradient-v", cfun_GenImageGradientV,
"(gen-image-gradient-v width height top bottom)\n\n"
"Generate image: vertical gradient"
},
{"gen-image-gradient-h", cfun_GenImageGradientH,
"(gen-image-gradient-h width height left right)\n\n"
"Generate image: horizontal gradient"
{"gen-image-gradient-linear", cfun_GenImageGradientLinear,
"(gen-image-gradient-linear width height direction start end)\n\n"
"Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient"
},
{"gen-image-gradient-radial", cfun_GenImageGradientRadial,
"(gen-image-gradient-radial width height density inner outer)\n\n"
"Generate image: radial gradient"
},
{"gen-image-gradient-square", cfun_GenImageGradientSquare,
"(gen-image-gradient-square width height density inner outer)\n\n"
"Generate image: square gradient"
},
{"gen-image-checked", cfun_GenImageChecked,
"(gen-image-checked width height checks-x checks-y color1 color2)\n\n"
"Generate image: checked"
Expand Down

0 comments on commit 51e88ff

Please sign in to comment.