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
David Dormagen 2016-01-02 13:03:44 +01:00
parent a3e4b620b9
commit a0dddce691
1 changed files with 3 additions and 0 deletions

View File

@ -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())