#pragma once

#include "ta_parameter.hpp"
#include "texture.hpp"

namespace icons {
  enum icon_type {
    ff,
    fff,
    next,
    prev,
    rr,
    rrr,
    play,
    pause,
    repeat,
  };

  struct icon {
    const float x;
    const float y;
    const float width;
    const float height;
  };

  extern const icon icons[];

  static inline void global_polygon_icon(ta_parameter_writer& writer)
  {
    uint32_t texture_size = tsp_instruction_word::texture_u_size::from_int(64)
                          | tsp_instruction_word::texture_v_size::from_int(32)
                          | tsp_instruction_word::clamp_uv::uv
                          | tsp_instruction_word::dst_alpha_instr::inverse_src_alpha;

    global_polygon_textured(writer,
                            para_control::list_type::punch_through,
                            texture::offset::icons,
                            texture_size,
                            texture_control_word::pixel_format::_4bpp_palette);
  }

  void draw(ta_parameter_writer& writer, icon_type type,
            float x, float y, float z,
            uint32_t base_color);
}
