From 48cf8b6629da53443be6b1580ee15ad768c53370 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 28 Jun 2019 19:23:28 +0200 Subject: misc stuff, mostly collision --- src/main.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index d1ffbe6b..7b7c28e4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,6 +90,18 @@ void PrintGameVersion(); RwRGBA gColourTop; +#ifndef DEBUG +// This is the weirdest shit. In Debug this causes my game to crash in CPed::IsPedInControl shortly after level change +void +InitialiseGame(void) +{ + LoadingScreen(nil, nil, "loadsc0"); + CGame::Initialise("DATA\\GTA3.DAT"); +} +#else +WRAPPER void InitialiseGame(void) { EAXJMP(0x48E7E0); } +#endif + void Idle(void *arg) { @@ -591,6 +603,25 @@ ResetLoadingScreenBar(void) NumberOfChunksLoaded = 0.0f; } +WRAPPER void +LoadingIslandScreen(const char *levelName) +{ + EAXJMP(0x48DA50); +} + +char* +GetLevelSplashScreen(int level) +{ + static char *splashScreens[4] = { + nil, + "splash1", + "splash2", + "splash3", + }; + + return splashScreens[level]; +} + char* GetRandomSplashScreen(void) { -- cgit v1.2.3 From 0711bfacd451b8cbe59ae08efd595178e928f7dc Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 28 Jun 2019 21:24:22 +0200 Subject: fixed CFileMgr, the craziest bug i ever had --- src/main.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 7b7c28e4..8835bee9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,17 +90,12 @@ void PrintGameVersion(); RwRGBA gColourTop; -#ifndef DEBUG -// This is the weirdest shit. In Debug this causes my game to crash in CPed::IsPedInControl shortly after level change void InitialiseGame(void) { LoadingScreen(nil, nil, "loadsc0"); CGame::Initialise("DATA\\GTA3.DAT"); } -#else -WRAPPER void InitialiseGame(void) { EAXJMP(0x48E7E0); } -#endif void Idle(void *arg) -- cgit v1.2.3 From 38a7b74b1a10ec64b0ebac060cac92786081f3e0 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 28 Jun 2019 22:23:55 +0200 Subject: island load screen, some more CText --- src/main.cpp | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 8835bee9..c8af9ae0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -598,10 +598,46 @@ ResetLoadingScreenBar(void) NumberOfChunksLoaded = 0.0f; } -WRAPPER void +void LoadingIslandScreen(const char *levelName) { - EAXJMP(0x48DA50); + CSprite2d *splash; + wchar *name; + char str[100]; + wchar wstr[80]; + CRGBA col; + + splash = LoadSplash(nil); + name = TheText.Get(levelName); + if(!DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255)) + return; + + CSprite2d::SetRecipNearClip(); + CSprite2d::InitPerFrame(); + CFont::InitPerFrame(); + DefinedState(); + col = CRGBA(255, 255, 255, 255); + splash->Draw(CRect(0.0f, 0.0f, SCREENW, SCREENH), col, col, col, col); + CFont::SetBackgroundOff(); + CFont::SetScale(1.5f, 1.5f); + CFont::SetPropOn(); + CFont::SetRightJustifyOn(); + CFont::SetRightJustifyWrap(150.0f); + CFont::SetFontStyle(FONT_HEADING); + sprintf(str, "WELCOME TO"); + AsciiToUnicode(str, wstr); + CFont::SetDropColor(CRGBA(0, 0, 0, 255)); + 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")); + 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::DrawFonts(); + DoRWStuffEndOfFrame(); } char* -- cgit v1.2.3