From 69b5c9f1e0aff9bc32f903b39f5c1673b43a9b37 Mon Sep 17 00:00:00 2001 From: _AG Date: Wed, 3 Jul 2019 17:26:15 +0200 Subject: Update Frontend. --- src/main.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index de3d8b62..2835f396 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,8 +124,8 @@ Idle(void *arg) #ifdef GTA_PC // This is from SA, but it's nice for windowed mode RwV2d pos; - pos.x = SCREENW/2.0f; - pos.y = SCREENH/2.0f; + pos.x = SCREEN_WIDTH/2.0f; + pos.y = SCREEN_HEIGHT/2.0f; RsMouseSetPos(&pos); #endif CRenderer::ConstructRenderList(); @@ -230,7 +230,7 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR CSprite2d::InitPerFrame(); if(Alpha != 0) - CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREENW, SCREENH), BottomColor, BottomColor, TopColor, TopColor); + CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), BottomColor, BottomColor, TopColor, TopColor); return true; } @@ -346,15 +346,15 @@ Render2dStuff(void) // top and bottom strips if (weaponType == WEAPONTYPE_ROCKETLAUNCHER) { - CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREENW, SCREENH / 2 - SCREEN_SCALE_Y(180)), black); - CSprite2d::DrawRect(CRect(0.0f, SCREENH / 2 + SCREEN_SCALE_Y(170), SCREENW, SCREENH), black); + CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(180)), black); + CSprite2d::DrawRect(CRect(0.0f, SCREEN_HEIGHT / 2 + SCREEN_SCALE_Y(170), SCREEN_WIDTH, SCREEN_HEIGHT), black); } else { - CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREENW, SCREENH / 2 - SCREEN_SCALE_Y(210)), black); - CSprite2d::DrawRect(CRect(0.0f, SCREENH / 2 + SCREEN_SCALE_Y(210), SCREENW, SCREENH), black); + CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(210)), black); + CSprite2d::DrawRect(CRect(0.0f, SCREEN_HEIGHT / 2 + SCREEN_SCALE_Y(210), SCREEN_WIDTH, SCREEN_HEIGHT), black); } - CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREENW / 2 - SCREEN_SCALE_X(210), SCREENH), black); - CSprite2d::DrawRect(CRect(SCREENW / 2 + SCREEN_SCALE_X(210), 0.0f, SCREENW, SCREENH), black); + CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH / 2 - SCREEN_SCALE_X(210), SCREEN_HEIGHT), black); + CSprite2d::DrawRect(CRect(SCREEN_WIDTH / 2 + SCREEN_SCALE_X(210), 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), black); } MusicManager.DisplayRadioStationName(); @@ -444,16 +444,16 @@ DoFade(void) if(TheCamera.m_WideScreenOn){ // what's this? - float y = SCREENH/2 * TheCamera.m_ScreenReductionPercentage/100.0f; + float y = SCREEN_HEIGHT/2 * TheCamera.m_ScreenReductionPercentage/100.0f; rect.left = 0.0f; - rect.right = SCREENW; + rect.right = SCREEN_WIDTH; rect.top = y - 8.0f; - rect.bottom = SCREENH - y - 8.0f; + rect.bottom = SCREEN_HEIGHT - y - 8.0f; }else{ rect.left = 0.0f; - rect.right = SCREENW; + rect.right = SCREEN_WIDTH; rect.top = 0.0f; - rect.bottom = SCREENH; + rect.bottom = SCREEN_HEIGHT; } CSprite2d::DrawRect(rect, fadeColor); @@ -462,7 +462,7 @@ DoFade(void) fadeColor.g = 255; fadeColor.b = 255; fadeColor.a = CDraw::FadeValue; - splash->Draw(CRect(0.0f, 0.0f, SCREENW, SCREENH), fadeColor, fadeColor, fadeColor, fadeColor); + splash->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), fadeColor, fadeColor, fadeColor, fadeColor); } } } @@ -549,14 +549,14 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) CFont::InitPerFrame(); DefinedState(); RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP); - splash->Draw(CRect(0.0f, 0.0f, SCREENW, SCREENH), CRGBA(255, 255, 255, 255)); + splash->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255)); if(str1){ NumberOfChunksLoaded += 1; float hpos = SCREEN_SCALE_X(40); - float length = SCREENW - SCREEN_SCALE_X(100); - float vpos = SCREENH - SCREEN_SCALE_Y(13); + float length = SCREEN_WIDTH - SCREEN_SCALE_X(100); + float vpos = SCREEN_HEIGHT - SCREEN_SCALE_Y(13); float height = SCREEN_SCALE_Y(7); CSprite2d::DrawRect(CRect(hpos, vpos, hpos + length, vpos + height), CRGBA(40, 53, 68, 255)); @@ -617,7 +617,7 @@ LoadingIslandScreen(const char *levelName) CFont::InitPerFrame(); DefinedState(); col = CRGBA(255, 255, 255, 255); - splash->Draw(CRect(0.0f, 0.0f, SCREENW, SCREENH), col, col, col, col); + splash->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), col, col, col, col); CFont::SetBackgroundOff(); CFont::SetScale(1.5f, 1.5f); CFont::SetPropOn(); @@ -630,12 +630,12 @@ LoadingIslandScreen(const char *levelName) CFont::SetDropShadowPosition(3); CFont::SetColor(CRGBA(243, 237, 71, 255)); CFont::SetScale(SCREEN_STRETCH_X(1.2f), SCREEN_STRETCH_Y(1.2f)); - CFont::PrintString(SCREENW - 20, SCREEN_STRETCH_FROM_BOTTOM(110.0f), TheText.Get("WELCOME")); + CFont::PrintString(SCREEN_WIDTH - 20, SCREEN_STRETCH_FROM_BOTTOM(110.0f), TheText.Get("WELCOME")); TextCopy(wstr, name); TheText.UpperCase(wstr); CFont::SetColor(CRGBA(243, 237, 71, 255)); CFont::SetScale(SCREEN_STRETCH_X(1.2f), SCREEN_STRETCH_Y(1.2f)); - CFont::PrintString(SCREENW-20, SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr); + CFont::PrintString(SCREEN_WIDTH-20, SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr); CFont::DrawFonts(); DoRWStuffEndOfFrame(); } -- cgit v1.2.3