Go to the source code of this file.
|
float | R_ClampScale (cvar_t *var) |
|
void | R_SetScale (float scale) |
|
void | R_InitDraw (void) |
|
void | R_ClearColor (void) |
|
void | R_SetAlpha (float alpha) |
|
void | R_SetColor (uint32_t color) |
|
void | R_SetClipRect (const clipRect_t *clip) |
|
static void | R_DrawStretchData (int x, int y, int w, int h, int xx, int yy, int ww, int hh, int pitch, byte *data, color_t color) |
|
static void | R_DrawFixedData (int x, int y, int w, int h, int pitch, byte *data, color_t color) |
|
void | R_DrawStretchPic (int x, int y, int w, int h, qhandle_t pic) |
|
void | R_DrawPic (int x, int y, qhandle_t pic) |
|
static void | draw_char (int x, int y, int flags, int ch, image_t *image) |
|
void | R_DrawChar (int x, int y, int flags, int ch, qhandle_t font) |
|
int | R_DrawString (int x, int y, int flags, size_t maxChars, const char *string, qhandle_t font) |
|
void | R_TileClear (int x, int y, int w, int h, qhandle_t pic) |
|
void | R_DrawFill8 (int x, int y, int w, int h, int c) |
|
void | R_DrawFill32 (int x, int y, int w, int h, uint32_t c) |
|
◆ ROW1
Value: do { \
DO; \
} while (--count)
Definition at line 61 of file draw.c.
◆ ROW4
Value: do { \
DO; \
DO; \
DO; \
DO; \
\
count -= 4; \
} while (count)
Definition at line 66 of file draw.c.
◆ ROW8
Value: do { \
DO; \
DO; \
DO; \
DO; \
DO; \
DO; \
DO; \
DO; \
\
count -= 8; \
} while (count)
Definition at line 76 of file draw.c.
◆ STEP
Value: dst[0] = (dst[0] * (255 - src[3]) + src[2] * src[3]) >> 8; \
dst[1] = (dst[1] * (255 - src[3]) + src[1] * src[3]) >> 8; \
dst[2] = (dst[2] * (255 - src[3]) + src[0] * src[3]) >> 8; \
Definition at line 23 of file draw.c.
◆ STEP_M
Value: tmp[0] = (src[0] *
color.u8[0]) >> 8; \
tmp[1] = (src[1] *
color.u8[1]) >> 8; \
tmp[2] = (src[2] *
color.u8[2]) >> 8; \
tmp[3] = (src[3] *
color.u8[3]) >> 8; \
dst[0] = (dst[0] * (255 - tmp[3]) + tmp[2] * tmp[3]) >> 8; \
dst[1] = (dst[1] * (255 - tmp[3]) + tmp[1] * tmp[3]) >> 8; \
dst[2] = (dst[2] * (255 - tmp[3]) + tmp[0] * tmp[3]) >> 8; \
Definition at line 30 of file draw.c.
◆ STRETCH
Value:
dst[0] = (dst[0] * (255 - _src[3]) + _src[2] * _src[3]) >> 8; \
dst[1] = (dst[1] * (255 - _src[3]) + _src[1] * _src[3]) >> 8; \
dst[2] = (dst[2] * (255 - _src[3]) + _src[0] * _src[3]) >> 8; \
u += ustep;
Definition at line 41 of file draw.c.
◆ STRETCH_M
Value:
tmp[0] = (_src[0] *
color.u8[0]) >> 8; \
tmp[1] = (_src[1] *
color.u8[1]) >> 8; \
tmp[2] = (_src[2] *
color.u8[2]) >> 8; \
tmp[3] = (_src[3] *
color.u8[3]) >> 8; \
dst[0] = (dst[0] * (255 - tmp[3]) + tmp[2] * tmp[3]) >> 8; \
dst[1] = (dst[1] * (255 - tmp[3]) + tmp[1] * tmp[3]) >> 8; \
dst[2] = (dst[2] * (255 - tmp[3]) + tmp[0] * tmp[3]) >> 8; \
u += ustep;
Definition at line 49 of file draw.c.
◆ draw_char()
Definition at line 413 of file draw.c.
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;
Referenced by R_DrawChar(), and R_DrawString().
◆ R_ClampScale()
float R_ClampScale |
( |
cvar_t * |
var | ) |
|
◆ R_ClearColor()
◆ R_DrawChar()
Definition at line 434 of file draw.c.
442 if (image->upload_width != 128 || image->upload_height != 128)
◆ R_DrawFill32()
Definition at line 565 of file draw.c.
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++) {
◆ R_DrawFill8()
Definition at line 532 of file draw.c.
557 for (u = 0; u < w; u++) {
◆ R_DrawFixedData()
static void R_DrawFixedData |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
pitch, |
|
|
byte * |
data, |
|
|
color_t |
color |
|
) |
| |
|
static |
Definition at line 294 of file draw.c.
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)) {
Referenced by draw_char(), R_DrawPic(), and R_DrawStretchPic().
◆ R_DrawPic()
Definition at line 401 of file draw.c.
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,
◆ R_DrawStretchData()
static void R_DrawStretchData |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
xx, |
|
|
int |
yy, |
|
|
int |
ww, |
|
|
int |
hh, |
|
|
int |
pitch, |
|
|
byte * |
data, |
|
|
color_t |
color |
|
) |
| |
|
static |
Definition at line 170 of file draw.c.
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)) {
Referenced by R_DrawPic(), and R_DrawStretchPic().
◆ R_DrawStretchPic()
Definition at line 384 of file draw.c.
388 if (w == image->upload_width && h == image->upload_height)
Referenced by R_DrawPic_RTX().
◆ R_DrawString()
int R_DrawString |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
flags, |
|
|
size_t |
maxChars, |
|
|
const char * |
string, |
|
|
qhandle_t |
font |
|
) |
| |
Definition at line 453 of file draw.c.
462 if (image->upload_width != 128 || image->upload_height != 128)
465 while (maxChars-- && *
string) {
◆ R_InitDraw()
◆ R_SetAlpha()
void R_SetAlpha |
( |
float |
alpha | ) |
|
◆ R_SetClipRect()
void R_SetClipRect |
( |
const clipRect_t * |
clip | ) |
|
◆ R_SetColor()
void R_SetColor |
( |
uint32_t |
color | ) |
|
◆ R_SetScale()
void R_SetScale |
( |
float |
scale | ) |
|
◆ R_TileClear()
Definition at line 482 of file draw.c.
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++) {
◆ draw