瀏覽代碼

Fix extra memory allocated when updating color buffer in mesh (#1271)

pull/1274/head
Chang Si Yuan 5 年之前
committed by GitHub
父節點
當前提交
73cc33b493
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/rlgl.h

+ 1
- 1
src/rlgl.h 查看文件

@ -2587,7 +2587,7 @@ void rlUpdateMeshAt(Mesh mesh, int buffer, int count, int index)
case 3: // Update colors (vertex colors)
{
glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]);
if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*4*sizeof(float), mesh.colors, GL_DYNAMIC_DRAW);
if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*4*sizeof(unsigned char), mesh.colors, GL_DYNAMIC_DRAW);
else if (index + count >= mesh.vertexCount) break;
else glBufferSubData(GL_ARRAY_BUFFER, index*4*sizeof(unsigned char), count*4*sizeof(unsigned char), mesh.colors);

Loading…
取消
儲存