I’ve had a short break from programming at home because I’ve been programming at work! My new job is a software engineering job, and I’ve been struggling working out how to find time to do things at night while working during the day.
The answer is to not go out and do anything, but that’s tough this end of the year with, so I’ll take it as I go.
I’ve finished my first pass at refactoring, here’s the copy paste:
Main: "Game.h" Game: "InputHandler.h" "RenderHandler.h" "ShaderGroup.h" "Physics.h" "PlayerHandler.h" "SoundHandler.h" Physics: "Actor.h" "Scene.h" SoundHandler: <string> <map> "fmod.h" "fmod.hpp" "fmod_errors.h" InputHandler: "Keyboard.h" "Mouse.h" "Joystick.h" Keyboard: <SDL.h> "glm_libraries.h" Mouse: <SDL.h> <vector> "glm_libraries.h" Joystick: <SDL.h> <iostream> <vector> "glm_libraries.h" GLsupport <GL/glew.h> <GL/freeglut.h> <SDL.h> <SDL_opengl.h> <stdio.h> glm_libraries: "glm/glm.hpp" "glm/gtc/matrix_transform.hpp" "glm/gtc/constants.hpp" "glm/gtc/matrix_access.hpp" "glm/gtc/matrix_inverse.hpp" "glm/gtc/type_ptr.hpp" "glm/gtc/quaternion.hpp" "glm/gtx/quaternion.hpp" RenderHandler: "Actor.h" "CameraHandler.h" "WindowHandler.h" "ModelHandler.h" CameraHandler: "glm_libraries.h" WindowHandler: "SDL.h" "glm_libraries.h" ModelHandler: <map> "Model.h" "ShaderGroup.h" Actor: "Model.h" "ShaderGroup.h" "CollisionHandler.h" "RigidBody.h" "PlayerHandler.h" Model: "Face.h" Face: <vector> "Vertex.h" "GLsupport.h" Vertex: //Get rid of material dependency. "Material.h" Material: <string> "glm_libraries.h" ShaderGroup: <string> "Utils.h" CollisionHandler <vector> "glm_libraries.h" RigidBody: "Model.h" PlayerHandler #"RigidBody.h" Utils: <inttypes.h> <iostream> <fstream> <math.h> <sstream> <stdlib.h> <stdio.h> <string> <time.h> <vector> "glm_libraries.h" "GLsupport.h" "lodepng.h"
Gosh, what a mess, what is going on here? Well, I’m looking to make sure that my classes are logically ordered and I’m trying to block them off into related fields. When I first started writing, I made some effort to follow good coding standards, however as I was struggling to learn C++ at the beginning, I had to make a few sacrifices.
Now I’m going back with my better experiences and restructuring the code. It’s taken awhile, however it’s nearly done, and it’s well worth the effort.
The main things to do now are to fully separate the joystick/camera logic from each other, and re-do the Vertex class so that it no longer requires a Material component to do it’s job.
I also want to get rid of the Utils.h class and properly assign the required libraries to each class that needs it. One of my first posts on this blog was explaining why I needed to do things the way they are here; three years later I’m well beyond needing to collate all my libraries in a single repository. This is one of the last legacy files from when I started the engine, and I’ve already cut a big chunk out of it.
After that, it’s on to AI, and getting the enemy ships to move around.
There’s a Ludum Dare coming up in December, and Global Game Jam in January. Much of the engine is ‘nearly done’, and it won’t be long before I’m able to properly compete in these events.
***
Man I have no idea what week to put this under, but it’s December 1. I’ve finished refactoring utils out of the game; now I just have to finish separating joystick from the camera controls.