Ejemplo n.º 1
0
  void exe_loadpaths(FILE *exe)
  {
    unsigned pathid, pointcount;
    bool smooth, closed;
    int x, y, speed, nullhere, precision;

    if (!fread(&nullhere,4,1,exe)) return;
    if (nullhere != *(int*)"PTH ")
      return;

    // Determine how many paths we have
    int pathcount;
    if (!fread(&pathcount,4,1,exe)) return;

    // Fetch the highest ID we will be using
    int path_highid, buf;
    if (!fread(&path_highid,4,1,exe)) return;
    paths_init();

    for (int i = 0; i < pathcount; i++)
    {
      if (!fread(&pathid, 4,1,exe)) return;
      if (!fread(&buf, 4,1,exe)) return;
      smooth = buf; //to fix int to bool issues
      if (!fread(&buf, 4,1,exe)) return;
      closed = buf;
      if (!fread(&precision, 4,1,exe)) return;

      if (!fread(&pointcount,4,1,exe)) return;

      new path(pathid, smooth, closed, precision, pointcount);
      for (unsigned ii=0;ii<pointcount;ii++)
      {
        if (!fread(&x, 4,1,exe)) return;
        if (!fread(&y, 4,1,exe)) return;
        if (!fread(&speed, 4,1,exe)) return;
        path_add_point(pathid, x, y, speed/100);
      }
      path_recalculate(pathid);
    }
  }
Ejemplo n.º 2
0
static void init(void)
{
    system_init();
    kernel_init();
#ifdef APPLICATION
    paths_init();
#endif
    buffer_init();
    enable_irq();
    lcd_init();
#ifdef HAVE_REMOTE_LCD
    lcd_remote_init();
#endif
    font_init();
    show_logo();
    button_init();
    backlight_init();
#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO))
    sim_tasks_init();
#endif
#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
    notification_init();
#endif
    lang_init(core_language_builtin, language_strings, 
              LANG_LAST_INDEX_IN_ARRAY);
#ifdef DEBUG
    debug_init();
#endif
    /* Keep the order of this 3 (viewportmanager handles statusbars)
     * Must be done before any code uses the multi-screen API */
    gui_syncstatusbar_init(&statusbars);
    gui_sync_skin_init();
    sb_skin_init();
    viewportmanager_init();

    storage_init();
    settings_reset();
    settings_load(SETTINGS_ALL);
    settings_apply(true);
    init_dircache(true);
    init_dircache(false);
#ifdef HAVE_TAGCACHE
    init_tagcache();
#endif
    sleep(HZ/2);
    tree_mem_init();
    filetype_init();
    playlist_init();
    theme_init_buffer();

#if CONFIG_CODEC != SWCODEC
    mp3_init( global_settings.volume,
              global_settings.bass,
              global_settings.treble,
              global_settings.balance,
              global_settings.loudness,
              global_settings.avc,
              global_settings.channel_config,
              global_settings.stereo_width,
              global_settings.mdb_strength,
              global_settings.mdb_harmonics,
              global_settings.mdb_center,
              global_settings.mdb_shape,
              global_settings.mdb_enable,
              global_settings.superbass);

    /* audio_init must to know the size of voice buffer so init voice first */
    talk_init();
#endif /* CONFIG_CODEC != SWCODEC */

    scrobbler_init();
#if CONFIG_CODEC == SWCODEC && defined (HAVE_PITCHSCREEN)
    tdspeed_init();
#endif /* CONFIG_CODEC == SWCODEC */

    audio_init();
    button_clear_queue(); /* Empty the keyboard buffer */
    
    settings_apply_skins();
}