#include "GSCredits.h"
#include "BirdiesRevenge.h"



IMPLEMENT_CLONEABLE( CGSCredits, "GSCredits" )



void CGSCredits::Init()
{
  m_Menu.Add( 11 );

  m_Menu.SetValues( GR::tPoint( 400, 500 ) );
}



void CGSCredits::Exit()
{
}



void CGSCredits::Display( XRenderer& Renderer )
{
  theApp.RenderBackground( Renderer, "BG.2" );

  theApp.PrintText( 40, 40, "CODE AND GRAPHICS" );
  theApp.PrintText( 100, 60, "GEORG ROTTENSTEINER" );
  theApp.PrintText( 40, 100, "MUSIC" );
  theApp.PrintText( 100, 120, "KEVIN MACLEOD - INCOMPETECH.COM" );
  theApp.PrintText( 100, 140, "ITTY BITTY 8 BIT" );
  theApp.PrintText( 100, 160, "OUROBOROS" );

  theApp.PrintText( 40, 200, "COMPETITION" );
  theApp.PrintText( 100, 220, "GAMEDEV.NET OCTOBER CHALLENGE" );

  m_Menu.Display( Renderer );
}



void CGSCredits::UpdatePerDisplayFrame( const float ElapsedTime )
{
  if ( !IsActivelyUpdating() )
  {
    return;
  }
  if ( theApp.InputClass()->ReleasedKeyPressed( Xtreme::KEY_ESCAPE ) )
  {
    ChangeState( "GSMenu" );
  }

  m_Menu.Update( ElapsedTime );
  if ( m_Menu.Done() )
  {
    m_Menu.SetUndone();
    switch ( m_Menu.SelectedItem() )
    {
      case 11:
        ChangeState( "GSMenu" );
        break;
    }
  }
}



void CGSCredits::Update()
{

  // TODO - Update

}



bool CGSCredits::ProcessEvent( const GUI::OutputEvent& Event )
{
  switch ( Event.Type )
  {
    case OET_BUTTON_PUSHED:
      break;
  }
  return false;
}
