src/tron/gArmagetron.cpp File Reference

#include "gStuff.h"
#include "tSysTime.h"
#include "tDirectories.h"
#include "tLocale.h"
#include "rViewport.h"
#include "rConsole.h"
#include "gGame.h"
#include "gLogo.h"
#include "gCommandLineJumpStart.h"
#include "eSoundMixer.h"
#include "rScreen.h"
#include "rSysdep.h"
#include "uInputQueue.h"
#include "rTexture.h"
#include "tConfiguration.h"
#include "tRecorder.h"
#include "tCommandLine.h"
#include "eAdvWall.h"
#include "eGameObject.h"
#include "uMenu.h"
#include "ePlayer.h"
#include "gLanguageMenu.h"
#include "gAICharacter.h"
#include "gCycle.h"
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include "nServerInfo.h"
#include "nSocket.h"
#include "tRuby.h"
#include "rRender.h"
#include "rSDL.h"
#include <SDL_syswm.h>

Include dependency graph for gArmagetron.cpp:

Go to the source code of this file.

Classes

class  gMainCommandLineAnalyzer
class  gAutoStringArray

Functions

void exit_game_objects (eGrid *grid)
static void welcome ()
void cleanup (eGrid *grid)
int filter (const SDL_Event *tEvent)
void Update_netPlayer ()
void sg_SetIcon ()
void sg_PutEnv (char const *s)
int main (int argc, char **argv)

Variables

static
gCommandLineJumpStartAnalyzer 
sg_jumpStartAnalyzer
static gMainCommandLineAnalyzer commandLineAnalyzer
static bool use_directx = true


Function Documentation

void cleanup ( eGrid grid  ) 

Definition at line 341 of file gArmagetron.cpp.

References nNetObject::ClearAll(), exit_game_objects(), pp_out, sr_ExitDisplay(), sr_glOut, sr_RendererCleanup(), su_contInput, and rITexture::UnloadAll().

00342                          {
00343     static bool reentry=true;
00344     if (reentry){
00345         reentry=false;
00346         su_contInput=false;
00347 
00348         exit_game_objects(grid);
00349         /*
00350           for(int i=MAX_PLAYERS-1;i>=0;i--){
00351           if (playerConfig[i])
00352           destroy(playerConfig[i]->cam);
00353           }
00354 
00355 
00356           gNetPlayerWall::Clear();
00357 
00358           eFace::Clear();
00359           eEdge::Clear();
00360           ePoint::Clear();
00361 
00362           eFace::Clear();
00363           eEdge::Clear();
00364           ePoint::Clear();
00365 
00366           eGameObject::DeleteAll();
00367 
00368 
00369         */
00370 
00371 #ifdef POWERPAK_DEB
00372         if (pp_out){
00373             PD_Quit();
00374             PP_Quit();
00375         }
00376 #endif
00377         nNetObject::ClearAll();
00378 
00379         if (sr_glOut){
00380             rITexture::UnloadAll();
00381         }
00382 
00383         sr_glOut=false;
00384         sr_ExitDisplay();
00385 
00386 #ifndef DEDICATED
00387         sr_RendererCleanup();
00388 #endif
00389 
00390     }

Here is the call graph for this function:

void exit_game_objects ( eGrid grid  ) 

Definition at line 784 of file gGame.cpp.

References gNetPlayerWall::Clear(), eGameObject::DeleteAll(), exit_game_grid(), rConsole::fullscreen, GrowingArrayBase::Len(), nCLIENT, uPlayerPrototype::Num(), ePlayer::PlayerConfig(), se_PlayerNetIDs, sn_GetNetState(), sr_con, su_prefetchInput, and tDESTROY.

00784                                    {
00785     sr_con.fullscreen=true;
00786 
00787     su_prefetchInput=false;
00788 
00789     int i;
00790     for (i=ePlayer::Num()-1;i>=0;i--){
00791         if (ePlayer::PlayerConfig(i))
00792             tDESTROY(ePlayer::PlayerConfig(i)->cam);
00793     }
00794 
00795     eGameObject::DeleteAll(grid);
00796 
00797     if (sn_GetNetState()!=nCLIENT)
00798         for (int i=se_PlayerNetIDs.Len()-1;i>=0;i--)
00799             if (se_PlayerNetIDs(i))
00800                 se_PlayerNetIDs(i)->ClearObject();
00801 
00802     gNetPlayerWall::Clear();
00803 
00804     exit_game_grid(grid);
00805 }

Here is the call graph for this function:

int filter ( const SDL_Event *  tEvent  ) 

Definition at line 393 of file gArmagetron.cpp.

References Activate(), currentScreensetting, rScreenSettings::fullscreen, lastSuccess, uMenu::quickexit, tRecorder::Record(), sr_screenHeight, sr_screenWidth, st_SaveConfig(), su_mouseGrab, su_prefetchInput, and su_StoreSDLEvent().

Referenced by FilterLine(), eGameObject::FindCurrentFace(), main(), tString::NetFilter(), se_EscapeName(), and sg_TopologyPoliceCheck().

00394                                    {
00395     // recursion avoidance
00396     static bool recursion = false;
00397     if ( !recursion )
00398     {
00399         class RecursionGuard
00400         {
00401         public:
00402             RecursionGuard( bool& recursion )
00403                     :recursion_( recursion )
00404             {
00405                 recursion = true;
00406             }
00407 
00408             ~RecursionGuard()
00409             {
00410                 recursion_ = false;
00411             }
00412 
00413         private:
00414             bool& recursion_;
00415         };
00416 
00417         RecursionGuard guard( recursion );
00418 
00419         // boss key or OS X quit command
00420         if ((tEvent->type==SDL_KEYDOWN && tEvent->key.keysym.sym==27 &&
00421                 tEvent->key.keysym.mod & KMOD_SHIFT) ||
00422                 (tEvent->type==SDL_KEYDOWN && tEvent->key.keysym.sym==113 &&
00423                  tEvent->key.keysym.mod & KMOD_META) ||
00424                 (tEvent->type==SDL_QUIT)){
00425             // sn_SetNetState(nSTANDALONE);
00426             // sn_Receive();
00427 
00428             // register end of recording
00429             tRecorder::Record("END");
00430 
00431             st_SaveConfig();
00432             uMenu::quickexit=true;
00433             return false;
00434         }
00435 
00436         if(tEvent->type==SDL_MOUSEMOTION)
00437             if(tEvent->motion.x==sr_screenWidth/2 && tEvent->motion.y==sr_screenHeight/2)
00438                 return 0;
00439         if (su_mouseGrab &&
00440                 tEvent->type!=SDL_MOUSEBUTTONDOWN &&
00441                 tEvent->type!=SDL_MOUSEBUTTONUP &&
00442                 ((tEvent->motion.x>=sr_screenWidth-10  || tEvent->motion.x<=10) ||
00443                  (tEvent->motion.y>=sr_screenHeight-10 || tEvent->motion.y<=10)))
00444             SDL_WarpMouse(sr_screenWidth/2,sr_screenHeight/2);
00445 
00446         // fetch alt-tab
00447 
00448         if (tEvent->type==SDL_ACTIVEEVENT)
00449         {
00450             // Jonathans fullscreen bugfix.
00451 #ifdef MACOSX
00452             if(currentScreensetting.fullscreen ^ lastSuccess.fullscreen) return false;
00453 #endif
00454             int flags = SDL_APPINPUTFOCUS;
00455             if ( tEvent->active.gain && tEvent->active.state & flags )
00456                 Activate(true);
00457             if ( !tEvent->active.gain && tEvent->active.state & flags )
00458                 Activate(false);
00459             return false;
00460         }
00461 
00462         if (su_prefetchInput){
00463             return su_StoreSDLEvent(*tEvent);
00464         }
00465 
00466     }
00467 
00468     return 1;

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 528 of file gArmagetron.cpp.

References aiPlayersConfig, tCommandLineData::Analyse(), rConsole::autoDisplayAtSwap, tLocale::Clear(), nNetObject::ClearAll(), con, tDirectories::Config(), currentScreensetting, gMainCommandLineAnalyzer::daemon_, tDirectories::Data(), nServerInfo::DeleteAll(), gMainCommandLineAnalyzer::dont_use_directx_, tCommandLineData::Execute(), ePlayer::Exit(), filter(), rScreenSettings::fullscreen, gMainCommandLineAnalyzer::fullscreen_, tRecorderSyncBase::GetDebugLevelPlayback(), tException::GetDescription(), tException::GetName(), uMenu::IdleInput(), ePlayer::Init(), GrowingArrayBase::Len(), tLocale::Load(), Load(), gAICharacter::LoadAll(), MainMenu(), tConsole::Message(), uMenu::Message(), NULL, tRecorder::Playback(), tRecorder::PlaybackStrict(), gCycle::PrivateSettings(), tCommandLineData::programVersion_, uMenu::quickexit, tRecorder::Record(), tConsole::RegisterIdleCallback(), tConsole::RegisterMessageCallback(), renderer_identification, se_PlayerNetIDs, gLogo::SetBig(), gLogo::SetDisplayed(), uMenu::SetIdle(), gLogo::SetSpinning(), sg_HostGame(), sg_LanguageInit(), sg_moviepackInstalled, sg_PutEnv(), sg_SetIcon(), eSoundMixer::ShutDown(), sn_bigBrotherString, sn_programVersion, sr_con, sr_ExitDisplay(), sr_glOut, sr_glRendererInit(), sr_InitDisplay(), sr_RendererCleanup(), sr_Unblock_stdin(), st_LoadConfig(), st_PresentError(), st_SaveConfig(), su_JoystickInit(), su_KeyInit(), tERR_ERROR, rITexture::UnloadAll(), use_directx, gMainCommandLineAnalyzer::use_directx_, tDirectories::Var(), welcome(), and gMainCommandLineAnalyzer::windowed_.

00529                               {
00530     //std::cout << "enter\n";
00531     //  net_test();
00532 
00533     bool dedicatedServer = false;
00534 
00535     //  std::cout << "Running " << argv[0] << "...\n";
00536 
00537     // tERR_MESSAGE( "Start!" );
00538 
00539     try
00540     {
00541         tCommandLineData commandLine;
00542         commandLine.programVersion_  = &sn_programVersion;
00543 
00544         // analyse command line
00545         // tERR_MESSAGE( "Analyzing command line." );
00546         if ( ! commandLine.Analyse(argc, argv) )
00547             return 0;
00548 
00549 
00550         {
00551             // embed version in recording
00552             const char * versionSection = "VERSION";
00553             tString version( sn_programVersion );
00554             tRecorder::Playback( versionSection, version );
00555             tRecorder::Record( versionSection, version );
00556         }
00557 
00558         {
00559             // read/write server/client mode from/to recording
00560             const char * dedicatedSection = "DEDICATED";
00561             if ( !tRecorder::PlaybackStrict( dedicatedSection, dedicatedServer ) )
00562             {
00563 #ifdef DEDICATED          
00564                 dedicatedServer = true;
00565 #endif
00566             }
00567             tRecorder::Record( dedicatedSection, dedicatedServer );
00568         }
00569 
00570 
00571         // while DGA mouse is buggy in XFree 4.0:
00572 #ifdef linux
00573         // Sam 5/23 - Don't ever use DGA, we don't need it for this game.
00574         // no longer needed, the bug this compensated was fixed a long time
00575         // ago.
00576         /*
00577         if ( ! getenv("SDL_VIDEO_X11_DGAMOUSE") ) {
00578             sg_PutEnv("SDL_VIDEO_X11_DGAMOUSE=0");
00579         }
00580         */
00581 #endif
00582 
00583 #ifdef WIN32
00584         // disable DirectX by default; it causes problems with some boards.
00585         if (!use_directx && !getenv("SDL_VIDEODRIVER") ) {
00586             sg_PutEnv("SDL_VIDEODRIVER=windib");
00587         }
00588 #endif
00589 
00590         // atexit(ANET_Shutdown);
00591 
00592 #ifndef WIN32
00593 #ifdef DEBUG
00594 #define NOSOUND
00595 #endif
00596 #endif
00597 
00598 #ifndef DEDICATED
00599         Uint32 flags = SDL_INIT_VIDEO;
00600 #ifdef DEBUG
00601         flags |= SDL_INIT_NOPARACHUTE;
00602 #endif // DEBUG
00603         if (SDL_Init(flags) < 0) {
00604             tERR_ERROR("Couldn't initialize SDL: " << SDL_GetError());
00605         }
00606         atexit(SDL_Quit);
00607         // su_KeyInit();
00608 
00609         su_KeyInit();
00610 
00611 #ifndef NOJOYSTICK
00612         if (SDL_InitSubSystem(SDL_INIT_JOYSTICK))
00613             std::cout << "Error initializing joystick subsystem\n";
00614         else
00615         {
00616 #ifdef DEBUG
00617             // std::cout << "Joystick(s) initialized\n";
00618 #endif // DEBUG
00619             su_JoystickInit();
00620         }
00621 #endif // NOJOYSTICK
00622 #endif // DEDICATED
00623 
00624         // tERR_MESSAGE( "Initializing player data." );
00625         ePlayer::Init();
00626 
00627 #ifdef HAVE_LIBRUBY
00628         tRuby::InitializeInterpreter();
00629         try {
00630             tRuby::Load(tDirectories::Data(), "scripts/initialize.rb");
00631         }
00632         catch (std::runtime_error & e) {
00633             std::cerr << e.what() << '\n';
00634         }
00635 #endif
00636 
00637         // tERR_MESSAGE( "Loading configuration." );
00638         tLocale::Load("languages.txt");
00639 
00640         st_LoadConfig();
00641 
00642         // record and play back the recording debug level
00643         tRecorderSyncBase::GetDebugLevelPlayback();
00644 
00645         if ( commandLineAnalyzer.fullscreen_ )
00646             currentScreensetting.fullscreen   = true;
00647         if ( commandLineAnalyzer.windowed_ )
00648             currentScreensetting.fullscreen   = false;
00649         if ( commandLineAnalyzer.use_directx_ )
00650             use_directx                       = true;
00651         if ( commandLineAnalyzer.dont_use_directx_ )
00652             use_directx                       = false;
00653 
00654         //gAICharacter::LoadAll(tString( "aiplayers.cfg" ) );
00655         gAICharacter::LoadAll( aiPlayersConfig );
00656 
00657         sg_LanguageInit();
00658         atexit(tLocale::Clear);
00659 
00660         if ( commandLine.Execute() )
00661         {
00662             gCycle::PrivateSettings();
00663 
00664             {
00665                 std::ifstream t;
00666 
00667                 if ( !tDirectories::Config().Open( t, "settings.cfg" ) )
00668                 {
00669                     //          #ifdef WIN32
00670                     //                    tERR_ERROR( "Data files not found. You have to run Armagetron from its own directory." );
00671                     //          #else
00672                     tERR_ERROR( "Configuration files not found. Check your installation." );
00673                     //          #endif
00674                 }
00675             }
00676 
00677             {
00678                 std::ofstream s;
00679                 if (! tDirectories::Var().Open( s, "scorelog.txt", std::ios::app ) )
00680                 {
00681                     char const * error = "var directory not writable or does not exist. It should reside inside your user data directory and should have been created automatically on first start, but something must have gone wrong."
00682                     #ifdef WIN32
00683                                          " You can access your user data directory over one of the start menu entries we installed."
00684                     #else
00685                                          " Your user data directory is subdirectory named .armagetronad in your home directory."
00686                     #endif
00687                                          ;
00688 
00689                     tERR_ERROR( error );
00690                 }
00691             }
00692 
00693             {
00694                 std::ifstream t;
00695 
00696                 if ( tDirectories::Data().Open( t, "moviepack/settings.cfg" ) )
00697                 {
00698                     sg_moviepackInstalled=true;
00699                 }
00700             }
00701 
00702 #ifndef DEDICATED
00703             sr_glOut=1;
00704             //std::cout << "checked mp\n";
00705 
00706             sr_glRendererInit();
00707 
00708             SDL_SetEventFilter(&filter);
00709 
00710             //std::cout << "set filter\n";
00711 
00712             sg_SetIcon();
00713 
00714             tConsole::RegisterMessageCallback(&uMenu::Message);
00715             tConsole::RegisterIdleCallback(&uMenu::IdleInput);
00716 
00717             if (sr_InitDisplay()){
00718 
00719                 try
00720                 {
00721 #ifdef HAVE_GLEW
00722                     // initialize GLEW
00723                     {
00724                         GLenum err = glewInit();
00725                         if (GLEW_OK != err)
00726                         {
00727                             // Problem: glewInit failed, something is seriously wrong
00728                             throw tGenericException( (const char *)glewGetErrorString(err), "GLEW Error" );
00729                         }
00730                         con << "Status: Using GLEW " << glewGetString(GLEW_VERSION) << "\n";
00731                     }
00732 #endif // HAVE_GLEW
00733 
00734                     //std::cout << "init disp\n";
00735 
00736                     //std::cout << "init sound\n";
00737 
00738                     welcome();
00739 
00740                     //std::cout << "atexit\n";
00741 
00742                     sr_con.autoDisplayAtSwap=false;
00743 
00744                     //std::cout << "sound started\n";
00745 
00746                     gLogo::SetBig(false);
00747                     gLogo::SetSpinning(true);
00748 
00749                     sn_bigBrotherString = renderer_identification + "VER=" + sn_programVersion + "\n\n";
00750 
00751 #ifdef HAVE_LIBRUBY      
00752                     try {
00753                         // tRuby::Load(tDirectories::Data(), "scripts/menu.rb");
00754                         tRuby::Load(tDirectories::Data(), "scripts/ai.rb");
00755                     }
00756                     catch (std::runtime_error & e) {
00757                         std::cerr << e.what() << '\n';
00758                     }
00759 #endif
00760 
00761                     MainMenu();
00762 
00763                     // remove all players
00764                     for ( int i = se_PlayerNetIDs.Len()-1; i>=0; --i )
00765                         se_PlayerNetIDs(i)->RemoveFromGame();
00766 
00767                     nNetObject::ClearAll();
00768 
00769                     rITexture::UnloadAll();
00770                     sr_RendererCleanup();
00771                 }
00772                 catch (tException const & e)
00773                 {
00774                     gLogo::SetDisplayed(true);
00775                     uMenu::SetIdle(NULL);
00776                     sr_con.autoDisplayAtSwap=false;
00777 
00778                     // inform user of generic errors
00779                     tConsole::Message( e.GetName(), e.GetDescription(), 20 );
00780                 }
00781 
00782                 sr_ExitDisplay();
00783 
00784                 //std::cout << "exit\n";
00785 
00786                 st_SaveConfig();
00787 
00788                 //std::cout << "saved\n";
00789 
00790                 //    cleanup(grid);
00791                 SDL_QuitSubSystem(SDL_INIT_VIDEO);
00792             }
00793 
00794             eSoundMixer::ShutDown();
00795 
00796             SDL_Quit();
00797 #else // DEDICATED
00798             if (!commandLineAnalyzer.daemon_)
00799                 sr_Unblock_stdin();
00800 
00801             sr_glOut=0;
00802 
00803             //  nServerInfo::TellMasterAboutMe();
00804 
00805             while (!uMenu::quickexit)
00806                 sg_HostGame();
00807 #endif // DEDICATED
00808             nNetObject::ClearAll();
00809             nServerInfo::DeleteAll();
00810         }
00811 
00812         ePlayer::Exit();
00813 
00814 #ifdef HAVE_LIBRUBY
00815         tRuby::CleanupInterpreter();
00816 #endif
00817 
00818         //      tLocale::Clear();
00819     }
00820     catch( tException const & e )
00821     {
00822         try
00823         {
00824             st_PresentError( e.GetName(), e.GetDescription() );
00825         }
00826         catch(...)
00827         {
00828         }
00829 
00830         return 1;
00831     }
00832     catch ( std::exception & e )
00833     {
00834         try
00835         {
00836             st_PresentError("", e.what());
00837         }
00838         catch(...)
00839         {
00840         }
00841     }
00842 #ifdef _MSC_VER
00843 #pragma warning ( disable : 4286 )
00844     // GRR. Visual C++ dones not handle generic exceptions with the above general statement.
00845     // A specialized version is needed. The best part: it warns about the code below being redundant.
00846     catch( tGenericException const & e )
00847     {
00848         try
00849         {
00850             st_PresentError( e.GetName(), e.GetDescription() );
00851         }
00852         catch(...)
00853         {
00854         }
00855 
00856         return 1;
00857     }
00858 #endif
00859     catch(...)
00860     {
00861         return 1;
00862     }
00863 
00864     return 0;

Here is the call graph for this function:

void sg_PutEnv ( char const *  s  ) 

Definition at line 522 of file gArmagetron.cpp.

References gAutoStringArray::Store().

Referenced by main().

00524 {
00525     static gAutoStringArray store;
00526     putenv( store.Store( s ) );

Here is the call graph for this function:

Here is the caller graph for this function:

void sg_SetIcon (  ) 

Definition at line 474 of file gArmagetron.cpp.

References rSurface::GetSurface(), and NULL.

Referenced by main().

00476 {
00477 #ifndef DEDICATED
00478 #ifndef MACOSX
00479 #ifdef  WIN32
00480     SDL_SysWMinfo       info;
00481     HICON                       icon;
00482     // get the HWND handle
00483     SDL_VERSION( &info.version );
00484     if( SDL_GetWMInfo( &info ) )
00485     {
00486         icon = LoadIcon( GetModuleHandle( NULL ), MAKEINTRESOURCE( 1 ) );
00487         SetClassLong( info.window, GCL_HICON, (LONG) icon );
00488     }
00489 #else
00490     rSurface tex( "desktop/icons/medium/armagetronad.png" );
00491     //    SDL_Surface *tex=IMG_Load( tDirectories::Data().GetReadPath( "textures/icon.png" ) );
00492 
00493     if (tex.GetSurface())
00494         SDL_WM_SetIcon(tex.GetSurface(),NULL);
00495 #endif
00496 #endif
00497 #endif

Here is the call graph for this function:

Here is the caller graph for this function:

void Update_netPlayer (  ) 

static void welcome (  )  [static]

Definition at line 162 of file gArmagetron.cpp.

References c, rSysDep::ClearGL(), Color(), ColorString(), gCommandLineJumpStartAnalyzer::Connect(), gLogo::Display(), DisplayText(), uMenu::GenericBackground(), eSoundMixer::GetMixer(), gl_renderer, gl_vendor, gl_version, tRecorderBase::IsPlayingBack(), tRecorderBase::IsRunning(), tRecorder::Playback(), REAL, tRecorder::Record(), rViewport::s_viewportFullscreen, rViewport::Select(), gLogo::SetBig(), gLogo::SetDisplayed(), rTextField::SetIndent(), eSoundMixer::SetMode(), gLogo::SetSpinning(), sg_LanguageMenu(), gCommandLineJumpStartAnalyzer::ShouldConnect(), sr_fontError, sr_glOut, sr_LoadDefaultConfig(), sr_LockSDL(), sr_ResetRenderState(), sr_textOut, sr_UnlockSDL(), st_FirstUse, StartAAURLHandler(), su_GetSDLInput(), rSysDep::SwapGL(), tAdvanceFrame(), TITLE_TRACK, tSysTimeFloat(), and eSoundMixer::Update().

Referenced by main().

00163                      {
00164     bool textOutBack = sr_textOut;
00165     sr_textOut = false;
00166 
00167 #ifdef DEBUG_XXXX
00168     {
00169         for (int i = 20; i>=0; i--)
00170         {
00171             sr_ClearGL();
00172             {
00173                 rTextField c(-.8,.6, .1, .1);
00174                 tString s;
00175                 s << ColorString(1,1,1);
00176                 s << "Test";
00177                 s << ColorString(1,0,0);
00178                 s << "bla bla blubb blaa blaa blubbb blaaa blaaa blubbbb blaaaa blaaaa blubbbbb blaaaaa blaaaaa blubbbbbb blaaaaaa\n";
00179                 c << s;
00180             }
00181             sr_SwapGL();
00182         }
00183     }
00184 #endif
00185 
00186     REAL timeout = tSysTimeFloat() + .2;
00187     SDL_Event tEvent;
00188 
00189     if (st_FirstUse)
00190     {
00191         st_FirstUse=false;
00192         sr_LoadDefaultConfig();
00193         textOutBack = sr_textOut;
00194         sr_textOut = false;
00195         gLogo::SetBig(false);
00196         gLogo::SetSpinning(true);
00197     }
00198     else
00199     {
00200         bool showSplash = true;
00201 #ifdef DEBUG
00202         showSplash = false;
00203 #endif
00204 
00205         // Start the music up
00206         eSoundMixer* mixer;
00207         mixer = eSoundMixer::GetMixer();
00208         mixer->SetMode(TITLE_TRACK);
00209         mixer->Update();
00210 
00211         // disable splash screen when recording (it's annoying)
00212         static const char * splashSection = "SPLASH";
00213         if ( tRecorder::IsRunning() )
00214         {
00215             showSplash = false;
00216 
00217             // but keep it for old recordings where the splash screen was always active
00218             if ( !tRecorder::Playback( splashSection, showSplash ) )
00219                 showSplash = tRecorder::IsPlayingBack();
00220         }
00221 
00222 #ifndef DEDICATED
00223         if ( sg_jumpStartAnalyzer.ShouldConnect() )
00224         {
00225             showSplash = false;
00226             gLogo::SetDisplayed(false);
00227             sg_jumpStartAnalyzer.Connect();
00228         }
00229 #endif
00230 
00231 #ifdef MACOSX
00232         StartAAURLHandler();
00233 #endif
00234         tRecorder::Record( splashSection, showSplash );
00235 
00236         if ( showSplash )
00237         {
00238             timeout = tSysTimeFloat() + 6;
00239 
00240             uInputProcessGuard inputProcessGuard;
00241             while((!su_GetSDLInput(tEvent) || tEvent.type!=SDL_KEYDOWN) &&
00242                     tSysTimeFloat() < timeout)
00243             {
00244                 if ( sr_glOut )
00245                 {
00246                     sr_ResetRenderState(true);
00247                     rViewport::s_viewportFullscreen.Select();
00248 
00249                     rSysDep::ClearGL();
00250 
00251                     uMenu::GenericBackground();
00252 
00253                     rSysDep::SwapGL();
00254                 }
00255 
00256                 tAdvanceFrame();
00257             }
00258         }
00259 
00260         // catch some keyboard input
00261         {
00262             uInputProcessGuard inputProcessGuard;
00263             while (su_GetSDLInput(tEvent));
00264         }
00265 
00266         sr_textOut = textOutBack;
00267         return;
00268     }
00269 
00270     if ( sr_glOut )
00271     {
00272         rSysDep::ClearGL();
00273         //        rFont::s_defaultFont.Select();
00274         //        rFont::s_defaultFontSmall.Select();
00275         gLogo::Display();
00276         rSysDep::ClearGL();
00277     }
00278     rSysDep::SwapGL();
00279 
00280     sg_LanguageMenu();
00281 
00282     // catch some keyboard input
00283     {
00284         uInputProcessGuard inputProcessGuard;
00285         while (su_GetSDLInput(tEvent));
00286     }
00287 
00288     timeout = tSysTimeFloat() + 10;
00289 
00290     sr_UnlockSDL();
00291     uInputProcessGuard inputProcessGuard;
00292     while((!su_GetSDLInput(tEvent) || tEvent.type!=SDL_KEYDOWN) &&
00293             tSysTimeFloat() < timeout){
00294 
00295         sr_ResetRenderState(true);
00296         rViewport::s_viewportFullscreen.Select();
00297 
00298         if ( sr_glOut )
00299         {
00300             rSysDep::ClearGL();
00301 
00302             uMenu::GenericBackground();
00303 
00304             REAL w=16*2/640.0;
00305             REAL h=32*2/480.0;
00306 
00307 
00308             //REAL middle=-.6;
00309 
00310             Color(1,1,1);
00311             DisplayText(0,.8,h,tOutput("$welcome_message_heading"), sr_fontError);
00312 
00313             w/=2;
00314             h/=2;
00315 
00316             rTextField c(-.8,.6, h, sr_fontError);
00317 
00318 
00319             c << tOutput("$welcome_message_intro");
00320 
00321             c.SetIndent(12);
00322 
00323             c << tOutput("$welcome_message_vendor")   << gl_vendor   << '\n';
00324             c << tOutput("$welcome_message_renderer") << gl_renderer << '\n';
00325             c << tOutput("$welcome_message_version")  << gl_version  << '\n';
00326 
00327             c.SetIndent(0);
00328 
00329             c << tOutput("$welcome_message_finish");
00330 
00331             rSysDep::SwapGL();
00332         }
00333 
00334         tAdvanceFrame();
00335     }
00336     sr_LockSDL();
00337 
00338     sr_textOut = textOutBack;

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

gMainCommandLineAnalyzer commandLineAnalyzer [static]

Definition at line 150 of file gArmagetron.cpp.

Referenced by tCommandLineData::Analyse().

gCommandLineJumpStartAnalyzer sg_jumpStartAnalyzer [static]

Definition at line 68 of file gArmagetron.cpp.

bool use_directx = true [static]

Definition at line 152 of file gArmagetron.cpp.

Referenced by main().


Generated on Sat Mar 15 23:14:40 2008 for Armagetron Advanced by  doxygen 1.5.4