瀏覽代碼

Merge pull request #656 from noshbar/vs2017-fix

Physac.h fix for variable array size declaration.
pull/661/head
Ray 6 年之前
committed by GitHub
父節點
當前提交
b8b8e6ab7d
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. +3
    -1
      src/physac.h

+ 3
- 1
src/physac.h 查看文件

@ -606,7 +606,7 @@ PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force)
{
int count = vertexData.vertexCount;
Vector2 bodyPos = body->position;
Vector2 n">vertices[count];
Vector2 o">*vertices = (Vector2*)malloc(sizeof(Vector2) * count);
Mat2 trans = body->shape.transform;
for (int i = 0; i < count; i++) vertices[i] = vertexData.positions[i];
@ -698,6 +698,8 @@ PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force)
// Apply force to new physics body
PhysicsAddForce(newBody, forceDirection);
}
free(vertices);
}
}
}

Loading…
取消
儲存