Changeset 8e8aed6 in opengl-game for new-game.cpp


Ignore:
Timestamp:
Oct 17, 2018, 4:58:33 AM (6 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
446e55d
Parents:
25b47d7
Message:

Fix some g++ compiler warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • new-game.cpp

    r25b47d7 r8e8aed6  
    795795
    796796         // this code moves the asteroids
    797          for (int i = 0; i < objects.size(); i++) {
     797         for (unsigned int i = 0; i < objects.size(); i++) {
    798798            if (objects[i]->type == TYPE_ASTEROID && !objects[i]->deleted) {
    799799               transformObject(*objects[i], translate(mat4(1.0f), vec3(0.0f, 0.0f, 0.04f)), ubo);
     
    12421242
    12431243   obj->normals.reserve(obj->points.size());
    1244    for (int i = 0; i < obj->points.size(); i += 9) {
     1244   for (unsigned int i = 0; i < obj->points.size(); i += 9) {
    12451245      vec3 point1 = vec3(obj->points[i], obj->points[i + 1], obj->points[i + 2]);
    12461246      vec3 point2 = vec3(obj->points[i + 3], obj->points[i + 4], obj->points[i + 5]);
     
    13301330
    13311331   // start from the second point
    1332    for (int i = 3; i < obj->points.size(); i += 3) {
     1332   for (unsigned int i = 3; i < obj->points.size(); i += 3) {
    13331333      if (min_x > obj->points[i]) {
    13341334         min_x = obj->points[i];
     
    13671367      obj->bounding_radius = radius_z;
    13681368
    1369    for (int i = 0; i < obj->points.size(); i += 3) {
     1369   for (unsigned int i = 0; i < obj->points.size(); i += 3) {
    13701370      obj->points[i] -= obj->bounding_center.x;
    13711371      obj->points[i + 1] -= obj->bounding_center.y;
     
    20222022
    20232023   glBindBuffer(GL_ARRAY_BUFFER, model_mat_idx_vbo);
    2024    for (int i = 0; i < obj.num_points; i++) {
     2024   for (unsigned int i = 0; i < obj.num_points; i++) {
    20252025      glBufferSubData(GL_ARRAY_BUFFER, (obj.vertex_vbo_offset + i) * sizeof(GLuint), sizeof(GLuint), &obj.ubo_offset);
    20262026   }
     
    20682068   // TODO: A lot of the values calculated here can be calculated once and saved when the laser is created,
    20692069   // and then re-used here
    2070 
    2071    mat4 new_model_transform = translate(mat4(1.0f), translation) * laser->model_transform;
    20722070
    20732071   vec3 start = vec3(laser->model_transform * vec4(0.0f, 0.0f, 0.0f, 1.0f));
     
    22842282   */
    22852283
    2286    stringstream ss;
    2287    ss << "FPS:   " << fps;
    2288 
    22892284   {
    22902285      ImGui::SetNextWindowSize(ImVec2(95, 46), ImGuiCond_Once);
     
    22952290         ImGuiWindowFlags_NoMove);
    22962291      ImGui::Text("Score: ???");
    2297       ImGui::Text(ss.str().c_str());
     2292      ImGui::Text("FPS:   %f", fps);
    22982293      ImGui::End();
    22992294   }
Note: See TracChangeset for help on using the changeset viewer.