summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2024-07-01 13:06:00 +0200
committerRay <[email protected]>2024-07-01 13:06:00 +0200
commita1d516354e5bf85ddfff3293172bb6c0f8e853ec (patch)
treef9ec5a236ab50fe07e0171f1b628ef654d965ade
parent61cfd1afcb465b5913362981fe66b7db84e58915 (diff)
parentb5473d5ffde38fb0a6f9e31cfaf0fc8d50aaff74 (diff)
downloadraylib-a1d516354e5bf85ddfff3293172bb6c0f8e853ec.tar.gz
raylib-a1d516354e5bf85ddfff3293172bb6c0f8e853ec.zip
Merge branch 'master' of https://github.com/raysan5/raylib
-rw-r--r--.gitignore1
-rw-r--r--src/build.zig12
-rw-r--r--src/rtextures.c14
3 files changed, 12 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index eeb1ed09..d857bf2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -104,6 +104,7 @@ GRTAGS
GTAGS
# Zig programming language
+.zig-cache/
zig-cache/
zig-out/
build/
diff --git a/src/build.zig b/src/build.zig
index 0b85e5f8..3b462de6 100644
--- a/src/build.zig
+++ b/src/build.zig
@@ -207,15 +207,9 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
const cache_include = std.fs.path.join(b.allocator, &.{ b.sysroot.?, "cache", "sysroot", "include" }) catch @panic("Out of memory");
defer b.allocator.free(cache_include);
- if (comptime builtin.zig_version.minor > 12) {
- var dir = std.fs.cwd().openDir(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
- dir.close();
- raylib.addIncludePath(b.path(cache_include));
- } else {
- var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
- dir.close();
- raylib.addIncludePath(.{ .path = cache_include });
- }
+ var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
+ dir.close();
+ raylib.addIncludePath(.{ .cwd_relative = cache_include });
},
else => {
@panic("Unsupported OS");
diff --git a/src/rtextures.c b/src/rtextures.c
index ccfa12ec..54bf7c6a 100644
--- a/src/rtextures.c
+++ b/src/rtextures.c
@@ -3111,6 +3111,7 @@ Color *LoadImageColors(Image image)
pixels[i].b = 0;
pixels[i].a = 255;
+ k += 1;
} break;
case PIXELFORMAT_UNCOMPRESSED_R32G32B32:
{
@@ -3124,9 +3125,9 @@ Color *LoadImageColors(Image image)
case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32:
{
pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f);
- pixels[i].g = (unsigned char)(((float *)image.data)[k]*255.0f);
- pixels[i].b = (unsigned char)(((float *)image.data)[k]*255.0f);
- pixels[i].a = (unsigned char)(((float *)image.data)[k]*255.0f);
+ pixels[i].g = (unsigned char)(((float *)image.data)[k + 1]*255.0f);
+ pixels[i].b = (unsigned char)(((float *)image.data)[k + 2]*255.0f);
+ pixels[i].a = (unsigned char)(((float *)image.data)[k + 3]*255.0f);
k += 4;
} break;
@@ -3137,6 +3138,7 @@ Color *LoadImageColors(Image image)
pixels[i].b = 0;
pixels[i].a = 255;
+ k += 1;
} break;
case PIXELFORMAT_UNCOMPRESSED_R16G16B16:
{
@@ -3150,9 +3152,9 @@ Color *LoadImageColors(Image image)
case PIXELFORMAT_UNCOMPRESSED_R16G16B16A16:
{
pixels[i].r = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k])*255.0f);
- pixels[i].g = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k])*255.0f);
- pixels[i].b = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k])*255.0f);
- pixels[i].a = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k])*255.0f);
+ pixels[i].g = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k + 1])*255.0f);
+ pixels[i].b = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k + 2])*255.0f);
+ pixels[i].a = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k + 3])*255.0f);
k += 4;
} break;