Skip to content

Commit 1a4ad86

Browse files
author
Chris Warren-Smith
committed
RAYLIB: update to latest raylib version
1 parent 59de0df commit 1a4ad86

6 files changed

Lines changed: 360 additions & 159 deletions

File tree

raylib/README.md

Lines changed: 70 additions & 60 deletions
Large diffs are not rendered by default.

raylib/func-def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
{1, 1, "ISMOUSEBUTTONUP", cmd_ismousebuttonup},
205205
{1, 1, "ISMUSICSTREAMPLAYING", cmd_ismusicstreamplaying},
206206
{1, 1, "ISMUSICVALID", cmd_ismusicvalid},
207+
{1, 1, "ISPATHDIRECTORY", cmd_ispathdirectory},
207208
{1, 1, "ISPATHFILE", cmd_ispathfile},
208209
{1, 1, "ISRENDERTEXTUREVALID", cmd_isrendertexturevalid},
209210
{1, 1, "ISSHADERVALID", cmd_isshadervalid},

raylib/func.h

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Change working directory, return true on success
2+
// Change working directory, returns 0 on success
33
//
44
static int cmd_changedirectory(int argc, slib_par_t *params, var_t *retval) {
55
auto dirPath = get_param_str(argc, params, 0, 0);
@@ -394,7 +394,7 @@ static int cmd_decompressdata(int argc, slib_par_t *params, var_t *retval) {
394394
}
395395

396396
//
397-
// Check if a directory path exists
397+
// Check if directory path exists
398398
//
399399
static int cmd_directoryexists(int argc, slib_par_t *params, var_t *retval) {
400400
auto dirPath = get_param_str(argc, params, 0, 0);
@@ -595,7 +595,7 @@ static int cmd_fade(int argc, slib_par_t *params, var_t *retval) {
595595
}
596596

597597
//
598-
// Copy file from one path to another, dstPath created if it doesn't exist
598+
// Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success
599599
//
600600
static int cmd_filecopy(int argc, slib_par_t *params, var_t *retval) {
601601
auto srcPath = get_param_str(argc, params, 0, 0);
@@ -616,7 +616,7 @@ static int cmd_fileexists(int argc, slib_par_t *params, var_t *retval) {
616616
}
617617

618618
//
619-
// Move file from one directory to another, dstPath created if it doesn't exist
619+
// Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success
620620
//
621621
static int cmd_filemove(int argc, slib_par_t *params, var_t *retval) {
622622
auto srcPath = get_param_str(argc, params, 0, 0);
@@ -627,7 +627,7 @@ static int cmd_filemove(int argc, slib_par_t *params, var_t *retval) {
627627
}
628628

629629
//
630-
// Remove file (if exists)
630+
// Remove file (if exists), returns 0 on success
631631
//
632632
static int cmd_fileremove(int argc, slib_par_t *params, var_t *retval) {
633633
auto fileName = get_param_str(argc, params, 0, 0);
@@ -637,7 +637,7 @@ static int cmd_fileremove(int argc, slib_par_t *params, var_t *retval) {
637637
}
638638

639639
//
640-
// Rename file (if exists)
640+
// Rename file (if exists), returns 0 on success
641641
//
642642
static int cmd_filerename(int argc, slib_par_t *params, var_t *retval) {
643643
auto fileName = get_param_str(argc, params, 0, 0);
@@ -648,7 +648,7 @@ static int cmd_filerename(int argc, slib_par_t *params, var_t *retval) {
648648
}
649649

650650
//
651-
// Find text in existing file
651+
// Find text in existing file, returns -1 if index not found or index otherwise
652652
//
653653
static int cmd_filetextfindindex(int argc, slib_par_t *params, var_t *retval) {
654654
auto fileName = get_param_str(argc, params, 0, 0);
@@ -659,7 +659,7 @@ static int cmd_filetextfindindex(int argc, slib_par_t *params, var_t *retval) {
659659
}
660660

661661
//
662-
// Replace text in an existing file
662+
// Replace text in an existing file, returns 0 on success
663663
//
664664
static int cmd_filetextreplace(int argc, slib_par_t *params, var_t *retval) {
665665
auto fileName = get_param_str(argc, params, 0, 0);
@@ -1547,7 +1547,7 @@ static int cmd_getmusictimeplayed(int argc, slib_par_t *params, var_t *retval) {
15471547
// Get Color from a source pixel pointer of certain format
15481548
//
15491549
static int cmd_getpixelcolor(int argc, slib_par_t *params, var_t *retval) {
1550-
auto srcPtr = (void *)get_param_int_t(argc, params, 0, 0);
1550+
auto srcPtr = (const void *)get_param_int_t(argc, params, 0, 0);
15511551
auto format = get_param_int(argc, params, 1, 0);
15521552
auto fnResult = GetPixelColor(srcPtr, format);
15531553
v_setcolor(retval, fnResult);
@@ -2130,7 +2130,7 @@ static int cmd_iscursoronscreen(int argc, slib_par_t *params, var_t *retval) {
21302130
}
21312131

21322132
//
2133-
// Check if a file has been dropped into window
2133+
// Check if file has been dropped into window
21342134
//
21352135
static int cmd_isfiledropped(int argc, slib_par_t *params, var_t *retval) {
21362136
auto fnResult = IsFileDropped();
@@ -2160,7 +2160,7 @@ static int cmd_isfilenamevalid(int argc, slib_par_t *params, var_t *retval) {
21602160
}
21612161

21622162
//
2163-
// Check if a font is valid (font data loaded, WARNING: GPU texture not checked)
2163+
// Check if font is valid (font data loaded, WARNING: GPU texture not checked)
21642164
//
21652165
static int cmd_isfontvalid(int argc, slib_par_t *params, var_t *retval) {
21662166
int result;
@@ -2176,7 +2176,7 @@ static int cmd_isfontvalid(int argc, slib_par_t *params, var_t *retval) {
21762176
}
21772177

21782178
//
2179-
// Check if a gamepad is available
2179+
// Check if gamepad is available
21802180
//
21812181
static int cmd_isgamepadavailable(int argc, slib_par_t *params, var_t *retval) {
21822182
auto gamepad = get_param_int(argc, params, 0, 0);
@@ -2186,7 +2186,7 @@ static int cmd_isgamepadavailable(int argc, slib_par_t *params, var_t *retval) {
21862186
}
21872187

21882188
//
2189-
// Check if a gamepad button is being pressed
2189+
// Check if gamepad button is being pressed
21902190
//
21912191
static int cmd_isgamepadbuttondown(int argc, slib_par_t *params, var_t *retval) {
21922192
auto gamepad = get_param_int(argc, params, 0, 0);
@@ -2197,7 +2197,7 @@ static int cmd_isgamepadbuttondown(int argc, slib_par_t *params, var_t *retval)
21972197
}
21982198

21992199
//
2200-
// Check if a gamepad button has been pressed once
2200+
// Check if gamepad button has been pressed once
22012201
//
22022202
static int cmd_isgamepadbuttonpressed(int argc, slib_par_t *params, var_t *retval) {
22032203
auto gamepad = get_param_int(argc, params, 0, 0);
@@ -2208,7 +2208,7 @@ static int cmd_isgamepadbuttonpressed(int argc, slib_par_t *params, var_t *retva
22082208
}
22092209

22102210
//
2211-
// Check if a gamepad button has been released once
2211+
// Check if gamepad button has been released once
22122212
//
22132213
static int cmd_isgamepadbuttonreleased(int argc, slib_par_t *params, var_t *retval) {
22142214
auto gamepad = get_param_int(argc, params, 0, 0);
@@ -2219,7 +2219,7 @@ static int cmd_isgamepadbuttonreleased(int argc, slib_par_t *params, var_t *retv
22192219
}
22202220

22212221
//
2222-
// Check if a gamepad button is NOT being pressed
2222+
// Check if gamepad button is NOT being pressed
22232223
//
22242224
static int cmd_isgamepadbuttonup(int argc, slib_par_t *params, var_t *retval) {
22252225
auto gamepad = get_param_int(argc, params, 0, 0);
@@ -2230,7 +2230,7 @@ static int cmd_isgamepadbuttonup(int argc, slib_par_t *params, var_t *retval) {
22302230
}
22312231

22322232
//
2233-
// Check if a gesture has been detected
2233+
// Check if gesture has been detected
22342234
//
22352235
static int cmd_isgesturedetected(int argc, slib_par_t *params, var_t *retval) {
22362236
auto gesture = get_param_int(argc, params, 0, 0);
@@ -2256,7 +2256,7 @@ static int cmd_isimagevalid(int argc, slib_par_t *params, var_t *retval) {
22562256
}
22572257

22582258
//
2259-
// Check if a key is being pressed
2259+
// Check if key is being pressed
22602260
//
22612261
static int cmd_iskeydown(int argc, slib_par_t *params, var_t *retval) {
22622262
auto key = get_param_int(argc, params, 0, 0);
@@ -2266,7 +2266,7 @@ static int cmd_iskeydown(int argc, slib_par_t *params, var_t *retval) {
22662266
}
22672267

22682268
//
2269-
// Check if a key has been pressed once
2269+
// Check if key has been pressed once
22702270
//
22712271
static int cmd_iskeypressed(int argc, slib_par_t *params, var_t *retval) {
22722272
auto key = get_param_int(argc, params, 0, 0);
@@ -2276,7 +2276,7 @@ static int cmd_iskeypressed(int argc, slib_par_t *params, var_t *retval) {
22762276
}
22772277

22782278
//
2279-
// Check if a key has been pressed again
2279+
// Check if key has been pressed again
22802280
//
22812281
static int cmd_iskeypressedrepeat(int argc, slib_par_t *params, var_t *retval) {
22822282
auto key = get_param_int(argc, params, 0, 0);
@@ -2286,7 +2286,7 @@ static int cmd_iskeypressedrepeat(int argc, slib_par_t *params, var_t *retval) {
22862286
}
22872287

22882288
//
2289-
// Check if a key has been released once
2289+
// Check if key has been released once
22902290
//
22912291
static int cmd_iskeyreleased(int argc, slib_par_t *params, var_t *retval) {
22922292
auto key = get_param_int(argc, params, 0, 0);
@@ -2296,7 +2296,7 @@ static int cmd_iskeyreleased(int argc, slib_par_t *params, var_t *retval) {
22962296
}
22972297

22982298
//
2299-
// Check if a key is NOT being pressed
2299+
// Check if key is NOT being pressed
23002300
//
23012301
static int cmd_iskeyup(int argc, slib_par_t *params, var_t *retval) {
23022302
auto key = get_param_int(argc, params, 0, 0);
@@ -2323,7 +2323,7 @@ static int cmd_ismodelanimationvalid(int argc, slib_par_t *params, var_t *retval
23232323
}
23242324

23252325
//
2326-
// Check if a model is valid (loaded in GPU, VAO/VBOs)
2326+
// Check if model is valid (loaded in GPU, VAO/VBOs)
23272327
//
23282328
static int cmd_ismodelvalid(int argc, slib_par_t *params, var_t *retval) {
23292329
int result;
@@ -2339,7 +2339,7 @@ static int cmd_ismodelvalid(int argc, slib_par_t *params, var_t *retval) {
23392339
}
23402340

23412341
//
2342-
// Check if a mouse button is being pressed
2342+
// Check if mouse button is being pressed
23432343
//
23442344
static int cmd_ismousebuttondown(int argc, slib_par_t *params, var_t *retval) {
23452345
auto button = get_param_int(argc, params, 0, 0);
@@ -2349,7 +2349,7 @@ static int cmd_ismousebuttondown(int argc, slib_par_t *params, var_t *retval) {
23492349
}
23502350

23512351
//
2352-
// Check if a mouse button has been pressed once
2352+
// Check if mouse button has been pressed once
23532353
//
23542354
static int cmd_ismousebuttonpressed(int argc, slib_par_t *params, var_t *retval) {
23552355
auto button = get_param_int(argc, params, 0, 0);
@@ -2359,7 +2359,7 @@ static int cmd_ismousebuttonpressed(int argc, slib_par_t *params, var_t *retval)
23592359
}
23602360

23612361
//
2362-
// Check if a mouse button has been released once
2362+
// Check if mouse button has been released once
23632363
//
23642364
static int cmd_ismousebuttonreleased(int argc, slib_par_t *params, var_t *retval) {
23652365
auto button = get_param_int(argc, params, 0, 0);
@@ -2369,7 +2369,7 @@ static int cmd_ismousebuttonreleased(int argc, slib_par_t *params, var_t *retval
23692369
}
23702370

23712371
//
2372-
// Check if a mouse button is NOT being pressed
2372+
// Check if mouse button is NOT being pressed
23732373
//
23742374
static int cmd_ismousebuttonup(int argc, slib_par_t *params, var_t *retval) {
23752375
auto button = get_param_int(argc, params, 0, 0);
@@ -2395,7 +2395,7 @@ static int cmd_ismusicstreamplaying(int argc, slib_par_t *params, var_t *retval)
23952395
}
23962396

23972397
//
2398-
// Check if a music stream is valid (context and buffers initialized)
2398+
// Check if music stream is valid (context and buffers initialized)
23992399
//
24002400
static int cmd_ismusicvalid(int argc, slib_par_t *params, var_t *retval) {
24012401
int result;
@@ -2411,7 +2411,17 @@ static int cmd_ismusicvalid(int argc, slib_par_t *params, var_t *retval) {
24112411
}
24122412

24132413
//
2414-
// Check if a given path is a file or a directory
2414+
// Check if given path points to a directory
2415+
//
2416+
static int cmd_ispathdirectory(int argc, slib_par_t *params, var_t *retval) {
2417+
auto path = get_param_str(argc, params, 0, 0);
2418+
auto fnResult = IsPathDirectory(path);
2419+
v_setint(retval, fnResult);
2420+
return 1;
2421+
}
2422+
2423+
//
2424+
// Check if given path points to a file
24152425
//
24162426
static int cmd_ispathfile(int argc, slib_par_t *params, var_t *retval) {
24172427
auto path = get_param_str(argc, params, 0, 0);
@@ -2421,7 +2431,7 @@ static int cmd_ispathfile(int argc, slib_par_t *params, var_t *retval) {
24212431
}
24222432

24232433
//
2424-
// Check if a render texture is valid (loaded in GPU)
2434+
// Check if render texture is valid (loaded in GPU)
24252435
//
24262436
static int cmd_isrendertexturevalid(int argc, slib_par_t *params, var_t *retval) {
24272437
int result;
@@ -2437,7 +2447,7 @@ static int cmd_isrendertexturevalid(int argc, slib_par_t *params, var_t *retval)
24372447
}
24382448

24392449
//
2440-
// Check if a shader is valid (loaded on GPU)
2450+
// Check if shader is valid (loaded on GPU)
24412451
//
24422452
static int cmd_isshadervalid(int argc, slib_par_t *params, var_t *retval) {
24432453
auto shader = get_param_shader(argc, params, 0);
@@ -2447,7 +2457,7 @@ static int cmd_isshadervalid(int argc, slib_par_t *params, var_t *retval) {
24472457
}
24482458

24492459
//
2450-
// Check if a sound is currently playing
2460+
// Check if sound is currently playing
24512461
//
24522462
static int cmd_issoundplaying(int argc, slib_par_t *params, var_t *retval) {
24532463
int result;
@@ -2463,7 +2473,7 @@ static int cmd_issoundplaying(int argc, slib_par_t *params, var_t *retval) {
24632473
}
24642474

24652475
//
2466-
// Check if a sound is valid (data loaded and buffers initialized)
2476+
// Check if sound is valid (data loaded and buffers initialized)
24672477
//
24682478
static int cmd_issoundvalid(int argc, slib_par_t *params, var_t *retval) {
24692479
int result;
@@ -2479,7 +2489,7 @@ static int cmd_issoundvalid(int argc, slib_par_t *params, var_t *retval) {
24792489
}
24802490

24812491
//
2482-
// Check if a texture is valid (loaded in GPU)
2492+
// Check if texture is valid (loaded in GPU)
24832493
//
24842494
static int cmd_istexturevalid(int argc, slib_par_t *params, var_t *retval) {
24852495
int result;
@@ -2627,7 +2637,7 @@ static int cmd_loaddirectoryfiles(int argc, slib_par_t *params, var_t *retval) {
26272637
}
26282638

26292639
//
2630-
// Load directory filepaths with extension filtering and subdir scan; some filters available: `*.*`,`FILES*`,`DIRS*`
2640+
// Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'
26312641
//
26322642
static int cmd_loaddirectoryfilesex(int argc, slib_par_t *params, var_t *retval) {
26332643
auto basePath = get_param_str(argc, params, 0, 0);
@@ -2681,7 +2691,7 @@ static int cmd_loadfont(int argc, slib_par_t *params, var_t *retval) {
26812691
}
26822692

26832693
//
2684-
// Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height
2694+
// Load font from file with defined codepoints and generation size, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height
26852695
//
26862696
static int cmd_loadfontex(int argc, slib_par_t *params, var_t *retval) {
26872697
auto fileName = get_param_str(argc, params, 0, 0);

raylib/proc-def.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
{5, 5, "DRAWCIRCLE3D", cmd_drawcircle3d},
2222
{4, 4, "DRAWCIRCLEGRADIENT", cmd_drawcirclegradient},
2323
{4, 4, "DRAWCIRCLELINES", cmd_drawcirclelines},
24+
{4, 4, "DRAWCIRCLELINESEX", cmd_drawcirclelinesex},
2425
{3, 3, "DRAWCIRCLELINESV", cmd_drawcirclelinesv},
2526
{6, 6, "DRAWCIRCLESECTOR", cmd_drawcirclesector},
2627
{6, 6, "DRAWCIRCLESECTORLINES", cmd_drawcirclesectorlines},
@@ -130,23 +131,31 @@
130131
{2, 2, "IMAGECOLORTINT", cmd_imagecolortint},
131132
{2, 2, "IMAGECROP", cmd_imagecrop},
132133
{5, 5, "IMAGEDITHER", cmd_imagedither},
133-
{5, 5, "IMAGEDRAW", cmd_imagedraw},
134134
{5, 5, "IMAGEDRAWCIRCLE", cmd_imagedrawcircle},
135+
{5, 5, "IMAGEDRAWCIRCLEGRADIENT", cmd_imagedrawcirclegradient},
135136
{5, 5, "IMAGEDRAWCIRCLELINES", cmd_imagedrawcirclelines},
136137
{4, 4, "IMAGEDRAWCIRCLELINESV", cmd_imagedrawcirclelinesv},
137138
{4, 4, "IMAGEDRAWCIRCLEV", cmd_imagedrawcirclev},
139+
{5, 5, "IMAGEDRAWIMAGE", cmd_imagedrawimage},
140+
{6, 6, "IMAGEDRAWIMAGEEX", cmd_imagedrawimageex},
141+
{7, 7, "IMAGEDRAWIMAGEPRO", cmd_imagedrawimagepro},
142+
{5, 5, "IMAGEDRAWIMAGEREC", cmd_imagedrawimagerec},
138143
{6, 6, "IMAGEDRAWLINE", cmd_imagedrawline},
139144
{5, 5, "IMAGEDRAWLINEEX", cmd_imagedrawlineex},
145+
{4, 4, "IMAGEDRAWLINESTRIP", cmd_imagedrawlinestrip},
140146
{4, 4, "IMAGEDRAWLINEV", cmd_imagedrawlinev},
141147
{4, 4, "IMAGEDRAWPIXEL", cmd_imagedrawpixel},
142148
{3, 3, "IMAGEDRAWPIXELV", cmd_imagedrawpixelv},
143149
{6, 6, "IMAGEDRAWRECTANGLE", cmd_imagedrawrectangle},
150+
{6, 6, "IMAGEDRAWRECTANGLEGRADIENTEX", cmd_imagedrawrectanglegradientex},
144151
{6, 6, "IMAGEDRAWRECTANGLELINES", cmd_imagedrawrectanglelines},
145152
{4, 4, "IMAGEDRAWRECTANGLELINESEX", cmd_imagedrawrectanglelinesex},
153+
{5, 5, "IMAGEDRAWRECTANGLEPRO", cmd_imagedrawrectanglepro},
146154
{3, 3, "IMAGEDRAWRECTANGLEREC", cmd_imagedrawrectanglerec},
147155
{4, 4, "IMAGEDRAWRECTANGLEV", cmd_imagedrawrectanglev},
148156
{6, 6, "IMAGEDRAWTEXT", cmd_imagedrawtext},
149157
{7, 7, "IMAGEDRAWTEXTEX", cmd_imagedrawtextex},
158+
{9, 9, "IMAGEDRAWTEXTPRO", cmd_imagedrawtextpro},
150159
{5, 5, "IMAGEDRAWTRIANGLE", cmd_imagedrawtriangle},
151160
{4, 4, "IMAGEDRAWTRIANGLEFAN", cmd_imagedrawtrianglefan},
152161
{7, 7, "IMAGEDRAWTRIANGLEGRADIENT", cmd_imagedrawtrianglegradient},

0 commit comments

Comments
 (0)