1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 20:30:02 +00:00

Menu borders and weapon fixes

This commit is contained in:
eray orçunus 2020-05-24 02:59:30 +03:00
parent 5276abb0fb
commit 4870d9a31b
13 changed files with 384 additions and 225 deletions

View file

@ -1596,7 +1596,7 @@ CCam::Process_FollowPedWithMouse(const CVector &CameraTarget, float TargetOrient
CWorld::pIgnoreEntity = nil; CWorld::pIgnoreEntity = nil;
float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f); float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f);
float ViewPlaneWidth = ViewPlaneHeight * CDraw::FindAspectRatio() * fTweakFOV; float ViewPlaneWidth = ViewPlaneHeight * CDraw::CalculateAspectRatio() * fTweakFOV;
float Near = RwCameraGetNearClipPlane(Scene.camera); float Near = RwCameraGetNearClipPlane(Scene.camera);
float radius = ViewPlaneWidth*Near; float radius = ViewPlaneWidth*Near;
entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, false); entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, false);
@ -4574,7 +4574,7 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient
CWorld::pIgnoreEntity = nil; CWorld::pIgnoreEntity = nil;
float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f); float ViewPlaneHeight = Tan(DEGTORAD(FOV) / 2.0f);
float ViewPlaneWidth = ViewPlaneHeight * CDraw::FindAspectRatio() * fTweakFOV; float ViewPlaneWidth = ViewPlaneHeight * CDraw::CalculateAspectRatio() * fTweakFOV;
float Near = RwCameraGetNearClipPlane(Scene.camera); float Near = RwCameraGetNearClipPlane(Scene.camera);
float radius = ViewPlaneWidth*Near; float radius = ViewPlaneWidth*Near;
entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, false); entity = CWorld::TestSphereAgainstWorld(Source + Front*Near, radius, nil, true, true, false, true, false, false);

View file

@ -3117,15 +3117,6 @@ CCamera::Fade(float timeout, int16 direction)
m_iMusicFadingDirection = direction; m_iMusicFadingDirection = direction;
m_fTimeToFadeMusic = timeout; m_fTimeToFadeMusic = timeout;
m_uiFadeTimeStartedMusic = CTimer::GetTimeInMilliseconds(); m_uiFadeTimeStartedMusic = CTimer::GetTimeInMilliseconds();
// Not on PS2
if(!m_bJustJumpedOutOf1stPersonBecauseOfTarget && m_iMusicFadingDirection == FADE_OUT){
unknown++;
if(unknown >= 2){
m_bJustJumpedOutOf1stPersonBecauseOfTarget = true;
unknown = 0;
}else
m_bMoveCamToAvoidGeom = true;
}
} }
} }
@ -3314,8 +3305,9 @@ CCamera::CalculateDerivedValues(void)
// left plane // left plane
m_vecFrustumNormals[1] = CVector(-c, -s, 0.0f); m_vecFrustumNormals[1] = CVector(-c, -s, 0.0f);
c /= CDraw::FindAspectRatio(); CDraw::CalculateAspectRatio();
s /= CDraw::FindAspectRatio(); c /= SCREEN_ASPECT_RATIO;
s /= SCREEN_ASPECT_RATIO;
// bottom plane // bottom plane
m_vecFrustumNormals[2] = CVector(0.0f, -s, -c); m_vecFrustumNormals[2] = CVector(0.0f, -s, -c);
// top plane // top plane

View file

@ -37,6 +37,9 @@
#include "Messages.h" #include "Messages.h"
#include "FileLoader.h" #include "FileLoader.h"
// TODO(Miami): This is -3 on VC but still -1 on AudioManager?!? What the hell?
#define INVALID_AUDIO_PROVIDER -1
// Similar story to Hud.cpp: // Similar story to Hud.cpp:
// Game has colors inlined in code. // Game has colors inlined in code.
// For easier modification we collect them here: // For easier modification we collect them here:
@ -178,43 +181,6 @@ ScaleAndCenterX(float x)
#define MENU_Y(y) StretchY(y) #define MENU_Y(y) StretchY(y)
#endif #endif
#ifdef PS2_LIKE_MENU
#define ChangeScreen(screen, option, updateDelay, withReverseAlpha) \
do { \
if (reverseAlpha) { \
m_nPrevScreen = m_nCurrScreen; \
m_nCurrScreen = pendingScreen; \
m_nCurrOption = pendingOption; \
reverseAlpha = false; \
if (updateDelay) \
m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode(); \
} \
if (withReverseAlpha) { \
pendingOption = option; \
pendingScreen = screen; \
reverseAlpha = true; \
} else { \
m_nPrevScreen = m_nCurrScreen; \
m_nCurrScreen = screen; \
m_nCurrOption = option; \
if (updateDelay) \
m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode(); \
} \
m_nMenuFadeAlpha = 255; \
} while(0)
#else
#define ChangeScreen(screen, option, updateDelay, clearAlpha) \
do { \
m_nPrevScreen = m_nCurrScreen; \
m_nCurrScreen = screen; \
m_nCurrOption = option; \
if(updateDelay) \
m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode(); \
if(clearAlpha) \
m_nMenuFadeAlpha = 0; \
} while(0)
#endif
#define PREPARE_MENU_HEADER \ #define PREPARE_MENU_HEADER \
CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); \ CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); \
CFont::SetRightJustifyOn(); \ CFont::SetRightJustifyOn(); \
@ -248,6 +214,76 @@ ScaleAndCenterX(float x)
// --- Functions not in the game/inlined starts // --- Functions not in the game/inlined starts
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
void DoRWStuffEndOfFrame(void);
#ifdef PS2_LIKE_MENU
void
CMenuManager::SwitchToNewScreen(int8 screen)
{
if (reverseAlpha) {
m_nPrevScreen = m_nCurrScreen;
m_nCurrScreen = pendingScreen;
m_nCurrOption = pendingOption;
reverseAlpha = false;
if (updateDelay)
m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode();
}
if (withReverseAlpha) {
pendingOption = option;
pendingScreen = screen;
reverseAlpha = true;
} else {
m_nPrevScreen = m_nCurrScreen;
m_nCurrScreen = screen;
m_nCurrOption = option;
if (updateDelay)
m_LastScreenSwitch = CTimer::GetTimeInMillisecondsPauseMode();
}
m_nMenuFadeAlpha = 255;
}
#else
// --MIAMI: Done except using VC's gMenuPages
void
CMenuManager::SwitchToNewScreen(int8 screen)
{
bMenuChangeOngoing = true;
DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
DrawBackground(true);
DoRWStuffEndOfFrame();
DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255);
DrawBackground(true);
DoRWStuffEndOfFrame();
m_nPrevScreen = m_nCurrScreen;
m_ShowEmptyBindingError = false;
ResetHelperText();
ThingsToDoBeforeLeavingPage();
if (screen == -2) {
int oldScreen = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_PreviousPage[1] : aScreens[m_nCurrScreen].m_PreviousPage[0];
int oldOption = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_ParentEntry[1] :
(m_nCurrScreen == MENUPAGE_NEW_GAME ? 0 : (m_nCurrScreen == MENUPAGE_OPTIONS ? 1 : (m_nCurrScreen == MENUPAGE_EXIT ? 2 : aScreens[m_nCurrScreen].m_ParentEntry[0])));
m_nCurrOption = oldOption;
m_nCurrScreen = oldScreen;
} else if (screen == 0) {
m_nCurrScreen = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu;
m_nCurrOption = 0;
} else {
m_nCurrOption = 0;
m_nCurrScreen = screen;
}
if (m_nCurrScreen == MENUPAGE_CHOOSE_SAVE_SLOT)
m_nCurrOption = 8;
m_nMenuFadeAlpha = 0;
bOptionHighlightTransitionBlend = 0;
m_LastScreenSwitch = CTimer::GetTimeInMilliseconds();
}
#endif
inline void inline void
CMenuManager::ScrollUpListByOne() CMenuManager::ScrollUpListByOne()
{ {
@ -314,13 +350,14 @@ CMenuManager::PageDownList(bool playSoundOnSuccess)
} }
} }
// TODO(Miami)
inline void inline void
CMenuManager::ThingsToDoBeforeLeavingPage() CMenuManager::ThingsToDoBeforeLeavingPage()
{ {
if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && strcmp(m_aSkinName, m_PrefsSkinFile) != 0) { if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && strcmp(m_aSkinName, m_PrefsSkinFile) != 0) {
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile); CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
} else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) { } else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
if (m_nPrefsAudio3DProviderIndex != -1) if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER)
m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex(); m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex();
#ifdef TIDY_UP_PBP #ifdef TIDY_UP_PBP
DMAudio.StopFrontEndTrack(); DMAudio.StopFrontEndTrack();
@ -381,7 +418,7 @@ CMenuManager::CMenuManager()
OS_Language = LANG_ENGLISH; OS_Language = LANG_ENGLISH;
m_ControlMethod = CONTROL_STANDARD; m_ControlMethod = CONTROL_STANDARD;
CCamera::m_bUseMouse3rdPerson = true; CCamera::m_bUseMouse3rdPerson = true;
m_3DProviderOnLastSaveLoad = 0; m_lastWorking3DAudioProvider = 0;
m_nFirstVisibleRowOnList = 0; m_nFirstVisibleRowOnList = 0;
m_nScrollbarTopMargin = 0.0f; m_nScrollbarTopMargin = 0.0f;
m_nSelectedListRow = 0; m_nSelectedListRow = 0;
@ -421,9 +458,6 @@ CMenuManager::SetFrontEndRenderStates(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
} }
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);
void DoRWStuffEndOfFrame(void);
void void
CMenuManager::Initialise(void) CMenuManager::Initialise(void)
{ {
@ -762,11 +796,6 @@ CMenuManager::DrawStandardMenus()
case MENUPAGE_BRIEFS: case MENUPAGE_BRIEFS:
PrintBriefs(); PrintBriefs();
break; break;
#ifdef MENU_MAP
case MENUPAGE_MAP:
PrintMap();
break;
#endif
} }
// Header height isn't accounted, we will add that later. // Header height isn't accounted, we will add that later.
@ -1079,7 +1108,7 @@ CMenuManager::DrawStandardMenus()
break; break;
#endif #endif
case MENUACTION_AUDIOHW: case MENUACTION_AUDIOHW:
if (m_nPrefsAudio3DProviderIndex == -1) if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
rightText = TheText.Get("FEA_NAH"); rightText = TheText.Get("FEA_NAH");
else { else {
char *provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); char *provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
@ -1094,7 +1123,7 @@ CMenuManager::DrawStandardMenus()
} }
break; break;
case MENUACTION_SPEAKERCONF: { case MENUACTION_SPEAKERCONF: {
if (m_nPrefsAudio3DProviderIndex == -1) if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
rightText = TheText.Get("FEA_NAH"); rightText = TheText.Get("FEA_NAH");
else { else {
switch (m_PrefsSpeakers) { switch (m_PrefsSpeakers) {
@ -1233,7 +1262,7 @@ CMenuManager::DrawStandardMenus()
} }
if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) { if (m_nPrefsAudio3DProviderIndex != DMAudio.GetCurrent3DProviderIndex()) {
if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") != 0 if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") != 0
&& m_nCurrScreen == MENUPAGE_SOUND_SETTINGS && m_nPrefsAudio3DProviderIndex != -1) { && m_nCurrScreen == MENUPAGE_SOUND_SETTINGS && m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex(); m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex();
SetHelperText(3); SetHelperText(3);
@ -2005,10 +2034,7 @@ CMenuManager::DrawFrontEnd()
if (m_menuTransitionProgress == 255 && m_nMenuFadeAlpha == 255) if (m_menuTransitionProgress == 255 && m_nMenuFadeAlpha == 255)
bMenuChangeOngoing = false; bMenuChangeOngoing = false;
DrawBackground(); DrawBackground(false);
// TODO(Miami): Delete dis
PrintErrorMessage();
} }
#ifdef PS2_LIKE_MENU #ifdef PS2_LIKE_MENU
@ -2204,8 +2230,10 @@ CMenuManager::DrawBackground()
} }
} }
#else #else
// --MIAMI: Done except commented things
void void
CMenuManager::DrawBackground() CMenuManager::DrawBackground(bool transitionCall)
{ {
if (!m_bSpritesLoaded) if (!m_bSpritesLoaded)
return; return;
@ -2216,34 +2244,174 @@ CMenuManager::DrawBackground()
CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, 255)); CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, 255));
} }
if (m_nMenuFadeAlpha != 0) {
if (m_nMenuFadeAlpha < 255) { if (m_nMenuFadeAlpha < 255) {
// Famous transparent menu bug menuBg.Translate(m_nMenuFadeAlpha);
#ifdef FIX_BUGS SetFrontEndRenderStates();
static float fadeAlpha = 0.0f; m_aFrontEndSprites[MENUSPRITE_BACKGROUND].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, FadeIn(255)));
if (m_nMenuFadeAlpha == 0 && fadeAlpha > 1.0f) fadeAlpha = 0.0f; if (m_nCurrScreen == MENUPAGE_MAP)
PrintMap();
// +20 per every 33 ms (1000.f/30.f - original frame limiter fps) // Left border
fadeAlpha += (frameTime) * 20.f / 33.f; CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT,
m_nMenuFadeAlpha = fadeAlpha; SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
m_menuTransitionProgress = clamp(fadeAlpha, 0, 255);
#else
static uint32 LastFade = 0;
if(CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 10){ // Top border
m_nMenuFadeAlpha += 20; CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y),
LastFade = CTimer::GetTimeInMillisecondsPauseMode(); SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), SCREEN_WIDTH, 0.0f, 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
// Bottom border
CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), CRGBA(0, 0, 0, 255));
// Right border
CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255));
} else {
m_nMenuFadeAlpha = 255;
m_menuTransitionProgress = 255;
m_aFrontEndSprites[MENUSPRITE_BACKGROUND].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, FadeIn(255)));
if (m_nCurrScreen == MENUPAGE_MAP)
PrintMap();
// Left border
CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), 0.0f, SCREEN_HEIGHT,
SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
// Top border
CSprite2d::Draw2DPolygon(SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y),
SCREEN_STRETCH_X(menuBg.topLeft_x), SCREEN_STRETCH_Y(menuBg.topLeft_y), SCREEN_WIDTH, 0.0f, 0.0f, 0.0f, CRGBA(0, 0, 0, 255));
// Bottom border
CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
SCREEN_STRETCH_X(menuBg.bottomLeft_x), SCREEN_STRETCH_Y(menuBg.bottomLeft_y), CRGBA(0, 0, 0, 255));
// Right border
CSprite2d::Draw2DPolygon(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_STRETCH_X(menuBg.bottomRight_x), SCREEN_STRETCH_Y(menuBg.bottomRight_y),
SCREEN_WIDTH, 0.0f, SCREEN_STRETCH_X(menuBg.topRight_x), SCREEN_STRETCH_Y(menuBg.topRight_y), CRGBA(0, 0, 0, 255));
} }
#endif
} else { } else {
m_nMenuFadeAlpha = 255; menuBg.SaveCurrentCoors();
m_menuTransitionProgress = 255; switch (m_nCurrScreen) {
case MENUPAGE_STATS:
menuBg.topLeft_x = 70.0f;
menuBg.topLeft_y = 75.0f;
menuBg.topRight_x = 550.0f;
menuBg.topRight_y = 16.0f;
menuBg.bottomLeft_x = 74.0f;
menuBg.bottomLeft_y = 354.0f;
menuBg.bottomRight_x = 581.0f;
menuBg.bottomRight_y = 340.0f;
break;
case MENUPAGE_SOUND_SETTINGS:
menuBg.topLeft_x = 26.0f;
menuBg.topLeft_y = 59.0f;
menuBg.topRight_x = 629.0f;
menuBg.topRight_y = 29.0f;
menuBg.bottomLeft_x = 15.0f;
menuBg.bottomLeft_y = 438.0f;
menuBg.bottomRight_x = 610.0f;
menuBg.bottomRight_y = 410.0f;
break;
case MENUPAGE_SKIN_SELECT:
case MENUPAGE_KEYBOARD_CONTROLS:
menuBg.topLeft_x = 14.0f;
menuBg.topLeft_y = 39.0f;
menuBg.topRight_x = 636.0f;
menuBg.topRight_y = 29.0f;
menuBg.bottomLeft_x = 15.0f;
menuBg.bottomLeft_y = 426.0f;
menuBg.bottomRight_x = 630.0f;
menuBg.bottomRight_y = 398.0f;
break;
case MENUPAGE_BRIEFS:
case MENUPAGE_GRAPHICS_SETTINGS:
case MENUPAGE_MAP:
case MENUPAGE_CHOOSE_LOAD_SLOT:
case MENUPAGE_CHOOSE_DELETE_SLOT:
case MENUPAGE_CHOOSE_SAVE_SLOT:
case MENUPAGE_MOUSE_CONTROLS:
menuBg.topLeft_x = 26.0f;
menuBg.topLeft_y = 59.0f;
menuBg.topRight_x = 629.0f;
menuBg.topRight_y = 29.0f;
menuBg.bottomLeft_x = 15.0f;
menuBg.bottomLeft_y = 426.0f;
menuBg.bottomRight_x = 610.0f;
menuBg.bottomRight_y = 398.0f;
break;
default:
menuBg.topLeft_x = CGeneral::GetRandomNumber() % 40 + 65;
menuBg.topLeft_y = CGeneral::GetRandomNumber() % 40 + 21;
menuBg.topRight_x = CGeneral::GetRandomNumber() % 40 + 568;
menuBg.topRight_y = CGeneral::GetRandomNumber() % 40 + 44;
menuBg.bottomLeft_x = CGeneral::GetRandomNumber() % 40 + 36;
menuBg.bottomLeft_y = CGeneral::GetRandomNumber() % 40 + 382;
menuBg.bottomRight_x = CGeneral::GetRandomNumber() % 40 + 593;
menuBg.bottomRight_y = CGeneral::GetRandomNumber() % 40 + 342;
break;
}
menuBg.UpdateMultipliers();
if (m_menuTransitionProgress == 255)
bOptionHighlightTransitionBlend = 0;
} }
m_aFrontEndSprites[MENUSPRITE_BACKGROUND].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, FadeIn(255))); // Congrats R*, instead of solving the bug you just hacked your million dolar product.
#if 0
SetFrontEndRenderStates(); // This is how I fixed it in III, but I can't apply it here because "forceFadeInCounter > 30" gives it a unique effect.
static float fadeAlpha = 0.0f;
if (m_nMenuFadeAlpha == 0 && fadeAlpha > 1.0f) fadeAlpha = 0.0f;
// +20 per every 33 ms (1000.f/30.f - original frame limiter fps)
fadeAlpha += (frameTime) * 20.f / 33.f;
m_nMenuFadeAlpha = clamp(fadeAlpha, 0, 255);
m_menuTransitionProgress = clamp(fadeAlpha, 0, 255);
#else
static uint32 LastFade = 0;
static uint8 forceFadeInCounter = 0;
if (m_nMenuFadeAlpha >= 255) {
if (m_nMenuFadeAlpha > 255)
m_nMenuFadeAlpha = 255;
} else {
if (CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 30 || forceFadeInCounter > 30) {
m_nMenuFadeAlpha += 20;
m_menuTransitionProgress = Min(m_menuTransitionProgress + 20, 255);
LastFade = CTimer::GetTimeInMillisecondsPauseMode();
}
forceFadeInCounter++;
}
#endif
if (!transitionCall && m_menuTransitionProgress == 255) {
float oldAlpha = m_nMenuFadeAlpha;
if (oldAlpha < 255) {
int oldScreen = m_nCurrScreen;
SetFrontEndRenderStates();
m_nCurrScreen = m_nPrevScreen;
m_nMenuFadeAlpha = 255 - m_nMenuFadeAlpha;
switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT:
CMenuManager::DrawPlayerSetupScreen();
break;
case MENUPAGE_KEYBOARD_CONTROLS:
CMenuManager::DrawControllerSetupScreen();
break;
/* case MENUPAGE_OUTRO:
CMenuManager::DrawQuitGameScreen();
break; */ // TODO(Miami)
default:
CMenuManager::DrawStandardMenus();
break;
}
m_nCurrScreen = oldScreen;
m_nMenuFadeAlpha = oldAlpha;
}
}
switch (m_nCurrScreen) { switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT: case MENUPAGE_SKIN_SELECT:
@ -2252,20 +2420,24 @@ CMenuManager::DrawBackground()
case MENUPAGE_KEYBOARD_CONTROLS: case MENUPAGE_KEYBOARD_CONTROLS:
DrawControllerSetupScreen(); DrawControllerSetupScreen();
break; break;
/* case MENUPAGE_OUTRO:
CMenuManager::DrawQuitGameScreen();
break; */ // TODO(Miami)
default: default:
DrawStandardMenus(); DrawStandardMenus();
break; break;
} }
CFont::DrawFonts(); CFont::DrawFonts();
SetFrontEndRenderStates(); SetFrontEndRenderStates();
if (m_menuTransitionProgress == 255) { // TODO(Miami)
m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255)); // if (m_nCurrScreen != MENUPAGE_OUTRO)
} else { if (m_menuTransitionProgress == 255) {
m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255))); m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, 255));
} } else {
m_aFrontEndSprites[MENUSPRITE_VCLOGO].Draw(CRect(MENU_X(27.0f), MENU_Y(8.0f), MENU_X(157.0f), MENU_Y(138.0f)), CRGBA(255, 255, 255, FadeIn(255)));
}
if (m_bShowMouse) { if (m_bShowMouse) {
CRect mouse(0.0f, 0.0f, MENU_X(40.0f), MENU_Y(40.0f)); CRect mouse(0.0f, 0.0f, MENU_X(40.0f), MENU_Y(40.0f));
@ -2936,9 +3108,11 @@ CMenuManager::LoadSettings()
m_PrefsVsync = m_PrefsVsyncDisp; m_PrefsVsync = m_PrefsVsyncDisp;
CRenderer::ms_lodDistScale = m_PrefsLOD; CRenderer::ms_lodDistScale = m_PrefsLOD;
if (m_nPrefsAudio3DProviderIndex == -1) if (m_nPrefsAudio3DProviderIndex == INVALID_AUDIO_PROVIDER)
m_nPrefsAudio3DProviderIndex = -2; m_nPrefsAudio3DProviderIndex = -2;
m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
if (m_PrefsLanguage == prevLang) if (m_PrefsLanguage == prevLang)
m_bLanguageLoaded = false; m_bLanguageLoaded = false;
else { else {
@ -3021,6 +3195,7 @@ CMenuManager::SaveSettings()
CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1); CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1);
#endif #endif
} }
m_lastWorking3DAudioProvider = m_nPrefsAudio3DProviderIndex;
CFileMgr::CloseFile(fileHandle); CFileMgr::CloseFile(fileHandle);
CFileMgr::SetDir(""); CFileMgr::SetDir("");
@ -3109,30 +3284,6 @@ CMenuManager::PrintBriefs()
#endif #endif
} }
// Not sure about name. Not to be confused with CPad::PrintErrorMessage
void
CMenuManager::PrintErrorMessage()
{
if (!CPad::bDisplayNoControllerMessage && !CPad::bObsoleteControllerMessage)
return;
CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(20.0f), SCREEN_SCALE_Y(140.0f), SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f)), CRGBA(64, 16, 16, 224));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetBackgroundOff();
CFont::SetPropOn();
CFont::SetCentreOff();
CFont::SetJustifyOn();
CFont::SetRightJustifyOff();
CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f));
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_X(50.0f), SCREEN_SCALE_Y(180.0f), TheText.Get(CPad::bDisplayNoControllerMessage ? "NOCONT" : "WRCONT"));
#else
CFont::PrintString(SCREEN_SCALE_X(50.0f), SCREEN_SCALE_Y(40.0f), TheText.Get(CPad::bDisplayNoControllerMessage ? "NOCONT" : "WRCONT"));
#endif
CFont::DrawFonts();
}
void void
CMenuManager::PrintStats() CMenuManager::PrintStats()
{ {
@ -3224,6 +3375,7 @@ CMenuManager::PrintStats()
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y)); CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y));
} }
// --MIAMI: Done
void void
CMenuManager::Process(void) CMenuManager::Process(void)
{ {
@ -4022,10 +4174,7 @@ CMenuManager::ProcessButtonPresses(void)
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile); CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
SaveSettings(); SaveSettings();
} else { } else {
if (!m_bGameNotLoaded) SwitchToNewScreen(-2);
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
else
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
} }
} else if (m_nCurrScreen != MENUPAGE_MULTIPLAYER_FIND_GAME) { } else if (m_nCurrScreen != MENUPAGE_MULTIPLAYER_FIND_GAME) {
option = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action; option = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
@ -4125,11 +4274,7 @@ CMenuManager::ProcessButtonPresses(void)
if (changeMenu) { if (changeMenu) {
if (strncmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEDS_TB", 8) == 0) { if (strncmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEDS_TB", 8) == 0) {
#ifndef TIDY_UP_PBP #ifndef TIDY_UP_PBP
ResetHelperText(); RequestFrontEndShutDown();
if (!m_bGameNotLoaded)
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
else
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
#else #else
goBack = true; goBack = true;
break; break;
@ -4141,7 +4286,7 @@ CMenuManager::ProcessButtonPresses(void)
} }
#endif #endif
ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true); SwitchToNewScreen(0);
} }
} }
break; break;
@ -4153,7 +4298,7 @@ CMenuManager::ProcessButtonPresses(void)
if (saveSlot >= 2 && saveSlot <= 9) { if (saveSlot >= 2 && saveSlot <= 9) {
m_nCurrSaveSlot = saveSlot - 2; m_nCurrSaveSlot = saveSlot - 2;
if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY && Slots[m_nCurrSaveSlot + 1] != SLOT_CORRUPTED) { if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY && Slots[m_nCurrSaveSlot + 1] != SLOT_CORRUPTED) {
ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true); SwitchToNewScreen(0);
} }
} }
break; break;
@ -4176,7 +4321,7 @@ CMenuManager::ProcessButtonPresses(void)
RequestFrontEndShutDown(); RequestFrontEndShutDown();
break; break;
case MENUACTION_REDEFCTRL: case MENUACTION_REDEFCTRL:
ChangeScreen(MENUPAGE_KEYBOARD_CONTROLS, 0, true, true); SwitchToNewScreen(MENUPAGE_KEYBOARD_CONTROLS);
m_nSelectedListRow = 0; m_nSelectedListRow = 0;
m_nCurrExLayer = HOVEROPTION_LIST; m_nCurrExLayer = HOVEROPTION_LIST;
break; break;
@ -4202,7 +4347,7 @@ CMenuManager::ProcessButtonPresses(void)
#endif #endif
break; break;
case MENUACTION_DONTCANCEL: case MENUACTION_DONTCANCEL:
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true); SwitchToNewScreen(-2);
break; break;
case MENUACTION_SCREENRES: case MENUACTION_SCREENRES:
if (m_nDisplayVideoMode != m_nPrefsVideoMode) { if (m_nDisplayVideoMode != m_nPrefsVideoMode) {
@ -4231,7 +4376,7 @@ CMenuManager::ProcessButtonPresses(void)
case MENUACTION_AUDIOHW: case MENUACTION_AUDIOHW:
{ {
int selectedProvider = m_nPrefsAudio3DProviderIndex; int selectedProvider = m_nPrefsAudio3DProviderIndex;
if (selectedProvider != -1) { if (selectedProvider != INVALID_AUDIO_PROVIDER) {
m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex); m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex);
if (selectedProvider == m_nPrefsAudio3DProviderIndex) { if (selectedProvider == m_nPrefsAudio3DProviderIndex) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
@ -4246,7 +4391,7 @@ CMenuManager::ProcessButtonPresses(void)
} }
case MENUACTION_SPEAKERCONF: case MENUACTION_SPEAKERCONF:
#ifndef TIDY_UP_PBP #ifndef TIDY_UP_PBP
if (m_nPrefsAudio3DProviderIndex != -1) { if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
if (--m_PrefsSpeakers < 0) if (--m_PrefsSpeakers < 0)
m_PrefsSpeakers = 2; m_PrefsSpeakers = 2;
DMAudio.SetSpeakerConfig(m_PrefsSpeakers); DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
@ -4258,7 +4403,7 @@ CMenuManager::ProcessButtonPresses(void)
break; break;
case MENUACTION_PLAYERSETUP: case MENUACTION_PLAYERSETUP:
CPlayerSkin::BeginFrontendSkinEdit(); CPlayerSkin::BeginFrontendSkinEdit();
ChangeScreen(MENUPAGE_SKIN_SELECT, 0, true, true); SwitchToNewScreen(MENUPAGE_SKIN_SELECT);
m_nCurrExLayer = HOVEROPTION_LIST; m_nCurrExLayer = HOVEROPTION_LIST;
m_bSkinsEnumerated = false; m_bSkinsEnumerated = false;
break; break;
@ -4339,7 +4484,7 @@ CMenuManager::ProcessButtonPresses(void)
#endif #endif
break; break;
case MENUACTION_LOADRADIO: case MENUACTION_LOADRADIO:
ChangeScreen(MENUPAGE_SOUND_SETTINGS, 0, true, true); SwitchToNewScreen(MENUPAGE_SOUND_SETTINGS);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK"); OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
break; break;
@ -4384,7 +4529,6 @@ CMenuManager::ProcessButtonPresses(void)
#endif #endif
int oldScreen = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_PreviousPage[1] : aScreens[m_nCurrScreen].m_PreviousPage[0]; int oldScreen = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_PreviousPage[1] : aScreens[m_nCurrScreen].m_PreviousPage[0];
int oldOption = !m_bGameNotLoaded ? aScreens[m_nCurrScreen].m_ParentEntry[1] : aScreens[m_nCurrScreen].m_ParentEntry[0];
if (oldScreen != -1) { if (oldScreen != -1) {
ThingsToDoBeforeLeavingPage(); ThingsToDoBeforeLeavingPage();
@ -4396,7 +4540,7 @@ CMenuManager::ProcessButtonPresses(void)
} else } else
#endif #endif
{ {
ChangeScreen(oldScreen, oldOption, true, true); SwitchToNewScreen(-2);
} }
// We will go back for sure at this point, why process other things?! // We will go back for sure at this point, why process other things?!
@ -4523,14 +4667,14 @@ CMenuManager::ProcessButtonPresses(void)
break; break;
#endif #endif
case MENUACTION_AUDIOHW: case MENUACTION_AUDIOHW:
if (m_nPrefsAudio3DProviderIndex != -1) { if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
m_nPrefsAudio3DProviderIndex += changeValueBy; m_nPrefsAudio3DProviderIndex += changeValueBy;
m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1); m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1);
} }
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
break; break;
case MENUACTION_SPEAKERCONF: case MENUACTION_SPEAKERCONF:
if (m_nPrefsAudio3DProviderIndex != -1) { if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
m_PrefsSpeakers -= changeValueBy; m_PrefsSpeakers -= changeValueBy;
m_PrefsSpeakers = clamp(m_PrefsSpeakers, 0, 2); m_PrefsSpeakers = clamp(m_PrefsSpeakers, 0, 2);
DMAudio.SetSpeakerConfig(m_PrefsSpeakers); DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
@ -4679,20 +4823,20 @@ CMenuManager::SaveLoadFileError_SetUpErrorScreen()
case SAVESTATUS_ERR_SAVE_CREATE: case SAVESTATUS_ERR_SAVE_CREATE:
case SAVESTATUS_ERR_SAVE_WRITE: case SAVESTATUS_ERR_SAVE_WRITE:
case SAVESTATUS_ERR_SAVE_CLOSE: case SAVESTATUS_ERR_SAVE_CLOSE:
ChangeScreen(MENUPAGE_SAVE_FAILED, 0, true, false); SwitchToNewScreen(MENUPAGE_SAVE_FAILED);
break; break;
case SAVESTATUS_ERR_LOAD_OPEN: case SAVESTATUS_ERR_LOAD_OPEN:
case SAVESTATUS_ERR_LOAD_READ: case SAVESTATUS_ERR_LOAD_READ:
case SAVESTATUS_ERR_LOAD_CLOSE: case SAVESTATUS_ERR_LOAD_CLOSE:
ChangeScreen(MENUPAGE_LOAD_FAILED, 0, true, false); SwitchToNewScreen(MENUPAGE_LOAD_FAILED);
break; break;
case SAVESTATUS_ERR_DATA_INVALID: case SAVESTATUS_ERR_DATA_INVALID:
ChangeScreen(MENUPAGE_LOAD_FAILED_2, 0, true, false); SwitchToNewScreen(MENUPAGE_LOAD_FAILED_2);
break; break;
case SAVESTATUS_DELETEFAILED8: case SAVESTATUS_DELETEFAILED8:
case SAVESTATUS_DELETEFAILED9: case SAVESTATUS_DELETEFAILED9:
case SAVESTATUS_DELETEFAILED10: case SAVESTATUS_DELETEFAILED10:
ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false); SwitchToNewScreen(MENUPAGE_DELETE_FAILED);
break; break;
default: break; default: break;
} }
@ -4736,7 +4880,7 @@ CMenuManager::ProcessFileActions()
} }
if (SlotPopulated) if (SlotPopulated)
ChangeScreen(MENUPAGE_DELETE_SUCCESS, 0, true, false); SwitchToNewScreen(MENUPAGE_DELETE_SUCCESS);
else else
SaveLoadFileError_SetUpErrorScreen(); SaveLoadFileError_SetUpErrorScreen();
} }
@ -4744,7 +4888,7 @@ CMenuManager::ProcessFileActions()
int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot); int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
PcSaveHelper.PopulateSlotInfo(); PcSaveHelper.PopulateSlotInfo();
if (SaveSlot) if (SaveSlot)
ChangeScreen(MENUPAGE_SAVE_SUCCESSFUL, 0, true, false); SwitchToNewScreen(MENUPAGE_SAVE_SUCCESSFUL);
else else
SaveLoadFileError_SetUpErrorScreen(); SaveLoadFileError_SetUpErrorScreen();
} }
@ -4758,6 +4902,7 @@ CMenuManager::ProcessFileActions()
} }
} }
// --MIAMI: Done except DxInput things, are they even needed?
void void
CMenuManager::SwitchMenuOnAndOff() CMenuManager::SwitchMenuOnAndOff()
{ {

View file

@ -433,10 +433,10 @@ struct CMenuScreen
struct MenuTrapezoid struct MenuTrapezoid
{ {
float topRight_x;
float topRight_y;
float topLeft_x; float topLeft_x;
float topLeft_y; float topLeft_y;
float topRight_x;
float topRight_y;
float bottomLeft_x; float bottomLeft_x;
float bottomLeft_y; float bottomLeft_y;
float bottomRight_x; float bottomRight_x;
@ -459,15 +459,48 @@ struct MenuTrapezoid
float mult_bottomRight_y; float mult_bottomRight_y;
MenuTrapezoid(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) { MenuTrapezoid(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) {
topRight_x = x1; topLeft_x = x1;
topRight_y = y1; topLeft_y = y1;
topLeft_x = x2; topRight_x = x2;
topLeft_y = y2; topRight_y = y2;
bottomLeft_x = x3; bottomLeft_x = x3;
bottomLeft_y = y3; bottomLeft_y = y3;
bottomRight_x = x4; bottomRight_x = x4;
bottomRight_y = y4; bottomRight_y = y4;
}; };
void SaveCurrentCoors() {
old_topLeft_x = topLeft_x;
old_topLeft_y = topLeft_y;
old_topRight_x = topRight_x;
old_topRight_y = topRight_y;
old_bottomLeft_x = bottomLeft_x;
old_bottomLeft_y = bottomLeft_y;
old_bottomRight_x = bottomRight_x;
old_bottomRight_y = bottomRight_y;
}
void Translate(int delta) {
bottomRight_x = delta * mult_bottomRight_x + old_bottomRight_x;
bottomRight_y = delta * mult_bottomRight_y + old_bottomRight_y;
bottomLeft_x = delta * mult_bottomLeft_x + old_bottomLeft_x;
bottomLeft_y = delta * mult_bottomLeft_y + old_bottomLeft_y;
topRight_x = delta * mult_topRight_x + old_topRight_x;
topRight_y = delta * mult_topRight_y + old_topRight_y;
topLeft_x = delta * mult_topLeft_x + old_topLeft_x;
topLeft_y = delta * mult_topLeft_y + old_topLeft_y;
}
void UpdateMultipliers() {
mult_bottomRight_x = (bottomRight_x - old_bottomRight_x) / 255.0f;
mult_bottomRight_y = (bottomRight_y - old_bottomRight_y) / 255.0f;
mult_bottomLeft_x = (bottomLeft_x - old_bottomLeft_x) / 255.0f;
mult_bottomLeft_y = (bottomLeft_y - old_bottomLeft_y) / 255.0f;
mult_topRight_x = (topRight_x - old_topRight_x) / 255.0f;
mult_topRight_y = (topRight_y - old_topRight_y) / 255.0f;
mult_topLeft_x = (topLeft_x - old_topLeft_x) / 255.0f;
mult_topLeft_y = (topLeft_y - old_topLeft_y) / 255.0f;
}
}; };
class CMenuManager class CMenuManager
@ -523,7 +556,7 @@ public:
int32 m_nMouseTempPosX; int32 m_nMouseTempPosX;
int32 m_nMouseTempPosY; int32 m_nMouseTempPosY;
bool m_bGameNotLoaded; bool m_bGameNotLoaded;
int8 m_3DProviderOnLastSaveLoad; int8 m_lastWorking3DAudioProvider;
bool m_bFrontEnd_ReloadObrTxtGxt; bool m_bFrontEnd_ReloadObrTxtGxt;
int32 *pEditString; int32 *pEditString;
uint8 field_74[4]; uint8 field_74[4];
@ -625,7 +658,7 @@ public:
void DrawControllerScreenExtraText(int, int, int); void DrawControllerScreenExtraText(int, int, int);
void DrawControllerSetupScreen(); void DrawControllerSetupScreen();
void DrawFrontEnd(); void DrawFrontEnd();
void DrawBackground(); void DrawBackground(bool transitionCall);
void DrawPlayerSetupScreen(); void DrawPlayerSetupScreen();
int FadeIn(int alpha); int FadeIn(int alpha);
void FilterOutColorMarkersFromString(wchar*, CRGBA &); void FilterOutColorMarkersFromString(wchar*, CRGBA &);
@ -656,6 +689,7 @@ public:
void WaitForUserCD(); void WaitForUserCD();
int GetNumOptionsCntrlConfigScreens(); int GetNumOptionsCntrlConfigScreens();
int ConstructStatLine(int); int ConstructStatLine(int);
void SwitchToNewScreen(int8);
// New (not in function or inlined in the game) // New (not in function or inlined in the game)
void ThingsToDoBeforeLeavingPage(); void ThingsToDoBeforeLeavingPage();

View file

@ -542,6 +542,13 @@ void CGame::InitialiseWhenRestarting(void)
CTimer::Initialise(); CTimer::Initialise();
CSprite2d::SetRecipNearClip(); CSprite2d::SetRecipNearClip();
if (b_FoundRecentSavedGameWantToLoad || FrontEndMenuManager.m_bWantToLoad)
{
LoadSplash("splash1");
if (FrontEndMenuManager.m_bWantToLoad)
FrontEndMenuManager.MessageScreen("FELD_WR", true);
}
b_FoundRecentSavedGameWantToLoad = false; b_FoundRecentSavedGameWantToLoad = false;
TheCamera.Init(); TheCamera.Init();
@ -667,14 +674,8 @@ void CGame::Process(void)
void void
CGame::InitAfterFocusLoss() CGame::InitAfterFocusLoss()
{ {
/* FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = FrontEndMenuManager.m_lastWorking3DAudioProvider;
byte_869656 = byte_86969D; DMAudio.SetCurrent3DProvider(FrontEndMenuManager.m_lastWorking3DAudioProvider);
result = cDMAudio::SetCurrent3DProvider(byte_86969D);
if ( !bGameStarted && !bMenuVisible )
byte_869642 = 1;
*/
//cDMAudio::SetCurrent3DProvider( ? ? ? );
if (!FrontEndMenuManager.m_bGameNotLoaded && !FrontEndMenuManager.m_bMenuActive) if (!FrontEndMenuManager.m_bGameNotLoaded && !FrontEndMenuManager.m_bMenuActive)
FrontEndMenuManager.m_bStartUpFrontEndRequested = true; FrontEndMenuManager.m_bStartUpFrontEndRequested = true;

View file

@ -137,9 +137,10 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR
CRGBA TopColor(TopRed, TopGreen, TopBlue, Alpha); CRGBA TopColor(TopRed, TopGreen, TopBlue, Alpha);
CRGBA BottomColor(BottomRed, BottomGreen, BottomBlue, Alpha); CRGBA BottomColor(BottomRed, BottomGreen, BottomBlue, Alpha);
CDraw::CalculateAspectRatio();
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO); CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
CVisibilityPlugins::SetRenderWareCamera(Scene.camera); CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); RwCameraClear(Scene.camera, &TopColor.rwRGBA, rwCAMERACLEARZ);
if(!RsCameraBeginUpdate(Scene.camera)) if(!RsCameraBeginUpdate(Scene.camera))
return false; return false;
@ -155,6 +156,7 @@ DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomR
bool bool
DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha) DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha)
{ {
CDraw::CalculateAspectRatio();
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO); CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
CVisibilityPlugins::SetRenderWareCamera(Scene.camera); CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ);
@ -948,15 +950,12 @@ Render2dStuffAfterFade(void)
CHud::DrawAfterFade(); CHud::DrawAfterFade();
CFont::DrawFonts(); CFont::DrawFonts();
CCredits::Render();
} }
void void
Idle(void *arg) Idle(void *arg)
{ {
#ifdef ASPECT_RATIO_SCALE
CDraw::SetAspectRatio(CDraw::FindAspectRatio());
#endif
CTimer::Update(); CTimer::Update();
#ifdef TIMEBARS #ifdef TIMEBARS
@ -1062,6 +1061,7 @@ Idle(void *arg)
tbEndTimer("Render2dStuff"); tbEndTimer("Render2dStuff");
#endif #endif
}else{ }else{
CDraw::CalculateAspectRatio();
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO); CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
#else #else
@ -1090,7 +1090,7 @@ Idle(void *arg)
#ifdef TIMEBARS #ifdef TIMEBARS
tbEndTimer("Render2dStuff-Fade"); tbEndTimer("Render2dStuff-Fade");
#endif #endif
CCredits::Render(); // CCredits::Render(); // They added it to function above and also forgot it here
#ifdef TIMEBARS #ifdef TIMEBARS
tbDisplay(); tbDisplay();
@ -1105,10 +1105,7 @@ Idle(void *arg)
void void
FrontendIdle(void) FrontendIdle(void)
{ {
#ifdef ASPECT_RATIO_SCALE CDraw::CalculateAspectRatio();
CDraw::SetAspectRatio(CDraw::FindAspectRatio());
#endif
CTimer::Update(); CTimer::Update();
CSprite2d::SetRecipNearClip(); // this should be on InitialiseRenderWare according to PS2 asm. seems like a bug fix CSprite2d::SetRecipNearClip(); // this should be on InitialiseRenderWare according to PS2 asm. seems like a bug fix
CSprite2d::InitPerFrame(); CSprite2d::InitPerFrame();
@ -1119,11 +1116,7 @@ FrontendIdle(void)
if(RsGlobal.quit) if(RsGlobal.quit)
return; return;
#ifdef ASPECT_RATIO_SCALE
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO); CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
#else
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, DEFAULT_ASPECT_RATIO);
#endif
CVisibilityPlugins::SetRenderWareCamera(Scene.camera); CVisibilityPlugins::SetRenderWareCamera(Scene.camera);
RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ); RwCameraClear(Scene.camera, &gColourTop, rwCAMERACLEARZ);
if(!RsCameraBeginUpdate(Scene.camera)) if(!RsCameraBeginUpdate(Scene.camera))
@ -1133,7 +1126,7 @@ FrontendIdle(void)
RenderMenus(); RenderMenus();
DoFade(); DoFade();
Render2dStuffAfterFade(); Render2dStuffAfterFade();
// CFont::DrawFonts(); // redundant CFont::DrawFonts();
DoRWStuffEndOfFrame(); DoRWStuffEndOfFrame();
} }
@ -1239,9 +1232,8 @@ TheModelViewer(void)
#if (defined(GTA_PS2) || defined(GTA_XBOX)) #if (defined(GTA_PS2) || defined(GTA_XBOX))
//TODO //TODO
#else #else
#ifdef ASPECT_RATIO_SCALE
CDraw::SetAspectRatio(CDraw::FindAspectRatio()); CDraw::CalculateAspectRatio();
#endif
CAnimViewer::Update(); CAnimViewer::Update();
CTimer::Update(); CTimer::Update();
SetLightsWithTimeOfDayColour(Scene.world); SetLightsWithTimeOfDayColour(Scene.world);

View file

@ -680,7 +680,7 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed)
spentAmmoCheck: spentAmmoCheck:
if (CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_eWeaponFire != WEAPON_FIRE_MELEE if (CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_eWeaponFire != WEAPON_FIRE_MELEE
/*&& (!padUsed->GetWeapon() || GetWeapon()->m_eWeaponType != WEAPONTYPE_MINIGUN) */) { && (!padUsed->GetWeapon() || GetWeapon()->m_eWeaponType != WEAPONTYPE_MINIGUN)) {
if (GetWeapon()->m_nAmmoTotal <= 0) { if (GetWeapon()->m_nAmmoTotal <= 0) {
if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER
@ -1019,8 +1019,8 @@ CPlayerPed::ProcessAnimGroups(void)
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER) if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER)
groupToSet = ASSOCGRP_ROCKETLEFT; groupToSet = ASSOCGRP_ROCKETLEFT;
else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW || else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW ||
GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER ||
/* || GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN*/ ) GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
groupToSet = ASSOCGRP_CHAINSAWLEFT; groupToSet = ASSOCGRP_CHAINSAWLEFT;
else else
groupToSet = ASSOCGRP_PLAYERLEFT; groupToSet = ASSOCGRP_PLAYERLEFT;
@ -1028,8 +1028,8 @@ CPlayerPed::ProcessAnimGroups(void)
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER) if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER)
groupToSet = ASSOCGRP_ROCKETRIGHT; groupToSet = ASSOCGRP_ROCKETRIGHT;
else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW || else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW ||
GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER ||
/* || GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN*/) GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
groupToSet = ASSOCGRP_CHAINSAWRIGHT; groupToSet = ASSOCGRP_CHAINSAWRIGHT;
else else
groupToSet = ASSOCGRP_PLAYERRIGHT; groupToSet = ASSOCGRP_PLAYERRIGHT;
@ -1038,8 +1038,8 @@ CPlayerPed::ProcessAnimGroups(void)
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER) if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER)
groupToSet = ASSOCGRP_ROCKETBACK; groupToSet = ASSOCGRP_ROCKETBACK;
else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW || else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW ||
GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER ||
/* || GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN*/) GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
groupToSet = ASSOCGRP_CHAINSAWBACK; groupToSet = ASSOCGRP_CHAINSAWBACK;
else else
groupToSet = ASSOCGRP_PLAYERBACK; groupToSet = ASSOCGRP_PLAYERBACK;
@ -1052,16 +1052,15 @@ CPlayerPed::ProcessAnimGroups(void)
|| GetWeapon()->m_eWeaponType == WEAPONTYPE_MACHETE) || GetWeapon()->m_eWeaponType == WEAPONTYPE_MACHETE)
groupToSet = ASSOCGRP_PLAYERBBBAT; groupToSet = ASSOCGRP_PLAYERBBBAT;
else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW || else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CHAINSAW ||
GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER ||
/* || GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN*/) GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
groupToSet = ASSOCGRP_PLAYERCHAINSAW; groupToSet = ASSOCGRP_PLAYERCHAINSAW;
else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI
// I hope this was inlined... // I hope this is a inlined function...
/* && GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON*/ && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5 && GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA && GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA
/* && GetWeapon()->m_eWeaponType != WEAPONTYPE_CAMERA */) { && GetWeapon()->m_eWeaponType != WEAPONTYPE_CAMERA) {
if (!GetWeapon()->IsType2Handed()) { if (!GetWeapon()->IsType2Handed()) {
groupToSet = ASSOCGRP_PLAYER; groupToSet = ASSOCGRP_PLAYER;
} else { } else {
@ -1093,7 +1092,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER || if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER ||
GetWeapon()->m_eWeaponType == WEAPONTYPE_SNIPERRIFLE || GetWeapon()->m_eWeaponType == WEAPONTYPE_M4 || GetWeapon()->m_eWeaponType == WEAPONTYPE_SNIPERRIFLE || GetWeapon()->m_eWeaponType == WEAPONTYPE_M4 ||
GetWeapon()->m_eWeaponType == WEAPONTYPE_RUGER) { GetWeapon()->m_eWeaponType == WEAPONTYPE_RUGER) {
if (padUsed->TargetJustDown() || TheCamera.m_bJustJumpedOutOf1stPersonBecauseOfTarget) { if (padUsed->TargetJustDown()/* || TheCamera.m_bAllow1rstPersonWeaponsCamera */) { // TODO(Miami): Cam
SetStoredState(); SetStoredState();
m_nPedState = PED_SNIPER_MODE; m_nPedState = PED_SNIPER_MODE;
#ifdef FREE_CAM #ifdef FREE_CAM
@ -1240,7 +1239,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
#else #else
else if (weaponInfo->m_bCanAim && !CCamera::m_bUseMouse3rdPerson) { else if (weaponInfo->m_bCanAim && !CCamera::m_bUseMouse3rdPerson) {
#endif #endif
if (padUsed->TargetJustDown()) if (padUsed->TargetJustDown()/* || TheCamera.m_bAllow1rstPersonWeaponsCamera */) // TODO(Miami): Cam
FindWeaponLockOnTarget(); FindWeaponLockOnTarget();
} }
} else if (m_pPointGunAt) { } else if (m_pPointGunAt) {

View file

@ -19,24 +19,23 @@ uint8 CDraw::FadeGreen;
uint8 CDraw::FadeBlue; uint8 CDraw::FadeBlue;
float float
CDraw::FindAspectRatio(void) CDraw::CalculateAspectRatio(void)
{ {
#ifndef ASPECT_RATIO_SCALE if (FrontEndMenuManager.m_PrefsUseWideScreen) {
if(FrontEndMenuManager.m_PrefsUseWideScreen) if (TheCamera.m_WideScreenOn)
return 16.0f/9.0f; CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki
else else
return 4.0f/3.0f; #ifdef ASPECT_RATIO_SCALE
CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? SCREEN_WIDTH / SCREEN_HEIGHT : 16.f / 9.f;
#else #else
switch (FrontEndMenuManager.m_PrefsUseWideScreen) { CDraw::ms_fAspectRatio = 16.f / 9.f;
case AR_AUTO:
return SCREEN_WIDTH / SCREEN_HEIGHT;
default:
case AR_4_3:
return 4.0f / 3.0f;
case AR_16_9:
return 16.0f / 9.0f;
};
#endif #endif
} else if (TheCamera.m_WideScreenOn) {
CDraw::ms_fAspectRatio = 5.f/4.f;
} else {
CDraw::ms_fAspectRatio = 4.f/3.f;
}
return CDraw::ms_fAspectRatio;
} }
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE

View file

@ -38,12 +38,10 @@ public:
static void SetFOV(float fov); static void SetFOV(float fov);
static float GetFOV(void) { return ms_fFOV; } static float GetFOV(void) { return ms_fFOV; }
static float FindAspectRatio(void); static float CalculateAspectRatio(void);
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
static float ConvertFOV(float fov); static float ConvertFOV(float fov);
#endif
static float GetAspectRatio(void) { return ms_fAspectRatio; } static float GetAspectRatio(void) { return ms_fAspectRatio; }
static void SetAspectRatio(float ratio) { ms_fAspectRatio = ratio; } static void SetAspectRatio(float ratio) { ms_fAspectRatio = ratio; }
#else
static float GetAspectRatio(void) { return FindAspectRatio(); }
#endif
}; };

View file

@ -68,8 +68,8 @@ class CFont
static int16 Size[MAX_FONTS][193]; static int16 Size[MAX_FONTS][193];
#endif #endif
static int16 NewLine; static int16 NewLine;
static CSprite2d Sprite[MAX_FONTS];
public: public:
static CSprite2d Sprite[MAX_FONTS];
static CFontDetails Details; static CFontDetails Details;
static void Initialise(void); static void Initialise(void);

View file

@ -4,11 +4,11 @@
#include "Draw.h" #include "Draw.h"
#include "Camera.h" #include "Camera.h"
#include "Sprite2d.h" #include "Sprite2d.h"
#include "Font.h"
RwIm2DVertex CSprite2d::maVertices[8]; RwIm2DVertex CSprite2d::maVertices[8];
float CSprite2d::RecipNearClip; float CSprite2d::RecipNearClip;
int32 CSprite2d::mCurrentBank; int32 CSprite2d::mCurrentBank;
RwTexture *CSprite2d::mpBankTextures[10];
int32 CSprite2d::mCurrentSprite[10]; int32 CSprite2d::mCurrentSprite[10];
int32 CSprite2d::mBankStart[10]; int32 CSprite2d::mBankStart[10];
RwIm2DVertex CSprite2d::maBankVertices[500]; RwIm2DVertex CSprite2d::maBankVertices[500];
@ -16,7 +16,7 @@ RwIm2DVertex CSprite2d::maBankVertices[500];
void void
CSprite2d::SetRecipNearClip(void) CSprite2d::SetRecipNearClip(void)
{ {
RecipNearClip = 1.0f / RwCameraGetNearClipPlane(Scene.camera); // Used but empty in VC, instead they set in InitPerFrame. Isn't that great?
} }
void void
@ -24,17 +24,15 @@ CSprite2d::InitPerFrame(void)
{ {
int i; int i;
RecipNearClip = 1.0f / RwCameraGetNearClipPlane(Scene.camera);
mCurrentBank = 0; mCurrentBank = 0;
for(i = 0; i < 10; i++) for(i = 0; i < 10; i++)
mCurrentSprite[i] = 0; mCurrentSprite[i] = 0;
for(i = 0; i < 10; i++)
mpBankTextures[i] = nil;
} }
int32 int32
CSprite2d::GetBank(int32 n, RwTexture *tex) CSprite2d::GetBank(int32 n, RwTexture *tex)
{ {
mpBankTextures[mCurrentBank] = tex;
mCurrentSprite[mCurrentBank] = 0; mCurrentSprite[mCurrentBank] = 0;
mBankStart[mCurrentBank+1] = mBankStart[mCurrentBank] + n; mBankStart[mCurrentBank+1] = mBankStart[mCurrentBank] + n;
return mCurrentBank++; return mCurrentBank++;
@ -59,13 +57,14 @@ CSprite2d::DrawBank(int32 bank)
{ {
if(mCurrentSprite[bank] == 0) if(mCurrentSprite[bank] == 0)
return; return;
RwRenderStateSet(rwRENDERSTATETEXTURERASTER,
mpBankTextures[bank] ? RwTextureGetRaster(mpBankTextures[bank]) : nil); // This is hacked III function to make it work with VC frontend.
CFont::Sprite[bank].SetRenderState();
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR); RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, &maBankVertices[6*mBankStart[bank]], 6*mCurrentSprite[bank]); RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, &maBankVertices[6*mBankStart[bank]], 6*mCurrentSprite[bank]);
mCurrentSprite[bank] = 0; mCurrentSprite[bank] = 0;
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); //RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
} }

View file

@ -3030,7 +3030,7 @@ CAutomobile::ProcessBuoyancy(void)
void void
CAutomobile::DoDriveByShootings(void) CAutomobile::DoDriveByShootings(void)
{ {
CAnimBlendAssociation *anim; CAnimBlendAssociation *anim = nil;
CPlayerInfo* playerInfo = ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed(); CPlayerInfo* playerInfo = ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed();
if (playerInfo && !playerInfo->m_bDriveByAllowed) if (playerInfo && !playerInfo->m_bDriveByAllowed)
return; return;

View file

@ -930,7 +930,7 @@ CBoat::AddWakePoint(CVector point)
void void
CBoat::DoDriveByShootings(void) CBoat::DoDriveByShootings(void)
{ {
CAnimBlendAssociation *anim; CAnimBlendAssociation *anim = nil;
CPlayerInfo* playerInfo = ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed(); CPlayerInfo* playerInfo = ((CPlayerPed*)this)->GetPlayerInfoForThisPlayerPed();
if (playerInfo && !playerInfo->m_bDriveByAllowed) if (playerInfo && !playerInfo->m_bDriveByAllowed)
return; return;