fix-rgba8-max-channels.patch 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
  2. index 5656556db9..5c7ebed788 100644
  3. --- a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
  4. +++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8.cpp
  5. @@ -508,7 +508,7 @@ namespace Etc
  6. int iMaxRed1 = iColor1Red + (int)a_uiRadius;
  7. if (iMaxRed1 > 15)
  8. {
  9. - iMinRed1 = 15;
  10. + iMaxRed1 = 15;
  11. }
  12. int iMinGreen1 = iColor1Green - (int)a_uiRadius;
  13. @@ -519,7 +519,7 @@ namespace Etc
  14. int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
  15. if (iMaxGreen1 > 15)
  16. {
  17. - iMinGreen1 = 15;
  18. + iMaxGreen1 = 15;
  19. }
  20. int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
  21. @@ -530,7 +530,7 @@ namespace Etc
  22. int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
  23. if (iMaxBlue1 > 15)
  24. {
  25. - iMinBlue1 = 15;
  26. + iMaxBlue1 = 15;
  27. }
  28. int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
  29. @@ -545,7 +545,7 @@ namespace Etc
  30. int iMaxRed2 = iColor2Red + (int)a_uiRadius;
  31. if (iMaxRed2 > 15)
  32. {
  33. - iMinRed2 = 15;
  34. + iMaxRed2 = 15;
  35. }
  36. int iMinGreen2 = iColor2Green - (int)a_uiRadius;
  37. @@ -556,7 +556,7 @@ namespace Etc
  38. int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
  39. if (iMaxGreen2 > 15)
  40. {
  41. - iMinGreen2 = 15;
  42. + iMaxGreen2 = 15;
  43. }
  44. int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
  45. @@ -567,7 +567,7 @@ namespace Etc
  46. int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
  47. if (iMaxBlue2 > 15)
  48. {
  49. - iMinBlue2 = 15;
  50. + iMaxBlue2 = 15;
  51. }
  52. for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
  53. @@ -761,7 +761,7 @@ namespace Etc
  54. int iMaxRed1 = iColor1Red + (int)a_uiRadius;
  55. if (iMaxRed1 > 15)
  56. {
  57. - iMinRed1 = 15;
  58. + iMaxRed1 = 15;
  59. }
  60. int iMinGreen1 = iColor1Green - (int)a_uiRadius;
  61. @@ -772,7 +772,7 @@ namespace Etc
  62. int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
  63. if (iMaxGreen1 > 15)
  64. {
  65. - iMinGreen1 = 15;
  66. + iMaxGreen1 = 15;
  67. }
  68. int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
  69. @@ -783,7 +783,7 @@ namespace Etc
  70. int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
  71. if (iMaxBlue1 > 15)
  72. {
  73. - iMinBlue1 = 15;
  74. + iMaxBlue1 = 15;
  75. }
  76. int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
  77. @@ -798,7 +798,7 @@ namespace Etc
  78. int iMaxRed2 = iColor2Red + (int)a_uiRadius;
  79. if (iMaxRed2 > 15)
  80. {
  81. - iMinRed2 = 15;
  82. + iMaxRed2 = 15;
  83. }
  84. int iMinGreen2 = iColor2Green - (int)a_uiRadius;
  85. @@ -809,7 +809,7 @@ namespace Etc
  86. int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
  87. if (iMaxGreen2 > 15)
  88. {
  89. - iMinGreen2 = 15;
  90. + iMaxGreen2 = 15;
  91. }
  92. int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
  93. @@ -820,7 +820,7 @@ namespace Etc
  94. int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
  95. if (iMaxBlue2 > 15)
  96. {
  97. - iMinBlue2 = 15;
  98. + iMaxBlue2 = 15;
  99. }
  100. for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
  101. diff --git a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
  102. index ba2b42fb05..b94b64e68c 100644
  103. --- a/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
  104. +++ b/thirdparty/etc2comp/EtcBlock4x4Encoding_RGB8A1.cpp
  105. @@ -847,7 +847,7 @@ namespace Etc
  106. int iMaxRed1 = iColor1Red + (int)a_uiRadius;
  107. if (iMaxRed1 > 15)
  108. {
  109. - iMinRed1 = 15;
  110. + iMaxRed1 = 15;
  111. }
  112. int iMinGreen1 = iColor1Green - (int)a_uiRadius;
  113. @@ -858,7 +858,7 @@ namespace Etc
  114. int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
  115. if (iMaxGreen1 > 15)
  116. {
  117. - iMinGreen1 = 15;
  118. + iMaxGreen1 = 15;
  119. }
  120. int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
  121. @@ -869,7 +869,7 @@ namespace Etc
  122. int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
  123. if (iMaxBlue1 > 15)
  124. {
  125. - iMinBlue1 = 15;
  126. + iMaxBlue1 = 15;
  127. }
  128. int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
  129. @@ -884,7 +884,7 @@ namespace Etc
  130. int iMaxRed2 = iColor2Red + (int)a_uiRadius;
  131. if (iMaxRed2 > 15)
  132. {
  133. - iMinRed2 = 15;
  134. + iMaxRed2 = 15;
  135. }
  136. int iMinGreen2 = iColor2Green - (int)a_uiRadius;
  137. @@ -895,7 +895,7 @@ namespace Etc
  138. int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
  139. if (iMaxGreen2 > 15)
  140. {
  141. - iMinGreen2 = 15;
  142. + iMaxGreen2 = 15;
  143. }
  144. int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
  145. @@ -906,7 +906,7 @@ namespace Etc
  146. int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
  147. if (iMaxBlue2 > 15)
  148. {
  149. - iMinBlue2 = 15;
  150. + iMaxBlue2 = 15;
  151. }
  152. for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)
  153. @@ -1108,7 +1108,7 @@ namespace Etc
  154. int iMaxRed1 = iColor1Red + (int)a_uiRadius;
  155. if (iMaxRed1 > 15)
  156. {
  157. - iMinRed1 = 15;
  158. + iMaxRed1 = 15;
  159. }
  160. int iMinGreen1 = iColor1Green - (int)a_uiRadius;
  161. @@ -1119,7 +1119,7 @@ namespace Etc
  162. int iMaxGreen1 = iColor1Green + (int)a_uiRadius;
  163. if (iMaxGreen1 > 15)
  164. {
  165. - iMinGreen1 = 15;
  166. + iMaxGreen1 = 15;
  167. }
  168. int iMinBlue1 = iColor1Blue - (int)a_uiRadius;
  169. @@ -1130,7 +1130,7 @@ namespace Etc
  170. int iMaxBlue1 = iColor1Blue + (int)a_uiRadius;
  171. if (iMaxBlue1 > 15)
  172. {
  173. - iMinBlue1 = 15;
  174. + iMaxBlue1 = 15;
  175. }
  176. int iColor2Red = m_frgbaOriginalColor2_TAndH.IntRed(15.0f);
  177. @@ -1145,7 +1145,7 @@ namespace Etc
  178. int iMaxRed2 = iColor2Red + (int)a_uiRadius;
  179. if (iMaxRed2 > 15)
  180. {
  181. - iMinRed2 = 15;
  182. + iMaxRed2 = 15;
  183. }
  184. int iMinGreen2 = iColor2Green - (int)a_uiRadius;
  185. @@ -1156,7 +1156,7 @@ namespace Etc
  186. int iMaxGreen2 = iColor2Green + (int)a_uiRadius;
  187. if (iMaxGreen2 > 15)
  188. {
  189. - iMinGreen2 = 15;
  190. + iMaxGreen2 = 15;
  191. }
  192. int iMinBlue2 = iColor2Blue - (int)a_uiRadius;
  193. @@ -1167,7 +1167,7 @@ namespace Etc
  194. int iMaxBlue2 = iColor2Blue + (int)a_uiRadius;
  195. if (iMaxBlue2 > 15)
  196. {
  197. - iMinBlue2 = 15;
  198. + iMaxBlue2 = 15;
  199. }
  200. for (unsigned int uiDistance = 0; uiDistance < TH_DISTANCES; uiDistance++)