OpenTTD Source  13.2.1
32bpp_sse_func.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef BLITTER_32BPP_SSE_FUNC_HPP
11 #define BLITTER_32BPP_SSE_FUNC_HPP
12 
13 #ifdef WITH_SSE
14 
15 GNU_TARGET(SSE_TARGET)
16 static inline void InsertFirstUint32(const uint32 value, __m128i &into)
17 {
18 #if (SSE_VERSION >= 4)
19  into = _mm_insert_epi32(into, value, 0);
20 #else
21  into = _mm_insert_epi16(into, value, 0);
22  into = _mm_insert_epi16(into, value >> 16, 1);
23 #endif
24 }
25 
26 GNU_TARGET(SSE_TARGET)
27 static inline void InsertSecondUint32(const uint32 value, __m128i &into)
28 {
29 #if (SSE_VERSION >= 4)
30  into = _mm_insert_epi32(into, value, 1);
31 #else
32  into = _mm_insert_epi16(into, value, 2);
33  into = _mm_insert_epi16(into, value >> 16, 3);
34 #endif
35 }
36 
37 GNU_TARGET(SSE_TARGET)
38 static inline void LoadUint64(const uint64 value, __m128i &into)
39 {
40 #ifdef POINTER_IS_64BIT
41  into = _mm_cvtsi64_si128(value);
42 #else
43  #if (SSE_VERSION >= 4)
44  into = _mm_cvtsi32_si128(value);
45  InsertSecondUint32(value >> 32, into);
46  #else
47  (*(um128i*) &into).m128i_u64[0] = value;
48  #endif
49 #endif
50 }
51 
52 GNU_TARGET(SSE_TARGET)
53 static inline __m128i PackUnsaturated(__m128i from, const __m128i &mask)
54 {
55 #if (SSE_VERSION == 2)
56  from = _mm_and_si128(from, mask); // PAND, wipe high bytes to keep low bytes when packing
57  return _mm_packus_epi16(from, from); // PACKUSWB, pack 2 colours (with saturation)
58 #else
59  return _mm_shuffle_epi8(from, mask);
60 #endif
61 }
62 
63 GNU_TARGET(SSE_TARGET)
64 static inline __m128i DistributeAlpha(const __m128i from, const __m128i &mask)
65 {
66 #if (SSE_VERSION == 2)
67  __m128i alphaAB = _mm_shufflelo_epi16(from, 0x3F); // PSHUFLW, put alpha1 in front of each rgb1
68  alphaAB = _mm_shufflehi_epi16(alphaAB, 0x3F); // PSHUFHW, put alpha2 in front of each rgb2
69  return _mm_andnot_si128(mask, alphaAB); // PANDN, set alpha fields to 0
70 #else
71  return _mm_shuffle_epi8(from, mask);
72 #endif
73 }
74 
75 GNU_TARGET(SSE_TARGET)
76 static inline __m128i AlphaBlendTwoPixels(__m128i src, __m128i dst, const __m128i &distribution_mask, const __m128i &pack_mask, const __m128i &alpha_mask)
77 {
78  __m128i srcAB = _mm_unpacklo_epi8(src, _mm_setzero_si128()); // PUNPCKLBW, expand each uint8 into uint16
79  __m128i dstAB = _mm_unpacklo_epi8(dst, _mm_setzero_si128());
80 
81  __m128i alphaMaskAB = _mm_cmpgt_epi16(srcAB, _mm_setzero_si128()); // PCMPGTW (alpha > 0) ? 0xFFFF : 0
82  __m128i alphaAB = _mm_sub_epi16(srcAB, alphaMaskAB); // if (alpha > 0) a++;
83  alphaAB = DistributeAlpha(alphaAB, distribution_mask);
84 
85  srcAB = _mm_sub_epi16(srcAB, dstAB); // PSUBW, (r - Cr)
86  srcAB = _mm_mullo_epi16(srcAB, alphaAB); // PMULLW, a*(r - Cr)
87  srcAB = _mm_srli_epi16(srcAB, 8); // PSRLW, a*(r - Cr)/256
88  srcAB = _mm_add_epi16(srcAB, dstAB); // PADDW, a*(r - Cr)/256 + Cr
89 
90  alphaMaskAB = _mm_and_si128(alphaMaskAB, alpha_mask); // PAND, set non alpha fields to 0
91  srcAB = _mm_or_si128(srcAB, alphaMaskAB); // POR, set alpha fields to 0xFFFF is src alpha was > 0
92 
93  return PackUnsaturated(srcAB, pack_mask);
94 }
95 
96 /* Darken 2 pixels.
97  * rgb = rgb * ((256/4) * 4 - (alpha/4)) / ((256/4) * 4)
98  */
99 GNU_TARGET(SSE_TARGET)
100 static inline __m128i DarkenTwoPixels(__m128i src, __m128i dst, const __m128i &distribution_mask, const __m128i &tr_nom_base)
101 {
102  __m128i srcAB = _mm_unpacklo_epi8(src, _mm_setzero_si128());
103  __m128i dstAB = _mm_unpacklo_epi8(dst, _mm_setzero_si128());
104  __m128i alphaAB = DistributeAlpha(srcAB, distribution_mask);
105  alphaAB = _mm_srli_epi16(alphaAB, 2); // Reduce to 64 levels of shades so the max value fits in 16 bits.
106  __m128i nom = _mm_sub_epi16(tr_nom_base, alphaAB);
107  dstAB = _mm_mullo_epi16(dstAB, nom);
108  dstAB = _mm_srli_epi16(dstAB, 8);
109  return _mm_packus_epi16(dstAB, dstAB);
110 }
111 
112 IGNORE_UNINITIALIZED_WARNING_START
113 GNU_TARGET(SSE_TARGET)
114 static Colour ReallyAdjustBrightness(Colour colour, uint8 brightness)
115 {
116  uint64 c16 = colour.b | (uint64) colour.g << 16 | (uint64) colour.r << 32;
117  c16 *= brightness;
118  uint64 c16_ob = c16; // Helps out of order execution.
119  c16 /= Blitter_32bppBase::DEFAULT_BRIGHTNESS;
120  c16 &= 0x01FF01FF01FFULL;
121 
122  /* Sum overbright (maximum for each rgb is 508, 9 bits, -255 is changed in -256 so we just have to take the 8 lower bits into account). */
123  c16_ob = (((c16_ob >> (8 + 7)) & 0x0100010001ULL) * 0xFF) & c16;
124  const uint ob = ((uint16) c16_ob + (uint16) (c16_ob >> 16) + (uint16) (c16_ob >> 32)) / 2;
125 
126  const uint32 alpha32 = colour.data & 0xFF000000;
127  __m128i ret;
128  LoadUint64(c16, ret);
129  if (ob != 0) {
130  __m128i ob128 = _mm_cvtsi32_si128(ob);
131  ob128 = _mm_shufflelo_epi16(ob128, 0xC0);
132  __m128i white = OVERBRIGHT_VALUE_MASK;
133  __m128i c128 = ret;
134  ret = _mm_subs_epu16(white, c128); // PSUBUSW, (255 - rgb)
135  ret = _mm_mullo_epi16(ret, ob128); // PMULLW, ob*(255 - rgb)
136  ret = _mm_srli_epi16(ret, 8); // PSRLW, ob*(255 - rgb)/256
137  ret = _mm_add_epi16(ret, c128); // PADDW, ob*(255 - rgb)/256 + rgb
138  }
139 
140  ret = _mm_packus_epi16(ret, ret); // PACKUSWB, saturate and pack.
141  return alpha32 | _mm_cvtsi128_si32(ret);
142 }
143 IGNORE_UNINITIALIZED_WARNING_STOP
144 
148 static inline Colour AdjustBrightneSSE(Colour colour, uint8 brightness)
149 {
150  /* Shortcut for normal brightness. */
151  if (brightness == Blitter_32bppBase::DEFAULT_BRIGHTNESS) return colour;
152 
153  return ReallyAdjustBrightness(colour, brightness);
154 }
155 
156 GNU_TARGET(SSE_TARGET)
157 static inline __m128i AdjustBrightnessOfTwoPixels(__m128i from, uint32 brightness)
158 {
159 #if (SSE_VERSION < 3)
160  NOT_REACHED();
161 #else
162  /* The following dataflow differs from the one of AdjustBrightness() only for alpha.
163  * In order to keep alpha in colAB, insert a 1 in a unused brightness byte (a*1->a).
164  * OK, not a 1 but DEFAULT_BRIGHTNESS to compensate the div.
165  */
166  brightness &= 0xFF00FF00;
167  brightness += Blitter_32bppBase::DEFAULT_BRIGHTNESS;
168 
169  __m128i colAB = _mm_unpacklo_epi8(from, _mm_setzero_si128());
170  __m128i briAB = _mm_cvtsi32_si128(brightness);
171  briAB = _mm_shuffle_epi8(briAB, BRIGHTNESS_LOW_CONTROL_MASK); // DEFAULT_BRIGHTNESS in 0, 0x00 in 2.
172  colAB = _mm_mullo_epi16(colAB, briAB);
173  __m128i colAB_ob = _mm_srli_epi16(colAB, 8 + 7);
174  colAB = _mm_srli_epi16(colAB, 7);
175 
176  /* Sum overbright.
177  * Maximum for each rgb is 508 => 9 bits. The highest bit tells if there is overbright.
178  * -255 is changed in -256 so we just have to take the 8 lower bits into account.
179  */
180  colAB = _mm_and_si128(colAB, BRIGHTNESS_DIV_CLEANER);
181  colAB_ob = _mm_and_si128(colAB_ob, OVERBRIGHT_PRESENCE_MASK);
182  colAB_ob = _mm_mullo_epi16(colAB_ob, OVERBRIGHT_VALUE_MASK);
183  colAB_ob = _mm_and_si128(colAB_ob, colAB);
184  __m128i obAB = _mm_hadd_epi16(_mm_hadd_epi16(colAB_ob, _mm_setzero_si128()), _mm_setzero_si128());
185 
186  obAB = _mm_srli_epi16(obAB, 1); // Reduce overbright strength.
187  obAB = _mm_shuffle_epi8(obAB, OVERBRIGHT_CONTROL_MASK);
188  __m128i retAB = OVERBRIGHT_VALUE_MASK; // ob_mask is equal to white.
189  retAB = _mm_subs_epu16(retAB, colAB); // (255 - rgb)
190  retAB = _mm_mullo_epi16(retAB, obAB); // ob*(255 - rgb)
191  retAB = _mm_srli_epi16(retAB, 8); // ob*(255 - rgb)/256
192  retAB = _mm_add_epi16(retAB, colAB); // ob*(255 - rgb)/256 + rgb
193 
194  return _mm_packus_epi16(retAB, retAB);
195 #endif
196 }
197 
198 #if FULL_ANIMATION == 0
199 
206 IGNORE_UNINITIALIZED_WARNING_START
207 template <BlitterMode mode, Blitter_32bppSSE2::ReadMode read_mode, Blitter_32bppSSE2::BlockType bt_last, bool translucent>
208 GNU_TARGET(SSE_TARGET)
209 #if (SSE_VERSION == 2)
210 inline void Blitter_32bppSSE2::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
211 #elif (SSE_VERSION == 3)
212 inline void Blitter_32bppSSSE3::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
213 #elif (SSE_VERSION == 4)
214 inline void Blitter_32bppSSE4::Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom)
215 #endif
216 {
217  const byte * const remap = bp->remap;
218  Colour *dst_line = (Colour *) bp->dst + bp->top * bp->pitch + bp->left;
219  int effective_width = bp->width;
220 
221  /* Find where to start reading in the source sprite. */
222  const SpriteData * const sd = (const SpriteData *) bp->sprite;
223  const SpriteInfo * const si = &sd->infos[zoom];
224  const MapValue *src_mv_line = (const MapValue *) &sd->data[si->mv_offset] + bp->skip_top * si->sprite_width;
225  const Colour *src_rgba_line = (const Colour *) ((const byte *) &sd->data[si->sprite_offset] + bp->skip_top * si->sprite_line_size);
226 
227  if (read_mode != RM_WITH_MARGIN) {
228  src_rgba_line += bp->skip_left;
229  src_mv_line += bp->skip_left;
230  }
231  const MapValue *src_mv = src_mv_line;
232 
233  /* Load these variables into register before loop. */
234  const __m128i alpha_and = ALPHA_AND_MASK;
235  #define ALPHA_BLEND_PARAM_3 alpha_and
236 #if (SSE_VERSION == 2)
237  const __m128i clear_hi = CLEAR_HIGH_BYTE_MASK;
238  #define ALPHA_BLEND_PARAM_1 alpha_and
239  #define ALPHA_BLEND_PARAM_2 clear_hi
240  #define DARKEN_PARAM_1 tr_nom_base
241  #define DARKEN_PARAM_2 tr_nom_base
242 #else
243  const __m128i a_cm = ALPHA_CONTROL_MASK;
244  const __m128i pack_low_cm = PACK_LOW_CONTROL_MASK;
245  #define ALPHA_BLEND_PARAM_1 a_cm
246  #define ALPHA_BLEND_PARAM_2 pack_low_cm
247  #define DARKEN_PARAM_1 a_cm
248  #define DARKEN_PARAM_2 tr_nom_base
249 #endif
250  const __m128i tr_nom_base = TRANSPARENT_NOM_BASE;
251 
252  for (int y = bp->height; y != 0; y--) {
253  Colour *dst = dst_line;
254  const Colour *src = src_rgba_line + META_LENGTH;
255  if (mode == BM_COLOUR_REMAP || mode == BM_CRASH_REMAP) src_mv = src_mv_line;
256 
257  if (read_mode == RM_WITH_MARGIN) {
258  assert(bt_last == BT_NONE); // or you must ensure block type is preserved
259  src += src_rgba_line[0].data;
260  dst += src_rgba_line[0].data;
261  if (mode == BM_COLOUR_REMAP || mode == BM_CRASH_REMAP) src_mv += src_rgba_line[0].data;
262  const int width_diff = si->sprite_width - bp->width;
263  effective_width = bp->width - (int) src_rgba_line[0].data;
264  const int delta_diff = (int) src_rgba_line[1].data - width_diff;
265  const int new_width = effective_width - delta_diff;
266  effective_width = delta_diff > 0 ? new_width : effective_width;
267  if (effective_width <= 0) goto next_line;
268  }
269 
270  switch (mode) {
271  default:
272  if (!translucent) {
273  for (uint x = (uint) effective_width; x > 0; x--) {
274  if (src->a) *dst = *src;
275  src++;
276  dst++;
277  }
278  break;
279  }
280 
281  for (uint x = (uint) effective_width / 2; x > 0; x--) {
282  __m128i srcABCD = _mm_loadl_epi64((const __m128i*) src);
283  __m128i dstABCD = _mm_loadl_epi64((__m128i*) dst);
284  _mm_storel_epi64((__m128i*) dst, AlphaBlendTwoPixels(srcABCD, dstABCD, ALPHA_BLEND_PARAM_1, ALPHA_BLEND_PARAM_2, ALPHA_BLEND_PARAM_3));
285  src += 2;
286  dst += 2;
287  }
288 
289  if ((bt_last == BT_NONE && effective_width & 1) || bt_last == BT_ODD) {
290  __m128i srcABCD = _mm_cvtsi32_si128(src->data);
291  __m128i dstABCD = _mm_cvtsi32_si128(dst->data);
292  dst->data = _mm_cvtsi128_si32(AlphaBlendTwoPixels(srcABCD, dstABCD, ALPHA_BLEND_PARAM_1, ALPHA_BLEND_PARAM_2, ALPHA_BLEND_PARAM_3));
293  }
294  break;
295 
296  case BM_COLOUR_REMAP:
297 #if (SSE_VERSION >= 3)
298  for (uint x = (uint) effective_width / 2; x > 0; x--) {
299  __m128i srcABCD = _mm_loadl_epi64((const __m128i*) src);
300  __m128i dstABCD = _mm_loadl_epi64((__m128i*) dst);
301  uint32 mvX2 = *((uint32 *) const_cast<MapValue *>(src_mv));
302 
303  /* Remap colours. */
304  if (mvX2 & 0x00FF00FF) {
305  #define CMOV_REMAP(m_colour, m_colour_init, m_src, m_m) \
306  /* Written so the compiler uses CMOV. */ \
307  Colour m_colour = m_colour_init; \
308  { \
309  const Colour srcm = (Colour) (m_src); \
310  const uint m = (byte) (m_m); \
311  const uint r = remap[m]; \
312  const Colour cmap = (this->LookupColourInPalette(r).data & 0x00FFFFFF) | (srcm.data & 0xFF000000); \
313  m_colour = r == 0 ? m_colour : cmap; \
314  m_colour = m != 0 ? m_colour : srcm; \
315  }
316 #ifdef POINTER_IS_64BIT
317  uint64 srcs = _mm_cvtsi128_si64(srcABCD);
318  uint64 remapped_src = 0;
319  CMOV_REMAP(c0, 0, srcs, mvX2);
320  remapped_src = c0.data;
321  CMOV_REMAP(c1, 0, srcs >> 32, mvX2 >> 16);
322  remapped_src |= (uint64) c1.data << 32;
323  srcABCD = _mm_cvtsi64_si128(remapped_src);
324 #else
325  Colour remapped_src[2];
326  CMOV_REMAP(c0, 0, _mm_cvtsi128_si32(srcABCD), mvX2);
327  remapped_src[0] = c0.data;
328  CMOV_REMAP(c1, 0, src[1], mvX2 >> 16);
329  remapped_src[1] = c1.data;
330  srcABCD = _mm_loadl_epi64((__m128i*) &remapped_src);
331 #endif
332 
333  if ((mvX2 & 0xFF00FF00) != 0x80008000) srcABCD = AdjustBrightnessOfTwoPixels(srcABCD, mvX2);
334  }
335 
336  /* Blend colours. */
337  _mm_storel_epi64((__m128i *) dst, AlphaBlendTwoPixels(srcABCD, dstABCD, ALPHA_BLEND_PARAM_1, ALPHA_BLEND_PARAM_2, ALPHA_BLEND_PARAM_3));
338  dst += 2;
339  src += 2;
340  src_mv += 2;
341  }
342 
343  if ((bt_last == BT_NONE && effective_width & 1) || bt_last == BT_ODD) {
344 #else
345  for (uint x = (uint) effective_width; x > 0; x--) {
346 #endif
347  /* In case the m-channel is zero, do not remap this pixel in any way. */
348  __m128i srcABCD;
349  if (src_mv->m) {
350  const uint r = remap[src_mv->m];
351  if (r != 0) {
352  Colour remapped_colour = AdjustBrightneSSE(this->LookupColourInPalette(r), src_mv->v);
353  if (src->a == 255) {
354  *dst = remapped_colour;
355  } else {
356  remapped_colour.a = src->a;
357  srcABCD = _mm_cvtsi32_si128(remapped_colour.data);
358  goto bmcr_alpha_blend_single;
359  }
360  }
361  } else {
362  srcABCD = _mm_cvtsi32_si128(src->data);
363  if (src->a < 255) {
364 bmcr_alpha_blend_single:
365  __m128i dstABCD = _mm_cvtsi32_si128(dst->data);
366  srcABCD = AlphaBlendTwoPixels(srcABCD, dstABCD, ALPHA_BLEND_PARAM_1, ALPHA_BLEND_PARAM_2, ALPHA_BLEND_PARAM_3);
367  }
368  dst->data = _mm_cvtsi128_si32(srcABCD);
369  }
370 #if (SSE_VERSION == 2)
371  src_mv++;
372  dst++;
373  src++;
374 #endif
375  }
376  break;
377 
378  case BM_TRANSPARENT:
379  /* Make the current colour a bit more black, so it looks like this image is transparent. */
380  for (uint x = (uint) bp->width / 2; x > 0; x--) {
381  __m128i srcABCD = _mm_loadl_epi64((const __m128i*) src);
382  __m128i dstABCD = _mm_loadl_epi64((__m128i*) dst);
383  _mm_storel_epi64((__m128i *) dst, DarkenTwoPixels(srcABCD, dstABCD, DARKEN_PARAM_1, DARKEN_PARAM_2));
384  src += 2;
385  dst += 2;
386  }
387 
388  if ((bt_last == BT_NONE && bp->width & 1) || bt_last == BT_ODD) {
389  __m128i srcABCD = _mm_cvtsi32_si128(src->data);
390  __m128i dstABCD = _mm_cvtsi32_si128(dst->data);
391  dst->data = _mm_cvtsi128_si32(DarkenTwoPixels(srcABCD, dstABCD, DARKEN_PARAM_1, DARKEN_PARAM_2));
392  }
393  break;
394 
395  case BM_CRASH_REMAP:
396  for (uint x = (uint) bp->width; x > 0; x--) {
397  if (src_mv->m == 0) {
398  if (src->a != 0) {
399  uint8 g = MakeDark(src->r, src->g, src->b);
400  *dst = ComposeColourRGBA(g, g, g, src->a, *dst);
401  }
402  } else {
403  uint r = remap[src_mv->m];
404  if (r != 0) *dst = ComposeColourPANoCheck(this->AdjustBrightness(this->LookupColourInPalette(r), src_mv->v), src->a, *dst);
405  }
406  src_mv++;
407  dst++;
408  src++;
409  }
410  break;
411 
412  case BM_BLACK_REMAP:
413  for (uint x = (uint) bp->width; x > 0; x--) {
414  if (src->a != 0) {
415  *dst = Colour(0, 0, 0);
416  }
417  src_mv++;
418  dst++;
419  src++;
420  }
421  break;
422  }
423 
424 next_line:
425  if (mode == BM_COLOUR_REMAP || mode == BM_CRASH_REMAP) src_mv_line += si->sprite_width;
426  src_rgba_line = (const Colour*) ((const byte*) src_rgba_line + si->sprite_line_size);
427  dst_line += bp->pitch;
428  }
429 }
430 IGNORE_UNINITIALIZED_WARNING_STOP
431 
439 #if (SSE_VERSION == 2)
440 void Blitter_32bppSSE2::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
441 #elif (SSE_VERSION == 3)
442 void Blitter_32bppSSSE3::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
443 #elif (SSE_VERSION == 4)
444 void Blitter_32bppSSE4::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
445 #endif
446 {
447  switch (mode) {
448  default: {
449  if (bp->skip_left != 0 || bp->width <= MARGIN_NORMAL_THRESHOLD) {
450 bm_normal:
451  const BlockType bt_last = (BlockType) (bp->width & 1);
452  switch (bt_last) {
453  default: Draw<BM_NORMAL, RM_WITH_SKIP, BT_EVEN, true>(bp, zoom); return;
454  case BT_ODD: Draw<BM_NORMAL, RM_WITH_SKIP, BT_ODD, true>(bp, zoom); return;
455  }
456  } else {
457  if (((const Blitter_32bppSSE_Base::SpriteData *) bp->sprite)->flags & SF_TRANSLUCENT) {
458  Draw<BM_NORMAL, RM_WITH_MARGIN, BT_NONE, true>(bp, zoom);
459  } else {
460  Draw<BM_NORMAL, RM_WITH_MARGIN, BT_NONE, false>(bp, zoom);
461  }
462  return;
463  }
464  break;
465  }
466  case BM_COLOUR_REMAP:
467  if (((const Blitter_32bppSSE_Base::SpriteData *) bp->sprite)->flags & SF_NO_REMAP) goto bm_normal;
468  if (bp->skip_left != 0 || bp->width <= MARGIN_REMAP_THRESHOLD) {
469  Draw<BM_COLOUR_REMAP, RM_WITH_SKIP, BT_NONE, true>(bp, zoom); return;
470  } else {
471  Draw<BM_COLOUR_REMAP, RM_WITH_MARGIN, BT_NONE, true>(bp, zoom); return;
472  }
473  case BM_TRANSPARENT: Draw<BM_TRANSPARENT, RM_NONE, BT_NONE, true>(bp, zoom); return;
474  case BM_CRASH_REMAP: Draw<BM_CRASH_REMAP, RM_NONE, BT_NONE, true>(bp, zoom); return;
475  case BM_BLACK_REMAP: Draw<BM_BLACK_REMAP, RM_NONE, BT_NONE, true>(bp, zoom); return;
476  }
477 }
478 #endif /* FULL_ANIMATION */
479 
480 #endif /* WITH_SSE */
481 #endif /* BLITTER_32BPP_SSE_FUNC_HPP */
Colour::data
uint32 data
Conversion of the channel information to a 32 bit number.
Definition: gfx_type.h:160
Blitter::BlitterParams::top
int top
The top offset in the 'dst' in pixels to start drawing.
Definition: base.hpp:42
BM_TRANSPARENT
@ BM_TRANSPARENT
Perform transparency colour remapping.
Definition: base.hpp:20
Blitter::BlitterParams::skip_left
int skip_left
How much pixels of the source to skip on the left (based on zoom of dst)
Definition: base.hpp:35
BlitterMode
BlitterMode
The modes of blitting we can do.
Definition: base.hpp:17
Blitter::BlitterParams::width
int width
The width in pixels that needs to be drawn to dst.
Definition: base.hpp:37
Blitter::BlitterParams::dst
void * dst
Destination buffer.
Definition: base.hpp:44
ZoomLevel
ZoomLevel
All zoom levels we know.
Definition: zoom_type.h:19
Blitter::BlitterParams::pitch
int pitch
The pitch of the destination buffer.
Definition: base.hpp:45
Blitter::BlitterParams::sprite
const void * sprite
Pointer to the sprite how ever the encoder stored it.
Definition: base.hpp:32
BM_COLOUR_REMAP
@ BM_COLOUR_REMAP
Perform a colour remapping.
Definition: base.hpp:19
BM_CRASH_REMAP
@ BM_CRASH_REMAP
Perform a crash remapping.
Definition: base.hpp:21
BM_BLACK_REMAP
@ BM_BLACK_REMAP
Perform remapping to a completely blackened sprite.
Definition: base.hpp:22
Colour
Structure to access the alpha, red, green, and blue channels from a 32 bit number.
Definition: gfx_type.h:159
Colour::a
uint8 a
colour channels in LE order
Definition: gfx_type.h:167
Blitter::BlitterParams::left
int left
The left offset in the 'dst' in pixels to start drawing.
Definition: base.hpp:41
Blitter::BlitterParams
Parameters related to blitting.
Definition: base.hpp:31
Blitter::BlitterParams::height
int height
The height in pixels that needs to be drawn to dst.
Definition: base.hpp:38
Blitter::BlitterParams::skip_top
int skip_top
How much pixels of the source to skip on the top (based on zoom of dst)
Definition: base.hpp:36
Blitter::BlitterParams::remap
const byte * remap
XXX – Temporary storage for remap array.
Definition: base.hpp:33