fix Skybox::clear to set _empty

This commit is contained in:
Zach Pomerantz 2016-08-29 13:40:56 -07:00
parent 5f699072d9
commit 1e7c00c0c8

View file

@ -26,13 +26,15 @@ Skybox::Skybox() {
} }
void Skybox::setColor(const Color& color) { void Skybox::setColor(const Color& color) {
_empty = false;
_schemaBuffer.edit<Schema>().color = color; _schemaBuffer.edit<Schema>().color = color;
_empty = false;
} }
void Skybox::setCubemap(const gpu::TexturePointer& cubemap) { void Skybox::setCubemap(const gpu::TexturePointer& cubemap) {
_empty = false;
_cubemap = cubemap; _cubemap = cubemap;
if (cubemap) {
_empty = false;
}
} }
void Skybox::updateSchemaBuffer() const { void Skybox::updateSchemaBuffer() const {
@ -52,9 +54,9 @@ void Skybox::updateSchemaBuffer() const {
} }
void Skybox::clear() { void Skybox::clear() {
_empty = true;
_schemaBuffer.edit<Schema>().color = vec3(0); _schemaBuffer.edit<Schema>().color = vec3(0);
setCubemap(nullptr); _cubemap = nullptr;
_empty = true;
} }
void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const { void Skybox::prepare(gpu::Batch& batch, int textureSlot, int bufferSlot) const {