/* =================== idPlayerView::RenderPlayerView =================== */ void idPlayerView::RenderPlayerView(idUserInterface *hud) { const renderView_t *view = player->GetRenderView(); if (g_skipViewEffects.GetBool()) { SingleView(hud, view); } else { if (player->GetInfluenceMaterial() || player->GetInfluenceEntity()) { InfluenceVision(hud, view); } else if (gameLocal.time < dvFinishTime) { DoubleVision(hud, view, dvFinishTime - gameLocal.time); } else if (player->PowerUpActive(BERSERK)) { BerserkVision(hud, view); } else { SingleView(hud, view); } ScreenFade(); } if (net_clientLagOMeter.GetBool() && lagoMaterial && gameLocal.isClient) { renderSystem->SetColor4(1.0f, 1.0f, 1.0f, 1.0f); renderSystem->DrawStretchPic(10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial); } }
/* =================== idPlayerView::RenderPlayerView =================== */ void idPlayerView::RenderPlayerView( idUserInterface *hud ) { const renderView_t *view = player->GetRenderView(); SingleView( hud, view ); ScreenFade(); if ( net_clientLagOMeter.GetBool() && lagoMaterial && gameLocal.isClient ) { renderSystem->SetColor4( 1.0f, 1.0f, 1.0f, 1.0f ); renderSystem->DrawStretchPic( 10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial ); } }
void CGeneral::BonusGame() { int i, j, k; char dat[] = {0xe9, 0x85, 0x8d, 0x00, 0xe7, 0x89, 0x8c, 0x00, 0xe5, 0x87, 0xba, 0x00, 0xe8, 0xa1, 0x80, 0x00, 0xe5, 0xa5, 0x96, 0xe5, 0x8a, 0xb1, 0xe6, 0xb8, 0xb8, 0xe6, 0x88, 0x8f, 0x00}; SDL_BlitSurface(m_imgBonusGame, NULL, gpScreen, NULL); UpdateScreen(); PlayMusic(m_musBGame, 0); UTIL_Delay(6000); bool locked = false; if (SDL_MUSTLOCK(gpScreen)) { SDL_LockSurface(gpScreen); locked = true; } for (i = 0; i < 640; i++) { for (j = 0; j < 480; j++) { unsigned char r, g, b; k = 0; UTIL_GetPixel(gpScreen, i, j, &r, &g, &b); k += r; k += g; k += b; k /= 3; UTIL_PutPixel(gpScreen, i, j, k, k, k); } } if (locked) { SDL_UnlockSurface(gpScreen); } for (i = 0; i < 4; i++) { DrawUTF8Text(&dat[i * 4], 150 + i * 100, 100, 2, 255, 255, 0); UpdateScreen(); PlaySound(SND_SOUND1); UTIL_Delay(1300); } DrawUTF8Text(&dat[i * 4], 175, 200, 2, 0, 255, 255); PlaySound(SND_DISCARD2); UpdateScreen(); UTIL_Delay(2500); ScreenFade(); }
/* =================== idPlayerView::RenderPlayerView =================== */ void idPlayerView::RenderPlayerView( idMenuHandler_HUD * hudManager ) { const renderView_t *view = player->GetRenderView(); if ( renderSystem->GetStereo3DMode() != STEREO3D_OFF ) { // render both eye views each frame on the PC for ( int eye = 1 ; eye >= -1 ; eye -= 2 ) { EmitStereoEyeView( eye, hudManager ); } } else { SingleView( view, hudManager ); } ScreenFade(); }
/* =================== idPlayerView::RenderPlayerView =================== */ void idPlayerView::RenderPlayerView( idUserInterface *hud ) { const renderView_t *view = player->GetRenderView(); if(g_skipViewEffects.GetBool()) { SingleView( hud, view ); } else { /*if ( player->GetInfluenceMaterial() || player->GetInfluenceEntity() ) { InfluenceVision( hud, view ); } else if ( gameLocal.time < dvFinishTime ) { DoubleVision( hud, view, dvFinishTime - gameLocal.time ); } else {*/ // greebo: For underwater effects, use the Doom3 Doubleview if (static_cast<idPhysics_Player*>(player->GetPlayerPhysics())->GetWaterLevel() >= WATERLEVEL_HEAD) { DoubleVision(hud, view, cv_tdm_underwater_blur.GetInteger()); } else { // Do not postprocess the HUD // if ( r_bloom_hud.GetBool() || !r_bloom.GetBool() ) // If HUD blooming is enabled or bloom is disabled // { // SingleView( hud, view ); // } // else { SingleView( hud, view, false ); } } //} // Bloom related - J.C.Denton /* Update post-process */ this->m_postProcessManager.Update(); ScreenFade(); } player->DrawHUD(hud); // TDM Ambient Method checking. By Dram // Modified by JC Denton if ( cv_ambient_method.IsModified() ) // If the ambient method option has changed { UpdateAmbientLight(); } }
void CGeneral::DrawBGFade(int girlnum, int color, int duration) { if (girlnum < 0 || girlnum > 4 || color < 0 || color > 2) { TerminateOnError("CGeneral::DrawBGFade(): invalid parameter"); } SDL_Surface *bg = ((girlnum >= 4) ? m_imgElectron : m_imgGirls[girlnum][color]); assert(bg != NULL); // display the image ScreenFade(duration, bg); m_iPrevGirl = girlnum; m_iPrevGirlColor = color; }
void CGeneral::ClearScreen(bool fadein, bool fadeout, bool bg) { SDL_Surface *r = SDL_CreateRGBSurface(gpScreen->flags, gpScreen->w, gpScreen->h, gpScreen->format->BitsPerPixel, gpScreen->format->Rmask, gpScreen->format->Gmask, gpScreen->format->Bmask, gpScreen->format->Amask); if (bg) { int w = r->w; while (w > 0) { int h = r->h; while (h > 0) { SDL_Rect dstrect; dstrect.x = r->w - w; dstrect.y = r->h - h; dstrect.w = m_imgBack->w; dstrect.h = m_imgBack->h; SDL_BlitSurface(m_imgBack, NULL, r, &dstrect); h -= m_imgBack->h; } w -= m_imgBack->w; } } else { UTIL_FillRect(r, 0, 0, gpScreen->w, gpScreen->h, 30, 130, 100); } UTIL_RectShade(r, 0, 0, gpScreen->w, gpScreen->h, 196, 196, 0, 0, 196, 196, 196, 0, 196); if (fadeout) { ScreenFade(300); } ScreenFade(fadein ? 300 : 0, r); SDL_FreeSurface(r); }
/* =================== idPlayerView::RenderPlayerView =================== */ void idPlayerView::RenderPlayerView( idUserInterface *hud ) { if ( !player ) { return; } const renderView_t *view = player->GetRenderView(); if ( !view ) { return; } bool guiRendered = false; // place the sound origin for the player soundSystem->PlaceListener( view->vieworg, view->viewaxis, player->entityNumber + 1, gameLocal.time, "Undefined" ); InfluenceVision( hud, view ); if ( g_skipViewEffects.GetBool() ) { SingleView( hud, view ); } else { if ( player->GetInfluenceMaterial() || player->GetInfluenceEntity() ) { InfluenceVision( hud, view ); guiRendered = true; } else if ( g_doubleVision.GetBool() && gameLocal.time < dvFinishTime ) { DoubleVision( hud, view, dvFinishTime - gameLocal.time ); guiRendered = false; } else { SingleView( hud, view, RF_NO_GUI | RF_PRIMARY_VIEW ); } // Now draw GUI's. if ( !guiRendered ) { SingleView( hud, view, RF_GUI_ONLY ); } ScreenFade(); } if ( net_clientLagOMeter.GetBool() && lagoMaterial && gameLocal.isClient && !( gameLocal.GetDemoState() == DEMO_PLAYING && ( gameLocal.IsServerDemo() || gameLocal.IsTimeDemo() ) ) ) { renderSystem->SetColor4( 1.0f, 1.0f, 1.0f, 1.0f ); renderSystem->DrawStretchPic( 10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial ); } }
/* =================== idPlayerView::RenderPlayerView =================== */ void idPlayerView::RenderPlayerView( idUserInterface *hud ) { const renderView_t *view = player->GetRenderView(); if ( g_skipViewEffects.GetBool() ) { SingleView( hud, view ); } else { /* Render the standard view */ if ( player->GetInfluenceMaterial() || player->GetInfluenceEntity() ) { InfluenceVision( hud, view ); } else if ( gameLocal.time < dvFinishTime ) { DoubleVision( hud, view, dvFinishTime - gameLocal.time ); } else if ( player->PowerUpActive( BERSERK ) ) { BerserkVision( hud, view ); } else { SingleView( hud, view ); } #ifdef _DENTONMOD // HDR related - J.C.Denton /* Update HDR post-process */ this->m_postProcessManager.Update(); #endif ScreenFade(); } /* Render the hud on top of everything */ if ( !pm_thirdPerson.GetBool() && !g_skipViewEffects.GetBool() && !player->objectiveSystemOpen && !player->spectating ) { player->DrawHUD( hud ); } if ( net_clientLagOMeter.GetBool() && lagoMaterial && gameLocal.isClient ) { renderSystem->SetColor4( 1.0f, 1.0f, 1.0f, 1.0f ); renderSystem->DrawStretchPic( 10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial ); } }
void CGeneral::GameOver() { int iCurSel = 0; SDL_Event event; // Draw the background SDL_BlitSurface(m_imgGameOver, NULL, gpScreen, NULL); // Draw the text DrawText("GAME OVER", 22, 22, 1, 255, 255, 0); DrawUTF8Text(va("%s?", msg("Continue")), 400, 300, 1, 255, 255, 0); DrawUTF8Text(msg("Yes"), 450, 350, 1, 255, 255, 0); DrawUTF8Text(msg("No"), 450, 390, 1, 255, 255, 0); // Play the "Game Over" music PlayMusic(m_musGameOver, 0); while (1) { // Erase the original arrow SDL_Rect dstrect; dstrect.x = 400; dstrect.y = 350; dstrect.w = 32; dstrect.h = 80; SDL_BlitSurface(m_imgGameOver, &dstrect, gpScreen, &dstrect); // Draw the new arrow DrawText(">", 400, iCurSel ? 390 : 350, 1, 255, 255, 0); UpdateScreen(); if (SDL_WaitEvent(&event)) { if (event.type == SDL_KEYDOWN) { switch (event.key.keysym.sym) { case SDLK_ESCAPE: case SDLK_n: // Quit the program immediately if user pressed ESC PlayMusic(NULL); UserQuit(); break; case SDLK_UP: case SDLK_DOWN: case SDLK_LEFT: case SDLK_RIGHT: iCurSel ^= 1; break; case SDLK_y: PlayMusic(NULL); PlaySound(SND_SOUND1); UTIL_Delay(2000); ScreenFade(300); return; case SDLK_KP_ENTER: case SDLK_RETURN: case SDLK_SPACE: PlayMusic(NULL); if (iCurSel == 0) { PlaySound(SND_SOUND1); UTIL_Delay(2000); ScreenFade(300); return; } else { UserQuit(); } break; } } else if (event.type == SDL_QUIT) { PlayMusic(NULL); UserQuit(); } } } PlayMusic(NULL); UserQuit(); }