diff --git a/api/raylib.json b/api/raylib.json index c9b74f1..2b33951 100644 --- a/api/raylib.json +++ b/api/raylib.json @@ -2229,7 +2229,7 @@ { "name": "GAMEPAD_BUTTON_RIGHT_FACE_RIGHT", "value": 6, - "description": "Gamepad right button right (i.e. PS3: Square, Xbox: X)" + "description": "Gamepad right button right (i.e. PS3: Circle, Xbox: B)" }, { "name": "GAMEPAD_BUTTON_RIGHT_FACE_DOWN", @@ -2239,7 +2239,7 @@ { "name": "GAMEPAD_BUTTON_RIGHT_FACE_LEFT", "value": 8, - "description": "Gamepad right button left (i.e. PS3: Circle, Xbox: B)" + "description": "Gamepad right button left (i.e. PS3: Square, Xbox: X)" }, { "name": "GAMEPAD_BUTTON_LEFT_TRIGGER_1", @@ -3906,11 +3906,11 @@ "name": "camera" }, { - "type": "float", + "type": "int", "name": "width" }, { - "type": "float", + "type": "int", "name": "height" } ] @@ -7302,7 +7302,7 @@ "name": "image" }, { - "type": "float *", + "type": "float*", "name": "kernel" }, { @@ -11669,7 +11669,7 @@ }, { "name": "AttachAudioStreamProcessor", - "description": "Attach audio stream processor to stream, receives the samples as s", + "description": "Attach audio stream processor to stream, receives the samples as 'float'", "returnType": "void", "params": [ { @@ -11699,7 +11699,7 @@ }, { "name": "AttachAudioMixedProcessor", - "description": "Attach audio stream processor to the entire audio pipeline, receives the samples as s", + "description": "Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'", "returnType": "void", "params": [ { diff --git a/mangle_names.patch b/mangle_names.patch index 883d7c9..a9a05dd 100644 --- a/mangle_names.patch +++ b/mangle_names.patch @@ -153,7 +153,7 @@ index 23b8f43..7369198 100644 #endif diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c -index e9d372f..2b55a28 100644 +index 04b7335..f90193b 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -951,7 +951,7 @@ const char *GetClipboardText(void) @@ -179,19 +179,10 @@ index 1aea685..33fe6d4 100644 SDL_ShowCursor(SDL_ENABLE); diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c -index d303ab1..d905155 100644 +index a07ba27..4b08806 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c -@@ -83,7 +83,7 @@ typedef struct { - - int fd; // File descriptor to the device it is assigned to - int eventNum; // Number of 'event' device -- Rectangle absRange; // Range of values for absolute pointing devices (touchscreens) -+ rlRectangle absRange; // Range of values for absolute pointing devices (touchscreens) - int touchSlot; // Hold the touch slot number of the currently being sent multitouch block - bool isMouse; // True if device supports relative X Y movements - bool isTouch; // True if device supports absolute X Y movements and has BTN_TOUCH -@@ -124,7 +124,7 @@ typedef struct { +@@ -119,7 +119,7 @@ typedef struct { char currentButtonStateEvdev[MAX_MOUSE_BUTTONS]; // Holds the new mouse state for the next polling event to grab bool cursorRelative; // Relative cursor mode int mouseFd; // File descriptor for the evdev mouse/touch/gestures @@ -200,7 +191,7 @@ index d303ab1..d905155 100644 int touchSlot; // Hold the touch slot number of the currently being sent multitouch block // Gamepad data -@@ -420,7 +420,7 @@ const char *GetClipboardText(void) +@@ -460,7 +460,7 @@ const char *GetClipboardText(void) } // Show mouse cursor @@ -236,7 +227,7 @@ index 9328b8c..1ddcbcb 100644 if (CORE.Input.Mouse.cursorHidden) { diff --git a/src/raylib.h b/src/raylib.h -index 1a15e12..39909b6 100644 +index 0d862a0..6abdfed 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -246,12 +246,12 @@ typedef struct Color { @@ -453,7 +444,7 @@ index 1a15e12..39909b6 100644 // Mesh management functions RLAPI void UploadMesh(Mesh *mesh, bool dynamic); // Upload mesh vertex data in GPU and provide VAO/VBO ids diff --git a/src/rcore.c b/src/rcore.c -index dcdc3be..ca2bb7e 100644 +index 9705495..2418d5a 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -638,16 +638,16 @@ void InitWindow(int width, int height, const char *title) @@ -494,8 +485,8 @@ index dcdc3be..ca2bb7e 100644 { #if defined(SUPPORT_GIF_RECORDING) if (gifRecording) -@@ -868,7 +868,7 @@ void EndDrawing(void) - if (((gifFrameCounter/15)%2) == 1) +@@ -878,7 +878,7 @@ void EndDrawing(void) + if ((int)(GetTime()/0.5)%2 == 1) { DrawCircle(30, CORE.Window.screen.height - 20, 10, MAROON); // WARNING: Module required: rshapes - DrawText("GIF RECORDING", 50, CORE.Window.screen.height - 25, 10, RED); // WARNING: Module required: rtext @@ -504,7 +495,7 @@ index dcdc3be..ca2bb7e 100644 #endif diff --git a/src/rmodels.c b/src/rmodels.c -index d94754f..079cf4d 100644 +index 77bb19a..ed38e7e 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -3562,13 +3562,13 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float @@ -995,7 +986,7 @@ index 87b9910..24b7adc 100644 // Save data properly in sprite font font.glyphs[i].value = charId; diff --git a/src/rtextures.c b/src/rtextures.c -index 588c8b1..1f940b4 100644 +index 8321648..c041902 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -271,7 +271,7 @@ static Vector4 *LoadImageDataNormalized(Image image); // Load pixel data f @@ -1016,7 +1007,7 @@ index 588c8b1..1f940b4 100644 frameCount = 1; } -@@ -1249,7 +1249,7 @@ Image ImageCopy(Image image) +@@ -1250,7 +1250,7 @@ Image ImageCopy(Image image) } // Create an image from another image piece @@ -1025,7 +1016,7 @@ index 588c8b1..1f940b4 100644 { Image result = { 0 }; -@@ -1271,7 +1271,7 @@ Image ImageFromImage(Image image, Rectangle rec) +@@ -1272,7 +1272,7 @@ Image ImageFromImage(Image image, Rectangle rec) // Crop an image to area defined by a rectangle // NOTE: Security checks are performed in case rectangle goes out of bounds @@ -1034,7 +1025,7 @@ index 588c8b1..1f940b4 100644 { // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; -@@ -1581,8 +1581,8 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co +@@ -1582,8 +1582,8 @@ Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Co { if ((codepoint != ' ') && (codepoint != '\t')) { @@ -1045,7 +1036,7 @@ index 588c8b1..1f940b4 100644 } if (font.glyphs[index].advanceX == 0) textOffsetX += (int)(font.recs[index].width + spacing); -@@ -1716,7 +1716,7 @@ void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, i +@@ -1717,7 +1717,7 @@ void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, i if (image->format >= PIXELFORMAT_COMPRESSED_DXT1_RGB) TRACELOG(LOG_WARNING, "Image manipulation not supported for compressed formats"); else if ((newWidth != image->width) || (newHeight != image->height)) { @@ -1054,7 +1045,7 @@ index 588c8b1..1f940b4 100644 Vector2 dstPos = { (float)offsetX, (float)offsetY }; if (offsetX < 0) -@@ -1796,7 +1796,7 @@ void ImageAlphaCrop(Image *image, float threshold) +@@ -1797,7 +1797,7 @@ void ImageAlphaCrop(Image *image, float threshold) // Security check to avoid program crash if ((image->data == NULL) || (image->width == 0) || (image->height == 0)) return; @@ -1063,7 +1054,7 @@ index 588c8b1..1f940b4 100644 // Crop if rectangle is valid if (((int)crop.width != 0) && ((int)crop.height != 0)) ImageCrop(image, crop); -@@ -3047,9 +3047,9 @@ void UnloadImagePalette(Color *colors) +@@ -3048,9 +3048,9 @@ void UnloadImagePalette(Color *colors) // Get image alpha border rectangle // NOTE: Threshold is defined as a percentage: 0.0f -> 1.0f @@ -1075,7 +1066,7 @@ index 588c8b1..1f940b4 100644 Color *pixels = LoadImageColors(image); -@@ -3077,7 +3077,7 @@ Rectangle GetImageAlphaBorder(Image image, float threshold) +@@ -3078,7 +3078,7 @@ Rectangle GetImageAlphaBorder(Image image, float threshold) // Check for empty blank image if ((xMin != 65536) && (xMax != 65536)) { @@ -1084,7 +1075,7 @@ index 588c8b1..1f940b4 100644 } UnloadImageColors(pixels); -@@ -3546,7 +3546,7 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) +@@ -3547,7 +3547,7 @@ void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color color) // Draw rectangle within an image void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color) { @@ -1093,7 +1084,7 @@ index 588c8b1..1f940b4 100644 } // Draw rectangle within an image (Vector version) -@@ -3556,7 +3556,7 @@ void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color +@@ -3557,7 +3557,7 @@ void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color } // Draw rectangle within an image @@ -1102,7 +1093,7 @@ index 588c8b1..1f940b4 100644 { // Security check to avoid program crash if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0)) return; -@@ -3601,7 +3601,7 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) +@@ -3602,7 +3602,7 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) } // Draw rectangle lines within an image @@ -1111,7 +1102,7 @@ index 588c8b1..1f940b4 100644 { ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color); -@@ -3611,7 +3611,7 @@ void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color) +@@ -3612,7 +3612,7 @@ void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color) // Draw an image (source) within an image (destination) // NOTE: Color tint is applied to source image @@ -1120,7 +1111,7 @@ index 588c8b1..1f940b4 100644 { // Security check to avoid program crash if ((dst->data == NULL) || (dst->width == 0) || (dst->height == 0) || -@@ -3637,7 +3637,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color +@@ -3638,7 +3638,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color { srcMod = ImageFromImage(src, srcRec); // Create image from another image ImageResize(&srcMod, (int)dstRec.width, (int)dstRec.height); // Resize to destination rectangle @@ -1129,7 +1120,7 @@ index 588c8b1..1f940b4 100644 srcPtr = &srcMod; useSrcMod = true; -@@ -3744,8 +3744,8 @@ void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, +@@ -3745,8 +3745,8 @@ void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, { Image imText = ImageTextEx(font, text, fontSize, spacing, tint); @@ -1140,7 +1131,7 @@ index 588c8b1..1f940b4 100644 ImageDraw(dst, imText, srcRec, dstRec, WHITE); -@@ -3760,7 +3760,7 @@ Texture2D LoadTexture(const char *fileName) +@@ -3761,7 +3761,7 @@ Texture2D LoadTexture(const char *fileName) { Texture2D texture = { 0 }; @@ -1149,7 +1140,7 @@ index 588c8b1..1f940b4 100644 if (image.data != NULL) { -@@ -3828,9 +3828,9 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) +@@ -3829,9 +3829,9 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) int size = cubemap.width; Image faces = { 0 }; // Vertical column image @@ -1161,7 +1152,7 @@ index 588c8b1..1f940b4 100644 if (layout == CUBEMAP_LAYOUT_LINE_VERTICAL) { -@@ -3869,7 +3869,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) +@@ -3870,7 +3870,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout) // NOTE: Image formatting does not work with compressed textures @@ -1170,7 +1161,7 @@ index 588c8b1..1f940b4 100644 } // NOTE: Cubemap data is expected to be provided as 6 images in a single data array, -@@ -3987,7 +3987,7 @@ void UpdateTexture(Texture2D texture, const void *pixels) +@@ -3988,7 +3988,7 @@ void UpdateTexture(Texture2D texture, const void *pixels) // Update GPU texture rectangle with new data // NOTE: pixels data must match texture.format @@ -1179,7 +1170,7 @@ index 588c8b1..1f940b4 100644 { rlUpdateTexture(texture.id, (int)rec.x, (int)rec.y, (int)rec.width, (int)rec.height, texture.format, pixels); } -@@ -4117,17 +4117,17 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) +@@ -4118,17 +4118,17 @@ void DrawTextureV(Texture2D texture, Vector2 position, Color tint) // Draw a texture with extended parameters void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint) { @@ -1201,7 +1192,7 @@ index 588c8b1..1f940b4 100644 Vector2 origin = { 0.0f, 0.0f }; DrawTexturePro(texture, source, dest, origin, 0.0f, tint); -@@ -4135,7 +4135,7 @@ void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color +@@ -4136,7 +4136,7 @@ void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color // Draw a part of a texture (defined by a rectangle) with 'pro' parameters // NOTE: origin is relative to destination rectangle size @@ -1210,7 +1201,7 @@ index 588c8b1..1f940b4 100644 { // Check if texture is valid if (texture.id > 0) -@@ -4257,7 +4257,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 +@@ -4258,7 +4258,7 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 } // Draws a texture (or part of it) that stretches or shrinks nicely using n-patch info diff --git a/src/raylib b/src/raylib index 9cf408f..890058a 160000 --- a/src/raylib +++ b/src/raylib @@ -1 +1 @@ -Subproject commit 9cf408f77c58828fd1019d5cd35c6b8c5139c8dc +Subproject commit 890058abcd6e3c03fe2c59ebb416db1e8b75446f diff --git a/src/raylib.nim b/src/raylib.nim index f5403cf..299ae7c 100644 --- a/src/raylib.nim +++ b/src/raylib.nim @@ -292,9 +292,9 @@ type LeftFaceDown ## Gamepad left DPAD down button LeftFaceLeft ## Gamepad left DPAD left button RightFaceUp ## Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) - RightFaceRight ## Gamepad right button right (i.e. PS3: Square, Xbox: X) + RightFaceRight ## Gamepad right button right (i.e. PS3: Circle, Xbox: B) RightFaceDown ## Gamepad right button down (i.e. PS3: Cross, Xbox: A) - RightFaceLeft ## Gamepad right button left (i.e. PS3: Circle, Xbox: B) + RightFaceLeft ## Gamepad right button left (i.e. PS3: Square, Xbox: X) LeftTrigger1 ## Gamepad top/back trigger left (first), it could be a trailing button LeftTrigger2 ## Gamepad top/back trigger left (second), it could be a trailing button RightTrigger1 ## Gamepad top/back trigger right (one), it could be a trailing button @@ -938,7 +938,7 @@ proc setShaderValueTexture*(shader: Shader, locIndex: ShaderLocation, texture: T proc unloadShader(shader: Shader) {.importc: "UnloadShader".} proc getScreenToWorldRay*(position: Vector2, camera: Camera): Ray {.importc: "GetScreenToWorldRay".} ## Get a ray trace from screen position (i.e mouse) -proc getScreenToWorldRay*(position: Vector2, camera: Camera, width: float32, height: float32): Ray {.importc: "GetScreenToWorldRayEx".} +proc getScreenToWorldRay*(position: Vector2, camera: Camera, width: int32, height: int32): Ray {.importc: "GetScreenToWorldRayEx".} ## Get a ray trace from screen position (i.e mouse) in a viewport proc getWorldToScreen*(position: Vector3, camera: Camera): Vector2 {.importc: "GetWorldToScreen".} ## Get the screen space position for a 3d world space position @@ -1677,11 +1677,11 @@ proc setAudioStreamBufferSizeDefault*(size: int32) {.importc: "SetAudioStreamBuf proc setAudioStreamCallback*(stream: AudioStream, callback: AudioCallback) {.importc: "SetAudioStreamCallback".} ## Audio thread callback to request new data proc attachAudioStreamProcessor*(stream: AudioStream, processor: AudioCallback) {.importc: "AttachAudioStreamProcessor".} - ## Attach audio stream processor to stream, receives the samples as s + ## Attach audio stream processor to stream, receives the samples as 'float' proc detachAudioStreamProcessor*(stream: AudioStream, processor: AudioCallback) {.importc: "DetachAudioStreamProcessor".} ## Detach audio stream processor from stream proc attachAudioMixedProcessor*(processor: AudioCallback) {.importc: "AttachAudioMixedProcessor".} - ## Attach audio stream processor to the entire audio pipeline, receives the samples as s + ## Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' proc detachAudioMixedProcessor*(processor: AudioCallback) {.importc: "DetachAudioMixedProcessor".} ## Detach audio stream processor from the entire audio pipeline {.pop.} diff --git a/tools/common.nim b/tools/common.nim index ecc6f33..d6391b7 100644 --- a/tools/common.nim +++ b/tools/common.nim @@ -138,24 +138,15 @@ proc convertType*(s: string, pattern: string, many, isVar: bool, baseKind: var s for token, isSep in tokenize(s): if isSep: continue case token - of "const": - discard - of "void": - isVoid = true - of "*": - isPointer = true - of "**": - isDoublePointer = true - of "char": - isChar = true - of "unsigned": - isUnsigned = true - of "size_t": - isSizeT = true - of "signed": - isSigned = true - of "int": - discard + of "const": discard + of "void": isVoid = true + of "*": isPointer = true + of "**": isDoublePointer = true + of "char": isChar = true + of "unsigned": isUnsigned = true + of "size_t": isSizeT = true + of "signed": isSigned = true + of "int": discard else: for token, isSep in tokenize(token, {'*'}): case token