From 2fb393306c8ddf82ceb9152fb686fc6c66c23903 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sat, 29 Jun 2019 21:01:03 -0700 Subject: [PATCH] rm skybox args; They used to always be necessary, now they are almost never necessary. --- src/api/l_graphics.c | 6 +----- src/modules/graphics/graphics.c | 6 +----- src/modules/graphics/graphics.h | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/api/l_graphics.c b/src/api/l_graphics.c index e073da78..25c7ac62 100644 --- a/src/api/l_graphics.c +++ b/src/api/l_graphics.c @@ -914,11 +914,7 @@ static int l_lovrGraphicsSphere(lua_State* L) { static int l_lovrGraphicsSkybox(lua_State* L) { Texture* texture = luax_checktype(L, 1, Texture); - float angle = luax_optfloat(L, 2, 0.f); - float ax = luax_optfloat(L, 3, 0.f); - float ay = luax_optfloat(L, 4, 1.f); - float az = luax_optfloat(L, 5, 0.f); - lovrGraphicsSkybox(texture, angle, ax, ay, az); + lovrGraphicsSkybox(texture); return 0; } diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 95b1cce1..0a5175cb 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -1145,16 +1145,13 @@ void lovrGraphicsSphere(Material* material, mat4 transform, int segments) { } } -void lovrGraphicsSkybox(Texture* texture, float angle, float ax, float ay, float az) { +void lovrGraphicsSkybox(Texture* texture) { TextureType type = lovrTextureGetType(texture); lovrAssert(type == TEXTURE_CUBE || type == TEXTURE_2D, "Only 2D and cube textures can be used as skyboxes"); Pipeline pipeline = state.pipeline; pipeline.winding = WINDING_COUNTERCLOCKWISE; - float transform[16] = MAT4_IDENTITY; - mat4_rotate(transform, angle, ax, ay, az); - float* vertices = NULL; lovrGraphicsBatch(&(BatchRequest) { @@ -1162,7 +1159,6 @@ void lovrGraphicsSkybox(Texture* texture, float angle, float ax, float ay, float .topology = DRAW_TRIANGLE_STRIP, .shader = type == TEXTURE_CUBE ? SHADER_CUBE : SHADER_PANO, .pipeline = &pipeline, - .transform = transform, .diffuseTexture = type == TEXTURE_2D ? texture : NULL, .environmentMap = type == TEXTURE_CUBE ? texture : NULL, .vertexCount = 4, diff --git a/src/modules/graphics/graphics.h b/src/modules/graphics/graphics.h index 7d40629a..72c5aaa9 100644 --- a/src/modules/graphics/graphics.h +++ b/src/modules/graphics/graphics.h @@ -167,7 +167,7 @@ void lovrGraphicsArc(DrawStyle style, ArcMode mode, struct Material* material, m void lovrGraphicsCircle(DrawStyle style, struct Material* material, mat4 transform, int segments); void lovrGraphicsCylinder(struct Material* material, mat4 transform, float r1, float r2, bool capped, int segments); void lovrGraphicsSphere(struct Material* material, mat4 transform, int segments); -void lovrGraphicsSkybox(struct Texture* texture, float angle, float ax, float ay, float az); +void lovrGraphicsSkybox(struct Texture* texture); void lovrGraphicsPrint(const char* str, size_t length, mat4 transform, float wrap, HorizontalAlign halign, VerticalAlign valign); void lovrGraphicsFill(struct Texture* texture, float u, float v, float w, float h); void lovrGraphicsDrawMesh(struct Mesh* mesh, mat4 transform, uint32_t instances, float* pose);