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:
authorTon Roosendaal <ton@blender.org>2004-11-18 16:58:37 +0300
committerTon Roosendaal <ton@blender.org>2004-11-18 16:58:37 +0300
commite696cdfd70c8136a2725b35c67e763ac9a82cbf1 (patch)
treeb3e08117efc59810807aee4a04f26a938aa7e5b0
parentc7d8c44de999dcabe3c418f6f1babba452cf0786 (diff)
Bug fix for #1835
Found out the conversion functions for indices <-> framebuffer only went up to 18 bits, making selection in zbuffer-select (or vpaint/faceselect even) not work on large datasets. Provided you have 24 bits display, of course. This limit was just dangling in the code since long ago... modern times eh!
-rw-r--r--source/blender/src/mywindow.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/src/mywindow.c b/source/blender/src/mywindow.c
index b56b81001fc..1ef4e330107 100644
--- a/source/blender/src/mywindow.c
+++ b/source/blender/src/mywindow.c
@@ -504,7 +504,9 @@ unsigned int index_to_framebuffer(int index)
i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3);
i |= 0x070707;
break;
- default:
+ case 24:
+ break;
+ default: // 18 bits... not enuf
i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2);
i |= 0x030303;
break;
@@ -525,7 +527,9 @@ int framebuffer_to_index(unsigned int col)
case 15:
case 16:
return ((col & 0xF80000)>>9) + ((col & 0xF800)>>6) + ((col & 0xF8)>>3);
- default:
+ case 24:
+ return col & 0xFFFFFF;
+ default: // 18 bits...
return ((col & 0xFC0000)>>6) + ((col & 0xFC00)>>4) + ((col & 0xFC)>>2);
}
}