Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Goers <mega@osirion.org>2012-01-14 06:29:25 +0000
committerEvan Goers <mega@osirion.org>2012-01-14 06:29:25 +0000
commit4354cdabdb618dba09155d0fcdff1e9af44bf50c (patch)
tree637e7882eb6f8a9dd14e30b95fdedf2417b67d9c /src/render
parentaba7572643ca5211b6c13bb0cf37c3d2fffea11b (diff)
Provide a fallback for zones without a sky set.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/draw.cc9
-rw-r--r--src/render/state.cc3
2 files changed, 7 insertions, 5 deletions
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
}
}