|
UFO: Alien Invasion
|
#include "r_local.h"#include "r_sphere.h"#include "r_error.h"#include "r_draw.h"#include "r_mesh.h"#include "r_framebuffer.h"#include "r_program.h"#include "r_misc.h"#include "../cl_console.h"
Go to the source code of this file.
Data Structures | |
| struct | char_arrays_t |
| Characters are batched per frame and drawn in one shot accumulate coordinates and colors as vertex arrays. More... | |
| struct | batch_arrays_t |
| array to store batched vertices and colors per frame More... | |
| struct | bbox_arrays_t |
| struct | rect_t |
Macros | |
| #define | MAX_CHARS 8192 |
| #define | MAX_BATCH_ENTRIES 512 |
| #define | MAX_BBOX_ENTRIES 256 |
| #define | MAX_LINEVERTS 256 |
| #define | MAX_CLIPRECT 16 |
Functions | |
| void | R_DrawInitLocal (void) |
| Loads some textures and init the 3d globe. | |
| void | R_DrawChar (int x, int y, int num, uint32_t color) |
| Draws one 8*8 graphics character with 0 being transparent. It can be clipped to the top of the screen to allow the console to be smoothly scrolled off. | |
| void | R_DrawChars (void) |
| void | R_DrawFill (int x, int y, int w, int h, const vec4_t color) |
| Fills a box of pixels with a single color. | |
| void | R_DrawFills (void) |
| int | R_UploadData (const char *name, unsigned *frame, int width, int height) |
| Uploads image data. | |
| void | R_DrawTexture (int texnum, int x, int y, int w, int h) |
| Bind and draw a texture. | |
| void | R_DrawImage (float x, float y, const image_t *image) |
| Draws an image or parts of it. | |
| void | R_DrawStretchImage (float x, float y, int w, int h, const image_t *image) |
| const image_t * | R_DrawImageArray (const vec2_t texcoords[4], const vec2_t verts[4], const image_t *image) |
| void | R_DrawRect (int x, int y, int w, int h, const vec4_t color, float lineWidth, int pattern) |
| Draws a rect to the screen. Also has support for stippled rendering of the rect. | |
| void | R_DrawCircle (float radius, const vec4_t color, float thickness, const vec3_t shift) |
| static void | R_Draw2DArray (int points, int *verts, GLenum mode) |
| void | R_DrawLineStrip (int points, int *verts) |
| 2 dimensional line strip | |
| void | R_DrawLineLoop (int points, int *verts) |
| void | R_DrawLine (int *verts, float thickness) |
| Draws one line with only one start and one end point. | |
| void | R_DrawPolygon (int points, int *verts) |
| static void | R_RectIntersection (const rect_t *a, const rect_t *b, rect_t *out) |
| Compute the intersection of 2 rect. | |
| void | R_PushClipRect (int x, int y, int width, int height) |
| Force to draw only on a rect. | |
| void | R_PopClipRect (void) |
| void | R_CleanupDepthBuffer (int x, int y, int width, int height) |
| "Clean up" the depth buffer into a rect | |
| static void | R_ComputeBoundingBox (const vec3_t mins, const vec3_t maxs, vec3_t bbox[8]) |
| Compute the bounding box for an entity out of the mins, maxs. | |
| void | R_DrawBoundingBoxes (void) |
| void | R_DrawBoundingBoxBatched (const AABB &absbox) |
| void | R_DrawBoundingBox (const AABB &absBox) |
| Draws the model bounding box. | |
| void | R_DrawTexturedBox (const vec3_t a0, const vec3_t a1) |
| Draws the textured box, the caller should bind the texture. | |
Variables | |
| image_t * | shadow |
| static image_t * | draw_chars |
| static char_arrays_t | r_char_arrays |
| static batch_arrays_t | r_fill_arrays |
| static bbox_arrays_t | r_bbox_array |
| static rect_t | clipRect [MAX_CLIPRECT] |
| static int | currentClipRect = 0 |
| #define MAX_BATCH_ENTRIES 512 |
Definition at line 57 of file r_draw.cpp.
| #define MAX_BBOX_ENTRIES 256 |
Definition at line 70 of file r_draw.cpp.
| #define MAX_CHARS 8192 |
Definition at line 40 of file r_draw.cpp.
| #define MAX_CLIPRECT 16 |
Definition at line 521 of file r_draw.cpp.
Referenced by R_PushClipRect().
| #define MAX_LINEVERTS 256 |
Definition at line 449 of file r_draw.cpp.
Referenced by R_Draw2DArray().
"Clean up" the depth buffer into a rect
Definition at line 596 of file r_draw.cpp.
References GLboolean(), GLint, R_BindArray(), R_BindDefaultArray(), refdef, and viddef.
Referenced by uiItemNode::draw(), uiRadarNode::draw(), uiSequenceNode::draw(), and UI_DrawModelNode().
Compute the bounding box for an entity out of the mins, maxs.
Definition at line 630 of file r_draw.cpp.
References i.
Referenced by R_DrawBoundingBox(), and R_DrawBoundingBoxBatched().
Definition at line 451 of file r_draw.cpp.
References GLenum, i, MAX_LINEVERTS, r_state, refdef, and viddef.
Referenced by R_DrawLine(), R_DrawLineLoop(), R_DrawLineStrip(), and R_DrawPolygon().
Draws the model bounding box.
Definition at line 690 of file r_draw.cpp.
References AABB::maxs, AABB::mins, R_BindArray(), R_BindDefaultArray(), and R_ComputeBoundingBox().
Referenced by R_DrawAliasModel(), R_DrawBox(), R_DrawModelDirect(), R_DrawModelParticle(), and R_RenderBspRRefs().
Definition at line 670 of file r_draw.cpp.
References i, lengthof, AABB::maxs, AABB::mins, r_bbox_array, R_ComputeBoundingBox(), and VectorCopy.
Referenced by CL_Trace().
Definition at line 640 of file r_draw.cpp.
References i, r_bbox_array, R_BindArray(), R_BindDefaultArray(), and R_Color().
Referenced by R_RenderFrame().
Draws one 8*8 graphics character with 0 being transparent. It can be clipped to the top of the screen to allow the console to be smoothly scrolled off.
Definition at line 99 of file r_draw.cpp.
References con_fontHeight, con_fontWidth, int(), lengthof, and r_char_arrays.
Referenced by Con_DrawConsole(), and Con_DrawText().
Definition at line 155 of file r_draw.cpp.
References draw_chars, R_BindArray(), R_BindDefaultArray(), R_BindTexture, r_char_arrays, R_DrawArrays(), R_EnableColorArray(), and refdef.
Referenced by R_EndFrame().
Definition at line 422 of file r_draw.cpp.
References i, lengthof, M_PI, R_BindArray(), R_BindDefaultArray(), R_Color(), refdef, shift, and VectorSet.
Referenced by R_DrawPtlCircle().
Fills a box of pixels with a single color.
Definition at line 188 of file r_draw.cpp.
References lengthof, LittleLong, R_DrawFills(), r_fill_arrays, and viddef.
Referenced by uiLineChartNode::draw(), GAME_GetImportData(), SCR_DrawLoadingBar(), SEQ_Render2D(), UI_DrawFill(), and cgame_import_t::void().
Definition at line 232 of file r_draw.cpp.
References R_BindArray(), R_BindDefaultArray(), R_Color(), R_DrawArrays(), R_EnableColorArray(), R_EnableTexture(), r_fill_arrays, refdef, and texunit_diffuse.
Referenced by R_DrawFill().
Draws an image or parts of it.
| x,y | position to draw the image to | |
| [in] | image | Pointer to the imlage to display |
Definition at line 341 of file r_draw.cpp.
References image_t::height, R_DrawTexture(), image_t::texnum, viddef, and image_t::width.
Referenced by HUD_UpdateCursor(), R_DrawImageCentered(), SCR_DrawCursor(), SCR_DrawLoadingScreen(), and SEQ_Render2D().
| const image_t * R_DrawImageArray | ( | const vec2_t | texcoords[4], |
| const vec2_t | verts[4], | ||
| const image_t * | image ) |
Definition at line 357 of file r_draw.cpp.
References R_BindArray(), R_BindDefaultArray(), R_BindTexture, refdef, and image_t::texnum.
Referenced by R_DrawTexture(), UI_DrawNormImage(), and UI_RadarNodeDrawArrays().
Loads some textures and init the 3d globe.
Definition at line 83 of file r_draw.cpp.
References Com_Error(), Com_Printf(), draw_chars, ERR_FATAL, it_chars, it_effect, R_FindImage(), r_noTexture, and shadow.
Referenced by R_Init().
Draws one line with only one start and one end point.
Definition at line 494 of file r_draw.cpp.
References R_Draw2DArray().
Referenced by GAME_GetImportData().
2 dimensional line strip
Definition at line 477 of file r_draw.cpp.
References R_Draw2DArray().
Referenced by uiLineChartNode::draw(), and GAME_GetImportData().
Definition at line 509 of file r_draw.cpp.
References R_Draw2DArray().
Draws a rect to the screen. Also has support for stippled rendering of the rect.
| [in] | x,y | X/Y-position of the rect |
| [in] | w | Width of the rect |
| [in] | h | Height of the rect |
| [in] | color | RGBA color of the rect |
| [in] | lineWidth | Line strength in pixel of the rect |
| [in] | pattern | Specifies a 16-bit integer whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first; the default pattern is all 1's |
2 for this function Definition at line 390 of file r_draw.cpp.
References R_BindDefaultArray(), R_Color(), refdef, and viddef.
Referenced by GAME_GetImportData(), SEQ_Render2D(), UI_DrawRect(), and cgame_import_t::void().
Definition at line 349 of file r_draw.cpp.
References R_DrawTexture(), image_t::texnum, and viddef.
Referenced by Con_DrawConsole().
Bind and draw a texture.
| [in] | texnum | The texture id (already uploaded of course) |
| [in] | x,y | normalized position on the screen |
| [in] | w,h | normalized width and height values |
Definition at line 328 of file r_draw.cpp.
References default_texcoords, R_BindTexture, R_DrawImageArray(), and Vector2FromInt.
Referenced by CIN_OGM_DrawCinematic(), CIN_ROQ_DrawCinematic(), R_Draw3DGlobe(), R_DrawImage(), and R_DrawStretchImage().
Draws the textured box, the caller should bind the texture.
Definition at line 714 of file r_draw.cpp.
References R_BindArray(), and R_BindDefaultArray().
Referenced by R_DrawBox().
Definition at line 579 of file r_draw.cpp.
References clipRect, and currentClipRect.
Referenced by UI_PopClipRect().
Force to draw only on a rect.
R_EndClipRect Definition at line 550 of file r_draw.cpp.
References clipRect, currentClipRect, rect_t::height, MAX_CLIPRECT, R_RectIntersection(), viddef, rect_t::width, rect_t::x, and rect_t::y.
Referenced by UI_PushClipRect().
Compute the intersection of 2 rect.
| [in] | a | A rect |
| [in] | b | A rect |
| [out] | out | The intersection rect |
Definition at line 533 of file r_draw.cpp.
References rect_t::height, rect_t::width, rect_t::x, and rect_t::y.
Referenced by R_PushClipRect().
Uploads image data.
| [in] | name | The name of the texture to use for this data |
| [in] | frame | The frame data that is uploaded |
| [in] | width | The width of the texture |
| [in] | height | The height of the texture |
Definition at line 270 of file r_draw.cpp.
References Com_Error(), ERR_FATAL, glTexImage2D(), glTexParameterf(), image_t::height, i, it_pic, Mem_Free, Mem_PoolAllocTypeN, name, R_BindTexture, R_CheckError, r_config, R_FindImage(), R_GetScaledTextureSize(), r_noTexture, R_ScaleTexture(), image_t::texnum, image_t::upload_height, image_t::upload_width, vid_imagePool, and image_t::width.
Referenced by CIN_OGM_DrawCinematic(), and CIN_ROQ_DrawCinematic().
|
static |
Definition at line 523 of file r_draw.cpp.
Referenced by R_PopClipRect(), and R_PushClipRect().
|
static |
Definition at line 525 of file r_draw.cpp.
Referenced by R_PopClipRect(), and R_PushClipRect().
|
static |
Definition at line 38 of file r_draw.cpp.
Referenced by R_DrawChars(), and R_DrawInitLocal().
|
static |
Definition at line 77 of file r_draw.cpp.
Referenced by R_DrawBoundingBoxBatched(), and R_DrawBoundingBoxes().
|
static |
Definition at line 55 of file r_draw.cpp.
Referenced by R_DrawChar(), and R_DrawChars().
|
static |
Definition at line 68 of file r_draw.cpp.
Referenced by R_DrawFill(), and R_DrawFills().
| image_t* shadow |
draw this when actor is alive
Definition at line 35 of file r_draw.cpp.
Referenced by R_DrawEntityEffects(), and R_DrawInitLocal().