diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-09-27 03:39:25 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-09-27 03:39:25 +0200 |
commit | 9b7642454006f4c6b93d57297f88b2899e3f0077 (patch) | |
tree | f6d36d6be1b23ee2dfc4e0a64cbd9d54fd7c4150 /src/render/Credits.cpp | |
parent | Add target arm64 (diff) | |
download | re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.gz re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.bz2 re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.lz re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.xz re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.zst re3-9b7642454006f4c6b93d57297f88b2899e3f0077.zip |
Diffstat (limited to 'src/render/Credits.cpp')
-rw-r--r-- | src/render/Credits.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/render/Credits.cpp b/src/render/Credits.cpp index 2cfdba90..2d33ce40 100644 --- a/src/render/Credits.cpp +++ b/src/render/Credits.cpp @@ -11,6 +11,13 @@ bool CCredits::bCreditsGoing; uint32 CCredits::CreditsStartTime; +#ifdef ASPECT_RATIO_SCALE +#define SCALE_AND_CENTER(x) ScaleAndCenterX(x) +extern float ScaleAndCenterX(float x); +#else +#define SCALE_AND_CENTER(x) SCREEN_STRETCH_X(x) +#endif + void CCredits::Init(void) { @@ -39,11 +46,11 @@ CCredits::PrintCreditSpace(float space, uint32 &line) void CCredits::PrintCreditText(float scaleX, float scaleY, wchar *text, uint32 &lineoffset, float scrolloffset) { - float start = SCREEN_HEIGHT + 50.0f; + float start = DEFAULT_SCREEN_HEIGHT + 50.0f; float y = lineoffset + start - scrolloffset; if(y > -50.0f && y < start){ - CFont::SetScale(scaleX, scaleY); - CFont::PrintString(SCREEN_WIDTH/2.0f, y, (uint16*)text); + CFont::SetScale(SCREEN_SCALE_X(scaleX), SCREEN_SCALE_Y(scaleY)); + CFont::PrintString(SCREEN_WIDTH/2.0f, SCREEN_SCALE_Y(y), (uint16*)text); } lineoffset += scaleY*25.0f; } @@ -62,7 +69,7 @@ CCredits::Render(void) scrolloffset = (CTimer::GetTimeInMilliseconds() - CreditsStartTime) / 24.0f; CFont::SetJustifyOff(); CFont::SetBackgroundOff(); - CFont::SetCentreSize(SCREEN_WIDTH - 20); + CFont::SetCentreSize(SCALE_AND_CENTER(DEFAULT_SCREEN_WIDTH - 20)); CFont::SetCentreOn(); CFont::SetPropOn(); CFont::SetColor(CRGBA(220, 220, 220, 220)); @@ -489,7 +496,7 @@ CCredits::Render(void) if(TheCamera.m_WideScreenOn) TheCamera.DrawBordersForWideScreen(); - if(lineoffset + SCREEN_HEIGHT - scrolloffset < -10.0f) + if(lineoffset + DEFAULT_SCREEN_HEIGHT - scrolloffset < -10.0f) bCreditsGoing = false; } @@ -497,3 +504,5 @@ bool CCredits::AreCreditsDone(void) { return !bCreditsGoing; } + +#undef SCALE_AND_CENTER
\ No newline at end of file |