diff options
Diffstat (limited to 'src/core/main.cpp')
-rw-r--r-- | src/core/main.cpp | 101 |
1 files changed, 74 insertions, 27 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp index d4ef8c4b..0009048d 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -2,6 +2,10 @@ #include "rpmatfx.h" #include "rphanim.h" #include "rpskin.h" +#include "rtbmp.h" +#ifndef LIBRW +#include "rpanisot.h" +#endif #include "main.h" #include "CdStream.h" @@ -61,8 +65,10 @@ #include "MemoryCard.h" #include "SceneEdit.h" #include "debugmenu.h" +#include "Clock.h" #include "Occlusion.h" #include "Ropes.h" +#include "custompipes.h" GlobalScene Scene; @@ -279,6 +285,28 @@ DoFade(void) } } +bool +RwGrabScreen(RwCamera *camera, RwChar *filename) +{ + char temp[255]; + RwImage *pImage = RsGrabScreen(camera); + bool result = true; + + if (pImage == nil) + return false; + + strcpy(temp, CFileMgr::GetRootDirName()); + strcat(temp, filename); + + if (RtBMPImageWrite(pImage, &temp[0]) == nil) + result = false; + RwImageDestroy(pImage); + return result; +} + +#define TILE_WIDTH 576 +#define TILE_HEIGHT 432 + void DoRWStuffEndOfFrame(void) { @@ -287,6 +315,20 @@ DoRWStuffEndOfFrame(void) FlushObrsPrintfs(); RwCameraEndUpdate(Scene.camera); RsCameraShowRaster(Scene.camera); +#ifndef MASTER + char s[48]; + if (CPad::GetPad(1)->GetLeftShockJustDown()) { + // try using both controllers for this thing... crazy bastards + if (CPad::GetPad(0)->GetRightStickY() > 0) { + sprintf(s, "screen%d%d.ras", CClock::ms_nGameClockHours, CClock::ms_nGameClockMinutes); + // TODO + //RtTileRender(Scene.camera, TILE_WIDTH * 2, TILE_HEIGHT * 2, TILE_WIDTH, TILE_HEIGHT, &NewTileRendererCB, nil, s); + } else { + sprintf(s, "screen%d%d.bmp", CClock::ms_nGameClockHours, CClock::ms_nGameClockMinutes); + RwGrabScreen(Scene.camera, s); + } + } +#endif // !MASTER } static RwBool @@ -345,6 +387,12 @@ PluginAttach(void) return FALSE; } +#ifndef LIBRW + RpAnisotPluginAttach(); +#endif +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeRegister(); +#endif return TRUE; } @@ -358,7 +406,11 @@ Initialise3D(void *param) DebugMenuInit(); DebugMenuPopulate(); #endif // !DEBUGMENU - return CGame::InitialiseRenderWare(); + bool ret = CGame::InitialiseRenderWare(); +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeInit(); // need Scene.world for this +#endif + return ret; } return (FALSE); @@ -367,6 +419,9 @@ Initialise3D(void *param) static void Terminate3D(void) { +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeShutdown(); +#endif CGame::ShutdownRenderWare(); #ifdef DEBUGMENU DebugMenuShutdown(); @@ -554,17 +609,13 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen) } } +//--MIAMI: done void LoadingIslandScreen(const char *levelName) { 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; @@ -572,26 +623,10 @@ LoadingIslandScreen(const char *levelName) CSprite2d::InitPerFrame(); CFont::InitPerFrame(); DefinedState(); - col = CRGBA(255, 255, 255, 255); + CRGBA col = CRGBA(255, 255, 255, 255); + CRGBA col2 = CRGBA(0, 0, 0, 255); + CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), col2); 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(); - 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(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(SCREEN_WIDTH-20, SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr); CFont::DrawFonts(); DoRWStuffEndOfFrame(); } @@ -852,7 +887,7 @@ RenderScene(void) CRenderer::RenderFadingInEntities(); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); CWeather::RenderRainStreaks(); - // CCoronas::RenderSunReflection + CCoronas::RenderSunReflection(); } void @@ -1065,6 +1100,12 @@ Idle(void *arg) tbEndTimer("PreRender"); #endif +#ifdef FIX_BUGS + // This has to be done BEFORE RwCameraBeginUpdate + RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); + RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); +#endif + if(CWeather::LightningFlash && !CCullZones::CamNoRain()){ if(!DoRWStuffStartOfFrame_Horizon(255, 255, 255, 255, 255, 255, 255)) return; @@ -1077,9 +1118,10 @@ Idle(void *arg) DefinedState(); - // BUG. This has to be done BEFORE RwCameraBeginUpdate +#ifndef FIX_BUGS RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); +#endif #ifdef TIMEBARS tbStartTimer(0, "RenderScene"); @@ -1088,6 +1130,11 @@ Idle(void *arg) #ifdef TIMEBARS tbEndTimer("RenderScene"); #endif + +#ifdef EXTENDED_PIPELINES + CustomPipes::EnvMapRender(); +#endif + RenderDebugShit(); RenderEffects(); |