mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:37:20 +02:00
quiet compiler
This commit is contained in:
parent
2480402515
commit
c17c9f1818
6 changed files with 20 additions and 14 deletions
|
@ -35,14 +35,13 @@ void Rectangle3DOverlay::render(RenderArgs* args) {
|
||||||
if (!_visible) {
|
if (!_visible) {
|
||||||
return; // do nothing if we're not visible
|
return; // do nothing if we're not visible
|
||||||
}
|
}
|
||||||
|
|
||||||
float alpha = getAlpha();
|
float alpha = getAlpha();
|
||||||
xColor color = getColor();
|
xColor color = getColor();
|
||||||
const float MAX_COLOR = 255.0f;
|
const float MAX_COLOR = 255.0f;
|
||||||
glm::vec4 rectangleColor(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
glm::vec4 rectangleColor(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
||||||
|
|
||||||
glm::vec3 position = getPosition();
|
glm::vec3 position = getPosition();
|
||||||
glm::vec3 center = getCenter();
|
|
||||||
glm::vec2 dimensions = getDimensions();
|
glm::vec2 dimensions = getDimensions();
|
||||||
glm::vec2 halfDimensions = dimensions * 0.5f;
|
glm::vec2 halfDimensions = dimensions * 0.5f;
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
|
@ -67,7 +66,7 @@ void Rectangle3DOverlay::render(RenderArgs* args) {
|
||||||
glm::vec3 point2(halfDimensions.x, -halfDimensions.y, 0.0f);
|
glm::vec3 point2(halfDimensions.x, -halfDimensions.y, 0.0f);
|
||||||
glm::vec3 point3(halfDimensions.x, halfDimensions.y, 0.0f);
|
glm::vec3 point3(halfDimensions.x, halfDimensions.y, 0.0f);
|
||||||
glm::vec3 point4(-halfDimensions.x, halfDimensions.y, 0.0f);
|
glm::vec3 point4(-halfDimensions.x, halfDimensions.y, 0.0f);
|
||||||
|
|
||||||
geometryCache->renderDashedLine(*batch, point1, point2, rectangleColor);
|
geometryCache->renderDashedLine(*batch, point1, point2, rectangleColor);
|
||||||
geometryCache->renderDashedLine(*batch, point2, point3, rectangleColor);
|
geometryCache->renderDashedLine(*batch, point2, point3, rectangleColor);
|
||||||
geometryCache->renderDashedLine(*batch, point3, point4, rectangleColor);
|
geometryCache->renderDashedLine(*batch, point3, point4, rectangleColor);
|
||||||
|
|
|
@ -238,7 +238,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, uint32 paramOffset) {
|
||||||
|
|
||||||
std::vector<GLenum> drawBuffers;
|
std::vector<GLenum> drawBuffers;
|
||||||
if (masks & Framebuffer::BUFFER_COLORS) {
|
if (masks & Framebuffer::BUFFER_COLORS) {
|
||||||
for (int i = 0; i < Framebuffer::MAX_NUM_RENDER_BUFFERS; i++) {
|
for (unsigned int i = 0; i < Framebuffer::MAX_NUM_RENDER_BUFFERS; i++) {
|
||||||
if (masks & (1 << i)) {
|
if (masks & (1 << i)) {
|
||||||
drawBuffers.push_back(GL_COLOR_ATTACHMENT0 + i);
|
drawBuffers.push_back(GL_COLOR_ATTACHMENT0 + i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,17 +474,18 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
// IN DEBUG: light->setShowContour(true);
|
// IN DEBUG: light->setShowContour(true);
|
||||||
|
|
||||||
batch.setUniformBuffer(_spotLightLocations.lightBufferUnit, light->getSchemaBuffer());
|
batch.setUniformBuffer(_spotLightLocations.lightBufferUnit, light->getSchemaBuffer());
|
||||||
|
|
||||||
auto eyeLightPos = eyePoint - light->getPosition();
|
auto eyeLightPos = eyePoint - light->getPosition();
|
||||||
auto eyeHalfPlaneDistance = glm::dot(eyeLightPos, light->getDirection());
|
auto eyeHalfPlaneDistance = glm::dot(eyeLightPos, light->getDirection());
|
||||||
|
|
||||||
const float TANGENT_LENGTH_SCALE = 0.666f;
|
const float TANGENT_LENGTH_SCALE = 0.666f;
|
||||||
glm::vec4 coneParam(light->getSpotAngleCosSin(), TANGENT_LENGTH_SCALE * tan(0.5 * light->getSpotAngle()), 1.0f);
|
glm::vec4 coneParam(light->getSpotAngleCosSin(), TANGENT_LENGTH_SCALE * tanf(0.5f * light->getSpotAngle()), 1.0f);
|
||||||
|
|
||||||
float expandedRadius = light->getMaximumRadius() * (1.0f + SCALE_EXPANSION);
|
float expandedRadius = light->getMaximumRadius() * (1.0f + SCALE_EXPANSION);
|
||||||
// TODO: We shouldn;t have to do that test and use a different volume geometry for when inside the vlight volume,
|
// TODO: We shouldn;t have to do that test and use a different volume geometry for when inside the vlight volume,
|
||||||
// we should be able to draw thre same geometry use DepthClamp but for unknown reason it's s not working...
|
// we should be able to draw thre same geometry use DepthClamp but for unknown reason it's s not working...
|
||||||
if ((eyeHalfPlaneDistance > -nearRadius) && (glm::distance(eyePoint, glm::vec3(light->getPosition())) < expandedRadius + nearRadius)) {
|
if ((eyeHalfPlaneDistance > -nearRadius) &&
|
||||||
|
(glm::distance(eyePoint, glm::vec3(light->getPosition())) < expandedRadius + nearRadius)) {
|
||||||
coneParam.w = 0.0f;
|
coneParam.w = 0.0f;
|
||||||
batch._glUniform4fv(_spotLightLocations.coneParam, 1, reinterpret_cast< const GLfloat* >(&coneParam));
|
batch._glUniform4fv(_spotLightLocations.coneParam, 1, reinterpret_cast< const GLfloat* >(&coneParam));
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ void Item::Status::Value::setColor(float hue) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item::Status::getPackedValues(glm::ivec4& values) const {
|
void Item::Status::getPackedValues(glm::ivec4& values) const {
|
||||||
for (unsigned int i = 0; i < values.length(); i++) {
|
for (unsigned int i = 0; i < (unsigned int)values.length(); i++) {
|
||||||
if (i < _values.size()) {
|
if (i < _values.size()) {
|
||||||
values[i] = _values[i]().getPackedData();
|
values[i] = _values[i]().getPackedData();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -208,7 +208,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
|
||||||
int bitAt = 0;
|
int bitAt = 0;
|
||||||
int expectedBitCount; // unknown at this point
|
int expectedBitCount; // unknown at this point
|
||||||
int lastValueBit;
|
int lastValueBit;
|
||||||
for (int byte = 0; byte < size; byte++) {
|
for (unsigned int byte = 0; byte < size; byte++) {
|
||||||
char originalByte = data[byte];
|
char originalByte = data[byte];
|
||||||
bytesConsumed++;
|
bytesConsumed++;
|
||||||
unsigned char maskBit = 0x80; // LEFT MOST BIT set
|
unsigned char maskBit = 0x80; // LEFT MOST BIT set
|
||||||
|
|
|
@ -73,14 +73,18 @@ template <typename T>
|
||||||
void testByteCountCodedStable(const T& value) {
|
void testByteCountCodedStable(const T& value) {
|
||||||
ByteCountCoded<T> coder((T)value);
|
ByteCountCoded<T> coder((T)value);
|
||||||
auto encoded = coder.encode();
|
auto encoded = coder.encode();
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
auto originalEncodedSize = encoded.size();
|
auto originalEncodedSize = encoded.size();
|
||||||
|
#endif
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
encoded.append(qrand());
|
encoded.append(qrand());
|
||||||
}
|
}
|
||||||
ByteCountCoded<T> decoder;
|
ByteCountCoded<T> decoder;
|
||||||
decoder.decode(encoded);
|
decoder.decode(encoded);
|
||||||
Q_ASSERT(decoder.data == coder.data);
|
Q_ASSERT(decoder.data == coder.data);
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
auto consumed = decoder.decode(encoded.data(), encoded.size());
|
auto consumed = decoder.decode(encoded.data(), encoded.size());
|
||||||
|
#endif
|
||||||
Q_ASSERT(consumed == originalEncodedSize);
|
Q_ASSERT(consumed == originalEncodedSize);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -100,12 +104,12 @@ void testPropertyFlags(uint32_t value) {
|
||||||
EntityPropertyFlags original;
|
EntityPropertyFlags original;
|
||||||
original.clear();
|
original.clear();
|
||||||
auto enumSize = sizeof(EntityPropertyList);
|
auto enumSize = sizeof(EntityPropertyList);
|
||||||
for (size_t i = 0; i < sizeof(EntityPropertyList) * 8; ++i) {
|
for (size_t i = 0; i < enumSize * 8; ++i) {
|
||||||
original.setHasProperty((EntityPropertyList)i);
|
original.setHasProperty((EntityPropertyList)i);
|
||||||
}
|
}
|
||||||
QByteArray encoded = original.encode();
|
QByteArray encoded = original.encode();
|
||||||
auto originalSize = encoded.size();
|
// auto originalSize = encoded.size();
|
||||||
for (size_t i = 0; i < sizeof(EntityPropertyList); ++i) {
|
for (size_t i = 0; i < enumSize; ++i) {
|
||||||
encoded.append(qrand());
|
encoded.append(qrand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +120,9 @@ void testPropertyFlags(uint32_t value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_DEBUG
|
||||||
auto decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size());
|
auto decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size());
|
||||||
|
#endif
|
||||||
Q_ASSERT(originalSize == decodeSize);
|
Q_ASSERT(originalSize == decodeSize);
|
||||||
Q_ASSERT(decodeNew == original);
|
Q_ASSERT(decodeNew == original);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +135,7 @@ void testPropertyFlags() {
|
||||||
testPropertyFlags(0xFFFF);
|
testPropertyFlags(0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
{
|
{
|
||||||
auto start = usecTimestampNow();
|
auto start = usecTimestampNow();
|
||||||
|
|
Loading…
Reference in a new issue