mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
Merge pull request #4360 from ZappoMan/transparentRAWheightmaps
add support for transparency in RAW heightmaps
This commit is contained in:
commit
d123ad5b76
1 changed files with 1 additions and 1 deletions
|
@ -648,7 +648,7 @@ void HeightfieldHeightEditor::select() {
|
||||||
const float CONVERSION_SCALE = 65534.0f / numeric_limits<quint16>::max();
|
const float CONVERSION_SCALE = 65534.0f / numeric_limits<quint16>::max();
|
||||||
for (int i = 0; i < rawSize; i++, dest += size) {
|
for (int i = 0; i < rawSize; i++, dest += size) {
|
||||||
for (quint16* lineDest = dest, *end = dest + rawSize; lineDest != end; lineDest++, src++) {
|
for (quint16* lineDest = dest, *end = dest + rawSize; lineDest != end; lineDest++, src++) {
|
||||||
*lineDest = (quint16)(*src * CONVERSION_SCALE) + CONVERSION_OFFSET;
|
*lineDest = (*src == 0) ? 0 : (quint16)(*src * CONVERSION_SCALE) + CONVERSION_OFFSET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit heightChanged(_height = new HeightfieldHeight(size, contents));
|
emit heightChanged(_height = new HeightfieldHeight(size, contents));
|
||||||
|
|
Loading…
Reference in a new issue