Exemple #1
0
void DrawRevText(char plr, int val)
{
    int index = 0, length, line = 0;
    FILE *fin;
    memset(buffer, 0x00, 10000);
    fin = sOpen("P_REV.DAT", "rb", 0);  // Read Mission Structure
    fseek(fin, 204 * 18 * plr + 204 * val, SEEK_SET);
    fread(buffer, 204, 1, fin);
    fclose(fin);

    grSetColor(1);

    grMoveTo(20, 140);

    do {
        if (buffer[index] == '*') {
            length = 0;
            index++;
            line++;
            grMoveTo(20, 140 + 12 * line);
        }

        DispChr(buffer[index]);
        length++;
        index++;
    } while (buffer[index] != 0);
}
/** draws the bubble on the screen,
 * starts with upper left coor
 * 
 * \param x x-coord of the upper left corner of the bubble
 * \param y y-coord of the upper left corner of the bubble
 */
void Bd(int x,int y)
{
 int x1,y1,x2,y2;
 x1=x-2; y1=y; x2=x-1; y2=y-1;
 RectFill(x1,y1,x1+8,y1+4,21);
 RectFill(x2,y2,x2+6,y2+6,21);
 grSetColor(1);
 grMoveTo(x,y+4);
 /** \note references Bub_Count to determine the number of the character to draw in the bubble */
 DispChr(65+Bub_Count);
 StepBub[Bub_Count].x_cor=x1;
 StepBub[Bub_Count].y_cor=y1;
 ++Bub_Count;
 return;
}
void MissionName(int val,int xx,int yy,int len)
{
  TRACE5("->MissionName(val %d, xx %d, yy %d, len %d)", val, xx, yy, len);
  int i,j=0;

  GetMisType(val);

  grMoveTo(xx,yy);
  for (i=0;i<50;i++) {
    if (j>len && Mis.Name[i]==' ') {yy+=7;j=0;grMoveTo(xx,yy);}
    else DispChr(Mis.Name[i]);
    j++;if (Mis.Name[i]=='\0') break;
  };
  TRACE1("<-MissionName");
  return;
}