Skip to content

Commit

Permalink
fix #6341
Browse files Browse the repository at this point in the history
  • Loading branch information
rtri committed Jul 2, 2020
1 parent aea3617 commit f7b65ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rts/Map/HeightMapTexture.cpp
Expand Up @@ -83,7 +83,7 @@ void HeightMapTexture::UnsyncedHeightMapUpdate(const SRectangle& rect)
pbo.New(sizeX * sizeZ * sizeof(float));

const float* heightMap = readMap->GetCornerHeightMapUnsynced();
float* heightBuf = reinterpret_cast<float*>(pbo.MapBuffer());
float* heightBuf = reinterpret_cast<float*>(pbo.MapBuffer(0, pbo.bufSize, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | pbo.mapUnsyncedBit));

if (heightBuf != nullptr) {
for (int z = 0; z < sizeZ; z++) {
Expand All @@ -99,5 +99,6 @@ void HeightMapTexture::UnsyncedHeightMapUpdate(const SRectangle& rect)
glBindTexture(GL_TEXTURE_2D, texID);
glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x1, rect.z1, sizeX, sizeZ, GL_RED, GL_FLOAT, pbo.GetPtr());

pbo.Invalidate();
pbo.Unbind();
}

0 comments on commit f7b65ae

Please sign in to comment.