Merge branch 'master' of https://github.com/raysan5/raylib
This commit is contained in:
commit
a1d516354e
3 changed files with 12 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -104,6 +104,7 @@ GRTAGS
|
||||||
GTAGS
|
GTAGS
|
||||||
|
|
||||||
# Zig programming language
|
# Zig programming language
|
||||||
|
.zig-cache/
|
||||||
zig-cache/
|
zig-cache/
|
||||||
zig-out/
|
zig-out/
|
||||||
build/
|
build/
|
||||||
|
|
|
@ -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");
|
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);
|
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!");
|
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();
|
dir.close();
|
||||||
raylib.addIncludePath(.{ .path = cache_include });
|
raylib.addIncludePath(.{ .cwd_relative = cache_include });
|
||||||
}
|
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
@panic("Unsupported OS");
|
@panic("Unsupported OS");
|
||||||
|
|
|
@ -3111,6 +3111,7 @@ Color *LoadImageColors(Image image)
|
||||||
pixels[i].b = 0;
|
pixels[i].b = 0;
|
||||||
pixels[i].a = 255;
|
pixels[i].a = 255;
|
||||||
|
|
||||||
|
k += 1;
|
||||||
} break;
|
} break;
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R32G32B32:
|
case PIXELFORMAT_UNCOMPRESSED_R32G32B32:
|
||||||
{
|
{
|
||||||
|
@ -3124,9 +3125,9 @@ Color *LoadImageColors(Image image)
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32:
|
case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32:
|
||||||
{
|
{
|
||||||
pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f);
|
pixels[i].r = (unsigned char)(((float *)image.data)[k]*255.0f);
|
||||||
pixels[i].g = (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]*255.0f);
|
pixels[i].b = (unsigned char)(((float *)image.data)[k + 2]*255.0f);
|
||||||
pixels[i].a = (unsigned char)(((float *)image.data)[k]*255.0f);
|
pixels[i].a = (unsigned char)(((float *)image.data)[k + 3]*255.0f);
|
||||||
|
|
||||||
k += 4;
|
k += 4;
|
||||||
} break;
|
} break;
|
||||||
|
@ -3137,6 +3138,7 @@ Color *LoadImageColors(Image image)
|
||||||
pixels[i].b = 0;
|
pixels[i].b = 0;
|
||||||
pixels[i].a = 255;
|
pixels[i].a = 255;
|
||||||
|
|
||||||
|
k += 1;
|
||||||
} break;
|
} break;
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R16G16B16:
|
case PIXELFORMAT_UNCOMPRESSED_R16G16B16:
|
||||||
{
|
{
|
||||||
|
@ -3150,9 +3152,9 @@ Color *LoadImageColors(Image image)
|
||||||
case PIXELFORMAT_UNCOMPRESSED_R16G16B16A16:
|
case PIXELFORMAT_UNCOMPRESSED_R16G16B16A16:
|
||||||
{
|
{
|
||||||
pixels[i].r = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k])*255.0f);
|
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].g = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k + 1])*255.0f);
|
||||||
pixels[i].b = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k])*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])*255.0f);
|
pixels[i].a = (unsigned char)(HalfToFloat(((unsigned short *)image.data)[k + 3])*255.0f);
|
||||||
|
|
||||||
k += 4;
|
k += 4;
|
||||||
} break;
|
} break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue