Fix Far::StencilTablesFactory introduced in re-factor

- big stencil initialization was incorrect
This commit is contained in:
manuelk 2014-10-22 11:57:49 -07:00
parent 8e5426d93e
commit f1ac01ca84

View File

@ -86,9 +86,11 @@ public:
// Adds the contribution of a supporting vertex that was not yet
// in the stencil
void PushBackVertex(Index stencil, Index vert, float weight) {
assert(weight!=0.0f);
unsigned char & size = _sizes[stencil];
Index idx = stencil * _maxsize + size;
Index idx = stencil*_maxsize;
if (size < (_maxsize-1)) {
idx += size;
_indices[idx] = vert;
_weights[idx] = weight;
} else {
@ -210,10 +212,11 @@ public:
void PushBackVertex(Index stencil,
Index vert, float weight, float tan1Weight, float tan2Weight) {
assert(weight!=0.0f);
unsigned char & size = this->_sizes[stencil];
Index idx = stencil * this->_maxsize + size;
Index idx = stencil*this->_maxsize;
if (size < (this->_maxsize-1)) {
idx += size;
this->_indices[idx] = vert;
this->_weights[idx] = weight;
this->_tan1Weights[idx] = tan1Weight;