Esempio n. 1
0
void draw_overlay_compass(long base_x, long base_y)
{
    unsigned short flg_mem;
    flg_mem = lbDisplay.DrawFlags;
    LbTextSetFont(winfont);
    lbDisplay.DrawFlags |= Lb_SPRITE_TRANSPAR4;
    LbTextSetWindow(0, 0, MyScreenWidth, MyScreenHeight);
    int units_per_px;
    units_per_px = (16*status_panel_width + 70) / 140;
    int tx_units_per_px;
    tx_units_per_px = (22 * units_per_px) / LbTextLineHeight();
    int w,h;
    w = (LbSprFontCharWidth(lbFontPtr,'/')*tx_units_per_px/16) / 2;
    h = (LbSprFontCharHeight(lbFontPtr,'/')*tx_units_per_px/16) / 2 + 2*units_per_px/16;
    struct PlayerInfo *player;
    player = get_my_player();
    struct Camera *cam;
    cam = player->acamera;
    int center_x, center_y;
    int shift_x, shift_y;
    center_x = base_x*units_per_px/16 + PANNEL_MAP_RADIUS*units_per_px/16;
    center_y = base_y*units_per_px/16 + PANNEL_MAP_RADIUS*units_per_px/16;
    shift_x = ((-(PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = ((-(PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, gui_strings[877]);
    }
    shift_x = (( (PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = (( (PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, gui_strings[879]);
    }
    shift_x = (( (PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = ((-(PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, gui_strings[878]);
    }
    shift_x = ((-(PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = (( (PANNEL_MAP_RADIUS*7/8)*units_per_px/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, gui_strings[880]);
    }
    lbDisplay.DrawFlags = flg_mem;
}
Esempio n. 2
0
void draw_overlay_compass(long base_x, long base_y)
{
    unsigned short flg_mem;
    flg_mem = lbDisplay.DrawFlags;
    LbTextSetFont(winfont);
    lbDisplay.DrawFlags |= Lb_SPRITE_TRANSPAR4;
    LbTextSetWindow(0, 0, MyScreenWidth, MyScreenHeight);
    int units_per_px;
    units_per_px = (16*status_panel_width + 140/2) / 140;
    int tx_units_per_px;
    tx_units_per_px = (22 * units_per_px) / LbTextLineHeight();
    int w,h;
    w = (LbSprFontCharWidth(lbFontPtr,'/')*tx_units_per_px/16) / 2;
    h = (LbSprFontCharHeight(lbFontPtr,'/')*tx_units_per_px/16) / 2 + 2*units_per_px/16;
    struct PlayerInfo *player;
    player = get_my_player();
    const struct Camera *cam;
    cam = player->acamera;
    int center_x, center_y;
    int shift_x, shift_y;
    center_x = base_x*units_per_px/16 + MapDiagonalLength/2;
    center_y = base_y*units_per_px/16 + MapDiagonalLength/2;
    shift_x = (-(MapDiagonalLength*7/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = (-(MapDiagonalLength*7/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, get_string(GUIStr_MapN));
    }
    shift_x = ( (MapDiagonalLength*7/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = ( (MapDiagonalLength*7/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, get_string(GUIStr_MapS));
    }
    shift_x = ( (MapDiagonalLength*7/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = (-(MapDiagonalLength*7/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, get_string(GUIStr_MapE));
    }
    shift_x = (-(MapDiagonalLength*7/16) * LbCosL(cam->orient_a)) >> LbFPMath_TrigmBits;
    shift_y = ( (MapDiagonalLength*7/16) * LbSinL(cam->orient_a)) >> LbFPMath_TrigmBits;
    if (LbScreenIsLocked()) {
        LbTextDrawResized(center_x + shift_x - w, center_y + shift_y - h, tx_units_per_px, get_string(GUIStr_MapW));
    }
    lbDisplay.DrawFlags = flg_mem;
}
Esempio n. 3
0
/**
 * Displays easter egg messages on screen.
 */
void draw_eastegg(void)
{
  char *text;
  static long px[2]={0,0},py[2]={0,0};
  static long vx[2]={0,0},vy[2]={0,0};
  long i,k;
  SYNCDBG(5,"Starting");
  LbTextSetWindow(0, 0, MyScreenWidth, MyScreenHeight);
  if (eastegg_skeksis_cntr >= eastegg_skeksis_codes.length)
  {
      unsigned char pos;
      eastegg_skeksis_cntr++;
      LbTextSetFont(winfont);
      text=buf_sprintf("Dene says a big 'Hello' to Goth Buns, Tarts and Barbies");
      lbDisplay.DrawFlags = Lb_TEXT_ONE_COLOR;
      for (i=0; i<30; i+=2)
      {
        pos = game.play_gameturn - i;
        lbDisplay.DrawColour = pos;
        LbTextDraw((LbCosL(16*(long)pos) / 512 + 120) / pixel_size,
          (LbSinL(32*(long)pos) / 512 + 200) / pixel_size, text);
      }
      set_flag_word(&lbDisplay.DrawFlags,Lb_TEXT_ONE_COLOR,false);
      pos=game.play_gameturn;
      LbTextDraw((LbCosL(16*(long)pos) / 512 + 120) / pixel_size,
        (LbSinL(32*(long)pos) / 512 + 200) / pixel_size, text);
      if (eastegg_skeksis_cntr >= 255)
        eastegg_skeksis_cntr = 0;
  }

  if (game.eastegg01_cntr >= eastegg_feckoff_codes.length)
  {
    LbTextSetWindow(0/pixel_size, 0/pixel_size, MyScreenWidth/pixel_size, MyScreenHeight/pixel_size);
    lbDisplay.DrawFlags &= ~Lb_TEXT_ONE_COLOR;
    LbTextSetFont(winfont);
    i = 0;
    text = buf_sprintf("Simon says Hi to everyone he knows...");
    px[i] += vx[i];
    if (px[i] < 0)
    {
      px[i] = 0;
      vx[i] = -vx[i];
    }
    py[i] += vy[i];
    if (py[i] < 0)
    {
      py[i] = 0;
      vy[i] = -vy[i];
    }
    k = pixel_size*LbTextStringWidth(text);
    if (px[i]+k  >= MyScreenWidth)
    {
      vx[i] = -vx[i];
      px[i] = MyScreenWidth-k-1;
    }
    k = pixel_size*LbTextStringHeight(text);
    if (py[i]+k >= MyScreenHeight)
    {
      vy[i] = -vy[i];
      py[i] = MyScreenHeight-k-1;
    }
    if (LbScreenIsLocked())
    {
      LbTextDraw(px[i]/pixel_size, py[i]/pixel_size, text);
    }
    play_non_3d_sample_no_overlap(90);
  }
  if ((game.flags_font & FFlg_AlexCheat) == 0)
    return;

  if (game.eastegg02_cntr >= eastegg_jlw_codes.length)
  {
    LbTextSetWindow(0/pixel_size, 0/pixel_size, MyScreenWidth/pixel_size, MyScreenHeight/pixel_size);
    lbDisplay.DrawFlags &= ~Lb_TEXT_ONE_COLOR;
    LbTextSetFont(winfont);
    i = 1;
    text = buf_sprintf("Alex, hopefully lying on a beach with Jo, says Hi");
    px[i] += vx[i];
    if (px[i] < 0)
    {
      px[i] = 0;
      vx[i] = -vx[i];
    }
    py[i] += vy[i];
    if (py[i] < 0)
    {
      py[i] = 0;
      vy[i] = -vy[i];
    }
    k = pixel_size * LbTextStringWidth(text);
    if (px[i]+k >= MyScreenWidth)
    {
      vx[i] = -vx[i];
      px[i] = MyScreenWidth-k-1;
    }
    k = pixel_size * LbTextStringHeight(text);
    if (py[i]+k >= MyScreenHeight)
    {
      vy[i] = -vy[i];
      py[i] = MyScreenHeight-k-1;
    }
    if (LbScreenIsLocked())
      LbTextDraw(px[i]/pixel_size, py[i]/pixel_size, text);
    play_non_3d_sample_no_overlap(90);
  }
}