浏览代码

Revert "REVIEWED: Avoid UBSAN warnings #1891"

This reverts commit a8e9e1387f.
pull/1923/head
raysan5 3 年前
父节点
当前提交
dffd1435e9
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. +2
    -4
      src/rlgl.h

+ 2
- 4
src/rlgl.h 查看文件

@ -3227,8 +3227,7 @@ void rlDrawVertexArray(int offset, int count)
void rlDrawVertexArrayElements(int offset, int count, void *buffer) void rlDrawVertexArrayElements(int offset, int count, void *buffer)
{ {
if (buffer == 0) glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, offset);
else glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short *)buffer + offset);
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short *)buffer + offset);
} }
void rlDrawVertexArrayInstanced(int offset, int count, int instances) void rlDrawVertexArrayInstanced(int offset, int count, int instances)
@ -3241,8 +3240,7 @@ void rlDrawVertexArrayInstanced(int offset, int count, int instances)
void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances) void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances)
{ {
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
if (buffer == 0) glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, offset, instances);
else glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short *)buffer + offset, instances);
glDrawElementsInstanced(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short *)buffer + offset, instances);
#endif #endif
} }

正在加载...
取消
保存