Remove Windows build protections
This commit is contained in:
parent
074faeb05a
commit
e5d32f58d3
1 changed files with 8 additions and 14 deletions
22
src/Main.cpp
22
src/Main.cpp
|
@ -15,9 +15,7 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if __linux__
|
#include <pwd.h>
|
||||||
#include <pwd.h>
|
|
||||||
#endif
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <packed/SharedResources.hpp>
|
#include <packed/SharedResources.hpp>
|
||||||
|
@ -113,17 +111,13 @@ int main()
|
||||||
PLAYFIELD_Y + ((float)GRID_HEIGHT * TILE_SIZE / 2) - (float)paused_texture_size.y / 2
|
PLAYFIELD_Y + ((float)GRID_HEIGHT * TILE_SIZE / 2) - (float)paused_texture_size.y / 2
|
||||||
);
|
);
|
||||||
|
|
||||||
#if __linux__
|
// https://stackoverflow.com/a/478088
|
||||||
// https://stackoverflow.com/a/478088
|
const char *homedir;
|
||||||
const char *homedir;
|
if ((homedir = getenv("HOME")) == NULL) {
|
||||||
if ((homedir = getenv("HOME")) == NULL) {
|
homedir = getpwuid(getuid())->pw_dir;
|
||||||
homedir = getpwuid(getuid())->pw_dir;
|
}
|
||||||
}
|
std::string highscore_file_path = homedir;
|
||||||
std::string highscore_file_path = homedir;
|
highscore_file_path += "/.septadrop";
|
||||||
highscore_file_path += "/.septadrop";
|
|
||||||
#else
|
|
||||||
std::string highscore_file_path = ".septadrop";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!std::filesystem::exists(highscore_file_path)) {
|
if (!std::filesystem::exists(highscore_file_path)) {
|
||||||
std::ofstream highscore_file(highscore_file_path);
|
std::ofstream highscore_file(highscore_file_path);
|
||||||
|
|
Loading…
Add table
Reference in a new issue