From 64faf81a0db42ddd9c622b79bff098099584746b Mon Sep 17 00:00:00 2001 From: Emil Kabirov Date: Sat, 1 Dec 2018 18:43:53 +0500 Subject: [PATCH] fixed reflector size & android game starting --- assets/gui_game_pause_menu.json | 2 +- game/galaxy_menu.cpp | 3 --- game/gamecode.cpp | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/assets/gui_game_pause_menu.json b/assets/gui_game_pause_menu.json index a2e6ba7..5793ecc 100755 --- a/assets/gui_game_pause_menu.json +++ b/assets/gui_game_pause_menu.json @@ -7,7 +7,7 @@ "width": "match_parent", "height": "match_parent", "visible": 1, - "touchTransparency": 0, + "touchTransparency": 1, "marginTop": 20, "horizontalAlignment": "HA_CENTER", "verticalAlignment": "VA_TOP", diff --git a/game/galaxy_menu.cpp b/game/galaxy_menu.cpp index 2ab668b..d915edf 100755 --- a/game/galaxy_menu.cpp +++ b/game/galaxy_menu.cpp @@ -287,7 +287,6 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) { // OnTapDown-> /*../hover\..*/ - GetConsole() << std::to_string(lastTapPos[0]) + " | " + std::to_string(lastTapPos[1]) + " | " + std::to_string(totalTapShift[0]) + " | " + std::to_string(totalTapShift[1]); int phi = findPlanetByPos(lastTapPos - totalTapShift); if (phi != -1) { planetHoverIndex = phi; @@ -302,7 +301,6 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) { //totalTapShift = Eigen::Vector2f(totalTapShift(0) + currentTapShift(0), totalTapShift(1) + currentTapShift(1)); /*../hover\..*/ - GetConsole() << std::to_string(lastTapPos[0]) + " | " + std::to_string(lastTapPos[1]) + " | " + std::to_string(totalTapShift[0]) + " | " + std::to_string(totalTapShift[1]); int phi = findPlanetByPos(lastTapPos - totalTapShift); if (phi != -1) { planetHoverIndex = phi; @@ -342,7 +340,6 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) { // OnTapDown->OnTapUp /*..level select menu open..*/ - GetConsole() << std::to_string(lastTapPos[0]) + " | " + std::to_string(lastTapPos[1]) + " | " + std::to_string(totalTapShift[0]) + " | " + std::to_string(totalTapShift[1]); starIndex = findPlanetByPos(lastTapPos - totalTapShift); diff --git a/game/gamecode.cpp b/game/gamecode.cpp index 58fe972..1a22e01 100755 --- a/game/gamecode.cpp +++ b/game/gamecode.cpp @@ -976,7 +976,7 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i float scale; if (screenRatioToFixedRatio > 1.f) { - offset[0] = (screenWidth - screenWidth / screenRatioToFixedRatio) / 2.f; + offset[0] = (Renderer->GetScreenWidth() - screenWidth / screenRatioToFixedRatio) / 2.f; offset[1] = 0; scale = matrixHeight / 480.f; } @@ -1043,11 +1043,11 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i //float LEVEL_VIEWPORT_HEIGHT = Application->GetGameLevelScreenHeight(); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_REFLECTOR_TEXTURE]); - float xRW = 210.f * tSW/700.f; // x Reflector Width - float yRH = 45.f * tSH/480.f; // y Reflector Height - Vector2f matrixSize = ReflectorPos.cwiseProduct(Vector2f(Application->GetGameLevelScreenWidth(), Application->GetGameLevelScreenHeight())); - Renderer->DrawRect(Vector2f(-xRW * 0.5f, -yRH * 0.5f) + matrixSize + offset, - Vector2f(xRW*0.5f, yRH*0.5f) + matrixSize + offset, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); + float xRW = 210.f; // x Reflector Width + float yRH = 45.f; // y Reflector Height + Vector2f matrixSize = ReflectorPos.cwiseProduct(Vector2f(768, 480)); + Renderer->DrawRect(Vector2f(-xRW * 0.5f, -yRH * 0.5f) * scale + offset + matrixSize, + Vector2f(xRW*0.5f, yRH*0.5f) * scale + offset + matrixSize, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); const Vector2f wallUpPos1(xlOffset, tSH-ylOffset-uWTW); const Vector2f wallUpPos2(tSW + xlOffset, tSH-ylOffset);