Skip to content

Commit

Permalink
fix #94
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Dec 23, 2023
1 parent 98a5145 commit 1f62ede
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/raylib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1864,8 +1864,6 @@ proc materialCount*(x: Model): int32 {.inline.} = x.materialCount
proc boneCount*(x: Model): int32 {.inline.} = x.boneCount
proc boneCount*(x: ModelAnimation): int32 {.inline.} = x.boneCount
proc frameCount*(x: ModelAnimation): int32 {.inline.} = x.frameCount
proc buffer*(x: AudioStream): ptr rAudioBuffer {.inline.} = x.buffer
proc processor*(x: AudioStream): ptr rAudioProcessor {.inline.} = x.processor

type
RaylibError* = object of CatchableError
Expand Down
8 changes: 4 additions & 4 deletions tools/raylib_gen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const raylibDir = currentSourcePath().parentDir / "raylib/src"
{.passC: "-I" & raylibDir.}
{.passC: "-I" & raylibDir / "external/glfw/include".}
{.passC: "-I" & raylibDir / "external/glfw/deps/mingw".}
{.passC: "-Wall -D_GNU_SOURCE -Wno-missing-braces -Werror=pointer-arith".}
{.passC: "-Wall -D_GNU_SOURCE -Wno-missing-braces -Werror=pointer-arith".}
when defined(emscripten):
{.passC: "-DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2".}
{.passL: "-s USE_GLFW=3 -s WASM=1 -s ASYNCIFY -s TOTAL_MEMORY=67108864".}
Expand Down Expand Up @@ -574,8 +574,7 @@ proc genBindings(t: TopLevel, fname: string; header, middle: string) =
continue
let isPrivate = (obj.name, name) notin
{"Wave": "frameCount", "Sound": "frameCount", "Music": "frameCount"} and
name.endsWith("Count") or (obj.name, name) in {"AudioStream": "buffer",
"AudioStream": "processor"}
name.endsWith("Count")
const replacements = [
("Camera3D", "projection", "CameraProjection"),
("Image", "format", "PixelFormat"),
Expand All @@ -601,7 +600,8 @@ proc genBindings(t: TopLevel, fname: string; header, middle: string) =
var isArray = many and not endsWith(name.normalize, "data") and
(obj.name, name) notin {"Material": "params", "VrDeviceInfo": "lensDistortionValues", "FilePathList": "paths", "AutomationEvent": "params"}
if isPrivate or isArray or obj.name in ["FilePathList", "AutomationEventList"] or
(obj.name, name) in {"MaterialMap": "texture", "Material": "shader"}:
(obj.name, name) in {"MaterialMap": "texture", "Material": "shader", "AudioStream": "buffer",
"AudioStream": "processor"}:
lit ": "
else:
lit "*: "
Expand Down

0 comments on commit 1f62ede

Please sign in to comment.