diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-10 04:01:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-10 04:01:44 +0400 |
commit | 7b3ea6cc2caf1df9c510a97a3272924f1a51a768 (patch) | |
tree | 8e51ede796703ec141340403cb6b95c0b7a2cc5a /source/blender/editors/space_view3d/drawmesh.c | |
parent | 39c4e3ae3c9668f8d5b3ba1e901b824a747db02e (diff) |
mesh VBO drawing code was swapping red/blue vertex colors - this is confusing because MCol.r is blue and MCol.b is red but not excuse! (and how come nobody noticed this?).
- fixed this error in 4 places.
Diffstat (limited to 'source/blender/editors/space_view3d/drawmesh.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 3cb55c0c10a..76263f5ac3d 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -450,9 +450,9 @@ static void add_tface_color_layer(DerivedMesh *dm) } } else if (tface && tface->mode&TF_OBCOL) { for(j=0;j<4;j++) { - finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[0]); + finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[0]); finalCol[i*4+j].g = FTOCHAR(Gtexdraw.obcol[1]); - finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[2]); + finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[2]); } } else if (!mcol) { if (tface) { @@ -471,9 +471,9 @@ static void add_tface_color_layer(DerivedMesh *dm) else copy_v3_v3(col, &ma->r); for(j=0;j<4;j++) { - finalCol[i*4+j].b = FTOCHAR(col[2]); + finalCol[i*4+j].b = FTOCHAR(col[0]); finalCol[i*4+j].g = FTOCHAR(col[1]); - finalCol[i*4+j].r = FTOCHAR(col[0]); + finalCol[i*4+j].r = FTOCHAR(col[2]); } } else @@ -485,9 +485,9 @@ static void add_tface_color_layer(DerivedMesh *dm) } } else { for(j=0;j<4;j++) { - finalCol[i*4+j].b = mcol[i*4+j].r; + finalCol[i*4+j].r = mcol[i*4+j].r; finalCol[i*4+j].g = mcol[i*4+j].g; - finalCol[i*4+j].r = mcol[i*4+j].b; + finalCol[i*4+j].b = mcol[i*4+j].b; } } } |