mirror of https://github.com/libsdl-org/SDL
render: constified some local variables in SDL_AllocateRenderVertices.
This commit is contained in:
parent
5faea84c63
commit
857cc7c0c9
|
@ -287,10 +287,10 @@ void *
|
||||||
SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
|
SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
|
||||||
{
|
{
|
||||||
const size_t needed = renderer->vertex_data_used + numbytes + alignment;
|
const size_t needed = renderer->vertex_data_used + numbytes + alignment;
|
||||||
size_t current_offset = renderer->vertex_data_used;
|
const size_t current_offset = renderer->vertex_data_used;
|
||||||
|
|
||||||
size_t aligner = (alignment && ((current_offset & (alignment - 1)) != 0)) ? (alignment - (current_offset & (alignment - 1))) : 0;
|
const size_t aligner = (alignment && ((current_offset & (alignment - 1)) != 0)) ? (alignment - (current_offset & (alignment - 1))) : 0;
|
||||||
size_t aligned = current_offset + aligner;
|
const size_t aligned = current_offset + aligner;
|
||||||
|
|
||||||
if (renderer->vertex_data_allocation < needed) {
|
if (renderer->vertex_data_allocation < needed) {
|
||||||
const size_t current_allocation = renderer->vertex_data ? renderer->vertex_data_allocation : 1024;
|
const size_t current_allocation = renderer->vertex_data ? renderer->vertex_data_allocation : 1024;
|
||||||
|
|
Loading…
Reference in New Issue