mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Added Windows compiled files to .gitignore.
Added "WIN32" preprocessor definition to the default VS2010 project. Replaced getHomePath() with the one mentioned in the pull request comments.
This commit is contained in:
parent
8803266660
commit
0f6338045a
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -11,11 +11,17 @@
|
|||
*.la
|
||||
*.a
|
||||
|
||||
# And on Windows
|
||||
*.dll
|
||||
*.pdb
|
||||
*.exe.manifest
|
||||
|
||||
# Dependency makefiles
|
||||
*.d
|
||||
|
||||
#Compiled executable
|
||||
emulationstation
|
||||
emulationstation.exe
|
||||
|
||||
#build directory
|
||||
EmulationStation_vs2010
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_DESKTOP_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DESKTOP_;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>SDLmain.lib;SDL.lib;FreeImage.lib;freetype.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
|
|
@ -3,10 +3,26 @@
|
|||
|
||||
std::string getHomePath()
|
||||
{
|
||||
//this gives you something like "/home/YOUR_USERNAME" on Linux and "C:\Users\YOUR_USERNAME\" on Windows
|
||||
const char* home = getenv("HOME");
|
||||
if(home == NULL)
|
||||
return "";
|
||||
else
|
||||
return home;
|
||||
std::string homePath;
|
||||
//this should give you something like "/home/YOUR_USERNAME" on Linux and "C:\Users\YOUR_USERNAME\" on Windows
|
||||
const char * envHome = getenv("HOME");
|
||||
if(envHome != nullptr) {
|
||||
homePath = envHome;
|
||||
}
|
||||
#ifdef WIN32
|
||||
//but does not seem to work for Windwos XP or Vista, so try something else
|
||||
if (homePath.empty()) {
|
||||
const char * envDir = getenv("HOMEDRIVE");
|
||||
const char * envPath = getenv("HOMEPATH");
|
||||
if (envDir != nullptr && envPath != nullptr) {
|
||||
homePath = envDir;
|
||||
homePath += envPath;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (homePath.empty()) {
|
||||
homePath = "~";
|
||||
}
|
||||
#endif
|
||||
return homePath;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue