From 4354cdabdb618dba09155d0fcdff1e9af44bf50c Mon Sep 17 00:00:00 2001 From: Evan Goers Date: Sat, 14 Jan 2012 06:29:25 +0000 Subject: Provide a fallback for zones without a sky set. --- src/render/draw.cc | 9 +++++---- src/render/state.cc | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/render/draw.cc b/src/render/draw.cc index f9076cc..04c839b 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -168,10 +168,11 @@ void draw_pass_sky() if (!core::localplayer()->zone()) return; - if (!core::localplayer()->zone()->sky().size()) - return; - - Textures::load_cubemap("textures/sky/" + core::localplayer()->zone()->sky()); + if (core::localplayer()->zone()->sky().size()) { + Textures::load_cubemap("textures/sky/" + core::localplayer()->zone()->sky()); + } else { + Textures::load_cubemap("textures/sky/default"); + } gl::enable(GL_TEXTURE_CUBE_MAP); diff --git a/src/render/state.cc b/src/render/state.cc index f5cbb8d..a6a65ba 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -289,8 +289,9 @@ void State::use_material(const model::Material * material) { gl::enable(GL_TEXTURE_GEN_S); gl::enable(GL_TEXTURE_GEN_T); gl::enable(GL_TEXTURE_GEN_R); + } else { + color.assign(0.0f, 0.0f, 0.0f); } - //FIXME provide a fallback for zones without a skybox } } -- cgit v1.2.3