#include "prt.hpp"
#include "common/ini.hpp"
namespace _Prt_ {
  static void load(uint id, CN(INI) ini, CN(a83::Str) dir,
  CN(a83::Str) section, Bank_anim::Loader type) {
    auto info = new Prt_info();
    bank_anim_mu.lock();
    info->p_anim = bank_anim.add(Game::archive, ini, dir, section, type,
      Sprite::LightMode::none);
    bank_anim_mu.unlock();
    mp_info_mu.lock();
    mp_info[id] = info;
    mp_info_mu.unlock();
    info->check_dist = 999999.0f; // частице незачем хитбоксы по шагам проверять
  }
} // _Prt_ ns
void load_prt(CN(a83::Str) dir_name) {
  #ifdef NO_LOAD_PARTICLE
  a83::log("load_prt: particle loading skiped");
  return;
  #endif
  INI ini(Game::archive, dir_name + "conf.ini");
// загрузка данных в банки
  #define LD(NAME, TYPE) _Prt_::load(PRT_##NAME, ini, dir_name, #NAME, Bank_anim::Loader::TYPE);
  LD(DUMMY, AN)
  LD(FLAME_1, AA)
  LD(FLAME_2, AA)
  LD(FLAME_3, AA)
  LD(SHOOT_1, AA)
  LD(WALL_EXPL_1, AA)
  LD(WALL_EXPL_2, AA)
  LD(WALL_EXPL_3, AA)
  LD(SMOKE_1, AA)
  LD(SMOKE_2, AA)
  LD(SMOKE_3, AA)
  LD(EXPL_1, AA)
  LD(EXPL_2, AA)
  LD(STAR_1, NN)
  LD(SPARKS_1, AN)
  LD(SPHERE, AA)
  LD(BULLET_CRUSH, AA)
  LD(SMALL_EXPL, AA)
  LD(SHARD_CRUSH, AA)
  LD(SPIKE_EXPL, AA)
  LD(MINI_EXPL, AA)
  LD(MICRO_EXPL, AA)
  LD(DARK_SHIELD, AA)
  LD(BOMBER_FLAME, AA)
  LD(SPEED_LINES, AA)
  #undef LD
} // load_prt