Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision 4994692c43ddba22f532c23a33d0e66fa41c6ece)
+++ new-game.cpp	(revision 73a10caea6c4ac9731862d7f1ed503afd065643b)
@@ -162,11 +162,10 @@
 };
 
+/*** START OF REFACTORED CODE ***/
 void glfw_error_callback(int error, const char* description);
 
 void mouse_button_callback(GLFWwindow* window, int button, int action, int mods);
 void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
-/*** START OF REFACTORED CODE ***/
 void window_size_callback(GLFWwindow* window, int width, int height);
-/*** END OF REFACTORED CODE ***/
 
 void APIENTRY debugGlCallback(
@@ -179,4 +178,5 @@
    const void* userParam
 );
+/*** END OF REFACTORED CODE ***/
 
 bool faceClicked(array<vec3, 3> points, SceneObject* obj, vec4 world_ray, vec4 cam, vec4& click_point);
@@ -187,4 +187,5 @@
 unsigned char* loadImage(string file_name, int* x, int* y);
 
+/*** START OF REFACTORED CODE ***/
 void initObject(SceneObject* obj);
 void addObjectToScene(SceneObject* obj,
@@ -192,4 +193,5 @@
                   map<ObjectType, ShaderModelGroup>& modelGroups,
                   GLuint ubo);
+/*** END OF REFACTORED CODE ***/
 void removeObjectFromScene(SceneObject& obj, GLuint ubo);
 
@@ -198,4 +200,5 @@
 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);
@@ -203,4 +206,5 @@
 void bindUniformData(AttribInfo& attrib);
 void bindUniformData(AttribInfo& attrib, GLfloat* data);
+/*** END OF REFACTORED CODE ***/
 
 size_t GLsizeof(GLenum);
@@ -210,4 +214,5 @@
 void calculateObjectBoundingBox(SceneObject* obj);
 
+/*** START OF REFACTORED CODE ***/
 void populateBuffers(vector<SceneObject*>& objects,
                   map<GLuint, BufferInfo>& shaderBufferInfo,
@@ -226,9 +231,12 @@
 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);
 bool getLaserAndAsteroidIntersection(vec3& start, vec3& end, SceneObject& asteroid, vec3& intersection);
+/*** END OF REFACTORED CODE ***/
 
 void renderMainMenu();
@@ -253,4 +261,5 @@
 bool key_down[NUM_KEYS];
 
+/*** START OF REFACTORED CODE ***/
 int windowWidth = 640;
 int windowHeight = 480;
@@ -262,10 +271,12 @@
 
 vector<SceneObject*> objects;
+vector<EffectOverTime*> effects;
+/*** END OF REFACTORED CODE ***/
 queue<Event> events;
-vector<EffectOverTime*> effects;
 
 SceneObject* clickedObject = NULL;
 SceneObject* selectedObject = NULL;
 
+/*** START OF REFACTORED CODE ***/
 float NEAR_CLIP = 0.1f;
 float FAR_CLIP = 100.0f;
@@ -274,6 +285,4 @@
 bool isRunning = true;
 
-ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
-
 Laser* leftLaser = NULL;
 EffectOverTime* leftLaserEffect = NULL;
@@ -281,7 +290,9 @@
 Laser* rightLaser = NULL;
 EffectOverTime* rightLaserEffect = NULL;
+/*** END OF REFACTORED CODE ***/
 
 map<string, vector<UIValue>> valueLists;
 
+/*** START OF REFACTORED CODE ***/
 /*
 * TODO: Asteroid and ship movement currently depend on framerate, fix this in a generic/reusable way
@@ -289,5 +300,4 @@
 */
 
-/*** START OF REFACTORED CODE ***/
 // Helps to test logging during crashes
 void badFunc() {
@@ -570,4 +580,5 @@
    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;
@@ -655,8 +666,10 @@
 
    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"]);
@@ -685,4 +698,5 @@
    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 ***/
 
 
@@ -769,4 +783,5 @@
       if (curState == STATE_GAME) {
 
+/*** START OF REFACTORED CODE ***/
          elapsed_seconds_spawn += elapsedTime;
          if (elapsed_seconds_spawn > 0.5f) {
@@ -776,4 +791,5 @@
             elapsed_seconds_spawn -= 0.5f;
          }
+/*** END OF REFACTORED CODE ***/
 
          /*
@@ -786,4 +802,5 @@
          */
 
+/*** START OF REFACTORED CODE ***/
          /*
          if (key_state[GLFW_KEY_SPACE] == GLFW_PRESS) {
@@ -861,4 +878,5 @@
 
                      removeObjectFromScene(*objects[i], ubo);
+/*** END OF REFACTORED CODE ***/
                      score++;
 
@@ -871,4 +889,5 @@
                   }
                }
+/*** START OF REFACTORED CODE ***/
             }
          }
@@ -958,4 +977,5 @@
          cam_moved = false;
       }
+/*** END OF REFACTORED CODE ***/
 
       glUseProgram(modelGroups[TYPE_EXPLOSION].shaderProgram);
@@ -1426,4 +1446,5 @@
 }
 
+/*** START OF REFACTORED CODE ***/
 SceneObject* createShip() {
    SceneObject* ship = new SceneObject();
@@ -1896,4 +1917,5 @@
    return obj;
 }
+/*** END OF REFACTORED CODE ***/
 
 ShaderModelGroup createModelGroup(GLuint shaderProgram) {
@@ -1920,4 +1942,5 @@
 }
 
+/*** START OF REFACTORED CODE ***/
 void defineModelGroupAttrib(ShaderModelGroup& modelGroup, string name, AttribType attribType,
                   GLint size, GLenum type, size_t fieldOffset) {
@@ -1938,5 +1961,4 @@
 }
 
-/*** START OF REFACTORED CODE ***/
 void defineModelGroupUniform(ShaderModelGroup& modelGroup, string name, AttribType attribType,
                   GLint size, UniformType type, GLfloat* data) {
@@ -1977,5 +1999,4 @@
    }
 }
-/*** END OF REFACTORED CODE ***/
 
 void bindUniformData(AttribInfo& attrib) {
@@ -2010,4 +2031,5 @@
    }
 }
+/*** END OF REFACTORED CODE ***/
 
 /* The purpose of this function is to replace the use of sizeof() when calling
@@ -2393,5 +2415,4 @@
       ImGui::Text("Hello, world!");                           // Display some text (you can use a format string too)
       ImGui::SliderFloat("float", &f, 0.0f, 1.0f);            // Edit 1 float using a slider from 0.0f to 1.0f    
-      ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
 
       ImGui::Checkbox("Demo Window", &show_demo_window);      // Edit bools storing our windows open/close state
@@ -2528,4 +2549,5 @@
 }
 
+/*** START OF REFACTORED CODE ***/
 Asteroid* createAsteroid(vec3 pos) {
    Asteroid* obj = new Asteroid();
@@ -2649,4 +2671,5 @@
    return obj;
 }
+/*** END OF REFACTORED CODE ***/
 
 // TODO: Maybe pass in startTime instead of calling glfwGetTime() here
