History

Another tweak.

Andrzej Kapolka committed 11 years ago

Commit b8a15f01 parent c124dff1 file · +12 −4Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+12−4
@@ -1542,13 +1542,21 @@ static inline void appendTriangle(const EdgeCrossing& e0, const EdgeCrossing& e1 · 1541 unmodified lines
1542 1542
1543const int CORNER_COUNT = 4;1543const int CORNER_COUNT = 4;
1544 1544
1545static inline StackArray::Entry getEntry(const StackArray* lineSrc, int stackWidth, int y, float heightfieldHeight,1545static StackArray::Entry getEntry(const StackArray* lineSrc, int stackWidth, int y, float heightfieldHeight,
1546 EdgeCrossing cornerCrossings[CORNER_COUNT], int cornerIndex) {1546 EdgeCrossing cornerCrossings[CORNER_COUNT], int cornerIndex) {
1547 int offsetX = (cornerIndex & X_MAXIMUM_FLAG) ? 1 : 0;
1548 int offsetZ = (cornerIndex & Y_MAXIMUM_FLAG) ? 1 : 0;
1549 const StackArray& src = lineSrc[offsetZ * stackWidth + offsetX];
1550 int count = src.getEntryCount();
1551 if (count > 0) {
1552 int relative = y - src.getPosition();
1553 if (relative < count && (relative >= 0 || heightfieldHeight == 0.0f)) {
1554 return src.getEntry(y, heightfieldHeight);
1555 }
1556 }
1547 const EdgeCrossing& cornerCrossing = cornerCrossings[cornerIndex];1557 const EdgeCrossing& cornerCrossing = cornerCrossings[cornerIndex];
1548 if (cornerCrossing.point.y == 0.0f) {1558 if (cornerCrossing.point.y == 0.0f) {
1549 int offsetX = (cornerIndex & X_MAXIMUM_FLAG) ? 1 : 0;1559 return src.getEntry(y, heightfieldHeight);
1550 int offsetZ = (cornerIndex & Y_MAXIMUM_FLAG) ? 1 : 0;
1551 return lineSrc[offsetZ * stackWidth + offsetX].getEntry(y, heightfieldHeight);
1552 }1560 }
1553 StackArray::Entry entry;1561 StackArray::Entry entry;
1554 bool set = false;1562 bool set = false;