forked from Mirrors/openclonk
C4FoWDrawLightTextureStrategy: do not crash when nothing to draw
This would crash for me when starting a game in developer's mode. Not sure if this is the best place for the fix. Maybe there is some other underlying issue. ck?shapetextures
parent
a3e4b620b9
commit
a0dddce691
|
@ -126,6 +126,9 @@ void C4FoWDrawLightTextureStrategy::Begin(const C4FoWRegion* regionPar)
|
|||
|
||||
void C4FoWDrawLightTextureStrategy::End(C4ShaderCall& call)
|
||||
{
|
||||
// If we have nothing to draw (e.g. directly after initialization), abort early.
|
||||
if (vertices.empty()) return;
|
||||
|
||||
// Upload vertices
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||
if (vbo == 0 || vbo_size < vertices.size())
|
||||
|
|
Loading…
Reference in New Issue