Archived
1
Fork 0

Check game config before writing or reading it

This commit is contained in:
Joshua Goins 2018-10-17 17:19:38 -04:00
parent b700ed3111
commit e010cb356b

View file

@ -47,6 +47,8 @@ int toInt(const std::string &str) {
void readConfig() {
std::ifstream file("config.txt");
if(!file)
return;
std::string line;
while(std::getline(file, line)) {
@ -72,6 +74,8 @@ void readConfig() {
void writeConfig() {
std::ofstream file("config.txt");
if(!file)
return;
int x, y;
SDL_GetWindowPosition(window, &x, &y);