home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 July & August / PCWorld_2006-07-08_cd.bin / temacd / planearcade / planearcade.exe / Tank3.bmp / menu.cpp < prev    next >
C/C++ Source or Header  |  2004-11-24  |  31KB  |  1,304 lines

  1.  
  2.  
  3. #include "Main.h"
  4.  
  5. //----------------
  6. //Global
  7. //----------------
  8. MENU Menu;
  9.  
  10.  
  11. //inicializacia objektov
  12. //------------------------------------------------------------
  13. void MENU::Initialize()
  14. {
  15.  
  16.     //BackGrouund
  17.     BackGround.Create((float)Engine.Width+10 ,(float)Engine.Height+10,1);
  18.     BackGround.AddFrame("menu/background.bmp",GetColor(1,0,1,0));
  19.  
  20.     EnabledIntro = true;
  21.     EnabledMenu = true;
  22.  
  23.     //---------
  24.     //Loading
  25.     //---------
  26.     Progress.Create(32,32,1);
  27.     Progress.AddFrame("menu/progress.bmp",GetColor(1,0,1,0));
  28.     Progress.RelativeMode = true;
  29.  
  30.     Loading.Create(142,42,1);
  31.     Loading.AddFrame("menu/Loading.bmp",GetColor(1,0,1,0));
  32.     Loading.RelativeMode = true;
  33.  
  34.     DxFont.Create((int)FTRX(18.0f),FW_BOLD,"Arial");
  35.  
  36.     //---------
  37.     //Intro
  38.     //---------
  39.     TimeIntro = 0.0f;
  40.  
  41.     //logo3D Games
  42.     Logo3DGames.Create(384,86,1);
  43.     Logo3DGames.AddFrame("menu/logo3DGames.bmp",GetColor(1,0,1,0));
  44.     Logo3DGames.RelativeMode = true;
  45.  
  46.     //logo3D PLE
  47.     LogoPLE.Create(480,49,1);
  48.     LogoPLE.AddFrame("menu/logoPLE.bmp",GetColor(1,0,1,0));
  49.     LogoPLE.RelativeMode = true;
  50.  
  51.     //logo becher LogoBecher
  52.     LogoBecher.Create(141,152,1);
  53.     LogoBecher.AddFrame("menu/LogoBecher.bmp",GetColor(1,0,1,0));
  54.     LogoBecher.RelativeMode = true;
  55.  
  56.     //-----------------
  57.     //Becher Game
  58.     //-----------------
  59.     TimeBecherGame = 0.0f;
  60.     EnabledBecherGame = false;
  61.     
  62.     BecherGame.Create(189,77,1);
  63.     BecherGame.AddFrame("menu/bechergame.bmp",GetColor(1,0,1,0));
  64.     BecherGame.RelativeMode = true;
  65.  
  66.     //-----------------
  67.     //Menu
  68.     //-----------------
  69.  
  70.     //obecne
  71.     LogoPlane.Create(265,132,1);
  72.     LogoPlane.AddFrame("menu/logoplane.bmp",GetColor(1,0,1));
  73.     LogoPlane.RelativeMode = true;
  74.  
  75.     LogoAir.Create(127,132,1);
  76.     LogoAir.AddFrame("menu/logoair.bmp",GetColor(1,0,1));
  77.     LogoAir.RelativeMode = true;
  78.  
  79.     LogoArcade.Create(331,132,1);
  80.     LogoArcade.AddFrame("menu/logoarcade.bmp",GetColor(1,0,1));
  81.     LogoArcade.RelativeMode = true;
  82.  
  83.     LogoPilot.Create(463,385,1);
  84.     LogoPilot.AddFrame("menu/logopilot.bmp",GetColor(1,0,1));
  85.     LogoPilot.RelativeMode = true;
  86.  
  87.     //curzor
  88.     Cursor.Create(30,30,1);
  89.     Cursor.AddFrame("menu/cursor.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  90.  
  91.     //main menu
  92.     TimeMainMenu = 0.0f;
  93.     EnabledMainMenu = false;
  94.     ModeMainMenu = 1;
  95.  
  96.     //campaing
  97.     Missions.RelativeMode = true;
  98.     Missions.Create(64,32,15);
  99.     Missions.AddFrame("menu/missions/1.bmp",GetColor(1,0,1));
  100.     Missions.AddFrame("menu/missions/2.bmp",GetColor(1,0,1));
  101.     Missions.AddFrame("menu/missions/3.bmp",GetColor(1,0,1));
  102.     Missions.AddFrame("menu/missions/4.bmp",GetColor(1,0,1));
  103.     Missions.AddFrame("menu/missions/5.bmp",GetColor(1,0,1));
  104.     Missions.AddFrame("menu/missions/6.bmp",GetColor(1,0,1));
  105.     Missions.AddFrame("menu/missions/7.bmp",GetColor(1,0,1));
  106.     Missions.AddFrame("menu/missions/8.bmp",GetColor(1,0,1));
  107.     Missions.AddFrame("menu/missions/9.bmp",GetColor(1,0,1));
  108.     Missions.AddFrame("menu/missions/10.bmp",GetColor(1,0,1));
  109.     Missions.AddFrame("menu/missions/11.bmp",GetColor(1,0,1));
  110.     Missions.AddFrame("menu/missions/12.bmp",GetColor(1,0,1));
  111.     Missions.AddFrame("menu/missions/13.bmp",GetColor(1,0,1));
  112.     Missions.AddFrame("menu/missions/14.bmp",GetColor(1,0,1));
  113.     Missions.AddFrame("menu/missions/15.bmp",GetColor(1,0,1));
  114.  
  115.     TimeCampaing = 0.0f;
  116.     EnabledCampaing = false;
  117.     ModeCampaing = 1;
  118.  
  119.     LoadArray();
  120.  
  121.     //credits
  122.     TimeCredits = 0.0f;
  123.     EnabledCredits = false;
  124.     ModeCredits = 1;
  125.  
  126.     CreditsFont.Create((int)FTRX(18.0f),FW_BOLD,"Courier");    
  127.  
  128.     LogoCredits.Create(308,300,1);
  129.     LogoCredits.AddFrame("menu/credits.bmp",GetColor(1,1,0,1));
  130.     LogoCredits.RelativeMode =  true;
  131.  
  132.     //campaing
  133.     ButtonCampaing.Create(180,40,1);
  134.     ButtonCampaing.RelativeMode = true;
  135.     if (Language == 0) ButtonCampaing.AddFrame("menu/eng/campaing.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  136.     if (Language == 1) ButtonCampaing.AddFrame("menu/cz/campaing.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  137.  
  138.     //battle
  139.     ButtonBattle.Create(180,40,1);
  140.     ButtonBattle.RelativeMode = true;
  141.     if (Language == 0) ButtonBattle.AddFrame("menu/eng/battle.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  142.     if (Language == 1) ButtonBattle.AddFrame("menu/cz/battle.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  143.  
  144.     //credits
  145.     ButtonCredits.Create(180,40,1);
  146.     ButtonCredits.RelativeMode = true;
  147.     if (Language == 0) ButtonCredits.AddFrame("menu/eng/credits.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  148.     if (Language == 1) ButtonCredits.AddFrame("menu/cz/credits.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  149.  
  150.     //exit
  151.     ButtonExit.Create(180,40,1);
  152.     ButtonExit.RelativeMode = true;
  153.     if (Language == 0) ButtonExit.AddFrame("menu/eng/exit.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  154.     if (Language == 1) ButtonExit.AddFrame("menu/cz/exit.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  155.  
  156.     //back
  157.     ButtonBack.Create(180,40,1);
  158.     ButtonBack.RelativeMode = true;
  159.     if (Language == 0) ButtonBack.AddFrame("menu/eng/back.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  160.     if (Language == 1) ButtonBack.AddFrame("menu/cz/back.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  161.  
  162.  
  163.     //-----------------
  164.     //Briefring
  165.     //-----------------
  166.     EnabledBriefring = false;
  167.  
  168.     LogoBriefring.Create(320,272,1);
  169.     ButtonRestart.Create(98,36,1);
  170.     ButtonContinue.Create(98,36,1);
  171.     ButtonEnd.Create(98,36,1);
  172.     
  173.     if (Language == 0)
  174.     {
  175.         ButtonRestart.AddFrame("menu/brief/but1eng.jpg",GetColor(1,0,1));
  176.         ButtonContinue.AddFrame("menu/brief/but2eng.jpg",GetColor(1,0,1));
  177.         ButtonEnd.AddFrame("menu/brief/but3eng.jpg",GetColor(1,0,1));
  178.     }
  179.  
  180.     if (Language == 1)
  181.     {
  182.         ButtonRestart.AddFrame("menu/brief/but1cz.jpg",GetColor(1,0,1));
  183.         ButtonContinue.AddFrame("menu/brief/but2cz.jpg",GetColor(1,0,1));
  184.         ButtonEnd.AddFrame("menu/brief/but3cz.jpg",GetColor(1,0,1));
  185.     }
  186.  
  187.     //-----------------
  188.     //GUI
  189.     //-----------------
  190.     Pilot.Create(72,72,7);
  191.     Pilot.AddFrame("menu/gui/pilot1.bmp",GetColor(1,0,1,0));
  192.     Pilot.AddFrame("menu/gui/pilot1fire.bmp",GetColor(1,0,1,0));
  193.     Pilot.AddFrame("menu/gui/pilot2.bmp",GetColor(1,0,1,0));
  194.     Pilot.AddFrame("menu/gui/pilot2fire.bmp",GetColor(1,0,1,0));
  195.     Pilot.AddFrame("menu/gui/pilot3.bmp",GetColor(1,0,1,0));
  196.     Pilot.AddFrame("menu/gui/pilot3fire.bmp",GetColor(1,0,1,0));
  197.     Pilot.AddFrame("menu/gui/pilotdeath.bmp",GetColor(1,0,1,0));
  198.  
  199.     Bevel.Create(148,81,1);
  200.     Bevel.AddFrame("menu/gui/bevel.bmp",GetColor(1.0f,1.0f,0,1.0f));
  201.     
  202.     GuiFont.Create(20,FW_BOLD,"Arial");    
  203.  
  204.     Kompas.Create(128,128,1);
  205.     if (Language == 0)
  206.         Kompas.AddFrame("menu/gui/kompaseng.bmp",GetColor(1,0,1));
  207.     if (Language == 1)
  208.         Kompas.AddFrame("menu/gui/kompascz.bmp",GetColor(1,0,1));
  209.  
  210.     Map.Create(147,147,1);
  211.     Map.AddFrame("menu/gui/mapa.bmp",GetColor(1.0f,1.0f,0.0f,1.0f));
  212.  
  213.     Frag.Create(15,15,6);
  214.     Frag.AddFrame("menu/gui/frag1.bmp",GetColor(1.0f,1.0f,1.0f,1.0f));
  215.     Frag.AddFrame("menu/gui/frag2.bmp",GetColor(1.0f,1.0f,1.0f,1.0f));
  216.     Frag.AddFrame("menu/gui/frag3.bmp",GetColor(1.0f,1.0f,1.0f,1.0f));
  217.     Frag.AddFrame("menu/gui/frag4.bmp",GetColor(1.0f,1.0f,1.0f,1.0f));
  218.     Frag.AddFrame("menu/gui/frag5.bmp",GetColor(1.0f,1.0f,1.0f,1.0f));
  219.     Frag.AddFrame("menu/gui/frag6.bmp",GetColor(1.0f,1.0f,1.0f,1.0f));
  220.  
  221.     TBack.Create(96,96,1);
  222.     TBack.AddFrame("menu/gui/tbk.bmp",GetColor(1.0f,0.0f,1.0f));
  223.  
  224.     TRuc.Create(26,78,1);
  225.     TRuc.AddFrame("menu/gui/truc.bmp",GetColor(1.0f,0.0f,1.0f));
  226.  
  227.     TBomb.Create(96,96,1);
  228.     TBomb.AddFrame("menu/gui/bombs.bmp",GetColor(1.0f,0.0f,1.0f));
  229.  
  230. }
  231.  
  232. //loadne briefring podla leveli
  233. //-----------------------------------------------------------
  234. void MENU::LoadBriefring(int LevelIndex)
  235. {
  236.     char Buffer[80];
  237.  
  238.     if (Language == 0)
  239.         sprintf(Buffer,"menu/brief/briefringeng%d.jpg",LevelIndex);
  240.     if (Language == 1)
  241.         sprintf(Buffer,"menu/brief/briefringcz%d.jpg",LevelIndex);
  242.  
  243.     LogoBriefring.ClearAllFrames();
  244.     LogoBriefring.AddFrame(Buffer,GetColor(1,0,1));
  245.  
  246. }
  247. //vykresli gui
  248. //-----------------------------------------------------------
  249. void MENU::DrawGui()
  250. {
  251.  
  252.     
  253.     //---------
  254.     //Pilot
  255.     //---------
  256.  
  257.     Pilot.Frame = 6.0f;
  258.  
  259.     if (SpitFire.Life > 0)
  260.     {
  261.         if (Input.MouseLeftDown)
  262.             Pilot.Frame = 5.0f;
  263.         else
  264.             Pilot.Frame = 4.0f;
  265.     }
  266.     
  267.     if (SpitFire.Life >= 30)
  268.     {
  269.         if (Input.MouseLeftDown)
  270.             Pilot.Frame = 3.0f;
  271.         else
  272.             Pilot.Frame = 2.0f;
  273.     }
  274.  
  275.     if (SpitFire.Life >= 60)
  276.     {
  277.         if (Input.MouseLeftDown)
  278.             Pilot.Frame = 1.0f;
  279.         else
  280.             Pilot.Frame = 0.0f;
  281.     }
  282.  
  283.     
  284.     //skore
  285.     char SScore[80];
  286.     if (SpitFire.FakeScore != SpitFire.Score)
  287.         SpitFire.FakeScore += 10;
  288.     sprintf(SScore,"%d",SpitFire.FakeScore);
  289.  
  290.     //vypocitaj cas
  291.     char STime[80];
  292.     float Stopky = Level.MaxTime - Level.StageTime;
  293.     int Minuty = (int) (Stopky/60.0f);
  294.     int Sekundy = ((int)Stopky) % 60;
  295.     if (Sekundy > 9)
  296.         sprintf(STime,"%d:%d",Minuty,Sekundy);
  297.     else
  298.         sprintf(STime,"%d:0%d",Minuty,Sekundy);
  299.  
  300.     //---------
  301.     //render
  302.     //---------
  303.  
  304.     Engine.SetBlendTrans();
  305.  
  306.         //kompas
  307.         if (SpitFire.ShowCompas)
  308.         {
  309.             Kompas.Pos = Get3D((float)Engine.Width/2.0f,(float)Engine.Height,0.0f);
  310.             Kompas.Rot = SpitFire.Rot.Y+0.55f;
  311.             Kompas.Render();
  312.         }
  313.  
  314.         //pilot render
  315.         Pilot.Pos = Get3D(Engine.Width-190.0f,40.0f,0.0f);
  316.         Pilot.Render();
  317.  
  318.         //ukazovatel zivota
  319.         Bevel.Pos = Get3D(Engine.Width-78.0f,40.0f,0.0f);
  320.         Bevel.Render();
  321.  
  322.         //otacky motora
  323.         TBack.Color.A = 0.8f;
  324.         TBack.Pos = Get3D(Engine.Width-80.0f,Engine.Height-60.0f,0.0f);
  325.         TBack.Render();
  326.         TRuc.Color.A = 0.8f;
  327.         TRuc.Rot = (SpitFire_MaxSpeed - SpitFire.Speed + 2.0f)/3.5f-1.4f; 
  328.         TRuc.Pos = Get3D(Engine.Width-80.0f,Engine.Height-47.0f,0.0f);
  329.         TRuc.Render();
  330.  
  331.         //pocet bomb
  332.         char sBombs[80];
  333.         sprintf(sBombs,"%d",SpitFire.Bombs);
  334.         TBomb.Color.A = 0.8f;
  335.         TBomb.Pos = Get3D(Engine.Width-180.0f,Engine.Height-60.0f,0.0f);
  336.         TBomb.Render();
  337.         GuiFont.Print(Engine.Width-188,Engine.Height-50,GetColor(1.0f,0.0f,0.0f,0.0f),sBombs);
  338.  
  339.         //pismo
  340.         GuiFont.Print(Engine.Width-135,18,GetColor(1.0f,0.0f,0.0f,0.0f),"Score: ");
  341.         GuiFont.Print(Engine.Width-80,18,GetColor(1.0f,0.28f,0.29f,0.25f),SScore);
  342.  
  343.         GuiFont.Print(Engine.Width-135,40,GetColor(1.0f,0.0f,0.0f,0.0f),"Time: ");
  344.         GuiFont.Print(Engine.Width-80,40,GetColor(1.0f,0.28f,0.29f,0.25f),STime);
  345.  
  346.     Engine.SetBlendNone();
  347.  
  348.  
  349. }
  350.  
  351. //vykresli mapu
  352. //-----------------------------------------------------------
  353. void MENU::DrawMap()
  354. {
  355.     if (SpitFire.ShowMap == false)
  356.         return;
  357.  
  358.     //pomocne
  359.     int i;
  360.     VECTOR3D MS;
  361.     float Mierka = 40.0f;
  362.     float Rozmer = 64.0f;
  363.  
  364.     //vypocitaj suradnice mapy
  365.     VECTOR3D MapSur = Get3D(80.0f,Engine.Height-80.0f,0.0f);
  366.  
  367.     //vypocitaj maticu spitfiri
  368.     D3DXMATRIX MatMap;
  369.     MatMap = GetMatrix(SpitFire.Pos,Get3D(0.0f,SpitFire.Rot.Y,0.0f),F_Scale);
  370.  
  371.     //zapni blending
  372.     Engine.SetBlendTrans();
  373.  
  374.     //vykresli podklad
  375.     Map.Color = GetColor(0.5f,1.0f,1.0f,1.0f);
  376.     Map.Pos = MapSur;
  377.     Map.Render();
  378.  
  379.     //vykresli poziciu hraca
  380.     Frag.Pos = MapSur;
  381.     Frag.Frame = 3.0f;
  382.     Frag.Render();
  383.  
  384.     //---------
  385.     //budovy
  386.     //---------
  387.     for (i=0;i<Max_Structures;i++)
  388.     {
  389.         if (Level.Structure[i].Life <= 0 ||
  390.             Level.Structure[i].Active == false)
  391.             continue;
  392.  
  393.         if (Level.Structure[i].Target == false &&
  394.             Level.Structure[i].Friendly == false)
  395.             continue;
  396.  
  397.  
  398.         MS = UnTransformPoint(Level.Structure[i].Pos,MatMap);
  399.  
  400.         MS.X = MS.X/Mierka;
  401.         MS.Y = MS.Z/Mierka;
  402.         MS.Z = 0.0f;
  403.  
  404.         if (MS.X >  Rozmer) MS.X =  Rozmer;
  405.         if (MS.X < -Rozmer) MS.X = -Rozmer;
  406.         if (MS.Y >  Rozmer) MS.Y =  Rozmer;
  407.         if (MS.Y < -Rozmer) MS.Y = -Rozmer;
  408.  
  409.         MS.X = MapSur.X + MS.X;
  410.         MS.Y = MapSur.Y - MS.Y;
  411.  
  412.         if (Level.Structure[i].Friendly == true) Frag.Frame = 5.0f;
  413.         if (Level.Structure[i].Target == true)   Frag.Frame = 0.0f;
  414.         Frag.Pos = MS;
  415.         Frag.Render();
  416.     
  417.     }
  418.  
  419.     //---------
  420.     //truck
  421.     //---------
  422.     for (i=0;i<Max_Trucks;i++)
  423.     {
  424.         if (Level.Truck[i].Life <= 0 || Level.Truck[i].Active == false)
  425.             continue;
  426.  
  427.         MS = UnTransformPoint(Level.Truck[i].Pos,MatMap);
  428.  
  429.         MS.X = MS.X/Mierka;
  430.         MS.Y = MS.Z/Mierka;
  431.         MS.Z = 0.0f;
  432.  
  433.         if (MS.X >  Rozmer) MS.X =  Rozmer;
  434.         if (MS.X < -Rozmer) MS.X = -Rozmer;
  435.         if (MS.Y >  Rozmer) MS.Y =  Rozmer;
  436.         if (MS.Y < -Rozmer) MS.Y = -Rozmer;
  437.  
  438.         MS.X = MapSur.X + MS.X;
  439.         MS.Y = MapSur.Y - MS.Y;
  440.  
  441.         //nastavi frame podla toho ci je target
  442.         if (Level.Truck[i].Target == true)    Frag.Frame = 0.0f;
  443.         if (Level.Truck[i].Target == false)    Frag.Frame = 1.0f;
  444.         Frag.Pos = MS;
  445.         Frag.Render();
  446.     
  447.     }
  448.  
  449.     //---------
  450.     //MesserSchmitt
  451.     //---------
  452.     for (i=0;i<Max_MesserSchmitt;i++)
  453.     {
  454.         if (Level.MesserSchmitt[i].Life <= 0 || Level.MesserSchmitt[i].Active == false)
  455.             continue;
  456.  
  457.         MS = UnTransformPoint(Level.MesserSchmitt[i].Pos,MatMap);
  458.  
  459.         MS.X = MS.X/Mierka;
  460.         MS.Y = MS.Z/Mierka;
  461.         MS.Z = 0.0f;
  462.  
  463.         if (MS.X >  Rozmer) MS.X =  Rozmer;
  464.         if (MS.X < -Rozmer) MS.X = -Rozmer;
  465.         if (MS.Y >  Rozmer) MS.Y =  Rozmer;
  466.         if (MS.Y < -Rozmer) MS.Y = -Rozmer;
  467.  
  468.         MS.X = MapSur.X + MS.X;
  469.         MS.Y = MapSur.Y - MS.Y;
  470.  
  471.         Frag.Frame = 2.0f;
  472.         Frag.Pos = MS;
  473.         Frag.Render();
  474.     
  475.     }
  476.  
  477.     //---------
  478.     //Volker
  479.     //---------
  480.     for (i=0;i<Max_Volkers;i++)
  481.     {
  482.         if (Level.Volker[i].Life <= 0 || Level.Volker[i].Active == false)
  483.             continue;
  484.  
  485.         MS = UnTransformPoint(Level.Volker[i].Pos,MatMap);
  486.  
  487.         MS.X = MS.X/Mierka;
  488.         MS.Y = MS.Z/Mierka;
  489.         MS.Z = 0.0f;
  490.  
  491.         if (MS.X >  Rozmer) MS.X =  Rozmer;
  492.         if (MS.X < -Rozmer) MS.X = -Rozmer;
  493.         if (MS.Y >  Rozmer) MS.Y =  Rozmer;
  494.         if (MS.Y < -Rozmer) MS.Y = -Rozmer;
  495.  
  496.         MS.X = MapSur.X + MS.X;
  497.         MS.Y = MapSur.Y - MS.Y;
  498.  
  499.         Frag.Frame = 2.0f;
  500.         Frag.Pos = MS;
  501.         Frag.Render();
  502.     
  503.     }
  504.  
  505.     //---------
  506.     //Bombarder
  507.     //---------
  508.     for (i=0;i<Max_Bombarders;i++)
  509.     {
  510.         if (Level.Bombarder[i].Life <= 0 || Level.Bombarder[i].Active == false)
  511.             continue;
  512.  
  513.         MS = UnTransformPoint(Level.Bombarder[i].Pos,MatMap);
  514.  
  515.         MS.X = MS.X/Mierka;
  516.         MS.Y = MS.Z/Mierka;
  517.         MS.Z = 0.0f;
  518.  
  519.         if (MS.X >  Rozmer) MS.X =  Rozmer;
  520.         if (MS.X < -Rozmer) MS.X = -Rozmer;
  521.         if (MS.Y >  Rozmer) MS.Y =  Rozmer;
  522.         if (MS.Y < -Rozmer) MS.Y = -Rozmer;
  523.  
  524.         MS.X = MapSur.X + MS.X;
  525.         MS.Y = MapSur.Y - MS.Y;
  526.  
  527.         Frag.Frame = 4.0f;
  528.         Frag.Pos = MS;
  529.         Frag.Render();
  530.     
  531.     }
  532.  
  533.  
  534.     //vypni blending
  535.     Engine.SetBlendNone();
  536.  
  537. }
  538.  
  539. //refresh intra
  540. //-----------------------------------------------------------
  541. void MENU::RefreshIntro()
  542. {
  543.  
  544.     //casovac
  545.     TimeIntro += PowerTime(1.0f);
  546.  
  547.     //background
  548.     BackGround.Center(Get3D(0.5f,0.5f,0.0f));
  549.     BackGround.Render();
  550.  
  551.  
  552.     //logo3D Games
  553.     Logo3DGames.Pos.Y = 300.0f;
  554.     if (TimeIntro < 1000.0f)
  555.         Logo3DGames.Pos.X = -300.0f+(TimeIntro/1.45f);
  556.     else if (TimeIntro > 3000.0f)
  557.         Logo3DGames.Pos.X = -300.0f+((4000.0f-TimeIntro)/1.45f);
  558.         
  559.     
  560.     Logo3DGames.Render();
  561.     
  562.     //logoPLE
  563.     LogoPLE.Pos.X = 400.0f;
  564.     if (TimeIntro < 1000.0f)
  565.         LogoPLE.Pos.Y = 710.0f-(TimeIntro/7.0f);
  566.     else if (TimeIntro > 3000.0f)
  567.         LogoPLE.Pos.Y = 710.0f-((4000.0f-TimeIntro)/7.0f);
  568.  
  569.     LogoPLE.Render();
  570.  
  571.     //koniec intra
  572.     if (TimeIntro > 4000.0f || Input.KeyPRESS[DIK_SPACE])
  573.     {
  574.         //EnabledIntro = false;
  575.         //EnabledBecherGame = true;
  576.  
  577.         EnabledIntro = false;
  578.         EnabledMainMenu = true;
  579.     }
  580. }
  581.  
  582. //refresh becher game loga
  583. //-----------------------------------------------------------
  584. void MENU::RefreshBecherGame()
  585. {
  586.  
  587.     //casovac
  588.     TimeBecherGame += PowerTime(0.001f);
  589.  
  590.     //background
  591.     BackGround.Center(Get3D(0.5f,0.5f,0.0f));
  592.     BackGround.Render();
  593.  
  594.     //becher game
  595.     BecherGame.Pos.Y = 300.0f;
  596.     BecherGame.Pos.X = 400.0f;
  597.     if (TimeBecherGame < 1.0f)
  598.         BecherGame.Scale = TimeBecherGame;
  599.     else if (TimeBecherGame > 3.0f)
  600.         BecherGame.Scale = 4.0f-TimeBecherGame;
  601.         
  602.     Engine.SetBlendTrans();
  603.         BecherGame.Render();
  604.     Engine.SetBlendNone();
  605.  
  606.     //koniec intra
  607.     if (TimeBecherGame > 4.0f || Input.KeyPRESS[DIK_SPACE])
  608.     {
  609.         EnabledBecherGame = false;
  610.         EnabledMainMenu = true;
  611.     }
  612. }
  613.  
  614.  
  615. //refresh hlavneho menu
  616. //----------------------------------------------------------
  617. void MENU::RefreshMainMenu()
  618. {
  619.  
  620.     //reset farieb buttonov
  621.     ButtonCampaing.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  622.     ButtonBattle.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  623.     ButtonExit.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  624.     ButtonCredits.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  625.     ButtonBack.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  626.  
  627.     //---------
  628.     //mody
  629.     //---------
  630.  
  631.     //vytahovanie logo
  632.     //---------------------
  633.     if (ModeMainMenu == 1)
  634.     {
  635.         TimeMainMenu += PowerTime(0.001f);
  636.         if (TimeMainMenu > 1.0f)
  637.         {
  638.             TimeMainMenu = 1.0f;
  639.             ModeMainMenu = 2;
  640.         }
  641.     }
  642.  
  643.     //vytahovanie buttony
  644.     //-----------------------
  645.     if (ModeMainMenu  == 2)
  646.     {
  647.         TimeMainMenu += PowerTime(0.001f);
  648.         if (TimeMainMenu > 2.0f)
  649.         {
  650.             TimeMainMenu = 2.0f;
  651.             ModeMainMenu  = 3;
  652.         }
  653.     }
  654.  
  655.     //zatahovanie buttony - do campaing
  656.     //----------------------------------------
  657.     if (ModeMainMenu  == 4)
  658.     {
  659.         TimeMainMenu -= PowerTime(0.001f);
  660.         if (TimeMainMenu < 1.0f)
  661.         {
  662.             ModeMainMenu  = 2;
  663.             TimeMainMenu = 1.0f;
  664.             EnabledMainMenu = false;
  665.             EnabledCampaing = true;
  666.  
  667.         }
  668.     }
  669.  
  670.     //zatahovanie buttony - do battle
  671.     //------------------------------------
  672.     if (ModeMainMenu  == 5)
  673.     {
  674.         TimeMainMenu -= PowerTime(0.001f);
  675.         if (TimeMainMenu < 0.0f)
  676.         {
  677.             ModeMainMenu  = 1;
  678.             TimeMainMenu = 0.0f;
  679.             EnabledMenu = false;
  680.  
  681.             //nakonfigurovanie levelu
  682.             Level.StartGame(0);
  683.         }
  684.  
  685.     }
  686.  
  687.     //zatahovanie buttony - do credits
  688.     //-----------------------------------
  689.     if (ModeMainMenu  == 6)
  690.     {
  691.         TimeMainMenu -= PowerTime(0.001f);
  692.         if (TimeMainMenu < 1.0f)
  693.         {
  694.             ModeMainMenu  = 2;
  695.             EnabledMainMenu = false;
  696.             EnabledCredits = true;
  697.             TimeMainMenu = 1.0f;
  698.         }
  699.         
  700.     }
  701.  
  702.     //zatahovanie buttony - do exit
  703.     //------------------------------
  704.     if (ModeMainMenu  == 7)
  705.     {
  706.         TimeMainMenu -= PowerTime(0.001f);
  707.         if (TimeMainMenu < 0.0f)
  708.         {
  709.             PostQuitMessage(0);
  710.         }
  711.     }
  712.  
  713.     //stand
  714.     //--------------------
  715.     if (ModeMainMenu  == 3)
  716.     {        
  717.         //campaing
  718.         if (ButtonCampaing.MousePick(Input.Mouse) == false)
  719.             ButtonCampaing.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  720.         else
  721.         {
  722.             ButtonCampaing.Color = GetColor(1.0f,0.0f,0.0f,0.0f);
  723.             if (Input.MouseLeftPress == true)
  724.                 ModeMainMenu = 4;
  725.         }
  726.  
  727.         //battle
  728.         if (ButtonBattle.MousePick(Input.Mouse) == false)
  729.             ButtonBattle.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  730.         else
  731.         {            
  732.             ButtonBattle.Color = GetColor(1.0f,0.0f,0.0f,0.0f);
  733.             if (Input.MouseLeftPress == true)
  734.                 ModeMainMenu = 5;
  735.         }
  736.  
  737.         //credits
  738.         if (ButtonCredits.MousePick(Input.Mouse) == false)
  739.             ButtonCredits.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  740.         else
  741.         {
  742.             ButtonCredits.Color = GetColor(1.0f,0.0f,0.0f,0.0f);
  743.             if (Input.MouseLeftPress == true)
  744.                 ModeMainMenu = 6;
  745.         }
  746.     
  747.         //exit
  748.         if (ButtonExit.MousePick(Input.Mouse) == false)
  749.             ButtonExit.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  750.         else
  751.         {
  752.             ButtonExit.Color = GetColor(1.0f,0.0f,0.0f,0.0f);
  753.             if (Input.MouseLeftPress == true)
  754.                 ModeMainMenu = 7;
  755.         }
  756.  
  757.  
  758.     }
  759.  
  760.     //--------
  761.     //Render
  762.     //--------
  763.  
  764.     BackGround.Center(Get3D(0.5f,0.5f,0.0f));
  765.     BackGround.Render();
  766.  
  767.     //alias time - prevedie cas celkovy pre jednotlive skupiny
  768.     //buttony alebo loga 
  769.     float LTime = TimeMainMenu; if (LTime>1.0f) LTime = 1.0f;
  770.     float BTime = TimeMainMenu-1.0f;
  771.  
  772.     LogoPlane.Pos.X = -300.0f + (LTime)*460.0f;
  773.     LogoPlane.Pos.Y = 90.0f;
  774.     LogoPlane.Render();
  775.  
  776.     LogoAir.Pos.X = -200.0f + (LTime)*565.0f;
  777.     LogoAir.Pos.Y =  500.0f - (LTime)*415.0f;
  778.     LogoAir.Render();
  779.  
  780.     LogoArcade.Pos.X = 600.0f ;
  781.     LogoArcade.Pos.Y = -70.0f + (LTime)*160.0f;
  782.     LogoArcade.Render();
  783.  
  784.     LogoPilot.Pos.X = (1200.0f)-(LTime)*620.0f;
  785.     LogoPilot.Pos.Y = 100+(1.0f)*330.0f;
  786.     LogoPilot.Render();
  787.  
  788.     LogoBecher.Pos.X = 74.0f ;
  789.     LogoBecher.Pos.Y = 500.0f;
  790.     if (BTime > 0.0f) LogoBecher.Scale = BTime;
  791.     else LogoBecher.Scale = 0.0f;
  792.     LogoBecher.Render();
  793.  
  794.  
  795.     //buttons & mouse
  796.     Engine.SetBlendTrans();
  797.  
  798.     ButtonCampaing.Pos.X = -250.0f + (BTime)*460.0f;
  799.     ButtonCampaing.Pos.Y = 230.0f;
  800.     ButtonCampaing.Render();
  801.  
  802.     ButtonBattle.Pos.X = -250.0f + (BTime)*440.0f;
  803.     ButtonBattle.Pos.Y = 280.0f;
  804.     ButtonBattle.Render();
  805.  
  806.     ButtonCredits.Pos.X = -250.0f + (BTime)*420.0f;
  807.     ButtonCredits.Pos.Y = 330.0f;
  808.     ButtonCredits.Render();
  809.  
  810.     ButtonExit.Pos.X = -250.0f + (BTime)*400.0f;
  811.     ButtonExit.Pos.Y = 380.0f;
  812.     ButtonExit.Render();
  813.  
  814.     //cursor
  815.     Cursor.Pos.X = Input.Mouse.X + 15;
  816.     Cursor.Pos.Y = Input.Mouse.Y + 15;
  817.     Cursor.Render();
  818.  
  819.     Engine.SetBlendNone();
  820.  
  821.     //program info
  822.     CreditsFont.Print(20,Engine.Height-((int)FTRX(22.0f)),GetColor(1.0f,0.0f,0.0f,0.0f),
  823.                      ProgramInfo);
  824.  
  825. }
  826.  
  827. //refresh credits
  828. //----------------------------------------------------------
  829. void MENU::RefreshCampaing()
  830. {
  831.  
  832.     //vytahovanie
  833.     if (ModeCampaing == 1)
  834.     {
  835.         TimeCampaing += PowerTime(0.001f);
  836.         if (TimeCampaing > 1.0f)
  837.         {
  838.             ModeCampaing = 2;
  839.             TimeCampaing = 1.0f;
  840.         }
  841.     }
  842.  
  843.     //zatahovanie
  844.     if (ModeCampaing == 3)
  845.     {
  846.         TimeCampaing -= PowerTime(0.001f);
  847.         if (TimeCampaing < 0.0f)
  848.         {
  849.             ModeCampaing = 1;
  850.             EnabledMainMenu = true;
  851.             EnabledCampaing = false;
  852.             TimeCampaing = 0.0f;
  853.         }
  854.  
  855.     }
  856.  
  857.     //zatahovanie do hry
  858.     if (ModeCampaing == 4)
  859.     {
  860.         TimeCampaing -= PowerTime(0.001f);
  861.         if (TimeCampaing < 0.0f)
  862.         {
  863.             ModeCampaing = 1;
  864.             EnabledMenu = false;
  865.             TimeCampaing = 0.0f;
  866.  
  867.             //nakonfigurovanie levelu
  868.             Level.StartGame(CampaingLevelIndex);
  869.         }
  870.  
  871.     }
  872.  
  873.     //stand by
  874.     if (ModeCampaing ==2)
  875.     {
  876.         //back
  877.         if (ButtonBack.MousePick(Input.Mouse) == false)
  878.             ButtonBack.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  879.         else
  880.         {            
  881.             ButtonBack.Color = GetColor(1.0f,0.0f,0.0f,0.0f);
  882.             if (Input.MouseLeftPress == true)
  883.                 ModeCampaing = 3;
  884.         }
  885.  
  886.     }
  887.  
  888.     //back
  889.     BackGround.Center(Get3D(0.5f,0.5f,0.0f));
  890.     BackGround.Render();
  891.  
  892.     //render logos
  893.     float LTime = TimeMainMenu;
  894.  
  895.     LogoPlane.Pos.X = -300.0f + (LTime)*460.0f;
  896.     LogoPlane.Pos.Y = 90.0f;
  897.     LogoPlane.Render();
  898.  
  899.     LogoAir.Pos.X = -200.0f + (LTime)*565.0f;
  900.     LogoAir.Pos.Y =  500.0f - (LTime)*415.0f;
  901.     LogoAir.Render();
  902.  
  903.     LogoArcade.Pos.X = 600.0f ;
  904.     LogoArcade.Pos.Y = -70.0f + (LTime)*160.0f;
  905.     LogoArcade.Render();
  906.  
  907.     LogoPilot.Pos.X = (1200.0f)-(LTime)*620.0f;
  908.     LogoPilot.Pos.Y = 100+(LTime)*330.0f;
  909.     LogoPilot.Render();
  910.  
  911.     //program info
  912.     CreditsFont.Print(20,Engine.Height-((int)FTRX(22.0f)),GetColor(1.0f,0.0f,0.0f,0.0f),
  913.                      ProgramInfo);
  914.  
  915.  
  916.     //Missions
  917.     //----------
  918.     for (int y=0;y<5;y++)
  919.     {
  920.         for (int x=0;x<3;x++)
  921.         {
  922.  
  923.             Missions.Frame = float (y*3+x);
  924.             Missions.Pos.X = (-300.0f + x*80.0f) + TimeCampaing*400.0f;
  925.             Missions.Pos.Y =   200.0f + y*70.0f;
  926.             if (y*3+x+1 <=  MaxMission)
  927.             {
  928.                 Missions.Color = GetColor(1.0f,1.0f,1.0f);
  929.                 Missions.Render();
  930.                 if (Missions.MousePick(Input.Mouse) == true &&
  931.                     Input.MouseLeftPress == true)
  932.                 {
  933.                     CampaingLevelIndex = y*3+x+1;
  934.                     ModeCampaing = 4;
  935.                 }
  936.             }
  937.             else
  938.             {
  939.                 Missions.Color = GetColor(0.5f,0.45f,0.30f);
  940.                 Missions.Render();
  941.             }
  942.  
  943.         }
  944.     }
  945.     
  946.  
  947.     Engine.SetBlendTrans();
  948.  
  949.         //buttonback
  950.         ButtonBack.Pos.X = 400.0f;
  951.         ButtonBack.Pos.Y = 650.0f - (TimeCampaing)*110.0f;
  952.         ButtonBack.Render();
  953.  
  954.         //cursor
  955.         Cursor.Pos.X = Input.Mouse.X + 15;
  956.         Cursor.Pos.Y = Input.Mouse.Y + 15;
  957.         Cursor.Render();
  958.  
  959.     Engine.SetBlendNone();
  960.  
  961. }
  962.  
  963. //refresh credits
  964. //----------------------------------------------------------
  965. void MENU::RefreshCredits()
  966. {
  967.  
  968.     //vytahovanie
  969.     if (ModeCredits == 1)
  970.     {
  971.         TimeCredits += PowerTime(0.001f);
  972.         if (TimeCredits > 1.0f)
  973.         {
  974.             ModeCredits = 2;
  975.             TimeCredits = 1.0f;
  976.         }
  977.     }
  978.  
  979.     //zatahovanie
  980.     if (ModeCredits == 3)
  981.     {
  982.         TimeCredits -= PowerTime(0.001f);
  983.         if (TimeCredits < 0.0f)
  984.         {
  985.             ModeCredits = 1;
  986.             EnabledMainMenu = true;
  987.             EnabledCredits = false;
  988.             TimeCredits = 0.0f;
  989.         }
  990.  
  991.     }
  992.  
  993.     //stand by
  994.     if (ModeCredits ==2)
  995.     {
  996.         //back
  997.         if (ButtonBack.MousePick(Input.Mouse) == false)
  998.             ButtonBack.Color = GetColor(1.0f,72/255.0f,71/255.0f,58/255.0f);
  999.         else
  1000.         {            
  1001.             ButtonBack.Color = GetColor(1.0f,0.0f,0.0f,0.0f);
  1002.             if (Input.MouseLeftPress == true)
  1003.                 ModeCredits = 3;
  1004.         }
  1005.  
  1006.     }
  1007.  
  1008.     //back
  1009.     BackGround.Center(Get3D(0.5f,0.5f,0.0f));
  1010.     BackGround.Render();
  1011.  
  1012.     //render logos
  1013.     float LTime = TimeMainMenu;
  1014.  
  1015.     LogoPlane.Pos.X = -300.0f + (LTime)*460.0f;
  1016.     LogoPlane.Pos.Y = 90.0f;
  1017.     LogoPlane.Render();
  1018.  
  1019.     LogoAir.Pos.X = -200.0f + (LTime)*565.0f;
  1020.     LogoAir.Pos.Y =  500.0f - (LTime)*415.0f;
  1021.     LogoAir.Render();
  1022.  
  1023.     LogoArcade.Pos.X = 600.0f ;
  1024.     LogoArcade.Pos.Y = -70.0f + (LTime)*160.0f;
  1025.     LogoArcade.Render();
  1026.  
  1027.     LogoPilot.Pos.X = (1200.0f)-(LTime)*620.0f;
  1028.     LogoPilot.Pos.Y = 100+(LTime)*330.0f;
  1029.     LogoPilot.Render();
  1030.  
  1031.     //credits
  1032.     LogoCredits.Pos.X = -300.0f + (TimeCredits)*500.0f;
  1033.     LogoCredits.Pos.Y = 340.0f;
  1034.     LogoCredits.Render();
  1035.  
  1036.     //mena
  1037.     if (ModeCredits ==2)
  1038.     {
  1039.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(225.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1040.                      "Peter Adamcik");
  1041.  
  1042.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(265.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1043.                      "Simon Meszaros, Peter Adamcik");
  1044.     
  1045.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(305.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1046.                      "Martin Hubacek");
  1047.  
  1048.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(345.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1049.                      "www.HS23.tk - for great music, yeaah..");
  1050.  
  1051.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(365.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1052.                      "aDuan Music Studio - for great music");
  1053.  
  1054.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(385.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1055.                      "Blazke,Denisovi,Swarmovi,Ivantovi,...");
  1056.  
  1057.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(405.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1058.                      "bud·cim man₧elkßm...");
  1059.     
  1060.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(425.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1061.                      "www.ceskehry.cz - for hosting, support, forum, magazin");
  1062.  
  1063.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(445.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1064.                      "forum.animacia.sk - for great people");
  1065.  
  1066.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(465.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1067.                      "www.codesampler.com - for great source codes");
  1068.  
  1069.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(485.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1070.                      "www.bloguje.cz - for great blog system");
  1071.  
  1072.         CreditsFont.Print((int)FTRX(80.0f),(int)FTRY(505.0f),GetColor(1.0f,0.0f,0.0f,0.0f),
  1073.                      "Adobe, Discreet - for great software");
  1074.     }
  1075.  
  1076.     //program info
  1077.     CreditsFont.Print(20,Engine.Height-((int)FTRX(22.0f)),GetColor(1.0f,0.0f,0.0f,0.0f),
  1078.                      ProgramInfo);
  1079.  
  1080.     Engine.SetBlendTrans();
  1081.     
  1082.         //buttonback
  1083.         ButtonBack.Pos.X = 400.0f;
  1084.         ButtonBack.Pos.Y = 650.0f - (TimeCredits)*110.0f;
  1085.         ButtonBack.Render();
  1086.  
  1087.         //cursor
  1088.         Cursor.Pos.X = Input.Mouse.X + 15;
  1089.         Cursor.Pos.Y = Input.Mouse.Y + 15;
  1090.         Cursor.Render();
  1091.  
  1092.     Engine.SetBlendNone();
  1093.  
  1094. }
  1095.  
  1096. //refresh briefring
  1097. //----------------------------------------------------------
  1098. void MENU::RefreshBriefring()
  1099. {
  1100.     
  1101.     //zastav zvuky
  1102.     //--------------
  1103.     Level.StopAllSounds();
  1104.  
  1105.     //LogoBriefring
  1106.     //-------------
  1107.     if (LogoBriefring.MousePick(Input.Mouse))
  1108.         LogoBriefring.Color.A = 1.0f;
  1109.     else
  1110.         LogoBriefring.Color.A = 1.0f;
  1111.     LogoBriefring.Center(Get3D(0.5f,0.5f,0.0f));
  1112.     LogoBriefring.Frame = 0.0f;
  1113.     Engine.SetBlendTrans();
  1114.         LogoBriefring.Render();
  1115.     Engine.SetBlendNone();
  1116.  
  1117.     //buttonrestart
  1118.     //-------------
  1119.     if (ButtonRestart.MousePick(Input.Mouse))
  1120.         ButtonRestart.Color.A = 1.0f;
  1121.     else
  1122.         ButtonRestart.Color.A = 0.6f;
  1123.     ButtonRestart.Pos.X = Engine.Width/2.0f - 110.0f;
  1124.     ButtonRestart.Pos.Y = Engine.Height/2.0f + 160.0f;
  1125.     Engine.SetBlendTrans();
  1126.         ButtonRestart.Render();
  1127.     Engine.SetBlendNone();
  1128.  
  1129.     //buttoncontinue
  1130.     //-------------
  1131.     if (ButtonContinue.MousePick(Input.Mouse))
  1132.         ButtonContinue.Color.A = 1.0f;
  1133.     else
  1134.         ButtonContinue.Color.A = 0.6f;
  1135.     ButtonContinue.Pos.X = Engine.Width/2.0f ;
  1136.     ButtonContinue.Pos.Y = Engine.Height/2.0f + 160.0f;
  1137.     Engine.SetBlendTrans();
  1138.         ButtonContinue.Render();
  1139.     Engine.SetBlendNone();
  1140.  
  1141.     //buttonend
  1142.     //-------------
  1143.     if (ButtonEnd.MousePick(Input.Mouse))
  1144.         ButtonEnd.Color.A = 1.0f;
  1145.     else
  1146.         ButtonEnd.Color.A = 0.6f;
  1147.     ButtonEnd.Pos.X = Engine.Width/2.0f + 110.0f;
  1148.     ButtonEnd.Pos.Y = Engine.Height/2.0f + 160.0f;
  1149.     Engine.SetBlendTrans();
  1150.         ButtonEnd.Render();
  1151.     Engine.SetBlendNone();
  1152.  
  1153.     //cursor
  1154.     //-------
  1155.     Engine.SetBlendTrans();
  1156.         Cursor.Pos.X = Input.Mouse.X + 15;
  1157.         Cursor.Pos.Y = Input.Mouse.Y + 15;
  1158.         Cursor.Render();
  1159.     Engine.SetBlendNone();
  1160.  
  1161.     //restart
  1162.     //---------
  1163.     if ((ButtonRestart.MousePick(Input.Mouse) == true) &&
  1164.         (Input.MouseLeftPress == true))
  1165.     {
  1166.         Level.StartGame(Level.LevelIndex);
  1167.         Menu.EnabledBriefring = false;    
  1168.  
  1169.         //aby spitfire nestrielal
  1170.         SpitFire.BulletTime = -400.0f;
  1171.  
  1172.     }
  1173.  
  1174.     //pokracovat v hre
  1175.     //-----------------
  1176.     if ((ButtonContinue.MousePick(Input.Mouse) == true) &&
  1177.         (Input.MouseLeftPress == true))
  1178.     {
  1179.         Menu.EnabledBriefring = false;    
  1180.  
  1181.         //aby spitfire nestrielal
  1182.         SpitFire.BulletTime = -400.0f;
  1183.     }
  1184.  
  1185.     //koniec - navrat do menu
  1186.     //-----------------------
  1187.     if ((ButtonEnd.MousePick(Input.Mouse) == true) &&
  1188.         (Input.MouseLeftPress == true))
  1189.     {
  1190.         Menu.EnabledBriefring = false;    
  1191.  
  1192.         //aby spitfire nestrielal
  1193.         SpitFire.BulletTime = -400.0f;
  1194.  
  1195.         //koniec misie
  1196.         SpitFire.MissionExit();
  1197.     }
  1198.  
  1199.     //koniec - klavesnica
  1200.     //------------------------
  1201.     if (Input.KeyPRESS[DIK_RETURN] == true)
  1202.     {
  1203.         //koniec briefringu
  1204.         Menu.EnabledBriefring = false;    
  1205.     }
  1206.  
  1207.  
  1208. }
  1209.  
  1210. //nacita ktore misie su pristupne
  1211. //----------------------------------------------------------
  1212. void MENU::LoadArray()
  1213. {
  1214.     FILE *File = NULL;
  1215.     File = fopen("menu/array.dat","r");
  1216.  
  1217.     if (File == NULL) LogPrint("Nemozem otvorit array.dat");
  1218.  
  1219.     fscanf(File,"%d",&MaxMission);
  1220.  
  1221.     fclose(File);
  1222.  
  1223. }
  1224.  
  1225. //ulozi ktore misie su pristupne
  1226. //----------------------------------------------------------
  1227. void MENU::SaveArray(int MaxLevelIndex)
  1228. {
  1229.     if (MaxLevelIndex < MaxMission)
  1230.         return;
  1231.  
  1232.     FILE *File = NULL;
  1233.     File = fopen("menu/array.dat","w");
  1234.  
  1235.     fprintf(File,"%d",MaxLevelIndex);
  1236.  
  1237.     MaxMission = MaxLevelIndex;
  1238.  
  1239.     fclose(File);
  1240.  
  1241. }
  1242.  
  1243. //Vykresli Loading
  1244. //----------------------------------------------------------
  1245. void MENU::DrawLoading(int Prog, char *Text)
  1246. {
  1247.  
  1248.     Engine.BeginScene();
  1249.  
  1250.     //background
  1251.     BackGround.Center(Get3D(0.5f,0.5f,0.0f));
  1252.     BackGround.Render();
  1253.  
  1254.     //loading
  1255.     Loading.Pos.X = 400.0f;
  1256.     Loading.Pos.Y = 300.0f;
  1257.     Loading.Render();
  1258.  
  1259.     //progress
  1260.     for(int i=0;i<Prog;i++)
  1261.     {
  1262.         Progress.Pos.Y = 350.0f;
  1263.         Progress.Pos.X = 284.0f+(i*32);
  1264.         Progress.Render();
  1265.     }
  1266.  
  1267.     //skry kurzor
  1268.     ShowCursor(false);
  1269.     
  1270.     //font
  1271.     DxFont.PrintCenter(0,(int)(FTRY(390.0f)),
  1272.               GetColor(1.0f,0.28f,0.29f,0.25f),Text);
  1273.  
  1274.  
  1275.     Engine.EndScene();
  1276.  
  1277. }
  1278.  
  1279. //refresh celeho menu
  1280. //----------------------------------------------------------
  1281. void MENU::Refresh()
  1282. {
  1283.  
  1284.     //intro
  1285.     if (EnabledIntro)
  1286.         RefreshIntro();
  1287.  
  1288.     //main menu
  1289.     else if (EnabledMainMenu)
  1290.         RefreshMainMenu();
  1291.  
  1292.     //campaing
  1293.     else if (EnabledCampaing)
  1294.         RefreshCampaing();
  1295.  
  1296.     //becher game
  1297.     else if (EnabledBecherGame)
  1298.         RefreshBecherGame();
  1299.  
  1300.     //credits
  1301.     else if (EnabledCredits)
  1302.         RefreshCredits();
  1303.  
  1304. }