Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1025,11 +1025,11 @@ void GeometryCache::renderBevelCornersRect(gpu::Batch& batch, int x, int y, int · 1024 unmodified lines | ||
| 1025 | 1025 | #endif // def WANT_DEBUG |
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | − const int FLOATS_PER_VERTEX = 2; // vertices | |
| 1029 | − const int NUM_VERTICES = 8; | |
| 1030 | − | |
| 1031 | 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 | 1033 | details.isCreated = true; |
| 1034 | 1034 | details.vertices = NUM_VERTICES; |
| 1035 | 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 | 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; | |
| 1055 | − GLfloat vertexBuffer[vertexPoints]; // only vertices, no normals because we're a 2D quad | |
| 1054 | + GLfloat vertexBuffer[NUM_FLOATS]; // only vertices, no normals because we're a 2D quad | |
| 1056 | 1055 | int vertexPoint = 0; |
| 1057 | 1056 | |
| 1058 | 1057 | // Triangle strip points |