Don't call glBufferSubData(GL_ARRAY_BUFFER, *, 0, *), which crashes some drivers.

Probably shouldn't have crashed... Fixes ticket:2293.

Changelog: Work around crash in some graphics drivers on some maps.
master
Cyp 2010-11-07 11:46:51 +01:00
parent 5a35eb9f89
commit c53a59b709
1 changed files with 7 additions and 1 deletions

View File

@ -622,7 +622,13 @@ static void updateSectorGeometry(int x, int y)
free(geometry);
free(water);
if (sectors[x*ySectors + y].decalSize <= 0)
{
// Nothing to do here, and glBufferSubData(GL_ARRAY_BUFFER, 0, 0, *) crashes in my graphics driver. Probably shouldn't crash...
return;
}
decaldata = malloc(sizeof(DecalVertex)*sectors[x*ySectors + y].decalSize);
setSectorDecals(x, y, decaldata, &decalSize);
ASSERT(decalSize == sectors[x*ySectors + y].decalSize , "the amount of decals has changed");