diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-17 20:48:12 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-17 20:48:12 +0200 |
commit | 3cc20d7962c317aeb1e1e36e77ec270298b51cdb (patch) | |
tree | c6fcaef6b3271d8407530c826b92367a4e81ff17 /src/core/Frontend.cpp | |
parent | full script basic support (diff) | |
parent | Merge pull request #555 from erorcun/miami (diff) | |
download | re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.gz re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.bz2 re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.lz re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.xz re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.tar.zst re3-3cc20d7962c317aeb1e1e36e77ec270298b51cdb.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/Frontend.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index d27a98ec..56c83337 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -5536,9 +5536,10 @@ CMenuManager::PrintMap(void) if (mapPoint.y > fMapCenterY - fMapSize && mapPoint.y < fMapCenterY + fMapSize && mapPoint.x > fMapCenterX - fMapSize && mapPoint.x < fMapCenterX + fMapSize) { + // Don't ask me the meanings, I don't know. Found them by trying float diffX = fMapCenterX - fMapSize, diffY = fMapCenterY - fMapSize; - float x = ((mapPoint.x - diffX) / (fMapSize * 2)) * 4000.0f - 2000.0f; - float y = 2000.0f - ((mapPoint.y - diffY) / (fMapSize * 2)) * 4000.0f; + float x = ((mapPoint.x - diffX) / (fMapSize * 2)) * (WORLD_SIZE_X / MENU_MAP_WIDTH_SCALE) - (WORLD_SIZE_X / 2 + MENU_MAP_LEFT_OFFSET * MENU_MAP_LENGTH_UNIT); + float y = (WORLD_SIZE_Y / 2 - MENU_MAP_TOP_OFFSET * MENU_MAP_LENGTH_UNIT) - ((mapPoint.y - diffY) / (fMapSize * 2)) * (WORLD_SIZE_Y / MENU_MAP_HEIGHT_SCALE); CRadar::ToggleTargetMarker(x, y); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0); } @@ -5584,7 +5585,8 @@ CMenuManager::PrintMap(void) if (fMapCenterY + fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f)) fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - fMapSize; - fMapCenterY = Min(fMapCenterY, fMapSize); // To not show beyond north border + if (fMapCenterY - fMapSize > SCREEN_HEIGHT / 2) + fMapCenterY = SCREEN_HEIGHT / 2 + fMapSize; bMenuMapActive = false; @@ -5654,9 +5656,7 @@ CMenuManager::ConstructStatLine(int rowIdx) STAT_LINE("PL_STAT", nil, false, nil); - int percentCompleted = (CStats::TotalProgressInGame == 0 ? 0 : - CStats::ProgressMade * 100.0f / (CGame::nastyGame ? CStats::TotalProgressInGame : CStats::TotalProgressInGame - 1)); - percentCompleted = Min(percentCompleted, 100); + int percentCompleted = CStats::GetPercentageProgress(); STAT_LINE("PER_COM", &percentCompleted, false, nil); STAT_LINE("NMISON", &CStats::MissionsGiven, false, nil); |