diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-02-08 11:23:19 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-02-08 11:23:19 +0100 |
commit | b464bb7fd43a86264e816e950ccac1d6845b0230 (patch) | |
tree | 1070200f94f1f7adf4ae26950011884e1956576d /src/render | |
parent | Use our synonyms for attack anims again (diff) | |
parent | reorganize shaders; use modulate flag; update librw (diff) | |
download | re3-b464bb7fd43a86264e816e950ccac1d6845b0230.tar re3-b464bb7fd43a86264e816e950ccac1d6845b0230.tar.gz re3-b464bb7fd43a86264e816e950ccac1d6845b0230.tar.bz2 re3-b464bb7fd43a86264e816e950ccac1d6845b0230.tar.lz re3-b464bb7fd43a86264e816e950ccac1d6845b0230.tar.xz re3-b464bb7fd43a86264e816e950ccac1d6845b0230.tar.zst re3-b464bb7fd43a86264e816e950ccac1d6845b0230.zip |
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/Font.cpp | 13 | ||||
-rw-r--r-- | src/render/Hud.cpp | 23 | ||||
-rw-r--r-- | src/render/Renderer.cpp | 4 | ||||
-rw-r--r-- | src/render/WaterLevel.cpp | 17 |
4 files changed, 34 insertions, 23 deletions
diff --git a/src/render/Font.cpp b/src/render/Font.cpp index de1ee8b4..0f5930ee 100644 --- a/src/render/Font.cpp +++ b/src/render/Font.cpp @@ -406,16 +406,19 @@ CFont::DrawButton(float x, float y) if (PS2Symbol != BUTTON_NONE) { CRect rect; rect.left = x; - rect.top = Details.scaleY + Details.scaleY + y; - rect.right = Details.scaleY * 17.0f + x; - rect.bottom = Details.scaleY * 19.0f + y; + rect.top = RenderState.scaleY + RenderState.scaleY + y; + rect.right = RenderState.scaleY * 17.0f + x; + rect.bottom = RenderState.scaleY * 19.0f + y; int vertexAlphaState; void *raster; RwRenderStateGet(rwRENDERSTATEVERTEXALPHAENABLE, &vertexAlphaState); RwRenderStateGet(rwRENDERSTATETEXTURERASTER, &raster); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE); - ButtonSprite[PS2Symbol].Draw(rect, CRGBA(255, 255, 255, Details.color.a)); + if (RenderState.bIsShadow) + ButtonSprite[PS2Symbol].Draw(rect, RenderState.color); + else + ButtonSprite[PS2Symbol].Draw(rect, CRGBA(255, 255, 255, RenderState.color.a)); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, raster); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)vertexAlphaState); } @@ -585,7 +588,7 @@ CFont::RenderFontBuffer() #ifdef BUTTON_ICONS if(PS2Symbol != BUTTON_NONE) { DrawButton(textPosX, textPosY); - textPosX += Details.scaleY * 17.0f; + textPosX += RenderState.scaleY * 17.0f; PS2Symbol = BUTTON_NONE; } #endif diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index b7c78eb1..91503917 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -1140,18 +1140,18 @@ void CHud::Draw() if (IntroRect.m_nTextureId >= 0) { CRect rect ( IntroRect.m_sRect.left, - IntroRect.m_sRect.top, + IntroRect.m_sRect.bottom, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom ); + IntroRect.m_sRect.top ); CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor); } else { CRect rect ( IntroRect.m_sRect.left, - IntroRect.m_sRect.top, + IntroRect.m_sRect.bottom, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom ); + IntroRect.m_sRect.top ); CSprite2d::DrawRect(rect, IntroRect.m_sColor); } @@ -1172,7 +1172,14 @@ void CHud::Draw() CFont::SetBackgroundColor(CRGBA(0, 0, 0, 128)); CFont::SetCentreOn(); CFont::SetPropOn(); - CFont::SetDropShadowPosition(0); +#ifdef CUTSCENE_BORDERS_SWITCH + if (!FrontEndMenuManager.m_PrefsCutsceneBorders) { + CFont::SetDropColor(CRGBA(0, 0, 0, 255)); + CFont::SetDropShadowPosition(2); + } + else +#endif + CFont::SetDropShadowPosition(0); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetColor(CRGBA(225, 225, 225, 255)); @@ -1182,10 +1189,6 @@ void CHud::Draw() onceItWasWidescreen = true; if (FrontEndMenuManager.m_PrefsShowSubtitles || !CCutsceneMgr::IsRunning()) { -#ifdef CUTSCENE_BORDERS_SWITCH - if (!FrontEndMenuManager.m_PrefsCutsceneBorders) - CFont::SetDropShadowPosition(2); -#endif CFont::SetCentreSize(SCREEN_WIDTH - SCREEN_SCALE_X(60.0f)); CFont::SetScale(SCREEN_SCALE_X(0.58f), SCREEN_SCALE_Y(1.2f)); CFont::PrintString(SCREEN_WIDTH / 2.f, SCREEN_SCALE_FROM_BOTTOM(80.0f), m_Message); @@ -1224,7 +1227,7 @@ void CHud::Draw() m_HelpMessageDisplayTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f; if (TheCamera.m_ScreenReductionPercentage == 0.0f) - DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0); + DMAudio.PlayFrontEndSound(SOUND_HUD, 0); break; case 1: case 2: diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 8c4714fb..dfbc02d7 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1394,6 +1394,10 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL void CRenderer::InsertEntityIntoList(CEntity *ent) { +#ifdef FIX_BUGS + if (!ent->m_rwObject) return; +#endif + #ifdef NEW_RENDERER // TODO: there are more flags being checked here if(gbNewRenderer && (ent->IsVehicle() || ent->IsPed())) diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp index 08fd5e6e..3d33dbf6 100644 --- a/src/render/WaterLevel.cpp +++ b/src/render/WaterLevel.cpp @@ -73,7 +73,7 @@ RwRaster *gpWaterEnvBaseRaster; RwRaster *gpWaterWakeRaster; bool _bSeaLife; -float _fWaterZOffset = 0.5f; +float _fWaterZOffset = WATER_Z_OFFSET; #ifdef PC_WATER float fEnvScale = 0.25f; @@ -318,6 +318,7 @@ CWaterLevel::Shutdown() _DELETE_TEXTURE(gpWaterTex); _DELETE_TEXTURE(gpWaterEnvTex); + _DELETE_TEXTURE(gpWaterWakeTex); _DELETE_TEXTURE(gpWaterEnvBaseTex); #undef _DELETE_TEXTURE @@ -714,9 +715,9 @@ CWaterLevel::GetWaterLevel(float fX, float fY, float fZ, float *pfOutLevel, bool if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false; #endif - uint8 nBlock = aWaterFineBlockList[x][y]; + int8 nBlock = aWaterFineBlockList[x][y]; - if ( nBlock == 0x80 ) + if ( nBlock == NO_WATER ) return false; ASSERT( pfOutLevel != nil ); @@ -756,9 +757,9 @@ CWaterLevel::GetWaterLevelNoWaves(float fX, float fY, float fZ, float *pfOutLeve if ( y < 0 || y >= MAX_SMALL_SECTORS ) return false; #endif - uint8 nBlock = aWaterFineBlockList[x][y]; + int8 nBlock = aWaterFineBlockList[x][y]; - if ( nBlock == 0x80 ) + if ( nBlock == NO_WATER ) return false; ASSERT( pfOutLevel != nil ); @@ -1076,7 +1077,7 @@ CWaterLevel::RenderWater() { for ( int32 y = 0; y < 5; y++ ) { - float fX = WATER_SIGN_X(float(x) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f - 400.0f; + float fX = WATER_SIGN_X(float(x) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f - WATER_X_OFFSET; float fY = WATER_SIGN_Y(float(y) * EXTRAHUGE_SECTOR_SIZE) - 1280.0f; if ( !bUseCamStartY ) @@ -1462,7 +1463,7 @@ CWaterLevel::RenderTransparentWater(void) int32 nBlock; - int32 BlockX = WATER_TO_SMALL_SECTOR_X(fCamX + 400.0f) + 1; + int32 BlockX = WATER_TO_SMALL_SECTOR_X(fCamX + WATER_X_OFFSET) + 1; int32 BlockY = WATER_TO_SMALL_SECTOR_Y(fCamY) + 1; if (_IsColideWithBlock(BlockX, BlockY, nBlock)) @@ -1472,7 +1473,7 @@ CWaterLevel::RenderTransparentWater(void) float fMaskX = Floor(fCamX / 2.0f) * 2.0f; float fMaskY = Floor(fCamY / 2.0f) * 2.0f; float fWaterZ = CWaterLevel::ms_aWaterZs[nBlock]; - float fSectorX = WATER_FROM_SMALL_SECTOR_X(BlockX) - 400.0f; + float fSectorX = WATER_FROM_SMALL_SECTOR_X(BlockX) - WATER_X_OFFSET; float fSectorY = WATER_FROM_SMALL_SECTOR_Y(BlockY); RenderWavyMask(fMaskX, fMaskY, fWaterZ, |