Closed khedoros closed 6 years ago
Hey @khedoros , thanks for the feedback.
These both seem like valid concerns. Differences in our software/hardware are probably the root cause :smile:
Feel free to open a pull request. I'd be happy to take these changes.
From the source directory, I built the game like this using gcc 4.8.5 and SDL 2.0.3:
g++ -std=c++11 Main.cpp Emulation/*.cpp SMB/*.cpp Util/*.cpp -o smb -lSDL2
First, the compilation errors:
In
SMB/SMBEngine.cpp
, there's amemcpy
with a cast toptrdiff_t
. My compiler wasn't happy unless that wasstd::ptrdiff_t
.Similarly in
SMB/SMBEngine.hpp
, the declaration ofwriteData
that takes asize_t
argument neededstd::size_t
.The game itself ran insanely fast. Granted, I didn't look very hard, but I didn't see any framerate limit code.
In
Main.cpp
, right beforewhile (running)
, I added:Inside that main loop block, after the call to
SDL_RenderPresent(renderer);
, I added the following:It's not super elegant, but it works pretty well to correct the framerate to 60FPS.