mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 11:22:10 +02:00
Fix miscellaneous types and casts
This commit is contained in:
parent
0ac8f79d2e
commit
07b30da2ac
5 changed files with 8 additions and 8 deletions
|
@ -60,7 +60,7 @@
|
||||||
#include "AudioMixer.h"
|
#include "AudioMixer.h"
|
||||||
|
|
||||||
const float LOUDNESS_TO_DISTANCE_RATIO = 0.00001f;
|
const float LOUDNESS_TO_DISTANCE_RATIO = 0.00001f;
|
||||||
const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.18;
|
const float DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE = 0.18f;
|
||||||
const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.003f;
|
const float DEFAULT_NOISE_MUTING_THRESHOLD = 0.003f;
|
||||||
const QString AUDIO_MIXER_LOGGING_TARGET_NAME = "audio-mixer";
|
const QString AUDIO_MIXER_LOGGING_TARGET_NAME = "audio-mixer";
|
||||||
const QString AUDIO_ENV_GROUP_KEY = "audio_env";
|
const QString AUDIO_ENV_GROUP_KEY = "audio_env";
|
||||||
|
|
|
@ -26,8 +26,8 @@ namespace AudioConstants {
|
||||||
const int NETWORK_FRAME_BYTES_PER_CHANNEL = 512;
|
const int NETWORK_FRAME_BYTES_PER_CHANNEL = 512;
|
||||||
const int NETWORK_FRAME_SAMPLES_PER_CHANNEL = NETWORK_FRAME_BYTES_PER_CHANNEL / sizeof(AudioSample);
|
const int NETWORK_FRAME_SAMPLES_PER_CHANNEL = NETWORK_FRAME_BYTES_PER_CHANNEL / sizeof(AudioSample);
|
||||||
const float NETWORK_FRAME_MSECS = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL
|
const float NETWORK_FRAME_MSECS = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL
|
||||||
/ (float) AudioConstants::SAMPLE_RATE) * 1000.0;
|
/ (float)AudioConstants::SAMPLE_RATE) * 1000.0f;
|
||||||
const unsigned int NETWORK_FRAME_USECS = floorf(NETWORK_FRAME_MSECS * 1000.0);
|
const unsigned int NETWORK_FRAME_USECS = (int)floorf(NETWORK_FRAME_MSECS * 1000.0f);
|
||||||
const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
|
const int MIN_SAMPLE_VALUE = std::numeric_limits<AudioSample>::min();
|
||||||
const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max();
|
const int MAX_SAMPLE_VALUE = std::numeric_limits<AudioSample>::max();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1529,7 +1529,7 @@ HeightfieldNode* HeightfieldNode::paintMaterial(const glm::vec3& position, const
|
||||||
colorContents = _color->getContents();
|
colorContents = _color->getContents();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
colorContents = QByteArray(baseWidth * baseHeight * DataBlock::COLOR_BYTES, 0xFF);
|
colorContents = QByteArray(baseWidth * baseHeight * DataBlock::COLOR_BYTES, 0xFFu);
|
||||||
}
|
}
|
||||||
|
|
||||||
int materialWidth = baseWidth, materialHeight = baseHeight;
|
int materialWidth = baseWidth, materialHeight = baseHeight;
|
||||||
|
@ -1885,7 +1885,7 @@ HeightfieldNode* HeightfieldNode::clearAndFetchHeight(const glm::vec3& translati
|
||||||
spanner->setHeight(HeightfieldHeightPointer(new HeightfieldHeight(spannerHeightWidth,
|
spanner->setHeight(HeightfieldHeightPointer(new HeightfieldHeight(spannerHeightWidth,
|
||||||
QVector<quint16>(spannerHeightWidth * spannerHeightHeight))));
|
QVector<quint16>(spannerHeightWidth * spannerHeightHeight))));
|
||||||
spanner->setColor(HeightfieldColorPointer(new HeightfieldColor(spannerColorWidth,
|
spanner->setColor(HeightfieldColorPointer(new HeightfieldColor(spannerColorWidth,
|
||||||
QByteArray(spannerColorWidth * spannerColorHeight * DataBlock::COLOR_BYTES, 0xFF))));
|
QByteArray(spannerColorWidth * spannerColorHeight * DataBlock::COLOR_BYTES, 0xFFu))));
|
||||||
spanner->setMaterial(HeightfieldMaterialPointer(new HeightfieldMaterial(spannerMaterialWidth,
|
spanner->setMaterial(HeightfieldMaterialPointer(new HeightfieldMaterial(spannerMaterialWidth,
|
||||||
QByteArray(spannerMaterialWidth * spannerMaterialHeight, 0), QVector<SharedObjectPointer>())));
|
QByteArray(spannerMaterialWidth * spannerMaterialHeight, 0), QVector<SharedObjectPointer>())));
|
||||||
}
|
}
|
||||||
|
@ -2358,7 +2358,7 @@ void HeightfieldNode::mergeChildren(bool height, bool colorMaterial) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (colorWidth > 0) {
|
if (colorWidth > 0) {
|
||||||
QByteArray colorContents(colorWidth * colorHeight * DataBlock::COLOR_BYTES, 0xFF);
|
QByteArray colorContents(colorWidth * colorHeight * DataBlock::COLOR_BYTES, 0xFFu);
|
||||||
for (int i = 0; i < CHILD_COUNT; i++) {
|
for (int i = 0; i < CHILD_COUNT; i++) {
|
||||||
HeightfieldColorPointer childColor = _children[i]->getColor();
|
HeightfieldColorPointer childColor = _children[i]->getColor();
|
||||||
if (!childColor) {
|
if (!childColor) {
|
||||||
|
|
|
@ -802,7 +802,7 @@ void OctreeTests::propertyFlagsTests(bool verbose) {
|
||||||
qDebug() << "fill encoded byte array with extra garbage (as if it was bitstream with more content)";
|
qDebug() << "fill encoded byte array with extra garbage (as if it was bitstream with more content)";
|
||||||
}
|
}
|
||||||
QByteArray extraContent;
|
QByteArray extraContent;
|
||||||
extraContent.fill(0xba, 10);
|
extraContent.fill(0xbau, 10);
|
||||||
encoded.append(extraContent);
|
encoded.append(extraContent);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
|
|
@ -837,7 +837,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
|
||||||
if (block->command.arguments.size()) {
|
if (block->command.arguments.size()) {
|
||||||
// THe actual value of the var defined sneeds to be evaluated:
|
// THe actual value of the var defined sneeds to be evaluated:
|
||||||
String val;
|
String val;
|
||||||
for (int t = 1; t < block->command.arguments.size(); t++) {
|
for (unsigned int t = 1; t < block->command.arguments.size(); t++) {
|
||||||
// detect if a param is a var
|
// detect if a param is a var
|
||||||
int len = block->command.arguments[t].length();
|
int len = block->command.arguments[t].length();
|
||||||
if ((block->command.arguments[t][0] == Tag::VAR)
|
if ((block->command.arguments[t][0] == Tag::VAR)
|
||||||
|
|
Loading…
Reference in a new issue