Permalink
Browse files

On first run, set scale to 2 if screen size is large enough

  • Loading branch information...
jacob1 committed May 15, 2015
1 parent 0a2b606 commit cee08b20245761a63616d6cfa25152dc2c32e7f0
Showing with 17 additions and 4 deletions.
  1. +5 −0 src/PowderToySDL.cpp
  2. +8 −0 src/client/Client.cpp
  3. +3 −2 src/client/Client.h
  4. +1 −2 src/gui/game/GameController.cpp
@@ -834,6 +834,11 @@ int main(int argc, char * argv[])
tempScale = 1;
SDLOpen();
if (Client::Ref().IsFirstRun() && desktopWidth > WINDOWW*2 && desktopHeight > WINDOWH*2)
{
tempScale = 2;
Client::Ref().SetPref("Scale", 2);
}
#ifdef WIN
LoadWindowPosition(tempScale);
#endif
@@ -126,7 +126,10 @@ Client::Client():
#ifndef MACOSX
configFile.close();
#endif
firstRun = false;
}
else
firstRun = true;
}
void Client::Initialise(std::string proxyString)
@@ -173,6 +176,11 @@ void Client::Initialise(std::string proxyString)
}
}
bool Client::IsFirstRun()
{
return firstRun;
}
bool Client::DoInstallation()
{
#if defined(WIN)
@@ -50,14 +50,14 @@ class ClientListener;
class Client: public Singleton<Client> {
private:
std::string messageOfTheDay;
std::vector<std::pair<std::string, std::string> > serverNotifications;
std::vector<std::pair<std::string, std::string> > serverNotifications;
void * versionCheckRequest;
bool updateAvailable;
UpdateInfo updateInfo;
std::string lastError;
bool firstRun;
std::list<std::string> stampIDs;
unsigned lastStampTime;
@@ -108,6 +108,7 @@ class Client: public Singleton<Client> {
void Initialise(std::string proxyString);
void SetProxy(std::string proxy);
bool IsFirstRun();
int MakeDirectory(const char * dirname);
bool WriteFile(std::vector<unsigned char> fileData, std::string filename);
@@ -753,9 +753,8 @@ void GameController::Tick()
((LuaScriptInterface*)commandInterface)->Init();
#endif
#if !defined(MACOSX) && !defined(NO_INSTALL_CHECK)
if(!Client::Ref().GetPrefBool("InstallCheck", false))
if (Client::Ref().IsFirstRun())
{
Client::Ref().SetPref("InstallCheck", true);
Install();
}
#endif

0 comments on commit cee08b2

Please sign in to comment.