From 0fddef2dfeaac817d7ee4a16b1bcf263b9951dc3 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Wed, 23 Oct 2024 16:37:25 -0700 Subject: [PATCH 1/2] Remove the panorama cubemap layout, it was not implemented. Left a todo in the code for some aspiring developer to finish. --- src/raylib.h | 3 +-- src/rtextures.c | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 536b441b429e..aceb458cee79 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -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 diff --git a/src/rtextures.c b/src/rtextures.c index 23b32c1b8c67..ca3ad0990aa1 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -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) { @@ -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; @@ -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; From 313fc32312a71d8ab4adde021a717dc57509a780 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 23 Oct 2024 23:37:48 +0000 Subject: [PATCH 2/2] Update raylib_api.* by CI --- parser/output/raylib_api.json | 5 ----- parser/output/raylib_api.lua | 5 ----- parser/output/raylib_api.txt | 3 +-- parser/output/raylib_api.xml | 3 +-- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/parser/output/raylib_api.json b/parser/output/raylib_api.json index 9db3d7ac0c71..948ff45e7ce3 100644 --- a/parser/output/raylib_api.json +++ b/parser/output/raylib_api.json @@ -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)" } ] }, diff --git a/parser/output/raylib_api.lua b/parser/output/raylib_api.lua index d5492cb9bcc2..fb16decc4203 100644 --- a/parser/output/raylib_api.lua +++ b/parser/output/raylib_api.lua @@ -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)" } } }, diff --git a/parser/output/raylib_api.txt b/parser/output/raylib_api.txt index f6c79f85e422..2c107a89496b 100644 --- a/parser/output/raylib_api.txt +++ b/parser/output/raylib_api.txt @@ -889,7 +889,7 @@ 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 @@ -897,7 +897,6 @@ Enum 15: CubemapLayout (6 values) 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 diff --git a/parser/output/raylib_api.xml b/parser/output/raylib_api.xml index 6de5933d4dcb..29689bf69a7a 100644 --- a/parser/output/raylib_api.xml +++ b/parser/output/raylib_api.xml @@ -595,13 +595,12 @@ - + -