Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

MainSponsor.cpp File Reference


Detailed Description

Implements the MultiplayMenu stuffs defined in MainFuncs.h.

Definition in file MainSponsor.cpp.

#include "Network.h"
#include "Sound.h"
#include "Typer.h"
#include "..\AEngine\AEngine.h"
#include "Overhead.h"
#include "MainFuncs.h"
#include "Globals.h"

Include dependency graph for MainSponsor.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void switchToSponsor ()
void updateSponsor ()
void renderSponsor ()

Variables

int time
const int PERIOD = 400


Function Documentation

void renderSponsor  
 

Definition at line 61 of file MainSponsor.cpp.

References Helper::abs(), Globals::artWork, ATexture, overlay_image(), PERIOD, time, and Vec2D.

Referenced by main_render().

00062 {
00063         int t = time % PERIOD;
00064         FLOAT alpha = abs(PERIOD/2 - t) * 2.0f / PERIOD;
00065         alpha = sqrtf( 1.0f - alpha );
00066 
00067         ATexture img;
00068         if( time < PERIOD )                     img = artWork->main_leftField;
00069         else if( time < 2*PERIOD )  img = artWork->main_sponsorMS;
00070         else if( time < 3*PERIOD )  img = artWork->main_sponsorNV;
00071         else                                            img = artWork->main_sponsorPF;
00072 
00073                 overlay_image( img, Vec2D(0.5f,0.5f), Vec2D(1.0f,1.0f), BlendModes::MIX, alpha );
00074 }

void switchToSponsor  
 

Definition at line 39 of file MainSponsor.cpp.

References time.

Referenced by main_init().

00040 {
00041         mode = MainModes::sponsor;
00042         time = 0;
00043 }

void updateSponsor  
 

Definition at line 45 of file MainSponsor.cpp.

References input_isKeyPressed(), PERIOD, Sound::playMusic(), switchToMainMenu(), and time.

Referenced by main_update().

00046 {
00047         time++;
00048         if( input_isKeyPressed(KeyCodes::key_ESCAPE) )                  // skip by pressing ESC
00049                 if( time < PERIOD ) time = PERIOD;
00050                 else if( time <2*PERIOD ) time = 2*PERIOD;
00051                 else if( time <3*PERIOD ) time = 3*PERIOD;
00052                 else if( time <4*PERIOD ) time = 4*PERIOD;
00053 
00054         if( time >= 4*PERIOD )
00055         {
00056                 Sound::playMusic( Sound::SMPL_SONG_MENU );
00057                 switchToMainMenu();                             // end of sponsor               
00058         }
00059 }


Variable Documentation

const int PERIOD = 400
 

Definition at line 36 of file MainSponsor.cpp.

Referenced by renderSponsor(), and updateSponsor().

int time
 

Definition at line 35 of file MainSponsor.cpp.

Referenced by BattleSprite::BattleSprite(), getOSTime(), main_init(), RecvHitEntry::RecvHitEntry(), renderSponsor(), switchToSponsor(), and updateSponsor().


Generated on Wed Apr 23 05:51:27 2003 for Modern Warfare by doxygen1.3-rc2