#include "blt.hpp"
#include "common/ini.hpp"
namespace _Blt_ {
  static void load(uint id, CN(INI) ini, CN(a83::Str) dir,
  CN(a83::Str) section, Bank_anim::Loader type,
  Sprite::LightMode light_mode = Sprite::LightMode::none) {
    auto info = new Blt_info();
    bank_anim_mu.lock();
    info->p_anim = bank_anim.add(Game::archive, ini, dir, section, type,
      light_mode);
    bank_anim_mu.unlock();
    mp_info_mu.lock();
    mp_info[id] = info;
    mp_info_mu.unlock();
    info->dmg = ini.getInt(section, "dmg", {});
    info->cld_dist = ini.getFloat(section, "cld_dist", {});
    info->check_dist = ini.getFloat(section, "check_dist", {});
  }
} // _Blt_ ns
void load_blt(CN(a83::Str) dir_name) {
  INI ini(Game::archive, dir_name + "conf.ini");
// загрузка в банки
  #define LD(NAME, TYPE, LMODE) _Blt_::load(BLT_##NAME, ini, dir_name, #NAME, Bank_anim::Loader::TYPE, Sprite::LightMode::LMODE);
  LD(MISSILE_1, NR4, none)
  LD(MISSILE_2, NR3, none)
  LD(MISSILE_3, NR3, way8)
  LD(ELIPS, AA, none)
  LD(FAST_HEAVY, AA, none)
  LD(CIRCLE_17, inv, none)
  LD(CIRCLE_37, inv, none)
  LD(CIRCLE_50, inv, none)
  LD(VULKAN, AA, none)
  LD(FRAG_BLACK_S, NA, way4)
  LD(FRAG_BLACK_M, NA, way4)
  LD(FRAG_BLACK_B, NA, way4)
  LD(SPIKE_IN, AA, none)
  LD(SPIKE_OUT, AA, none)
  LD(DUMMY, NA, none)
  LD(FLAME, AA, none)
  LD(AIRBOMB1, AA, none)
  LD(AIRBOMB2, AA, none)
  LD(FRAG, AA, way4)
  LD(CUBE, NN, none)
  #undef LD
} // load_blt