24 dst[0] = (dst[0] * (255 - src[3]) + src[2] * src[3]) >> 8; \
25 dst[1] = (dst[1] * (255 - src[3]) + src[1] * src[3]) >> 8; \
26 dst[2] = (dst[2] * (255 - src[3]) + src[0] * src[3]) >> 8; \
31 tmp[0] = (src[0] * color.u8[0]) >> 8; \
32 tmp[1] = (src[1] * color.u8[1]) >> 8; \
33 tmp[2] = (src[2] * color.u8[2]) >> 8; \
34 tmp[3] = (src[3] * color.u8[3]) >> 8; \
35 dst[0] = (dst[0] * (255 - tmp[3]) + tmp[2] * tmp[3]) >> 8; \
36 dst[1] = (dst[1] * (255 - tmp[3]) + tmp[1] * tmp[3]) >> 8; \
37 dst[2] = (dst[2] * (255 - tmp[3]) + tmp[0] * tmp[3]) >> 8; \
42 _src = src + (u >> 16) * TEX_BYTES; \
43 dst[0] = (dst[0] * (255 - _src[3]) + _src[2] * _src[3]) >> 8; \
44 dst[1] = (dst[1] * (255 - _src[3]) + _src[1] * _src[3]) >> 8; \
45 dst[2] = (dst[2] * (255 - _src[3]) + _src[0] * _src[3]) >> 8; \
50 _src = src + (u >> 16) * TEX_BYTES; \
51 tmp[0] = (_src[0] * color.u8[0]) >> 8; \
52 tmp[1] = (_src[1] * color.u8[1]) >> 8; \
53 tmp[2] = (_src[2] * color.u8[2]) >> 8; \
54 tmp[3] = (_src[3] * color.u8[3]) >> 8; \
55 dst[0] = (dst[0] * (255 - tmp[3]) + tmp[2] * tmp[3]) >> 8; \
56 dst[1] = (dst[1] * (255 - tmp[3]) + tmp[1] * tmp[3]) >> 8; \
57 dst[2] = (dst[2] * (255 - tmp[3]) + tmp[0] * tmp[3]) >> 8; \
171 int ww,
int hh,
int pitch,
byte *data, color_t
color)
173 byte *srcpixels, *dstpixels, *dst, *src;
176 int skipv = 0, skipu = 0;
197 if (w <= 0 || h <= 0)
200 srcpixels = data + yy * pitch + xx *
TEX_BYTES;
203 vstep = hh * 0x10000 /
height;
206 if (
color.u32 == U32_WHITE) {
210 src = &srcpixels[(v >> 16) * pitch];
216 }
else if (!(w & 3)) {
226 ustep = ww * 0x10000 /
width;
227 skipu = skipu * ustep;
229 src = &srcpixels[(v >> 16) * pitch];
236 }
else if (!(w & 3)) {
250 src = &srcpixels[(v >> 16) * pitch];
256 }
else if (!(w & 3)) {
266 ustep = ww * 0x10000 /
width;
267 skipu = skipu * ustep;
269 src = &srcpixels[(v >> 16) * pitch];
276 }
else if (!(w & 3)) {
295 int pitch,
byte *data, color_t
color)
297 byte *srcpixels, *dstpixels;
299 int skipv = 0, skipu = 0;
318 if (w <= 0 || h <= 0)
321 srcpixels = data + skipv * pitch + skipu *
TEX_BYTES;
324 if (
color.u32 == U32_WHITE) {
333 }
else if (!(w & 3)) {
359 }
else if (!(w & 3)) {
388 if (w == image->upload_width && h == image->upload_height)
405 if (image->width == image->upload_width && image->height == image->upload_height)
409 R_DrawStretchData(x, y, image->width, image->height, 0, 0, image->upload_width, image->upload_height,
418 if ((ch & 127) == 32)
421 if (flags & UI_ALTCOLOR)
424 if (flags & UI_XORCOLOR)
427 x2 = (ch & 15) * CHAR_WIDTH;
428 y2 = ((ch >> 4) & 15) * CHAR_HEIGHT;
434 void R_DrawChar(
int x,
int y,
int flags,
int ch, qhandle_t font)
442 if (image->upload_width != 128 || image->upload_height != 128)
454 const char *
string, qhandle_t font)
462 if (image->upload_width != 128 || image->upload_height != 128)
465 while (maxChars-- && *
string) {
505 if (w <= 0 || h <= 0)
509 if (image->upload_width != 64 || image->upload_height != 64)
515 psrc = image->pixels[0] + 64 *
TEX_BYTES * ((i + y) & 63);
516 for (j = x; j < x2; j++) {
557 for (u = 0; u < w; u++) {
570 int alpha, one_minus_alpha;
591 one_minus_alpha = 255 - alpha;
593 pre[0] =
color.u8[0] * alpha;
594 pre[1] =
color.u8[1] * alpha;
595 pre[2] =
color.u8[2] * alpha;
599 for (u = 0; u < w; u++) {