浏览代码

Fix LoadTextureCubemap for manual layouts (#3204)

pull/3209/head
Nikolas 1年前
committed by GitHub
父节点
当前提交
5d28bad0ad
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. +8
    -2
      src/rtextures.c

+ 8
- 2
src/rtextures.c 查看文件

@ -3369,10 +3369,16 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
if ((image.height/6) == image.width) { layout = CUBEMAP_LAYOUT_LINE_VERTICAL; cubemap.width = image.height/6; }
else if ((image.width/3) == (image.height/4)) { layout = CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR; cubemap.width = image.width/3; }
}
cubemap.height = cubemap.width;
} else {
if (layout == CUBEMAP_LAYOUT_LINE_VERTICAL) cubemap.width = image.height/6;
if (layout == CUBEMAP_LAYOUT_LINE_HORIZONTAL) cubemap.width = image.width/6;
if (layout == CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR) cubemap.width = image.width/3;
if (layout == CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE) cubemap.width = image.width/4;
if (layout == CUBEMAP_LAYOUT_PANORAMA) cubemap.width = image.width/4;
}
cubemap.height = cubemap.width;
// Layout provided or already auto-detected
if (layout != CUBEMAP_LAYOUT_AUTO_DETECT)
{

正在加载...
取消
保存