mirror of https://github.com/bjornbytes/lovr.git
rm skybox args;
They used to always be necessary, now they are almost never necessary.
This commit is contained in:
parent
e3e930d6cc
commit
2fb393306c
|
@ -914,11 +914,7 @@ static int l_lovrGraphicsSphere(lua_State* L) {
|
||||||
|
|
||||||
static int l_lovrGraphicsSkybox(lua_State* L) {
|
static int l_lovrGraphicsSkybox(lua_State* L) {
|
||||||
Texture* texture = luax_checktype(L, 1, Texture);
|
Texture* texture = luax_checktype(L, 1, Texture);
|
||||||
float angle = luax_optfloat(L, 2, 0.f);
|
lovrGraphicsSkybox(texture);
|
||||||
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);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
TextureType type = lovrTextureGetType(texture);
|
||||||
lovrAssert(type == TEXTURE_CUBE || type == TEXTURE_2D, "Only 2D and cube textures can be used as skyboxes");
|
lovrAssert(type == TEXTURE_CUBE || type == TEXTURE_2D, "Only 2D and cube textures can be used as skyboxes");
|
||||||
|
|
||||||
Pipeline pipeline = state.pipeline;
|
Pipeline pipeline = state.pipeline;
|
||||||
pipeline.winding = WINDING_COUNTERCLOCKWISE;
|
pipeline.winding = WINDING_COUNTERCLOCKWISE;
|
||||||
|
|
||||||
float transform[16] = MAT4_IDENTITY;
|
|
||||||
mat4_rotate(transform, angle, ax, ay, az);
|
|
||||||
|
|
||||||
float* vertices = NULL;
|
float* vertices = NULL;
|
||||||
|
|
||||||
lovrGraphicsBatch(&(BatchRequest) {
|
lovrGraphicsBatch(&(BatchRequest) {
|
||||||
|
@ -1162,7 +1159,6 @@ void lovrGraphicsSkybox(Texture* texture, float angle, float ax, float ay, float
|
||||||
.topology = DRAW_TRIANGLE_STRIP,
|
.topology = DRAW_TRIANGLE_STRIP,
|
||||||
.shader = type == TEXTURE_CUBE ? SHADER_CUBE : SHADER_PANO,
|
.shader = type == TEXTURE_CUBE ? SHADER_CUBE : SHADER_PANO,
|
||||||
.pipeline = &pipeline,
|
.pipeline = &pipeline,
|
||||||
.transform = transform,
|
|
||||||
.diffuseTexture = type == TEXTURE_2D ? texture : NULL,
|
.diffuseTexture = type == TEXTURE_2D ? texture : NULL,
|
||||||
.environmentMap = type == TEXTURE_CUBE ? texture : NULL,
|
.environmentMap = type == TEXTURE_CUBE ? texture : NULL,
|
||||||
.vertexCount = 4,
|
.vertexCount = 4,
|
||||||
|
|
|
@ -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 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 lovrGraphicsCylinder(struct Material* material, mat4 transform, float r1, float r2, bool capped, int segments);
|
||||||
void lovrGraphicsSphere(struct Material* material, mat4 transform, 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 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 lovrGraphicsFill(struct Texture* texture, float u, float v, float w, float h);
|
||||||
void lovrGraphicsDrawMesh(struct Mesh* mesh, mat4 transform, uint32_t instances, float* pose);
|
void lovrGraphicsDrawMesh(struct Mesh* mesh, mat4 transform, uint32_t instances, float* pose);
|
||||||
|
|
Loading…
Reference in New Issue