History

Make array size a constexpr

Atlante45 committed 11 years ago

Commit 5166d831 parent d0f27f11 file · +5 −6Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 1 file). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+5−6
@@ -1025,11 +1025,11 @@ void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int · 1024 unmodified lines
1025 #endif // def WANT_DEBUG1025 #endif // def WANT_DEBUG
1026 }1026 }
1027 1027
1028 const int FLOATS_PER_VERTEX = 2; // vertices
1029 const int NUM_VERTICES = 8;
1030
1031 if (!details.isCreated) {1028 if (!details.isCreated) {
1032 1029 static const int FLOATS_PER_VERTEX = 2; // vertices
1030 static const int NUM_VERTICES = 8;
1031 static constexpr int NUM_FLOATS = NUM_VERTICES * FLOATS_PER_VERTEX;
1032
1033 details.isCreated = true;1033 details.isCreated = true;
1034 details.vertices = NUM_VERTICES;1034 details.vertices = NUM_VERTICES;
1035 details.vertexSize = FLOATS_PER_VERTEX;1035 details.vertexSize = FLOATS_PER_VERTEX;
@@ -1051,8 +1051,7 @@ void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int · 15 unmodified lines
1051 details.stream->addBuffer(details.colorBuffer, 0, details.streamFormat->getChannels().at(1)._stride);1051 details.stream->addBuffer(details.colorBuffer, 0, details.streamFormat->getChannels().at(1)._stride);
1052 1052
1053 1053
1054 int vertexPoints = NUM_VERTICES * FLOATS_PER_VERTEX;1054 GLfloat vertexBuffer[NUM_FLOATS]; // only vertices, no normals because we're a 2D quad
1055 GLfloat vertexBuffer[vertexPoints]; // only vertices, no normals because we're a 2D quad
1056 int vertexPoint = 0;1055 int vertexPoint = 0;
1057 1056
1058 // Triangle strip points1057 // Triangle strip points

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t