Commit: 704a213674f296985d17b32873057bb60b6e3116
Author: Campbell Barton
Date:   Wed Mar 8 03:51:07 2017 +1100
Branches: temp-select-pick
https://developer.blender.org/rB704a213674f296985d17b32873057bb60b6e3116

Rename select_method -> algorithm

===================================================================

M       source/blender/gpu/intern/gpu_select.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_select.c 
b/source/blender/gpu/intern/gpu_select.c
index b21b850685..b8d5fb55b7 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -46,10 +46,11 @@
 
 #include "gpu_select_private.h"
 
+/* Internal algorithm used */
 enum {
-       SELECT_METHOD_GL_LEGACY = 1,
-       SELECT_METHOD_GL_QUERY = 2,
-       SELECT_METHOD_GL_PICK = 3,
+       ALGO_GL_LEGACY = 1,
+       ALGO_GL_QUERY = 2,
+       ALGO_GL_PICK = 3,
 };
 
 typedef struct GPUSelectState {
@@ -60,7 +61,7 @@ typedef struct GPUSelectState {
        /* mode of operation */
        char mode;
        /* internal algorithm for selection */
-       char select_method;
+       char algorithm;
        /* allow GPU_select_begin/end without drawing */
        bool use_cache;
 } GPUSelectState;
@@ -77,17 +78,17 @@ void GPU_select_begin(unsigned int *buffer, unsigned int 
bufsize, const rcti *in
        g_select_state.mode = mode;
 
        if (!g_select_state.use_gpu_select) {
-               g_select_state.select_method = SELECT_METHOD_GL_LEGACY;
+               g_select_state.algorithm = ALGO_GL_LEGACY;
        }
        else if (ELEM(g_select_state.mode, GPU_SELECT_PICK_SORT_ALL, 
GPU_SELECT_PICK_SORT_NEAREST)) {
-               g_select_state.select_method = SELECT_METHOD_GL_PICK;
+               g_select_state.algorithm = ALGO_GL_PICK;
        }
        else {
-               g_select_state.select_method = SELECT_METHOD_GL_QUERY;
+               g_select_state.algorithm = ALGO_GL_QUERY;
        }
 
-       switch (g_select_state.select_method) {
-               case SELECT_METHOD_GL_LEGACY:
+       switch (g_select_state.algorithm) {
+               case ALGO_GL_LEGACY:
                {
                        g_select_state.use_cache = false;
                        glSelectBuffer(bufsize, (GLuint *)buffer);
@@ -96,13 +97,13 @@ void GPU_select_begin(unsigned int *buffer, unsigned int 
bufsize, const rcti *in
                        glPushName(-1);
                        break;
                }
-               case SELECT_METHOD_GL_QUERY:
+               case ALGO_GL_QUERY:
                {
                        g_select_state.use_cache = false;
                        gpu_select_query_begin((unsigned int (*)[4])buffer, 
bufsize / 4, input, mode, oldhits);
                        break;
                }
-               default:  /* SELECT_METHOD_GL_PICK */
+               default:  /* ALGO_GL_PICK */
                {
                        gpu_select_pick_begin((unsigned int (*)[4])buffer, 
bufsize / 4, input, mode);
                        break;
@@ -123,17 +124,17 @@ bool GPU_select_load_id(unsigned int id)
        if (!g_select_state.select_is_active)
                return true;
 
-       switch (g_select_state.select_method) {
-               case SELECT_METHOD_GL_LEGACY:
+       switch (g_select_state.algorithm) {
+               case ALGO_GL_LEGACY:
                {
                        glLoadName(id);
                        return true;
                }
-               case SELECT_METHOD_GL_QUERY:
+               case ALGO_GL_QUERY:
                {
                        return gpu_select_query_load_id(id);
                }
-               default:  /* SELECT_METHOD_GL_PICK */
+               default:  /* ALGO_GL_PICK */
                {
                        return gpu_select_pick_load_id(id);
                }
@@ -149,19 +150,19 @@ unsigned int GPU_select_end(void)
 {
        unsigned int hits = 0;
 
-       switch (g_select_state.select_method) {
-               case SELECT_METHOD_GL_LEGACY:
+       switch (g_select_state.algorithm) {
+               case ALGO_GL_LEGACY:
                {
                        glPopName();
                        hits = glRenderMode(GL_RENDER);
                        break;
                }
-               case SELECT_METHOD_GL_QUERY:
+               case ALGO_GL_QUERY:
                {
                        hits = gpu_select_query_end();
                        break;
                }
-               default:  /* SELECT_METHOD_GL_PICK */
+               default:  /* ALGO_GL_PICK */
                {
                        hits = gpu_select_pick_end();
                        break;
@@ -198,7 +199,7 @@ void GPU_select_cache_begin(void)
        /* validate on GPU_select_begin, clear if not supported */
        BLI_assert(g_select_state.use_cache == false);
        g_select_state.use_cache = true;
-       if (g_select_state.select_method == SELECT_METHOD_GL_PICK) {
+       if (g_select_state.algorithm == ALGO_GL_PICK) {
                gpu_select_pick_cache_begin();
        }
 }
@@ -206,14 +207,14 @@ void GPU_select_cache_begin(void)
 void GPU_select_cache_load_id(void)
 {
        BLI_assert(g_select_state.use_cache == true);
-       if (g_select_state.select_method == SELECT_METHOD_GL_PICK) {
+       if (g_select_state.algorithm == ALGO_GL_PICK) {
                gpu_select_pick_cache_load_id();
        }
 }
 
 void GPU_select_cache_end(void)
 {
-       if (g_select_state.select_method == SELECT_METHOD_GL_PICK) {
+       if (g_select_state.algorithm == ALGO_GL_PICK) {
                gpu_select_pick_cache_end();
        }
        g_select_state.use_cache = false;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to