Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed May 21, 2024
1 parent 5eba9c8 commit 1d8b8c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/raylib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ from std/strutils import addf, toHex
from std/unicode import Rune
from std/syncio import writeFile
import std/[assertions, paths]
const raylibDir = currentSourcePath().Path.parentDir / Path"raylib"
const raylibDir = Path"/home/antonisg/Code/raydev/naylib/src/raylib"

{.passC: "-I" & raylibDir.string.}
{.passC: "-I" & string(raylibDir / Path"external/glfw/include").}
Expand Down Expand Up @@ -2339,7 +2339,7 @@ proc fade*(color: Color, alpha: float32): Color =

proc colorToInt*(color: Color): int32 =
## Get hexadecimal value for a Color
(color.r.int32 shl 24) or (color.g.int32 shl 16) or (color.b.int32 shl 8) or color.a.int32
int32((color.r.uint32 shl 24) or (color.g.uint32 shl 16) or (color.b.uint32 shl 8) or color.a.uint32)

proc getColor*(hexValue: uint32): Color =
## Get Color structure from hexadecimal value
Expand Down
2 changes: 1 addition & 1 deletion src/raylib/rmodels.c
Original file line number Diff line number Diff line change
Expand Up @@ -3431,7 +3431,7 @@ void GenMeshTangents(Mesh *mesh)
Vector3 *tan1 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
Vector3 *tan2 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));

for (int i = 0; i < mesh->vertexCount; i += 3)
for (int i = 0; i < mesh->vertexCount - 3; i += 3)
{
// Get triangle vertices
Vector3 v1 = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] };
Expand Down
4 changes: 1 addition & 3 deletions src/raylib/rtextures.c
Original file line number Diff line number Diff line change
Expand Up @@ -4510,9 +4510,7 @@ Color Fade(Color color, float alpha)
// Get hexadecimal value for a Color
int ColorToInt(Color color)
{
int result = (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a);

return result;
return (int)(((unsigned)color.r << 24) | ((unsigned)color.g << 16) | ((unsigned)color.b << 8) | color.a);
}

// Get color normalized as float [0..1]
Expand Down
2 changes: 1 addition & 1 deletion tools/raylib_wrap.nim
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ proc fade*(color: Color, alpha: float32): Color =

proc colorToInt*(color: Color): int32 =
## Get hexadecimal value for a Color
(color.r.int32 shl 24) or (color.g.int32 shl 16) or (color.b.int32 shl 8) or color.a.int32
int32((color.r.uint32 shl 24) or (color.g.uint32 shl 16) or (color.b.uint32 shl 8) or color.a.uint32)

proc getColor*(hexValue: uint32): Color =
## Get Color structure from hexadecimal value
Expand Down
2 changes: 1 addition & 1 deletion update_bindings.nims
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const
PkgDir = thisDir().quoteShell
RaylibDir = PkgDir / "raylib"
RaylibGit = "https://github.com/raysan5/raylib.git"
RayLatestCommit = "272a142ee5b830ff6742c2df6a7b3abe7399cfde"
RayLatestCommit = "9ef29aff9aa08e64ac2d25048829de7459ee7d25"
ApiDir = PkgDir / "api"
DocsDir = PkgDir / "docs"

Expand Down

0 comments on commit 1d8b8c6

Please sign in to comment.