Skip to content

Commit

Permalink
Corrected warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gray-heron committed Mar 14, 2019
1 parent 3fcb7de commit 139191e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void Mesh::RenderByOpenGL(OpenGLRenderingContext context, aiNode *node)
glEnableVertexAttribArray(1);
glEnableVertexAttribArray(2);

for (int i = 0; i < node->mNumMeshes; i++)
for (unsigned int i = 0; i < node->mNumMeshes; i++)
{
auto &obj = m_Entries[node->mMeshes[i]];

Expand Down Expand Up @@ -276,7 +276,7 @@ void Mesh::RenderByOpenGL(OpenGLRenderingContext context, aiNode *node)
glDisableVertexAttribArray(1);
glDisableVertexAttribArray(2);

for (int i = 0; i < node->mNumChildren; i++)
for (unsigned int i = 0; i < node->mNumChildren; i++)
{
RenderByOpenGL(context, node->mChildren[i]);
}
Expand All @@ -299,7 +299,7 @@ boost::optional<Intersection> Mesh::Raytrace(const glm::vec3 &source,
const auto &vertices = obj.first.vertices_;
const auto &indices = obj.first.indices_;

for (int i = 0; i < indices.size(); i += 3)
for (unsigned int i = 0; i < indices.size(); i += 3)
{
auto vertex1 = vertices[indices[i + 0]];
auto vertex2 = vertices[indices[i + 1]];
Expand Down
6 changes: 3 additions & 3 deletions src/raytracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ boost::optional<Intersection> Raytracer::Trace(glm::vec3 source, glm::vec3 targe
const Scene &scene)
{
boost::optional<Intersection> intersection_so_far;
auto intersection_dist_so_far = std::numeric_limits<float>::infinity();
// auto intersection_dist_so_far = std::numeric_limits<float>::infinity();
OpenGLRenderingContext ctx;
ctx.lights_ = scene.point_lights_;
ctx.ambient = scene.ambient_light_;
Expand All @@ -15,11 +15,11 @@ boost::optional<Intersection> Raytracer::Trace(glm::vec3 source, glm::vec3 targe
{
if (auto intersection = renderable->Raytrace(source, target, ctx, 1))
{
auto intersection_dist = glm::length(source - intersection->position);
// auto intersection_dist = glm::length(source - intersection->position);
// if (intersection_dist < intersection_dist_so_far)
//{
intersection_so_far = intersection;
intersection_dist_so_far = intersection_dist;
// intersection_dist_so_far = intersection_dist;
// }
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/view_raytracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void ViewRaytracer::TakePicture(glm::vec3 camera_pos, glm::mat4 mvp, const Scene
auto rt_func = [&](int x_start, int cols) -> void {
for (int x = x_start; x < x_start + cols; x += 1)
{
for (int y = 0; y < ry_; y += 1)
for (unsigned int y = 0; y < ry_; y += 1)
{
float xr = (float(x) - float(rx_ / 2)) / (float(rx_ / 2));
float yr = (float(y) - float(ry_ / 2)) / (float(ry_ / 2));
Expand Down Expand Up @@ -107,7 +107,7 @@ void ViewRaytracer::TakePicture(glm::vec3 camera_pos, glm::mat4 mvp, const Scene
auto threads_num = Config::inst().GetOption<int>("threads");
auto cols_per_thread = Config::inst().GetOption<int>("cols_per_thread");

for (int x = 0; x < rx_; x += threads_num * cols_per_thread)
for (unsigned int x = 0; x < rx_; x += threads_num * cols_per_thread)
{
std::vector<std::thread> threads;
for (int t = 0; t < threads_num; t++)
Expand Down

0 comments on commit 139191e

Please sign in to comment.