Comment tweaks, build tweaks, bugfixes

I've also disabled the "screen trick". It was ugly as hell.
This commit is contained in:
2015-08-24 14:32:54 +10:00
parent 188a6805bf
commit ffe5c80117
18 changed files with 22 additions and 105 deletions
+6 -7
View File
@@ -29,21 +29,21 @@
SplashScreen::SplashScreen(SDL_Window* w) {
//fit the screen to the logo
//TODO: refactor the code for this window trick
//NOTE: not using this window trick
window = w;
SDL_GetWindowSize(window, &windowWidth, &windowHeight);
logo.Load(GetRenderer(), ConfigUtility::GetSingleton()["dir.logos"] + "krstudios.png");
SDL_SetWindowSize(window, logo.GetClipW(), logo.GetClipH());
SDL_RenderSetLogicalSize(GetRenderer(), logo.GetClipW(), logo.GetClipH());
// SDL_SetWindowSize(window, logo.GetClipW(), logo.GetClipH());
// SDL_RenderSetLogicalSize(GetRenderer(), logo.GetClipW(), logo.GetClipH());
startTick = std::chrono::steady_clock::now();
}
SplashScreen::~SplashScreen() {
SDL_SetWindowSize(window, windowWidth, windowHeight);
SDL_RenderSetLogicalSize(GetRenderer(), windowWidth, windowHeight);
// SDL_SetWindowSize(window, windowWidth, windowHeight);
// SDL_RenderSetLogicalSize(GetRenderer(), windowWidth, windowHeight);
}
//-------------------------
@@ -51,7 +51,7 @@ SplashScreen::~SplashScreen() {
//-------------------------
void SplashScreen::FrameStart() {
//TODO: config flag to change the delay
//TODO: (0) config flag to change the delay
if (std::chrono::steady_clock::now() - startTick > std::chrono::duration<int>(3)) {
SetSceneSignal(SceneSignal::MAINMENU);
}
@@ -60,6 +60,5 @@ void SplashScreen::FrameStart() {
void SplashScreen::RenderFrame(SDL_Renderer* renderer) {
int w = 0, h = 0;
SDL_RenderGetLogicalSize(renderer, &w, &h);
//TODO: fix logo position
logo.DrawTo(renderer, (w - logo.GetClipW()) / 2, (h - logo.GetClipH()) / 2);
}