https://github.com/Robalni/red-eclipse (the main rewrite branch is called "crazy")
The goal with the rewrite is to make the code easier to read and maintain but not change how the game works. It must be compatible with the master branch of the official version. Some changes that are being done are:
- Move functions to new files, like video functions to video.cpp and input functions to input.cpp, and put them in namespaces or classes.
- Give functions and variables and other things more readable and describing names.
- Change the way code is written (like spaces and newlines) to make it more readable.
- Use the standard c++11 and some features from it, like nullptr and override. I don't know if we should use the standard library. There is a discussion about it here: http://redeclipse.net/forum/viewtopic.php?f=4&t=944
- Don't have function definitions in header files.
- Function definitions should not be too long. Split long functions into shorter ones.
- Lines should be shorter than 80 characters.
- Don't use too many global variables. Put them in classes, structs or namespaces.
- I'm using the file extension .hpp instead of .h for header files because otherwise my editor thinks it's C code.
- Write comments about what functions and classes do and how they should be used (unless it's too obvious).
Some noticeable changes right now that will not persist:
- The progress() function is disabled which causes the game not to render anything until it is done loading. This is just to make it easier and faster to test changes on the slow computer that I am currently using.
- The main loop is being rewritten and is not done yet. It can currently only handle menus. (playing the game doesn't work)
- It is possible that some variables and commands and other parts of the game are broken.
I don't know if everybody likes my coding style but i think it's better than what we currently have. Would you prefer another way of writing the code? Another thing is that the Makefile is gone and CMakeLists.txt is changed in some ways that works for me but I don't know about other operating systems. Is there a good reason to have a suffix (like "_linux") on the compiled binary? I removed it.
If you want to help me, that would be nice, or just tell me if I do bad things. Are there other changes you would like to see in the code?