Fix LoadTextureCubemap for manual layouts (#3204)
This commit is contained in:
parent
ac6f889dfc
commit
5d28bad0ad
1 changed files with 8 additions and 2 deletions
|
@ -3369,9 +3369,15 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
|
||||||
if ((image.height/6) == image.width) { layout = CUBEMAP_LAYOUT_LINE_VERTICAL; cubemap.width = image.height/6; }
|
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; }
|
else if ((image.width/3) == (image.height/4)) { layout = CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR; cubemap.width = image.width/3; }
|
||||||
}
|
}
|
||||||
|
} 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;
|
cubemap.height = cubemap.width;
|
||||||
}
|
|
||||||
|
|
||||||
// Layout provided or already auto-detected
|
// Layout provided or already auto-detected
|
||||||
if (layout != CUBEMAP_LAYOUT_AUTO_DETECT)
|
if (layout != CUBEMAP_LAYOUT_AUTO_DETECT)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue