Latest commit 07cbaaf
Sep 26, 2011
Clock update in the main loop. I'm not convinced that this actually changes anything, but the serious computations by the engine have been moved to the beginning of the infinite main loop, moving the SFML-related event handling and drawing to the end. This groups the high-priority computations together since the engine shouldn't rely on event handling for important, time-sensitive operations and, of course, drawing is always done last. Additionally I realized that breaking the float returned from sf::Window::GetFrameTime() into its integer and fractional parts was unnecessary thanks to the normalization performed by the TimeStamp class and so it has been reduced to simply updating the clock in terms of the frame time given in milliseconds. One side note to all of this: my reason for making these changes was to do some slight optimization for the time-sensitive operations so that they would occur together. I did this because the logic for calculating elapsed time between events via the Timer interface seems to be working correctly. However, the printing from TextMove indicates that the time difference between every second or third event is negative which of course can't happen. For the moment I'm going to ignore this sinc it might be an artifact of the I/O for printing during the events which may be slower than the event firing. However, should it rear its head again, hopefully I will remember this.
I apologize in advance for anyone trying to use or contribute to this project. At current, it's a single wolf (myself, Chris Frisz (email@example.com)) trying to design a 2D game engine without reading about how other people design games in C++. I'm simply trying to address each design problem as quickly as possible using OOP design patterns. That said, the master branch should compile, even if the resulting executable doesn't do much interesting. The included makefile is fairly self-explanatory, but here's a list of the notable rules: all: Compiles all execuateable, evolver, along with the necessary classes. run: Compiles the executeable and run it. clean: Delete all ancilliary files (emacs backups, core dumps, etc.) and object files clobber: Delete all ancilliary files and compiled files (object files and executeable)