Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RTEXTURES] Remove the panorama cubemap layout option #4425

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions parser/output/raylib_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2839,11 +2839,6 @@
"name": "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE",
"value": 4,
"description": "Layout is defined by a 4x3 cross with cubemap faces"
},
{
"name": "CUBEMAP_LAYOUT_PANORAMA",
"value": 5,
"description": "Layout is defined by a panorama image (equirrectangular map)"
}
]
},
Expand Down
5 changes: 0 additions & 5 deletions parser/output/raylib_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2839,11 +2839,6 @@ return {
name = "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE",
value = 4,
description = "Layout is defined by a 4x3 cross with cubemap faces"
},
{
name = "CUBEMAP_LAYOUT_PANORAMA",
value = 5,
description = "Layout is defined by a panorama image (equirrectangular map)"
}
}
},
Expand Down
3 changes: 1 addition & 2 deletions parser/output/raylib_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -889,15 +889,14 @@ Enum 14: TextureWrap (4 values)
Value[TEXTURE_WRAP_CLAMP]: 1
Value[TEXTURE_WRAP_MIRROR_REPEAT]: 2
Value[TEXTURE_WRAP_MIRROR_CLAMP]: 3
Enum 15: CubemapLayout (6 values)
Enum 15: CubemapLayout (5 values)
Name: CubemapLayout
Description: Cubemap layouts
Value[CUBEMAP_LAYOUT_AUTO_DETECT]: 0
Value[CUBEMAP_LAYOUT_LINE_VERTICAL]: 1
Value[CUBEMAP_LAYOUT_LINE_HORIZONTAL]: 2
Value[CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR]: 3
Value[CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE]: 4
Value[CUBEMAP_LAYOUT_PANORAMA]: 5
Enum 16: FontType (3 values)
Name: FontType
Description: Font type, defines generation method
Expand Down
3 changes: 1 addition & 2 deletions parser/output/raylib_api.xml
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,12 @@
<Value name="TEXTURE_WRAP_MIRROR_REPEAT" integer="2" desc="Mirrors and repeats the texture in tiled mode" />
<Value name="TEXTURE_WRAP_MIRROR_CLAMP" integer="3" desc="Mirrors and clamps to border the texture in tiled mode" />
</Enum>
<Enum name="CubemapLayout" valueCount="6" desc="Cubemap layouts">
<Enum name="CubemapLayout" valueCount="5" desc="Cubemap layouts">
<Value name="CUBEMAP_LAYOUT_AUTO_DETECT" integer="0" desc="Automatically detect layout type" />
<Value name="CUBEMAP_LAYOUT_LINE_VERTICAL" integer="1" desc="Layout is defined by a vertical line with faces" />
<Value name="CUBEMAP_LAYOUT_LINE_HORIZONTAL" integer="2" desc="Layout is defined by a horizontal line with faces" />
<Value name="CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR" integer="3" desc="Layout is defined by a 3x4 cross with cubemap faces" />
<Value name="CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE" integer="4" desc="Layout is defined by a 4x3 cross with cubemap faces" />
<Value name="CUBEMAP_LAYOUT_PANORAMA" integer="5" desc="Layout is defined by a panorama image (equirrectangular map)" />
</Enum>
<Enum name="FontType" valueCount="3" desc="Font type, defines generation method">
<Value name="FONT_DEFAULT" integer="0" desc="Default font generation, anti-aliased" />
Expand Down
3 changes: 1 addition & 2 deletions src/raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,7 @@ typedef enum {
CUBEMAP_LAYOUT_LINE_VERTICAL, // Layout is defined by a vertical line with faces
CUBEMAP_LAYOUT_LINE_HORIZONTAL, // Layout is defined by a horizontal line with faces
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces
CUBEMAP_LAYOUT_PANORAMA // Layout is defined by a panorama image (equirrectangular map)
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE // Layout is defined by a 4x3 cross with cubemap faces
} CubemapLayout;

// Font type, defines generation method
Expand Down
8 changes: 3 additions & 5 deletions src/rtextures.c
Original file line number Diff line number Diff line change
Expand Up @@ -4100,7 +4100,6 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
{
if ((image.width/6) == image.height) { layout = CUBEMAP_LAYOUT_LINE_HORIZONTAL; cubemap.width = image.width/6; }
else if ((image.width/4) == (image.height/3)) { layout = CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE; cubemap.width = image.width/4; }
else if (image.width >= (int)((float)image.height*1.85f)) { layout = CUBEMAP_LAYOUT_PANORAMA; cubemap.width = image.width/4; }
}
else if (image.height > image.width)
{
Expand All @@ -4114,7 +4113,6 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
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;
Expand All @@ -4133,11 +4131,11 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
{
faces = ImageCopy(image); // Image data already follows expected convention
}
else if (layout == CUBEMAP_LAYOUT_PANORAMA)
/*else if (layout == CUBEMAP_LAYOUT_PANORAMA)
{
// TODO: Convert panorama image to square faces...
// TODO: implement panorama by converting image to square faces...
// Ref: https://github.com/denivip/panorama/blob/master/panorama.cpp
}
} */
else
{
if (layout == CUBEMAP_LAYOUT_LINE_HORIZONTAL) for (int i = 0; i < 6; i++) faceRecs[i].x = (float)size*i;
Expand Down
Loading