diff options
author | Campbell Barton <campbell@blender.org> | 2022-01-31 05:01:27 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-01-31 05:06:56 +0300 |
commit | 9ccdad8a2173e14848fbfa5401210d8ffb074352 (patch) | |
tree | 6a5f8d56d35340d80ac7287ce2e89a46332f17b5 /source/blender/gpu/intern/gpu_select.c | |
parent | 57f6aa4d832cc24cc85ebc530dc6c8c51453120d (diff) |
Cleanup: use enum type for selection mode & internal algorithm enum
Diffstat (limited to 'source/blender/gpu/intern/gpu_select.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_select.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c index 958aab65b57..741df05799f 100644 --- a/source/blender/gpu/intern/gpu_select.c +++ b/source/blender/gpu/intern/gpu_select.c @@ -43,22 +43,22 @@ * \{ */ /* Internal algorithm used */ -enum { +typedef enum eGPUSelectAlgo { /** glBegin/EndQuery(GL_SAMPLES_PASSED... ), `gpu_select_query.c` * Only sets 4th component (ID) correctly. */ ALGO_GL_QUERY = 1, /** Read depth buffer for every drawing pass and extract depths, `gpu_select_pick.c` * Only sets 4th component (ID) correctly. */ ALGO_GL_PICK = 2, -}; +} eGPUSelectAlgo; typedef struct GPUSelectState { /* To ignore selection id calls when not initialized */ bool select_is_active; /* mode of operation */ - char mode; + eGPUSelectMode mode; /* internal algorithm for selection */ - char algorithm; + eGPUSelectAlgo algorithm; /* allow GPU_select_begin/end without drawing */ bool use_cache; /** @@ -80,7 +80,8 @@ static GPUSelectState g_select_state = {0}; /** \name Public API * \{ */ -void GPU_select_begin(uint *buffer, uint bufsize, const rcti *input, char mode, int oldhits) +void GPU_select_begin( + uint *buffer, uint bufsize, const rcti *input, eGPUSelectMode mode, int oldhits) { if (mode == GPU_SELECT_NEAREST_SECOND_PASS) { /* In the case hits was '-1', |