TextureDecoder_Util.h 420 B

12345678910111213141516171819202122232425
  1. // Copyright 2016 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "Common/CommonTypes.h"
  5. struct DXTBlock
  6. {
  7. u16 color1;
  8. u16 color2;
  9. u8 lines[4];
  10. };
  11. constexpr u32 MakeRGBA(int r, int g, int b, int a)
  12. {
  13. return (a << 24) | (b << 16) | (g << 8) | r;
  14. }
  15. constexpr int DXTBlend(int v1, int v2)
  16. {
  17. // 3/8 blend, which is close to 1/3
  18. return ((v1 * 3 + v2 * 5) >> 3);
  19. }