コード例 #1
0
ファイル: font.c プロジェクト: MatChung/genesis-plus-gx-ps3
void WriteCentre_HL( int y, char *string)
{
  gx_texture *texture = gxTextureOpenPNG(Overlay_bar_png,0);
  if (texture)
  {
    gxDrawTexture(texture, 0, y-fheight,  640, fheight,240);
    if (texture->data) free(texture->data);
    free(texture);
  }
  WriteCentre(y, string);
}
コード例 #2
0
ファイル: filesel.c プロジェクト: RedLucas/Provenance
static void selector_cb(void)
{
    int i;
    char text[MAXPATHLEN];
    int yoffset = 108;

    /* Initialize directory icon */
    gui_image dir_icon;
    dir_icon.texture = gxTextureOpenPNG(Browser_dir_png,0);
    dir_icon.w = dir_icon.texture->width;
    dir_icon.h = dir_icon.texture->height;
    dir_icon.x = 26;
    dir_icon.y = (26 - dir_icon.h)/2;

    /* Initialize selection bar */
    gui_image bar_over;
    bar_over.texture = gxTextureOpenPNG(Overlay_bar_png,0);
    bar_over.w = bar_over.texture->width;
    bar_over.h = bar_over.texture->height;
    bar_over.x = 16;
    bar_over.y = (26 - bar_over.h)/2;

    /* Draw browser array */
    gxDrawRectangle(15, 108, 358, 26, 127, (GXColor)BG_COLOR_1);
    gxDrawRectangle(15, 134, 358, 26, 127, (GXColor)BG_COLOR_2);
    gxDrawRectangle(15, 160, 358, 26, 127, (GXColor)BG_COLOR_1);
    gxDrawRectangle(15, 186, 358, 26, 127, (GXColor)BG_COLOR_2);
    gxDrawRectangle(15, 212, 358, 26, 127, (GXColor)BG_COLOR_1);
    gxDrawRectangle(15, 238, 358, 26, 127, (GXColor)BG_COLOR_2);
    gxDrawRectangle(15, 264, 358, 26, 127, (GXColor)BG_COLOR_1);
    gxDrawRectangle(15, 290, 358, 26, 127, (GXColor)BG_COLOR_2);
    gxDrawRectangle(15, 316, 358, 26, 127, (GXColor)BG_COLOR_1);
    gxDrawRectangle(15, 342, 358, 26, 127, (GXColor)BG_COLOR_2);

    /* Draw Files list */
    for (i = offset; (i < (offset + 10)) && (i < maxfiles); i++)
    {
        if (i == selection)
        {
            /* selection bar */
            gxDrawTexture(bar_over.texture,bar_over.x,yoffset+bar_over.y,bar_over.w,bar_over.h,255);

            /* scrolling text */
            if ((string_offset/SCROLL_SPEED) >= strlen(filelist[i].filename))
            {
                string_offset = 0;
            }

            if (string_offset)
            {
                sprintf(text,"%s ",filelist[i].filename+string_offset/SCROLL_SPEED);
                strncat(text, filelist[i].filename, string_offset/SCROLL_SPEED);
            }
            else
            {
                strcpy(text, filelist[i].filename);
            }

            /* print text */
            if (filelist[i].flags)
            {
                /* directory icon */
                gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255);
                if (FONT_write(text,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE))
                {
                    /* text scrolling */
                    string_offset ++;
                }
            }
            else
            {
                if (FONT_write(text,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)WHITE))
                {
                    /* text scrolling */
                    string_offset ++;
                }
            }
        }
        else
        {
            if (filelist[i].flags)
            {
                /* directory icon */
                gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255);
                FONT_write(filelist[i].filename,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE);
            }
            else
            {
                FONT_write(filelist[i].filename,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)WHITE);
            }
        }

        yoffset += 26;
    }

    gxTextureClose(&bar_over.texture);
    gxTextureClose(&dir_icon.texture);
}
コード例 #3
0
ファイル: filesel.c プロジェクト: IVBeatz/genplus-gx
static void selector_cb(void)
{
  int i;
  char text[MAXPATHLEN];
  int yoffset = 108;

  /* Draw browser array */
  gxDrawRectangle(15, 108, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 134, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 160, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 186, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 212, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 238, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 264, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 290, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 316, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 342, 358, 26, 127, (GXColor)BG_COLOR_2);

  /* Draw Files list */
  for (i = offset; (i < (offset + 10)) && (i < maxfiles); i++)
  {
    if (i == selection)
    {
      /* selection bar */
      gxDrawTexture(bar_over.texture,bar_over.x,yoffset+bar_over.y,bar_over.w,bar_over.h,255);

      /* scrolling text */
      if ((string_offset/SCROLL_SPEED) >= strlen(filelist[i].filename))
      {
        string_offset = 0;
      }

      if (string_offset)
      {
        sprintf(text,"%s ",filelist[i].filename+string_offset/SCROLL_SPEED);
        strncat(text, filelist[i].filename, string_offset/SCROLL_SPEED);
      }
      else
      {
        strcpy(text, filelist[i].filename);
      }

      /* print text */
      if (filelist[i].flags)
      {
        /* directory icon */
        gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255);
        if (FONT_write(text,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE))
        {
          /* text scrolling */
          string_offset ++;
        }
      }
      else
      {
        if (FONT_write(text,18,26,yoffset+22,bar_over.w-20,(GXColor)WHITE))
        {
          /* text scrolling */
          string_offset ++;
        }
      }
    }
    else
    {
      if (filelist[i].flags)
      {
        /* directory icon */
        gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255);
        FONT_write(filelist[i].filename,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE);
      }
      else
      {
        FONT_write(filelist[i].filename,18,26,yoffset+22,bar_over.w-20,(GXColor)WHITE);
      }
    }

    yoffset += 26;
  }
}  
コード例 #4
0
ファイル: legal.c プロジェクト: XiaoDuan/OpenEmu
void legal ()
{
  int count = 2000;
  int vis = 0;

#ifdef HW_RVL
  gx_texture *button = gxTextureOpenPNG(Key_A_wii_png,0);
#else
  gx_texture *button = gxTextureOpenPNG(Key_A_gcn_png,0);
#endif

  gx_texture *logo_left= gxTextureOpenPNG(Bg_intro_c5_png,0);
  gx_texture *logo_right = gxTextureOpenPNG(Bg_intro_c4_png,0);

  gxClearScreen((GXColor)BLACK);
  show_disclaimer(56);
  gxDrawTexture(logo_left, (640-logo_left->width-logo_right->width -32)/2, 480-logo_left->height-24, logo_left->width, logo_left->height,255);
  gxDrawTexture(logo_right, (640-logo_left->width-logo_right->width -32)/2+logo_left->width+32, 480-logo_right->height-24, logo_right->width, logo_right->height,255);
  gxSetScreen();

  sleep(1);

  while (!(m_input.keys & PAD_BUTTON_A) && (count > 0))
  {
    gxClearScreen((GXColor)BLACK);
    show_disclaimer(56);
    if (count%25 == 0) vis^=1;
    if (vis)
    {
      FONT_writeCenter("Press    button to continue.",24,0,640,366,(GXColor)SKY_BLUE);
      gxDrawTexture(button, 220, 366-24+(24-button->height)/2,  button->width, button->height,255);
    }
    gxDrawTexture(logo_left, (640-logo_left->width-logo_right->width -32)/2, 480-logo_left->height-24, logo_left->width, logo_left->height,255);
    gxDrawTexture(logo_right, (640-logo_left->width-logo_right->width -32)/2+logo_left->width+32, 480-logo_right->height-24, logo_right->width, logo_right->height,255);
    gxSetScreen();
    count--;
  }

  gxTextureClose(&button);
  gxTextureClose(&logo_left);
  gxTextureClose(&logo_right);

  if (count > 0)
  {
    ASND_Init();
    ASND_Pause(0);
    int voice = ASND_GetFirstUnusedVoice();
    ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)button_select_pcm,button_select_pcm_size,200,200,NULL);
    GUI_FadeOut();
    ASND_Pause(1);
    ASND_End();
    return;
  }

  gxClearScreen((GXColor)BLACK);
  gx_texture *texture = gxTextureOpenPNG(Bg_intro_c1_png,0);
  if (texture)
  {
    gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2,  texture->width, texture->height,255);
    if (texture->data) free(texture->data);
    free(texture);
  }
  gxSetScreen();

  sleep (1);

  gxClearScreen((GXColor)WHITE);
  texture = gxTextureOpenPNG(Bg_intro_c2_png,0);
  if (texture)
  {
    gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2,  texture->width, texture->height,255);
    if (texture->data) free(texture->data);
    free(texture);
  }
  gxSetScreen();

  sleep (1);

  gxClearScreen((GXColor)BLACK);
  texture = gxTextureOpenPNG(Bg_intro_c3_png,0);
  if (texture)
  {
    gxDrawTexture(texture, (640-texture->width)/2, (480-texture->height)/2,  texture->width, texture->height,255);
    if (texture->data) free(texture->data);
    free(texture);
  }
  gxSetScreen();

  ASND_Pause(0);
  int voice = ASND_GetFirstUnusedVoice();
  ASND_SetVoice(voice,VOICE_MONO_16BIT,44100,0,(u8 *)intro_pcm,intro_pcm_size,200,200,NULL);
  sleep (2);
  ASND_Pause(1);
}