Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-08-07 15:36:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-07 15:37:39 +0300
commitb134434224254d4ac3fc73d023f2f6d914746690 (patch)
treeb67d2c5aee982495d55848414c362665a37476b0 /source/blender/draw/intern/draw_cache.c
parent3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff)
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r--source/blender/draw/intern/draw_cache.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index b36a177c19f..d59c891fbeb 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -361,8 +361,8 @@ GPUBatch *DRW_cache_fullscreen_quad_get(void)
if (!SHC.drw_fullscreen_quad) {
/* Use a triangle instead of a real quad */
/* https://www.slideshare.net/DevCentralAMD/vertex-shader-tricks-bill-bilodeau - slide 14 */
- float pos[3][2] = {{-1.0f, -1.0f}, {3.0f, -1.0f}, {-1.0f, 3.0f}};
- float uvs[3][2] = {{0.0f, 0.0f}, {2.0f, 0.0f}, {0.0f, 2.0f}};
+ const float pos[3][2] = {{-1.0f, -1.0f}, {3.0f, -1.0f}, {-1.0f, 3.0f}};
+ const float uvs[3][2] = {{0.0f, 0.0f}, {2.0f, 0.0f}, {0.0f, 2.0f}};
/* Position Only 2D format */
static GPUVertFormat format = {0};
@@ -400,7 +400,7 @@ GPUBatch *DRW_cache_quad_get(void)
int v = 0;
int flag = VCLASS_EMPTY_SCALED;
- float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
+ const float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
for (int a = 0; a < 4; a++) {
GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[a][0], p[a][1], 0.0f}, flag});
}
@@ -421,7 +421,7 @@ GPUBatch *DRW_cache_quad_wires_get(void)
int v = 0;
int flag = VCLASS_EMPTY_SCALED;
- float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
+ const float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
for (int a = 0; a < 5; a++) {
GPU_vertbuf_vert_set(vbo, v++, &(Vert){{p[a % 4][0], p[a % 4][1], 0.0f}, flag});
}
@@ -1650,7 +1650,7 @@ GPUBatch *DRW_cache_light_area_square_lines_get(void)
int flag = VCLASS_LIGHT_AREA_SHAPE;
for (int a = 0; a < 4; a++) {
for (int b = 0; b < 2; b++) {
- float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
+ const float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
float x = p[(a + b) % 4][0];
float y = p[(a + b) % 4][1];
GPU_vertbuf_vert_set(vbo, v++, &(Vert){{x * 0.5f, y * 0.5f, 0.0f}, flag});
@@ -2659,7 +2659,7 @@ GPUBatch *DRW_cache_camera_frame_get(void)
GPU_vertbuf_data_alloc(vbo, v_len);
int v = 0;
- float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
+ const float p[4][2] = {{-1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, -1.0f}};
/* Frame */
for (int a = 0; a < 4; a++) {
for (int b = 0; b < 2; b++) {
@@ -2740,7 +2740,7 @@ GPUBatch *DRW_cache_camera_tria_wire_get(void)
GPU_vertbuf_data_alloc(vbo, v_len);
int v = 0;
- float p[3][2] = {{-1.0f, 1.0f}, {1.0f, 1.0f}, {0.0f, 0.0f}};
+ const float p[3][2] = {{-1.0f, 1.0f}, {1.0f, 1.0f}, {0.0f, 0.0f}};
for (int a = 0; a < 3; a++) {
for (int b = 0; b < 2; b++) {
float x = p[(a + b) % 3][0];
@@ -3416,8 +3416,8 @@ GPUBatch *DRW_cache_cursor_get(bool crosshair_lines)
const int vert_len = segments + 8;
const int index_len = vert_len + 5;
- uchar red[3] = {255, 0, 0};
- uchar white[3] = {255, 255, 255};
+ const uchar red[3] = {255, 0, 0};
+ const uchar white[3] = {255, 255, 255};
static GPUVertFormat format = {0};
static struct {