Warning and error fixes

This commit is contained in:
Brad Davis 2016-04-15 01:43:09 -07:00
parent 3a969eed47
commit b50f835d35
3 changed files with 6 additions and 8 deletions

View file

@ -29,7 +29,7 @@ void FrameTimingsScriptingInterface::finish() {
_min = std::numeric_limits<uint64_t>::max();
_max = std::numeric_limits<uint64_t>::lowest();
size_t count = _values.size();
for (auto i = 0; i < count; ++i) {
for (size_t i = 0; i < count; ++i) {
const uint64_t& value = _values[i];
_max = std::max(_max, value);
_min = std::min(_min, value);
@ -37,7 +37,7 @@ void FrameTimingsScriptingInterface::finish() {
}
_mean = (float)total / (float)count;
float deviationTotal = 0;
for (auto i = 0; i < count; ++i) {
for (size_t i = 0; i < count; ++i) {
float deviation = _values[i] - _mean;
deviationTotal += deviation*deviation;
}
@ -46,8 +46,8 @@ void FrameTimingsScriptingInterface::finish() {
QVariantList FrameTimingsScriptingInterface::getValues() const {
QVariantList result;
for (const auto& v : _values) {
result << v;
for (quint64 v : _values) {
result << QVariant(v);
}
return result;
}

View file

@ -126,7 +126,7 @@ ShapeWrapperPtr loadPlane(ProgramPtr program, float aspect) {
}
ShapeWrapperPtr loadSkybox(ProgramPtr program) {
return ShapeWrapperPtr(new shapes::ShapeWrapper({ { "Position" } }, shapes::SkyBox(), *program));
return ShapeWrapperPtr(new shapes::ShapeWrapper(std::initializer_list<std::string>{ "Position" }, shapes::SkyBox(), *program));
}
// Return a point's cartesian coordinates on a sphere from pitch and yaw

View file

@ -422,11 +422,10 @@ public:
static const uint SHAPE_TEXTURES_OFFSET = sizeof(glm::vec4);
static const gpu::Element POSITION_ELEMENT { gpu::VEC3, gpu::FLOAT, gpu::XYZ };
static const gpu::Element TEXTURE_ELEMENT { gpu::VEC2, gpu::FLOAT, gpu::UV };
static const gpu::Type SHAPE_INDEX_TYPE = gpu::UINT16;
static const uint SHAPE_INDEX_SIZE = sizeof(gpu::uint16);
std::vector<vec4> vertices;
const int MINX = -1000;
const int MAXX = 1000;
// top
vertices.push_back(vec4(MAXX, 0, MAXX, 1));
vertices.push_back(vec4(MAXX, MAXX, 0, 0));
@ -456,7 +455,6 @@ public:
pipeline = gpu::Pipeline::create(shader, state);
vertexFormat->setAttribute(gpu::Stream::POSITION);
vertexFormat->setAttribute(gpu::Stream::TEXCOORD);
});
batch.setPipeline(pipeline);
batch.setInputBuffer(gpu::Stream::POSITION, positionView);