Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision 73a10caea6c4ac9731862d7f1ed503afd065643b)
+++ new-game.cpp	(revision e1f88a9873d22257993a07f9c790d1739e9961db)
@@ -47,4 +47,5 @@
 };
 
+/*** START OF REFACTORED CODE ***/
 enum ObjectType {
    TYPE_SHIP,
@@ -67,4 +68,5 @@
    UNIFORM_3F,
 };
+/*** END OF REFACTORED CODE ***/
 
 enum UIValueType {
@@ -73,4 +75,5 @@
 };
 
+/*** START OF REFACTORED CODE ***/
 struct SceneObject {
    unsigned int id;
@@ -153,4 +156,5 @@
    unsigned int vboCapacity;
 };
+/*** END OF REFACTORED CODE ***/
 
 struct UIValue {
@@ -193,5 +197,4 @@
                   map<ObjectType, ShaderModelGroup>& modelGroups,
                   GLuint ubo);
-/*** END OF REFACTORED CODE ***/
 void removeObjectFromScene(SceneObject& obj, GLuint ubo);
 
@@ -200,5 +203,4 @@
 void addModelToGroup(ShaderModelGroup& modelGroup, SceneObject& model);
 
-/*** START OF REFACTORED CODE ***/
 void defineModelGroupAttrib(ShaderModelGroup& modelGroup, string name, AttribType attribType, GLint size, GLenum type, size_t fieldOffset);
 void defineModelGroupUniform(ShaderModelGroup& modelGroup, string name, AttribType attribType, GLint size, UniformType type, GLfloat* data);
@@ -206,5 +208,4 @@
 void bindUniformData(AttribInfo& attrib);
 void bindUniformData(AttribInfo& attrib, GLfloat* data);
-/*** END OF REFACTORED CODE ***/
 
 size_t GLsizeof(GLenum);
@@ -214,5 +215,4 @@
 void calculateObjectBoundingBox(SceneObject* obj);
 
-/*** START OF REFACTORED CODE ***/
 void populateBuffers(vector<SceneObject*>& objects,
                   map<GLuint, BufferInfo>& shaderBufferInfo,
@@ -231,8 +231,6 @@
 Asteroid* createAsteroid(vec3 pos);
 Laser* createLaser(vec3 start, vec3 end, vec3 color, GLfloat width);
-/*** END OF REFACTORED CODE ***/
 ParticleEffect* createExplosion(mat4 model_mat);
 
-/*** START OF REFACTORED CODE ***/
 void translateLaser(Laser* laser, const vec3& translation, GLuint ubo);
 void updateLaserTarget(Laser* laser, vector<SceneObject*>& objects, ShaderModelGroup& laserSmg, GLuint asteroid_sp);
@@ -254,7 +252,9 @@
 
 const int KEY_STATE_UNCHANGED = -1;
+/*** START OF REFACTORED CODE ***/
 const bool FULLSCREEN = false;
 const int EXPLOSION_PARTICLE_COUNT = 300;
 unsigned int MAX_UNIFORMS = 0; // Requires OpenGL constants only available at runtime, so it can't be const
+/*** END OF REFACTORED CODE ***/
 
 int key_state[NUM_KEYS];
@@ -381,5 +381,4 @@
       cout << "OpenGL debug message callback is not supported" << endl;
    }
-/*** END OF REFACTORED CODE ***/
 
    srand(time(0));
@@ -409,5 +408,4 @@
    cout << "MAX_UNIFORMS: " << MAX_UNIFORMS << endl;
 
-/*** START OF REFACTORED CODE ***/
    // Setup Dear ImGui binding
    IMGUI_CHECKVERSION();
@@ -489,4 +487,5 @@
     */
 
+/*** START OF REFACTORED CODE ***/
    GLfloat laserColor[3] = {0.2f, 1.0f, 0.2f};
    GLfloat curTime, prevTime, elapsedTime;
@@ -498,5 +497,4 @@
    map<ObjectType, ShaderModelGroup> modelGroups;
 
-/*** START OF REFACTORED CODE ***/
    modelGroups[TYPE_SHIP] = createModelGroup(
       loadShaderProgram("gl-shaders/ship.vert", "gl-shaders/ship.frag"));
@@ -558,5 +556,4 @@
 
    initModelGroupAttribs(modelGroups[TYPE_LASER]);
-/*** END OF REFACTORED CODE ***/
 
    modelGroups[TYPE_EXPLOSION] = createModelGroup(
@@ -580,5 +577,4 @@
    initModelGroupAttribs(modelGroups[TYPE_EXPLOSION]);
 
-/*** START OF REFACTORED CODE ***/
    cam_pos = vec3(0.0f, 0.0f, 2.0f);
    float cam_yaw = 0.0f * 2.0f * 3.14159f / 360.0f;
@@ -666,10 +662,8 @@
 
    GLuint laser_sp_models_ub_index = glGetUniformBlockIndex(modelGroups[TYPE_LASER].shaderProgram, "models");
-/*** END OF REFACTORED CODE ***/
 
    GLuint explosion_sp_models_ub_index = glGetUniformBlockIndex(modelGroups[TYPE_EXPLOSION].shaderProgram, "models");
 
 
-/*** START OF REFACTORED CODE ***/
    glUseProgram(modelGroups[TYPE_SHIP].shaderProgram);
    bindUniformData(modelGroups[TYPE_SHIP].attribs["view"]);
@@ -698,5 +692,4 @@
    glUniformBlockBinding(modelGroups[TYPE_LASER].shaderProgram, laser_sp_models_ub_index, ub_binding_point);
    glBindBufferRange(GL_UNIFORM_BUFFER, ub_binding_point, ubo, 0, GL_MAX_UNIFORM_BLOCK_SIZE);
-/*** END OF REFACTORED CODE ***/
 
 
@@ -707,4 +700,5 @@
    glUniformBlockBinding(modelGroups[TYPE_EXPLOSION].shaderProgram, explosion_sp_models_ub_index, ub_binding_point);
    glBindBufferRange(GL_UNIFORM_BUFFER, ub_binding_point, ubo, 0, GL_MAX_UNIFORM_BLOCK_SIZE);
+/*** END OF REFACTORED CODE ***/
 
 
@@ -881,4 +875,5 @@
                      score++;
 
+/*** START OF REFACTORED CODE ***/
                      addObjectToScene(createExplosion(model_mat), shaderBufferInfo, modelGroups, ubo);
                   }
@@ -889,5 +884,4 @@
                   }
                }
-/*** START OF REFACTORED CODE ***/
             }
          }
@@ -977,10 +971,8 @@
          cam_moved = false;
       }
-/*** END OF REFACTORED CODE ***/
 
       glUseProgram(modelGroups[TYPE_EXPLOSION].shaderProgram);
       bindUniformData(modelGroups[TYPE_EXPLOSION].attribs["cur_time"]);
 
-/*** START OF REFACTORED CODE ***/
       // Render scene
 
@@ -1200,4 +1192,5 @@
 
 
+/*** START OF REFACTORED CODE ***/
 GLuint loadShader(GLenum type, string file) {
   cout << "Loading shader from file " << file << endl;
@@ -1279,4 +1272,5 @@
   return image_data;
 }
+/*** END OF REFACTORED CODE ***/
 
 bool faceClicked(array<vec3, 3> points, SceneObject* obj, vec4 world_ray, vec4 cam, vec4& click_point) {
@@ -1324,4 +1318,5 @@
 }
 
+/*** START OF REFACTORED CODE ***/
 // TODO: Pass a reference, not a pointer
 void initObject(SceneObject* obj) {
@@ -1446,5 +1441,4 @@
 }
 
-/*** START OF REFACTORED CODE ***/
 SceneObject* createShip() {
    SceneObject* ship = new SceneObject();
@@ -1917,5 +1911,4 @@
    return obj;
 }
-/*** END OF REFACTORED CODE ***/
 
 ShaderModelGroup createModelGroup(GLuint shaderProgram) {
@@ -1942,5 +1935,4 @@
 }
 
-/*** START OF REFACTORED CODE ***/
 void defineModelGroupAttrib(ShaderModelGroup& modelGroup, string name, AttribType attribType,
                   GLint size, GLenum type, size_t fieldOffset) {
@@ -2031,5 +2023,4 @@
    }
 }
-/*** END OF REFACTORED CODE ***/
 
 /* The purpose of this function is to replace the use of sizeof() when calling
@@ -2403,4 +2394,5 @@
    glDisable(GL_BLEND);
 }
+/*** END OF REFACTORED CODE ***/
 
 void renderSceneGui(map<string, vector<UIValue>> valueLists) {
@@ -2671,5 +2663,4 @@
    return obj;
 }
-/*** END OF REFACTORED CODE ***/
 
 // TODO: Maybe pass in startTime instead of calling glfwGetTime() here
@@ -2703,2 +2694,3 @@
    return obj;
 }
+/*** END OF REFACTORED CODE ***/
