future.c

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005 Michael K. McCarty & Fritz Bronner
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018 /** \file future.c This is responsible for Future Mission planning screen.
00019  * 
00020  */
00021 #include "Buzz_inc.h"
00022 #include "externs.h"
00023 #include <assert.h>
00024 #include "logging.h"
00025 
00026 LOG_DEFAULT_CATEGORY(future);
00027 
00028   char status[5],lck[5],F1,F2,F3,F4,FMen,F5,Pad;
00029   char JointFlag,MarFlag,JupFlag,SatFlag,MisType;
00030   GXHEADER vh;
00031 
00032   struct StepInfo {
00033     i16 x_cor;
00034     i16 y_cor;
00035   } StepBub[MAXBUB];
00036 
00037   struct Parameter {
00038     char A:2;   /**< DOCKING */
00039     char B:2;   /**< EVA */
00040     char C:2;   /**< LEM */
00041     char D:2;   /**< JOINT */
00042     char E;     /**< MANNED/UNMANNED/Duration 0==unmanned 1-6==duration */
00043     char X;     /**< the type of mission for assign crew and hardware */
00044     char Z:2;   /**< A duaration mission only */
00045   } V[62];
00046 
00047 extern int Bub_Count;
00048 extern struct mStr Mis;
00049 extern struct MisEval Mev[60];
00050 extern int SEG;
00051 
00052 void Load_FUT_BUT(void)
00053 {
00054   FILE *fin;
00055   unsigned i;
00056   fin=sOpen("NFUTBUT.BUT","rb",0);
00057   i=fread(screen,1,MAX_X*MAX_Y,fin);
00058   fclose(fin);
00059   RLED_img((char *)screen,(char *)vh.vptr,(unsigned)i,vh.w,vh.h);
00060   return;
00061 }
00062 
00063 void DrawFuture(char plr,int mis,char pad)
00064 {
00065   int i,j;
00066   FILE *fin;
00067   unsigned sz;
00068   strcpy(IKEY,"k011");strcpy(IDT,"i011");
00069   
00070   JointFlag=0; // initialize joint flag
00071   F1=F2=F3=F4=FMen=F5=0;
00072   for (i=0;i<5;i++) lck[i]=status[i]=0;
00073   FadeOut(2,pal,10,0,0);
00074   Load_FUT_BUT();
00075   fin=sOpen("FMIN.IMG","rb",0);
00076   fread(&pal[0],768,1,fin);
00077   sz=fread(screen,1,MAX_X*MAX_Y,fin);
00078   fclose(fin);
00079   RLED_img((char *)screen,(char *)vhptr.vptr,sz,vhptr.w,vhptr.h);
00080   gxClearDisplay(0,0);
00081 
00082   gr_sync ();
00083 
00084     if (pad==2) JointFlag=0; // third pad automatic no joint mission
00085     else
00086       if (Data->P[plr].LaunchFacility[pad+1] == 1)
00087       {
00088        if (Data->P[plr].Future[pad+1].MissionCode==0) JointFlag=1; // if no mission then set joint flag
00089       else if (Data->P[plr].Future[pad+1].part==1) // check if the part of that second mission is set
00090          {
00091           JointFlag=1;
00092           Data->P[plr].Future[pad+1].MissionCode=0; // clear mission
00093           Data->P[plr].Future[pad+1].part=0;
00094          };
00095       };
00096 
00097   if (pad==1 || pal==0) {
00098     if (Data->P[plr].LaunchFacility[pad+1]==1) JointFlag=1;
00099   }
00100 
00101   i=Data->Year;j=Data->Season;
00102   DEBUG3("--- Setting i=Year (%d), j=Season (%d)", i, j);
00103   if ((i==60 && j==0) || (i==62 && j==0) || (i==64 && j==0) ||
00104       (i==66 && j==0) || (i==69 && j==1) || (i==71 && j==1) ||
00105       (i==73 && j==1)) {
00106 
00107      gxVirtualVirtual(&vhptr,1,2,12,11,&vhptr,198,153,gxSET); /* Mars */
00108      MarFlag=1; } else MarFlag=0;
00109   if ((i==60 || i==64 || i==68 || i==72 || i==73 || i==77)) {
00110     gxVirtualVirtual(&vhptr,14,2,64,54,&vhptr,214,130,gxSET); /* Jup */
00111     JupFlag=1; } else JupFlag=0;
00112   if (i==61 || i==66 || i==72) {
00113     gxVirtualVirtual(&vhptr,66,2,114,53,&vhptr,266,135,gxSET); /* Sat */
00114     SatFlag=1; } else SatFlag=0;
00115 
00116   RectFill(1,1,318,21,3);RectFill(317,22,318,198,3);RectFill(1,197,316,198,3);
00117   RectFill(1,22,2,196,3);OutBox(0,0,319,199);InBox(3,3,30,19);
00118   InBox(3,22,316,196);
00119   IOBox(242,3,315,19);
00120   ShBox(5,24,183,47);
00121   ShBox(5,24,201,47); //name box
00122   ShBox(5,74,41,82); // RESET
00123   ShBox(5,49,53,72); //dur/man
00124   ShBox(43,74,53,82); // lock
00125   ShBox(80,74,90,82);
00126   ShBox(117,74,127,82);
00127   ShBox(154,74,164,82);
00128   ShBox(191,74,201,82);
00129   ShBox(5,84,16,130);   //arrows up
00130   ShBox(5,132,16,146); //middle box
00131   ShBox(5,148,16,194);   //    down
00132   ShBox(203,24,238,31);  // new right boxes
00133   RectFill(206,36,235,44,7);
00134   ShBox(203,33,238,47);
00135   InBox(205,35,236,45);
00136   UPArrow(8,95);DNArrow(8,157);
00137   
00138   gxVirtualDisplay(&vh,140,5,5,132,15,146,0);
00139   Toggle(5,1);draw_Pie(0);OutBox(5,49,53,72);
00140   Toggle(1,1);TogBox(55,49,0);
00141   Toggle(2,1);TogBox(92,49,0);
00142   Toggle(3,1);TogBox(129,49,0);
00143 
00144   FMen=F1=F2=F3=F4=F5=0;
00145   for (i=1;i<4;i++){
00146     if (status[i]!=0) {
00147       Toggle(i,1);
00148     }
00149   };
00150      if (JointFlag==0) {
00151       F4=2;lck[4]=1;
00152       Toggle(4,1);
00153       InBox(191,74,201,82);
00154       PlaceRX(5);
00155       TogBox(166,49,1);
00156     }
00157      else {
00158       F4=0; lck[4]=0;
00159       status[4]=0;
00160       Toggle(4,1);
00161       OutBox(191,74,201,82);
00162       ClearRX(5);
00163       TogBox(166,49,0);
00164     };
00165 
00166   gr_sync ();
00167   Missions(plr,8,37,mis,1);
00168   GetMinus(plr);
00169   grSetColor(5);
00170   /* lines of text are 1:8,30  2:8,37   3:8,44    */
00171   switch(pad) {
00172     case 0: PrintAt(8,30,"PAD 1:");break;
00173     case 1: PrintAt(8,30,"PAD 2:");break;
00174     case 2: PrintAt(8,30,"PAD 3:");break;
00175     default:break;
00176   };
00177   grSetColor(1);
00178   PrintAt(9,80,"RESET");
00179   PrintAt(258,13,"CONTINUE");
00180   FlagSm(plr,4,4);
00181   DispBig(40,5,"FUTURE MISSIONS",0,-1);
00182   FadeIn(2,pal,10,0,0);
00183   
00184   return;
00185 }
00186 
00187 void ClearDisplay(void)
00188 {
00189  gxVirtualDisplay(&vhptr,202,48,202,48,241,82,0);
00190  gxVirtualDisplay(&vhptr,17,83,17,83,241,195,0);
00191  gxVirtualDisplay(&vhptr,242,23,242,23,315,195,0);
00192  grSetColor(1);
00193  return;
00194 }
00195 
00196 int GetMinus(char plr)
00197 {
00198  char i;int u;
00199 
00200  i=PrestMin(plr);
00201   RectFill(206,36,235,44,7);
00202  if (i<3) u=1; //ok
00203    else if (i<9) u=10; //caution
00204     else u=19; //danger
00205   gxVirtualDisplay(&vh,203,u,203,24,238,31,0);
00206  grSetColor(11);
00207  if (i>0) PrintAt(210,42,"-");
00208   else grMoveTo(210,42);
00209  DispNum(0,0,i);
00210  grSetColor(1);
00211  return 0;
00212 }
00213 
00214 void SetParameters(void)
00215 {
00216   int i;
00217   FILE *fin;
00218   fin=sOpen("MISSION.DAT","rb",0);
00219   for (i=0;i<62;i++) {
00220     fread(&Mis,sizeof Mis,1,fin);
00221     V[i].A=Mis.Doc;  V[i].B=Mis.EVA;
00222     V[i].C=Mis.LM;   V[i].D=Mis.Jt;
00223     V[i].E=Mis.Days; V[i].X=Mis.mCrew;
00224     V[i].Z=Mis.Dur;
00225   }
00226   fclose(fin);
00227   return;
00228 }
00229 
00230 void DrawLocks(void)
00231 {
00232  int i;
00233  for (i=0;i<5;i++)
00234    if (lck[i]==1) PlaceRX(i+1);
00235    else ClearRX(i+1);
00236  return;
00237 }
00238 
00239 
00240 /** set the toggles???
00241  * 
00242  * \param wh the button 
00243  * \param i in or out
00244  */
00245 void Toggle(int wh,int i) 
00246 {
00247  DEBUG3("->Toggle(wh %d, i %d)", wh, i);
00248  switch(wh)
00249    {
00250     case 1:if (i==1) gxVirtualDisplay(&vh,1,21,55,49,89,81,0);else
00251       gxVirtualDisplay(&vh,1,56,55,49,89,81,0); break;
00252 
00253     case 2:if(i==1)  gxVirtualDisplay(&vh,38,21,92,49,127,81,0);else
00254       gxVirtualDisplay(&vh,38,56,92,49,127,81,0); break;
00255 
00256     case 3:if(i==1)  gxVirtualDisplay(&vh,75,21,129,49,163,81,0);else
00257       gxVirtualDisplay(&vh,75,56,129,49,163,81,0); break;
00258 
00259     case 4:if(i==1)  gxVirtualDisplay(&vh,112,21,166,49,200,81,0);else
00260       gxVirtualDisplay(&vh,112,56,166,49,200,81,0); break;
00261 
00262     case 5:if (i==1)  gxVirtualDisplay(&vh,153,1,5,49,52,71,0);
00263          else gxVirtualDisplay(&vh,153,26,5,49,52,71,0); break;
00264 
00265   default:break;
00266  }
00267  DEBUG1("<-Toggle()");
00268  return;
00269 }
00270 
00271 void TogBox(int x,int y,int st)
00272  {
00273   DEBUG4("->TogBox(x %d, y %d, st %d)", x, y, st);
00274   char sta[2][2]={{2,4},{4,2}};
00275   
00276   grSetColor(sta[st][0]);
00277   grMoveTo(0+x,y+32);grLineTo(0+x,y+0);grLineTo(34+x,y+0);
00278   grSetColor(sta[st][1]);
00279   grMoveTo(x+0,y+33);grLineTo(23+x,y+33);grLineTo(23+x,y+23);
00280   grLineTo(x+35,y+23);grLineTo(x+35,y+0);
00281   
00282   DEBUG1("<-TogBox()");
00283   return;
00284 }
00285 
00286 void PianoKey(int X)
00287 {
00288  DEBUG2("->PianoKey(X %d)", X);
00289  int t;
00290  if (F1==0) {
00291    if (V[X].A==1) {Toggle(1,1);status[1]=1;}
00292      else {Toggle(1,0);PlaceRX(1);status[1]=0;}}
00293  if (F2==0) {
00294    if (V[X].B==1) {Toggle(2,1);status[2]=1;}
00295      else {Toggle(2,0);PlaceRX(2);status[2]=0;}}
00296  if (F3==0) {
00297    if (V[X].C==1) {Toggle(3,1);status[3]=1;}
00298      else {Toggle(3,0);PlaceRX(3);status[3]=0;}}
00299  if (F4==0) {
00300    if (V[X].D==1) {Toggle(4,0);status[4]=1;}
00301      else {Toggle(4,1);status[4]=0; }}
00302 
00303  if (F5==-1 || (F5==0 && V[X].E==0))
00304   {
00305    Toggle(5,0);
00306    status[0]=0;
00307   }
00308  else
00309   {
00310    Toggle(5,1);
00311    t=(F5==0) ? V[X].E : F5;
00312    assert(0 <= t);
00313    draw_Pie(t);
00314    status[0]=t;
00315   }
00316  
00317  DrawLocks();
00318  DEBUG1("<-PianoKey()");
00319  return;
00320 }
00321 
00322 /** draw a piechart
00323  * 
00324  * The piechart is indicating the number of astronauts on this mission.
00325  * 
00326  * \param s something of an offset...
00327  */
00328 void draw_Pie(int s)
00329 {
00330  int off;
00331  if (s==0) off=1;
00332    else off=s*20;
00333  gxVirtualDisplay(&vh,off,1,7,51,25,69,0);
00334  return;
00335 }
00336 
00337 void PlaceRX(int s)
00338 {
00339  switch(s)
00340   {
00341    case 1: RectFill(44,75,52,81,8);break;
00342    case 2: RectFill(81,75,89,81,8);break;
00343    case 3: RectFill(118,75,126,81,8);break;
00344    case 4: RectFill(155,75,163,81,8);break;
00345    case 5: RectFill(192,75,200,81,8);break;
00346    default:break;
00347   }
00348  return;
00349 }
00350 
00351 void ClearRX(int s)
00352 {
00353  switch(s)
00354  {
00355    case 1: RectFill(44,75,52,81,3);break;
00356    case 2: RectFill(81,75,89,81,3);break;
00357    case 3: RectFill(118,75,126,81,3);break;
00358    case 4: RectFill(155,75,163,81,3);break;
00359    case 5: RectFill(192,75,200,81,3);break;
00360    default:break;
00361   }
00362  return;
00363 }
00364 
00365 int UpSearchRout(int num,char plr)
00366 {
00367  int found=0,orig,c1=0,c2=0,c3=0,c4=0,c5=0,c6=1,c7=1,c8=1;
00368  orig=num;
00369  if (num >= 56+plr) num=0;
00370   else num++;
00371   while (found==0)
00372    {
00373     c1=0;c2=0;c3=0;c4=0;c5=0;c6=1;c7=1;c8=1;
00374     if (F1==V[num].A) c1=1; /* condition one is true */
00375     if (F1==0 && V[num].A==1) c1=1;
00376     if (F1==2 && V[num].A==0) c1=1;
00377     if (F2==V[num].B) c2=1; /* condition two is true */
00378     if (F2==0 && V[num].B==1) c2=1;
00379     if (F2==2 && V[num].B==0) c2=1;
00380     if (F3==V[num].C) c3=1; /* condition three is true */
00381     if (F3==0 && V[num].C==1) c3=1;
00382     if (F3==2 && V[num].C==0) c3=1;
00383     if (F4==V[num].D) c4=1; /* condition four is true */
00384     if (F4==0 && V[num].D==1) c4=1;
00385     if (F4==2 && V[num].D==0) c4=1;
00386     if (num==0) c5=1;
00387       else {
00388         if (F5==-1 && V[num].Z==0 && V[num].E==0) c5=1;
00389         if (F5==0) c5=1;
00390         if (F5>1 && V[num].Z==1) c5=1;
00391         if (F5==V[num].E) c5=1;
00392     };
00393 
00394   if ((num==32 || num==36) && F5==2) c5=0;
00395 
00396     // planet check
00397     if (num==10 && MarFlag==0) c6=0;
00398     if (num==12 && JupFlag==0) c7=0;
00399     if (num==13 && SatFlag==0) c8=0;
00400 
00401     if (c1 && c2 && c3 && c4 && c5 && c6 && c7 && c8)  found=1;
00402     if (num==orig) return(0);
00403 
00404     if (found==0) {
00405               if (num==56+plr) num=0;
00406               else ++num;
00407     }
00408 
00409    }; /* end while */
00410   return(num);
00411 }
00412 
00413 int DownSearchRout(int num,char plr)
00414 {
00415  int found=0,orig,c1=0,c2=0,c3=0,c4=0,c5=0,c6=1,c7=1,c8=1;
00416  orig=num;
00417  if (num<=0) num=56+plr;
00418    else --num;
00419  while (found==0)
00420    {
00421     c1=0;c2=0;c3=0;c4=0;c5=0;c6=1;c7=1;c8=1;
00422     if (F1==V[num].A) c1=1;
00423     if (F1==0 && V[num].A==1) c1=1; /* condition one is true */
00424     if (F1==2 && V[num].A==0) c1=1;
00425     if (F2==V[num].B) c2=1; /* condition two is true */
00426     if (F2==0 && V[num].B==1) c2=1; /* condition one is true */
00427     if (F2==2 && V[num].B==0) c2=1;
00428     if (F3==V[num].C) c3=1; /* condition three is true */
00429     if (F3==0 && V[num].C==1) c3=1; /* condition one is true */
00430     if (F3==2 && V[num].C==0) c3=1;
00431     if (F4==V[num].D) c4=1; /* condition four is true */
00432     if (F4==0 && V[num].D==1) c4=1; /* condition one is true */
00433     if (F4==2 && V[num].D==0) c4=1;
00434     if (num==0) c5=1;
00435       else {
00436         if (F5==-1 && V[num].Z==0 && V[num].E==0) c5=1;  // locked on zero duration
00437         if (F5==0) c5=1;                  // nothing set
00438         if (F5>1 && V[num].Z==1) c5=1;    // set duration with duration mission
00439         if (F5==V[num].E) c5=1;           // the duration is equal to what is preset
00440     };
00441 
00442   if ((num==32 || num==36) && F5==2) c5=0;
00443 
00444      // planet check
00445     if (num==10 && MarFlag==0) c6=0;
00446     if (num==12 && JupFlag==0) c7=0;
00447     if (num==13 && SatFlag==0) c8=0;
00448     if (c1 && c2 && c3 && c4 && c5 && c6 && c7 && c8)  found=1;
00449     if (num==orig) return(0);
00450 
00451     if (found==0) {
00452               if (num==0) num=56+plr;
00453               else --num;
00454     }
00455 
00456    }; /* end while */
00457   return(num);
00458 }
00459 
00460 void
00461 Future(char plr)
00462 {
00463     /** \todo the whole Future()-function is 500 >lines and unreadable */
00464     DEBUG1("->Future(plr)");
00465     int MisNum = 0, DuraType = 0, MaxDur = 6, i, ii;
00466     int setting = -1, prev_setting = -1;
00467     int Ok, NewType;
00468     GXHEADER local, local2;
00469 
00470     GV(&local, 166, 9);
00471     GV(&local2, 177, 197);
00472     GV(&vh,240,90);                  /* global variable */
00473   begfut:
00474     MisNum = FutureCheck(plr, 0);
00475     if (MisNum == 5)
00476     {
00477         DV(&local);
00478         DV(&local2);
00479         DV(&vh);
00480         return;
00481     }
00482 
00483     F1 = F2 = F3 = F4 = FMen = F5 = 0;
00484     // memset(buffer, 0x00, 20000);
00485     for (i = 0; i < 5; i++)
00486         lck[i] = status[i] = 0;
00487     SetParameters();
00488     strcpy(IDT, "i011");
00489     Pad = MisNum;
00490     DuraType = FMen = MisType = 0;
00491     ClrFut(plr, MisNum);
00492     DrawFuture(plr, MisType, MisNum);
00493 begfut_noredraw:
00494   
00495 //  for (i=0;i<5;i++) ClearRX(i+1);
00496     while (1)
00497     {
00498         GetMouse();
00499         if (mousebuttons == 0)
00500             break;
00501     }
00502     while (1)
00503     {
00504         GetMouse();
00505 
00506         prev_setting = setting;
00507         setting = -1;
00508 
00509         if (key == '-' && SEG > 1)
00510             SEG--;
00511 
00512         if (key == '+' && SEG < 500)
00513             SEG++;
00514 
00515         if (key >= 65 && key < Bub_Count + 65)
00516             setting = key - 65;
00517 
00518         for (ii = 0; ii < Bub_Count; ii++)
00519         {
00520             if (x >= StepBub[ii].x_cor && x <= StepBub[ii].x_cor + 7
00521                 && y >= StepBub[ii].y_cor && y <= StepBub[ii].y_cor + 7)
00522                 setting = ii;
00523         }
00524 
00525         if (setting >= 0)
00526         {
00527             if (prev_setting < 0)
00528                 gxGetImage(&local, 18, 186, 183, 194, 0);
00529 
00530             if (prev_setting != setting)
00531             {
00532                 ShBox(18, 186, 183, 194);
00533                 grSetColor(1);
00534                 MisStep(21, 192, Mev[setting].loc);
00535             }
00536         }
00537         else if (setting < 0 && prev_setting >= 0)
00538         {
00539             gxPutImage(&local, gxSET, 18, 186, 0);
00540         }
00541 
00542         if (Mis.Dur <= V[MisType].E && ((x >= 244 && y >= 5 && x <= 313
00543                     && y <= 17 && mousebuttons > 0) || key == K_ENTER))
00544         {
00545             InBox(244, 5, 313, 17);
00546             WaitForMouseUp();
00547             if (key > 0)
00548                 delay(300);
00549             key = 0;
00550             OutBox(244, 5, 313, 17);
00551             gxGetImage(&local2, 74, 3, 250, 199, 0);
00552             NewType = V[MisType].X;
00553             Data->P[plr].Future[MisNum].Duration = DuraType;
00554 
00555             Ok = HardCrewAssign(plr, Pad, MisType, NewType);
00556 
00557             gxPutImage(&local2, gxSET, 74, 3, 0);
00558             // DV(&local2);
00559             if (Ok == 1)
00560             {
00561                 Data->P[plr].Future[MisNum].Duration = DuraType;
00562                 goto begfut;       // return to loop
00563             }
00564             else
00565             {
00566                 ClrFut(plr, MisNum);
00567                 // DuraType = FMen = MisType = 0;
00568                 key = 0;
00569                 goto begfut_noredraw;
00570                 // DrawFuture(plr, MisType, MisNum);
00571             }
00572             key = 0;
00573         };
00574         // continue
00575 
00576         if ((((x >= 5 && y >= 49 && x <= 53 && y <= 72) || (x >= 43
00577                         && y >= 74 && x <= 53 && y <= 82))
00578                 && mousebuttons > 0) || (key == '!' || key == '1'))
00579         {
00580             if ((x >= 43 && y >= 74 && x <= 53 && y <= 82) || key == '!')
00581             {
00582 
00583                 lck[0] = abs(lck[0] - 1);
00584                 if (lck[0] == 1)
00585                     InBox(43, 74, 53, 82);
00586                 else
00587                     OutBox(43, 74, 53, 82);
00588                 if (lck[0] == 1)
00589                     F5 = (status[0] == 0) ? -1 : status[0];
00590                 if (lck[0] == 1)
00591                     PlaceRX(1);
00592                 else
00593                     ClearRX(1);
00594                 if (lck[0] == 0)
00595                 {
00596                     F5 = 0;
00597                     status[0] = 0;
00598                 }
00599 
00600                 while (1)
00601                 {
00602                     GetMouse();
00603                     if (mousebuttons == 0)
00604                         break;
00605                 }
00606             }
00607             else if (lck[0] != 1)
00608             {
00609                 InBox(5, 49, 53, 72);
00610 
00611                 if (DuraType == MaxDur)
00612                     DuraType = 0;
00613                 else
00614                     DuraType++;
00615                 Data->P[plr].Future[MisNum].Duration = DuraType;
00616 
00617                 if (DuraType == 0)
00618                     Toggle(5, 0);
00619                 else if (DuraType == 1)
00620                     Toggle(5, 1);
00621                 if (DuraType != 0)
00622                     draw_Pie(DuraType);
00623 
00624                 status[0] = DuraType;
00625 
00626                 while (1)
00627                 {
00628                     GetMouse();
00629                     if (mousebuttons == 0)
00630                         break;
00631                 }
00632                 grSetColor(34);
00633                 OutBox(5, 49, 53, 72);
00634             };
00635             key = 0;
00636             /* Duration */
00637         };
00638         if ((x >= 5 && y >= 74 && x <= 41 && y <= 82 && mousebuttons > 0)
00639             || (key == K_ESCAPE))
00640         {
00641             InBox(5, 74, 41, 82);
00642             while (1)
00643             {
00644                 GetMouse();
00645                 if (mousebuttons == 0)
00646                     break;
00647             }
00648             MisType = 0;
00649             if (DuraType != 0)
00650                 Toggle(5, 0);
00651             FMen = DuraType = F1 = F2 = F3 = F4 = F5 = 0;
00652             for (i = 1; i < 4; i++)
00653                 if (status[i] != 0)
00654                     Toggle(i, 1);
00655             if (JointFlag == 0)
00656             {
00657                 F4 = 2;
00658                 lck[4] = 1;
00659                 Toggle(4, 1);
00660                 InBox(191, 74, 201, 82);
00661                 PlaceRX(5);
00662                 TogBox(166, 49, 1);
00663             }
00664             else
00665             {
00666                 F4 = 0;
00667                 lck[4] = 0;
00668                 status[4] = 0;
00669                 Toggle(4, 1);
00670                 OutBox(191, 74, 201, 82);
00671                 ClearRX(5);
00672                 TogBox(166, 49, 0);
00673             };
00674             for (i = 0; i < 4; i++)
00675             {
00676                 lck[i] = status[i] = 0;
00677             }
00678             OutBox(5, 49, 53, 72);
00679             OutBox(43, 74, 53, 82);
00680             TogBox(55, 49, 0);
00681             OutBox(80, 74, 90, 82);
00682             TogBox(92, 49, 0);
00683             OutBox(117, 74, 127, 82);
00684             TogBox(129, 49, 0);
00685             OutBox(154, 74, 164, 82);
00686 
00687             ClrFut(plr, MisNum);
00688             Data->P[plr].Future[MisNum].Duration = 0;
00689             Missions(plr, 8, 37, MisType, 1);
00690             GetMinus(plr);
00691             OutBox(5, 74, 41, 82);
00692             key = 0;
00693             /* Reset */
00694         };
00695         if ((x >= 55 && y >= 49 && x <= 90 && y <= 82 && mousebuttons > 0)
00696             || (key == '2' || key == '@'))
00697         {
00698             if ((x >= 80 && y >= 74 && x <= 90 && y <= 82) || (key == '@'))
00699             {
00700 
00701                 if (lck[1] == 0)
00702                     InBox(80, 74, 90, 82);
00703                 else
00704                     OutBox(80, 74, 90, 82);
00705                 lck[1] = abs(lck[1] - 1);
00706                 if (lck[1] == 1)
00707                     PlaceRX(2);
00708                 else
00709                     ClearRX(2);
00710                 if ((status[1] == 0) && (lck[1] == 1))
00711                     F1 = 2;
00712                 else if ((status[1] == 1) && (lck[1] == 1))
00713                     F1 = 1;
00714                 else
00715                     F1 = 0;
00716 
00717                 while (1)
00718                 {
00719                     GetMouse();
00720                     if (mousebuttons == 0)
00721                         break;
00722                 }
00723             }
00724             else if (lck[1] != 1)
00725             {
00726 
00727                 TogBox(55, 49, 1);
00728                 if (status[1] == 0)
00729                     Toggle(1, 1);
00730                 else
00731                     Toggle(1, 0);
00732                 status[1] = abs(status[1] - 1);
00733 
00734                 while (1)
00735                 {
00736                     GetMouse();
00737                     if (mousebuttons == 0)
00738                         break;
00739                 }
00740                 TogBox(55, 49, 0);
00741             };                     /* Docking */
00742             key = 0;
00743         };
00744 
00745         if ((x >= 92 && y >= 49 && x <= 127 && y <= 82 && mousebuttons > 0)
00746             || (key == '3' || key == '#'))
00747         {
00748             if ((x >= 117 && y >= 74 && x <= 127 && y <= 82) || (key == '#'))
00749             {
00750 
00751                 if (lck[2] == 0)
00752                     InBox(117, 74, 127, 82);
00753                 else
00754                     OutBox(117, 74, 127, 82);
00755                 lck[2] = abs(lck[2] - 1);
00756                 if (lck[2] == 1)
00757                     PlaceRX(3);
00758                 else
00759                     ClearRX(3);
00760                 if ((status[2] == 0) && (lck[2] == 1))
00761                     F2 = 2;
00762                 else if ((status[2] == 1) && (lck[2] == 1))
00763                     F2 = 1;
00764                 else
00765                     F2 = 0;
00766 
00767                 while (1)
00768                 {
00769                     GetMouse();
00770                     if (mousebuttons == 0)
00771                         break;
00772                 }
00773             }
00774             else if (lck[2] != 1)
00775             {
00776 
00777                 TogBox(92, 49, 1);
00778                 if (status[2] == 0)
00779                     Toggle(2, 1);
00780                 else
00781                 {
00782                     Toggle(2, 0);
00783                 };
00784                 status[2] = abs(status[2] - 1);
00785 
00786                 while (1)
00787                 {
00788                     GetMouse();
00789                     if (mousebuttons == 0)
00790                         break;
00791                 }
00792                 TogBox(92, 49, 0);
00793             };                     /* EVA */
00794             key = 0;
00795         };
00796 
00797         if ((x >= 129 && y >= 49 && x <= 164 && y <= 82 && mousebuttons > 0)
00798             || (key == '4' || key == '$'))
00799         {
00800             if ((x >= 154 && y >= 74 && x <= 164 && y <= 82) || (key == '$'))
00801             {
00802 
00803                 if (lck[3] == 0)
00804                     InBox(154, 74, 164, 82);
00805                 else
00806                     OutBox(154, 74, 164, 82);
00807                 lck[3] = abs(lck[3] - 1);   // F3=lck[3];
00808                 if (lck[3] == 1)
00809                     PlaceRX(4);
00810                 else
00811                     ClearRX(4);
00812                 if ((status[3] == 0) && (lck[3] == 1))
00813                     F3 = 2;
00814                 else if ((status[3] == 1) && (lck[3] == 1))
00815                     F3 = 1;
00816                 else
00817                     F3 = 0;
00818 
00819                 while (1)
00820                 {
00821                     GetMouse();
00822                     if (mousebuttons == 0)
00823                         break;
00824                 }
00825             }
00826             else if (lck[3] != 1)
00827             {
00828 
00829                 TogBox(129, 49, 1);
00830                 if (status[3] == 0)
00831                     Toggle(3, 1);
00832                 else
00833                 {
00834                     Toggle(3, 0);
00835                 };
00836                 status[3] = abs(status[3] - 1);
00837 
00838                 while (1)
00839                 {
00840                     GetMouse();
00841                     if (mousebuttons == 0)
00842                         break;
00843                 }
00844                 TogBox(129, 49, 0);
00845             };                     /* LEM */
00846             key = 0;
00847         };
00848         if (((x >= 166 && y >= 49 && x <= 201 && y <= 82 && mousebuttons > 0)
00849                 || (key == '5' || key == '%')) && (JointFlag == 1))
00850         {
00851             if ((x > 191 && y >= 74 && x <= 201 && y <= 82) || (key == '%'))
00852             {
00853 
00854                 if (lck[4] == 0)
00855                     InBox(191, 74, 201, 82);
00856                 else
00857                     OutBox(191, 74, 201, 82);
00858                 lck[4] = abs(lck[4] - 1);
00859                 if (lck[4] == 1)
00860                     PlaceRX(5);
00861                 else
00862                     ClearRX(5);
00863 
00864                 if ((status[4] == 0) && (lck[4] == 1))
00865                     F4 = 2;
00866                 else if ((status[4] == 1) && (lck[4] == 1))
00867                     F4 = 1;
00868                 else
00869                     F4 = 0;
00870 
00871                 while (1)
00872                 {
00873                     GetMouse();
00874                     if (mousebuttons == 0)
00875                         break;
00876                 }
00877             }
00878             else if (lck[4] != 1)
00879             {
00880 
00881                 TogBox(166, 49, 1);
00882 
00883                 status[4] = abs(status[4] - 1);
00884                 if (status[4] == 0)
00885                 {
00886                     Toggle(4, 1);
00887                 }
00888                 else
00889                 {
00890                     Toggle(4, 0);
00891                 }
00892 
00893                 while (1)
00894                 {
00895                     GetMouse();
00896                     if (mousebuttons == 0)
00897                         break;
00898                 }
00899                 TogBox(166, 49, 0);
00900             };                     /* Joint Launch */
00901             key = 0;
00902         };
00903         if ((x >= 5 && y >= 84 && x <= 16 && y <= 130 && mousebuttons > 0)
00904             || (key == UP_ARROW))
00905         {
00906             InBox(5, 84, 16, 130);
00907             for (i = 0; i < 50; i++)
00908             {
00909                 key = 0;
00910                 GetMouse();
00911                 delay(10);
00912                 if (mousebuttons == 0)
00913                 {
00914                     MisType = UpSearchRout(MisType, plr);
00915                     Data->P[plr].Future[MisNum].MissionCode = MisType;
00916                     i = 51;
00917                 }
00918             }
00919             while (mousebuttons == 1 || key == UP_ARROW)
00920             {
00921                 MisType = UpSearchRout(MisType, plr);
00922                 Data->P[plr].Future[MisNum].MissionCode = MisType;
00923                 Missions(plr, 8, 37, MisType, 3);
00924                 DuraType = status[0];
00925                 delay(100);
00926                 key = 0;
00927                 GetMouse();
00928             }
00929             Missions(plr, 8, 37, MisType, 3);
00930             DuraType = status[0];
00931             OutBox(5, 84, 16, 130);
00932             key = 0;
00933             /* Mission Type plus */
00934         };
00935         if ((x >= 5 && y >= 132 && x < 16 && y <= 146 && mousebuttons > 0)
00936             || (key == K_SPACE))
00937         {
00938             InBox(5, 132, 16, 146);
00939             WaitForMouseUp();
00940             delay(50);
00941             MisType = Data->P[plr].Future[MisNum].MissionCode;
00942             assert(0 <= MisType);
00943             if (MisType != 0){
00944                 Missions(plr, 8, 37, MisType, 1);
00945             }
00946             else{
00947                 Missions(plr, 8, 37, MisType, 3);
00948             }
00949             OutBox(5, 132, 16, 146);
00950             key = 0;
00951         }
00952         if ((x >= 5 && y >= 148 && x <= 16 && y <= 194 && mousebuttons > 0)
00953             || (key == DN_ARROW))
00954         {
00955             InBox(5, 148, 16, 194);
00956             for (i = 0; i < 50; i++)
00957             {
00958                 key = 0;
00959                 GetMouse();
00960                 delay(10);
00961                 if (mousebuttons == 0)
00962                 {
00963                     MisType = DownSearchRout(MisType, plr);
00964                     Data->P[plr].Future[MisNum].MissionCode = MisType;
00965                     i = 51;
00966                 }
00967                 key = 0;
00968             }
00969             while (mousebuttons == 1 || key == DN_ARROW)
00970             {
00971                 MisType = DownSearchRout(MisType, plr);
00972                 Data->P[plr].Future[MisNum].MissionCode = MisType;
00973                 Missions(plr, 8, 37, MisType, 3);
00974                 DuraType = status[0];
00975                 delay(100);
00976                 key = 0;
00977                 GetMouse();
00978             }
00979             Missions(plr, 8, 37, MisType, 3);
00980             DuraType = status[0];
00981             OutBox(5, 148, 16, 194);
00982             key = 0;
00983             /* Mission Type minus */
00984 
00985         };
00986     }                              // while
00987   DEBUG1("<-Future()");
00988 }
00989 
00990 /** draws the bubble on the screen,
00991  * starts with upper left coor
00992  * 
00993  * \param x x-coord of the upper left corner of the bubble
00994  * \param y y-coord of the upper left corner of the bubble
00995  */
00996 void Bd(int x,int y)
00997 {
00998  int x1,y1,x2,y2;
00999  x1=x-2; y1=y; x2=x-1; y2=y-1;
01000  RectFill(x1,y1,x1+8,y1+4,21);
01001  RectFill(x2,y2,x2+6,y2+6,21);
01002  grSetColor(1);
01003  grMoveTo(x,y+4);
01004  /** \note references Bub_Count to determine the number of the character to draw in the bubble */
01005  DispChr(65+Bub_Count);
01006  StepBub[Bub_Count].x_cor=x1;
01007  StepBub[Bub_Count].y_cor=y1;
01008  ++Bub_Count;
01009  return;
01010 }
01011 
01012 /** Print the duration of a mission
01013  * 
01014  * \param x duration code
01015  * 
01016  * \todo Link this at whatever place the duration is actually defined
01017  */
01018 void DurPri(int x) 
01019 {
01020  grSetColor(5);
01021  switch(x)
01022   {
01023    case -1:PrintAt(112,30,"NO DURATION");break;
01024    case 0:PrintAt(112,30,"NO DURATION");break;
01025    case 1:PrintAt(112,30,"1 - 2 DAYS");break;
01026    case 2:PrintAt(112,30,"3 - 5 DAYS");break;
01027    case 3:PrintAt(112,30,"6 - 7 DAYS");break;
01028    case 4:PrintAt(112,30,"8 - 12 DAYS");break;
01029    case 5:PrintAt(112,30,"13 - 16 DAYS");break;
01030    case 6:PrintAt(112,30,"17 - 20 DAYS");break;
01031    default:break;
01032   };
01033  return;
01034 }
01035 
01036 void MissionName(int val,int xx,int yy,int len)
01037 {
01038   DEBUG5("->MissionName(val %d, xx %d, yy %d, len %d)", val, xx, yy, len);
01039   int i,j=0;
01040 
01041   GetMisType(val);
01042 
01043   grMoveTo(xx,yy);
01044   for (i=0;i<50;i++) {
01045     if (j>len && Mis.Name[i]==' ') {yy+=7;j=0;grMoveTo(xx,yy);}
01046     else DispChr(Mis.Name[i]);
01047     j++;if (Mis.Name[i]=='\0') break;
01048   };
01049   DEBUG1("<-MissionName");
01050   return;
01051 }
01052 
01053 /** Missions() will draw the future missions among other things
01054  * 
01055  * 
01056  * 
01057  * \param plr Player
01058  * \param X ???
01059  * \param Y ???
01060  * \param val ???
01061  * \param bub if set to 0 or 3 the function will not draw stuff
01062  */
01063 void Missions(char plr,int X,int Y,int val,char bub)
01064 {
01065   DEBUG5("->Missions(plr, X %d, Y %d, val %d, bub %c)", X, Y, val, bub);
01066   
01067   if (bub==1 || bub==3) {
01068     PianoKey(val);
01069     Bub_Count=0;   // set the initial bub_count
01070     ClearDisplay();
01071     RectFill(6,31,182,46,3);
01072     RectFill(80,25,175,30,3);grSetColor(5);
01073     PrintAt(55,30,"TYPE: ");DispNum(0,0,val);
01074     grSetColor(5);
01075     if (V[val].E>0) {
01076       if (F5 > V[val].E && Mis.Dur==1) DurPri(F5);
01077          else DurPri(V[val].E);}
01078           else DurPri(F5);
01079   } else grSetColor(1);
01080   MissionName(val,X,Y,24);
01081   if (bub==3) GetMinus(plr);
01082   if (bub==0 || bub==3) {return;}
01083   
01084   /**
01085    * \todo This mapping of val -> drawing of missions steps should be more variable
01086    */
01087   switch(val)
01088   {
01089     case 0: break;
01090     case 1: Draw_IJ(1); Draw_IJV(0); OrbOut(0,0,0);
01091         LefEarth(0,0); OrbOut(0,1,0);break;
01092     case 2: Draw_IJ(0); Draw_IJV(0); OrbIn(0,1,1);break;
01093     case 3: Draw_IJ(0);Draw_IJV(0);OrbIn(0,1,1);break;
01094     case 4: Draw_IJ(1);Draw_IJV(0);OrbMid(0,1,0,0);LefEarth(0,0);
01095         OrbMid(0,0,0,0);LefOrb(0,1,1,1);break;
01096     case 5: Draw_IJ(1);Draw_IJV(0);OrbOut(0,0,0);LefEarth(0,0);OrbOut(0,1,0);
01097         break;
01098     case 6: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);LefEarth(1,0);
01099         OrbMid(0,0,0,0);LefEarth(0,0);OrbMid(0,0,0,0);LefOrb(0,1,1,1);break;
01100     case 7: Draw_IJ(1); Draw_IJV(1); OrbOut(0,0,0); LefEarth(0,0);
01101         Draw_LowS(0,0,0,0,0,1); LefGap(1);break;
01102     case 8: Draw_IJ(1);Draw_IJV(1);OrbOut(0,0,0);LefEarth(0,0);
01103         Draw_LowS(0,0,0,0,0,1);S_Patch(1);break;
01104     case 9: Draw_IJ(1);Fly_By();VenMarMerc(1);break;
01105     case 10: Draw_IJ(1);Fly_By();VenMarMerc(2);break;
01106     case 11: Draw_IJ(1);Fly_By();VenMarMerc(3);break;
01107     case 12: Draw_IJ(1);Fly_By();Draw_PQR();break;
01108     case 13: Draw_IJ(1);Fly_By();Draw_PST();break;
01109     case 14: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);
01110          LefEarth(0,0);OrbMid(1,1,0,0);LefOrb(0,1,1,1);break;
01111     case 15: Draw_IJ(1);Draw_IJV(0);OrbMid(0,0,0,0);LefEarth(0,0);
01112          OrbMid(1,0,1,1);LefOrb(0,1,1,1);break;
01113     case 16: Draw_IJ(1);Draw_IJV(0);OrbMid(1,0,0,0);Draw_GH(1,0); Q_Patch();
01114          OrbMid(0,0,1,1);LefEarth(0,0);OrbMid(0,0,0,0);LefOrb(0,1,1,1);
01115          break;
01116     case 17: Draw_IJ(1);Draw_IJV(1);OrbOut(0,0,0);LefEarth(0,0);
01117          OrbOut(0,1,1);LefOrb(0,1,1,1);break;
01118     case 18: Draw_IJ(1); Draw_IJV(0); OrbMid(0,0,1,0);LefEarth(0,0);
01119          Draw_GH(1,0); Q_Patch();OrbOut(0,1,1); LefEarth(0,0);break;
01120     case 19: Draw_IJ(1); Draw_IJV(0); OrbMid(0,0,1,0); LefEarth(0,0);
01121          Draw_GH(1,0); Q_Patch(); OrbOut(0,1,1); LefEarth(0,0);
01122          OrbIn(1,1,1); OrbMid(0,0,0,0); LefOrb(0,1,1,1);break;
01123     case 20: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0); LefEarth(0,0);
01124          OrbMid(0,1,1,1); LefOrb(0,1,1,1);break;
01125     case 21: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01126          Draw_GH(1,1); Q_Patch(); OrbMid(1,0,0,1); LefOrb(0,1,1,1);break;
01127     case 22: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01128          Draw_GH(1,1); Q_Patch(); OrbMid(1,0,0,1); LefEarth(0,0);
01129          OrbIn(1,1,1);  OrbMid(0,0,0,0); LefOrb(0,1,1,1);break;
01130     case 23: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);
01131          Draw_GH(1,1); Q_Patch(); OrbMid(0,0,0,0);LefEarth(0,0);
01132          OrbMid(1,0,0,1);LefEarth(1,0);
01133          OrbIn(1,1,1);OrbMid(0,0,0,0);LefOrb(0,1,1,1);break;
01134     case 24: Draw_IJ(1);Draw_IJV(1);OrbOut(0,0,0);LefEarth(0,0);
01135          OrbOut(0,1,1);LefOrb(1,1,1,1);break;
01136     case 25: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);LefEarth(0,0);
01137          OrbMid(0,0,1,0);LefOrb(0,1,1,1);break;
01138     case 26: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,1,0);
01139          LefEarth(1,0);OrbMid(0,0,0,0);LefOrb(1,1,1,1);break;
01140     case 27: Draw_IJ(1);Draw_IJV(1);OrbMid(0,1,0,1);
01141          LefEarth(0,0);OrbMid(0,0,0,0);LefOrb(0,1,1,1);break;
01142     case 28: Draw_IJ(1);Draw_IJV(1);OrbOut(0,0,0);
01143          LefEarth(0,0);OrbOut(0,1,1);LefOrb(1,1,1,1);break;
01144     case 29: Draw_IJ(1);Draw_IJV(1);OrbOut(0,1,1);
01145          LefEarth(1,0);OrbOut(0,0,0);LefOrb(1,1,1,1);break;
01146     case 30: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);
01147          LefEarth(0,0);OrbMid(0,0,0,0);
01148          Draw_GH(1,1); Q_Patch(); OrbMid(1,0,0,1);LefEarth(0,0);
01149          OrbIn(1,1,1);OrbMid(0,0,0,0); LefEarth(1,0); OrbMid(0,0,0,0);
01150          LefOrb(0,1,1,1);break;
01151     case 31: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);LefEarth(0,0);
01152          Draw_GH(1,1);Q_Patch();OrbMid(1,0,0,1);LefOrb(0,1,1,1);break;
01153     case 32: Draw_IJ(1);Draw_IJV(1);OrbMid(0,0,0,0);LefEarth(0,0);
01154          Draw_GH(1,1); OrbMid(1,1,0,0); LefEarth(1,0);
01155          OrbIn(0,1,1); OrbMid(0,0,0,0); LefOrb(0,1,1,1);break;
01156     case 33: Draw_IJ(1); Draw_IJV(1); OrbMid(1,0,0,1); LefEarth(1,0);
01157          OrbOut(0,1,0); LefOrb(0,1,1,1);break;
01158     case 34: Draw_IJ(1); Draw_IJV(1); OrbOut(0,0,0); LefEarth(0,0);
01159          Draw_GH(1,1); Q_Patch(); OrbOut(1,1,1); LefOrb(0,1,1,1);break;
01160     case 35: Draw_IJ(1); Draw_IJV(1); OrbOut(0,0,0);
01161          Draw_GH(1,1); Q_Patch(); OrbOut(1,0,0); LefEarth(0,0); OrbOut(0,1,0);
01162          LefEarth(0,0); OrbIn(1,1,1); OrbOut(0,0,1); LefEarth(0,0);
01163          OrbOut(0,0,0); LefOrb(0,1,1,1); break;
01164     case 36: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01165          Draw_GH(1,1); Q_Patch(); OrbMid(1,0,1,0); LefEarth(0,0);
01166          OrbMid(0,0,0,1); OrbIn(1,1,1); OrbMid(0,0,0,0); LefOrb(0,1,1,1);
01167          break;
01168     case 37: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01169          Draw_GH(1,1); Q_Patch(); OrbMid(1,0,0,0); LefEarth(0,0);
01170          OrbIn(1,1,1); OrbMid(0,0,0,0); LefEarth(1,0); OrbMid(0,0,0,0);
01171          LefOrb(0,1,1,1);break;
01172     case 38: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01173          OrbMid(0,1,1,0); LefEarth(0,0);
01174          OrbOut(1,1,1); LefEarth(0,0); OrbMid(0,0,0,0);
01175          LefOrb(0,1,1,1);break;
01176     case 39: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01177          Draw_GH(1,1); Q_Patch(); OrbMid(0,0,1,0); LefEarth(0,0);
01178          OrbOut(1,1,1); LefEarth(0,0); OrbMid(0,0,0,0);
01179          LefOrb(0,1,1,1);break;
01180     case 40: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0); LefEarth(0,0);
01181          OrbMid(0,1,1,0); LefEarth(0,1); OrbOut(1,1,1);
01182          LefEarth(1,0); OrbMid(0,0,0,0); LefOrb(0,1,1,1);break;
01183     case 41: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01184          Draw_GH(1,1); Q_Patch(); OrbMid(0,1,1,0); LefEarth(0,0);
01185          OrbOut(1,1,1); LefEarth(1,0); OrbMid(0,0,0,0);
01186          LefOrb(0,1,1,1);break;
01187     case 42: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,0,1,0,0);
01188          RghtMoon(0,0); DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01189     case 43: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,0,1,0,0); RghtMoon(0,0);
01190          DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01191     case 44: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01192          Draw_GH(1,1); Q_Patch(); OrbMid(0,0,1,0); LefEarth(0,0);
01193          Draw_LowS(1,0,1,0,0,0); RghtMoon(0,0);
01194          DrawLunPas(1,1,1,1); LefOrb(0,1,1,1);break;
01195     case 45: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,1,0,0,1,0); RghtMoon(0,0);
01196          DrawLefMoon(1,0); RghtMoon(0,0);  DrawLunPas(1,1,1,1);
01197          LefOrb(0,1,1,1);break;
01198     case 46: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,1,0,0,1,0); RghtMoon(0,0);
01199          DrawLefMoon(1,0); RghtMoon(0,0); DrawLunPas(1,1,1,1);
01200          LefOrb(0,1,1,1);break;
01201     case 47: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01202          Draw_GH(1,1); Q_Patch(); OrbMid(0,0,1,0); LefEarth(0,0);
01203          Draw_LowS(0,1,0,1,1,0); RghtMoon(0,0);
01204          DrawLefMoon(1,0); RghtMoon(0,0); DrawLunPas(1,1,1,0);
01205          LefOrb(1,1,1,1);break;
01206     case 48: Draw_IJ(1); Draw_IJV(1);
01207          Draw_LowS(0,1,0,1,1,0); RghtMoon(0,0); DrawLefMoon(1,0);
01208          RghtMoon(1,0); DrawLefMoon(0,0);
01209          DrawSTUV(1,1,0,1);
01210          DrawLunPas(1,1,0,1); LefOrb(1,1,1,1);break;
01211     case 49: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,1,0,0,1,0);
01212          RghtMoon(0,0); DrawLefMoon(0,0);
01213          Draw_GH(1,1); Draw_HighS(1,1,0);
01214          RghtMoon(1,1); DrawLefMoon(1,0);
01215          DrawSTUV(1,1,1,0); DrawLefMoon(0,0);
01216          RghtMoon(0,0); DrawLunPas(1,1,0,1); LefOrb(1,1,1,1);break;
01217     case 50: Draw_IJ(1); Draw_IJV(1);
01218          Draw_LowS(0,1,0,1,1,0); RghtMoon(1,1); DrawLefMoon(1,0);
01219          DrawSTUV(1,1,1,0); DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01220     case 51: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,1,0,0,1,0);
01221          RghtMoon(0,0); DrawLefMoon(0,0); Draw_GH(1,1);
01222          Draw_HighS(1,1,0); RghtMoon(1,1); DrawLefMoon(1,1);
01223          DrawSTUV(1,1,1,0); DrawLunPas(1,1,0,1); LefOrb(1,1,1,1);break;
01224     case 52: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01225          Draw_GH(1,1); Q_Patch(); OrbMid(0,0,0,0);
01226          LefEarth(0,0); OrbMid(0,0,1,0);
01227          LefEarth(0,0); Draw_LowS(1,0,0,1,1,0); RghtMoon(0,0);
01228          DrawLefMoon(1,0); DrawSTUV(1,1,0,1);
01229          DrawLunPas(1,1,0,1); LefOrb(1,1,1,1);break;
01230     case 53: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,1,1,1,1);
01231          RghtMoon(0,0); DrawLefMoon(0,0); DrawMoon(1,1,1,0,1,1,1);
01232          RghtMoon(0,0); DrawLefMoon(1,0); RghtMoon(0,1);
01233          DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01234     case 54: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,1,0,0,1,0);DrawMoon(1,1,1,0,1,1,1);
01235          RghtMoon(0,1); DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01236     case 55: Draw_IJ(1); Draw_IJV(1); OrbMid(0,0,0,0);
01237          LefEarth(0,0); Draw_GH(1,1); OrbMid(0,0,1,0);
01238          LefEarth(0,0); Draw_LowS(0,1,0,1,1,0); RghtMoon(0,0);
01239          DrawLefMoon(0,0);DrawMoon(1,1,1,0,1,1,1);
01240          RghtMoon(0,0); DrawLefMoon(1,0);
01241          RghtMoon(0,1); DrawLunPas(1,1,1,0);
01242          LefOrb(1,1,1,1);break;
01243     case 56: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,1,0,1,0);
01244          RghtMoon(0,0); DrawLefMoon(0,0); Draw_GH(1,1);
01245          Draw_HighS(1,1,1);RghtMoon(0,0); DrawLefMoon(0,0);
01246          RghtMoon(1,0); DrawLefMoon(0,0);DrawMoon(0,1,1,0,1,1,1);
01247          RghtMoon(0,0);DrawLefMoon(1,0); RghtMoon(0,1);
01248          DrawLunPas(1,1,0,1); LefOrb(1,1,1,1);break;
01249     case 57: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,1,0,1,0);
01250          RghtMoon(0,0); DrawLefMoon(0,0); Draw_GH(1,1);
01251          Draw_HighS(1,1,0); RghtMoon(0,0); DrawLefMoon(1,0);
01252          DrawMoon(1,1,1,0,1,1,1); RghtMoon(0,0);
01253          DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01254     case 58: Draw_IJ(1); Draw_IJV(1); OrbOut(0,0,0);
01255          LefEarth(0,0); OrbOut(1,1,1); LefOrb(0,1,1,1);break;
01256     case 59: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,1,0,1,1);
01257          RghtMoon(0,0); DrawLefMoon(1,0); DrawZ(); DrawLefMoon(0,0);
01258          RghtMoon(1,0);DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01259     case 60: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,1,0,1,1,1);
01260          RghtMoon(0,0); DrawLefMoon(0,0);DrawMoon(1,1,1,1,1,1,1);
01261          RghtMoon(0,0);DrawLefMoon(1,0); RghtMoon(0,1);
01262          DrawLunPas(1,1,1,0); LefOrb(1,1,1,1);break;
01263     case 61: Draw_IJ(1); Draw_IJV(1); Draw_LowS(0,0,0,1,1,0);
01264          DrawMoon(1,1,1,1,1,1,1); RghtMoon(0,0);DrawLefMoon(0,1);
01265          RghtMoon(0,1);DrawLunPas(0,1,1,0); LefOrb(1,1,1,1);break;
01266     default: break;
01267   }  // end switch
01268   gr_sync ();
01269   MissionCodes(plr,MisType,Pad);
01270   DEBUG1("<-Missions()");
01271 }  // end function missions
01272 
01273 /** Draws stuff about choosing a program and having < 2 groups available
01274  * 
01275  * \deprecated This function appears to be depricated. 
01276  */
01277 char FutBad(void)
01278 {
01279   char i;
01280   
01281   grSetColor(0);
01282   ShBox(84,41,232,128);
01283   InBox(91,47,225,103);
01284   IOBox(91,107,225,123);
01285   grSetColor(1);
01286   PrintAt(150,117,"EXIT");
01287   grSetColor(11);
01288   PrintAt(96,60,"YOU HAVE SELECTED A");
01289   PrintAt(96,70,"PROGRAM WITH LESS THAN");
01290   PrintAt(96,80,"TWO GROUPS AVAILABLE.");
01291   
01292   WaitForMouseUp();
01293   i=0;
01294   while(i==0) {
01295   GetMouse();
01296    if (mousebuttons!=0) {
01297      if (x>=93 && y>=109 && x<=223 && y<=121) {
01298        InBox(93,109,223,123);i=3;
01299        delay(50);
01300      };
01301    };
01302   }; /* End while */
01303   return (i);
01304 }
01305 
01306 /* vim: set noet ts=4 sw=4 tw=77: */

Generated on Fri Sep 28 00:35:27 2007 for raceintospace by  doxygen 1.5.3