Permalink
Browse files

Merge pull request #45 from wzman/slotfix

select slot : fix channel bug and clear unstored vertex/face when loading slot
  • Loading branch information...
rygorous committed Jun 5, 2012
2 parents 55937e5 + 9dcd57e commit 5c3c958603fa9a62614c58644d96420197f56e53
Showing with 11 additions and 1 deletion.
  1. +6 −0 altona_wz4/wz4/wz4frlib/wz4_mesh.cpp
  2. +5 −1 altona_wz4/wz4/wz4frlib/wz4_mesh_ops.ops
@@ -2686,6 +2686,10 @@ void Wz4Mesh::SelStoreLoad(sInt mode, sInt type, sInt slot)
switch(type)
{
case wMST_VERTEX:
+ // clear vertices selection
+ sFORALL(Vertices,v)
+ v->Select = 0.0f;
+
// read all vertices stored and set selection
for(int i=0; i<SelVertices[slot].GetCount(); i++)
Vertices[SelVertices[slot][i].Id].Select = SelVertices[slot][i].Selected;
@@ -2700,6 +2704,8 @@ void Wz4Mesh::SelStoreLoad(sInt mode, sInt type, sInt slot)
{
if((f->Selected & (1 << slot)) > 0)
f->Select = 1;
+ else
+ f->Select = 0;
}
// clear vertices selection
@@ -1653,7 +1653,11 @@ operator Wz4Mesh Select(Wz4Mesh,?GenBitmap)
}
// face or vertex ?
- sInt type = ((para->Flags&48)==0)?wMST_VERTEX:wMST_FACE;
+ sInt type = 0;
+ if(((para->Flags&0x1c0)!=0x1c0))
+ type = (selectVerts)?wMST_VERTEX:wMST_FACE;
+ if(((para->Flags&0x1c0)==0x1c0))
+ type = ((para->Flags >> 4) & 1)?wMST_FACE:wMST_VERTEX;
// load slot
if(((para->Flags&0x1c0)==0x1c0))

0 comments on commit 5c3c958

Please sign in to comment.