game: convert to C++ and fix all warnings