PRIVATE void M_Victory_Draw_PageTwo( void ) { SW32 w, h; R_Draw_Tile( 0, 0, viddef.width, viddef.height, "walls/000.tga" ); M_DrawWindow( 16, 16, 608, 408, colourWhite, colourBlack, colourBlack ); TM_GetTextureSize( &w, &h, "pics/PLAQUE_PAGE.tga" ); R_Draw_Pic( ((viddef.width >> 1) - w) >> 1, viddef.height - 48, "pics/PLAQUE_PAGE.tga" ); TM_GetTextureSize( &w, &h, "pics/PLAQUE_BLANK.tga" ); R_Draw_Pic( viddef.width - w - (((viddef.width >> 1) - w) >> 1), viddef.height - 48, "pics/PLAQUE_BLANK.tga" ); Font_SetSize( FONT0, 2 ); Font_SetColour( FONT0, colourPage ); Font_put_line( FONT0, (viddef.width - w - (((viddef.width >> 1) - w) >> 1)) + 32, (viddef.height - 48) + 6, "pg 2 of 2" ); Font_SetColour( FONT0, colourTitle ); Font_put_paragraph( FONT0, 32+4, 34, victoryTextPageTwoTitle[ currentMap.episode ], 0, 600 ); Font_SetColour( FONT0, colourBlack ); Font_put_paragraph( FONT0, 32+4, 34+32, victorytextPageTwo[ currentMap.episode ], 0, 600 ); }
PRIVATE void SOD_EndScreen2_Draw( void ) { W32 w, h; R_Draw_Fill( 0, 0, viddef.width, viddef.height, viewcolour ); TM_GetTextureSize( &w, &h, "pics/ENDSCREEN3PIC.tga" ); R_Draw_Pic( (viddef.width - w) >> 1, (viddef.height - h) >> 1, "pics/ENDSCREEN3PIC.tga" ); Font_SetSize( FONT0, 2 ); Font_SetColour( FONT0, colourWhite ); if( victory_slide == 3 ) { Font_GetMsgDimensions( FONT0, STR_ENDGAME1, &w, &h ); Font_put_line( FONT0, (viddef.width - w) >> 1, viddef.height - h, STR_ENDGAME1 ); }
/////////////////// // Process & Draw the speech bubble void Dnr_SpeechProcess(void) { glColor4f(1,1,1,1); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); DrawPic( psDnrSpeech, 144, 500 ); int size = 16; Font_SetSize(size); int length = strlen( szDnrSpeech ) * size; Font_Draw( 400 - length/2, 445, CVec(0,0,0), szDnrSpeech ); if( (System_GetMouse()->Up & SDL_BUTTON(1)) || System_GetKeyboard()->KeyUp[SDLK_ESCAPE] ) { psDiner->bSpeechBubble = false; // If we have an offer, lets go! if(psDiner->bGoodOffer) { Dnr_LetsGo(); return; } } }
/////////////////// // Start the diner bool Dnr_Start(char *szDir) { keyboard_t *kb = System_GetKeyboard(); GLfloat one[] = {0.3f,0.3f,0.3f,1}; GLfloat blue[] = {0.3f, 0.3f, 1.0f, 1.0f}; GLfloat pos1[4] = {1,1,1,1}; GLfloat pos2[4] = {1,1,1,1}; GLfloat pos3[4] = {25,-100,50,1}; int i; if( !Dnr_Load(szDir) ) return false; for( i=0; i<3; i++ ) { pos1[i] = psDiner->pcLocation->getScene()->getLight(0).Position.GetIndex(i); pos2[i] = psDiner->pcLocation->getScene()->getLight(1).Position.GetIndex(i); } // Setup the diner for an opponent psDiner->nOppState = opp_waiting; psDiner->fOppTimer = tMainSR3.fCurTime + (float)GetRandomInt(2)+2.0f; sRaceInfo.pcOpponent = NULL; // HACK: Quickly get the opponent in the diner //Dnr_RollinOpponent(); //psDiner->pcLocation->SetupCamera( CVec(25,11,-1.4f),100); //psDiner->pcLocation->setCamPos( CVec(0,0,0) ); // Setup the fog State_Disable(GL_FOG); // Setup the lighting State_Enable(GL_LIGHTING); State_Enable(GL_LIGHT1); State_Enable(GL_LIGHT2); glLightfv(GL_LIGHT0, GL_DIFFUSE, one); glLightfv(GL_LIGHT1, GL_DIFFUSE, one); glLightfv(GL_LIGHT2, GL_DIFFUSE, one); glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.00f); glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.0f); glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 1.00f); glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.0f); glLightf(GL_LIGHT2, GL_CONSTANT_ATTENUATION, 0.80f); glLightf(GL_LIGHT2, GL_LINEAR_ATTENUATION, 0.01f); glMaterialf(GL_FRONT, GL_SHININESS, 25.0); glMaterialfv(GL_FRONT, GL_SPECULAR, one); System_ProcessInput(); while(psDiner->bProcessDiner) { System_ProcessInput(); // // Processing // psDiner->pcLocation->Process(); psDiner->cSky.Simulate(tMainSR3.fDeltaTime); if( !psDiner->bSpeechBubble ) { Dnr_ProcessOpponent(); Dnr_ProcessGUI(); } cMainGuy->processFrame(); // // 3D Drawing // glLightfv(GL_LIGHT0, GL_POSITION, pos1); glLightfv(GL_LIGHT1, GL_POSITION, pos2); glLightfv(GL_LIGHT2, GL_POSITION, pos3); SetupFrame(); // Manually setup the camera psDiner->pcLocation->getCamera()->LookAt(psDiner->pcLocation->getCamLook()); psDiner->pcLocation->getCamera()->Show(); psDiner->cSky.Render( psDiner->pcLocation->getCamera() ); State_Enable(GL_LIGHTING); psDiner->pcLocation->Draw(true, true, false); Dnr_DrawOpponent(); // // 2D Drawing // Render_Begin2D(); // Draw the sidedoor bit State_Enable(GL_TEXTURE_2D); State_Disable(GL_LIGHTING); State_Enable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(1,1,1,1); BlitTexture(psDiner->psSideDoor, 0,0, 0,472, 105,128, 1,1); for(i=0; i<10; i++ ) { BlitTexture(psDiner->psSideDoor, 105,0, i*95+105,472, 95,128, 1,1); } if( psDiner->bSpeechBubble ) Dnr_SpeechProcess(); psDiner->pcLocation->FinalDraw(); if(psOptions->nShowFPS) { Font_SetAlpha(1); Font_SetSize(14); int fps = GetFPS(); Font_Draw(5, 583, CVec(0,0,0), "FPS: %d", fps); Font_Draw(5, 585, CVec(1,1,1), "FPS: %d", fps); } if(psOptions->nDeveloper) { Font_SetAlpha(1); Font_SetSize(14); Font_Draw(5, 563, CVec(0,0,0), "Tris: %d", tMainSR3.TriCount); Font_Draw(5, 565, CVec(1,1,1), "Tris: %d", tMainSR3.TriCount); } // Draw the gui if(!psDiner->bSpeechBubble && psDiner->bProcessDiner) { if( psDiner->bOppClicked ) cDinerLayout.Draw(); cDinerLayout2.Draw(); } gui_DrawMouse(); Render_End2D(); SDL_GL_SwapBuffers(); } // // Show a loading sign on the screen // Render_Begin2D(); Font_SetSize(14); Font_SetAlpha(1); Font_DrawCentered(400, 300, CVec(1,1,1), "Loading..."); Render_End2D(); SDL_GL_SwapBuffers(); // Are we going to race? if(psDiner->bRacing) // Off to the track Game_SetLocation(LOC_RACE); else // Back to the garage Game_SetLocation(LOC_GARAGE); Dnr_Shutdown(); return true; }