diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index fa9357f4eec..28e24e442ca 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -392,6 +392,7 @@ void wmOrtho2_pixelspace(const float x, const float y); /* utilities */ void WM_framebuffer_index_set(int index); +void WM_framebuffer_index_get(int index, int *r_col); int WM_framebuffer_to_index(unsigned int col); void WM_framebuffer_to_index_array(unsigned int *col, const unsigned int size); diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 1583f9f9095..6b286bd19a5 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -459,6 +459,13 @@ void WM_framebuffer_index_set(int index) cpack(col); } +void WM_framebuffer_index_get(int index, int *r_col) +{ + *r_col = index_to_framebuffer(index); +} + + + #define INDEX_FROM_BUF_8(col) (((col & 0xC00000) >> 18) + ((col & 0xC000) >> 12) + ((col & 0xC0) >> 6)) #define INDEX_FROM_BUF_12(col) (((col & 0xF00000) >> 12) + ((col & 0xF000) >> 8) + ((col & 0xF0) >> 4)) #define INDEX_FROM_BUF_15_16(col) (((col & 0xF80000) >> 9) + ((col & 0xF800) >> 6) + ((col & 0xF8) >> 3)) |