UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
r_misc.cpp File Reference
#include "r_local.h"
#include "r_misc.h"
#include "r_error.h"
#include "r_font.h"
#include "r_model.h"
#include "../../shared/images.h"

Go to the source code of this file.

Macros

#define MISC_TEXTURE_SIZE   16
 
#define CAPABILITY(X)   {GL_ ## X, # X}
 

Enumerations

enum  { SSHOTTYPE_JPG, SSHOTTYPE_PNG, SSHOTTYPE_TGA, SSHOTTYPE_TGA_COMP }
 

Functions

void R_InitMiscTexture (void)
 
void R_ScreenShot (int x, int y, int width, int height, const char *filename, const char *ext)
 
void R_ScreenShot_f (void)
 
void R_Transform (const vec3_t transform, const vec3_t rotate, const vec3_t scale)
 Perform translate, rotate and scale operations on the current matrix. More...
 
void R_PushMatrix (void)
 Push a new matrix to the stack. More...
 
void R_PopMatrix (void)
 Removes the current matrix from the stack. More...
 
void R_DumpOpenGlState (void)
 Dumps OpenGL state for debugging - typically every capability set with glEnable(). More...
 
void R_ReinitOpenglContext (void)
 Re-initializes OpenGL state machine, all textures and renderer variables, this needed when application is put to background on Android. More...
 

Variables

static const byte gridtexture [8][8]
 
static const byte dummytexture [4] = {255, 255, 255, 255}
 

Macro Definition Documentation

#define CAPABILITY (   X)    {GL_ ## X, # X}

Referenced by R_DumpOpenGlState().

#define MISC_TEXTURE_SIZE   16

Definition at line 45 of file r_misc.cpp.

Referenced by R_InitMiscTexture().

Enumeration Type Documentation

anonymous enum
Enumerator
SSHOTTYPE_JPG 
SSHOTTYPE_PNG 
SSHOTTYPE_TGA 
SSHOTTYPE_TGA_COMP 

Definition at line 85 of file r_misc.cpp.

Function Documentation

void R_DumpOpenGlState ( void  )

Dumps OpenGL state for debugging - typically every capability set with glEnable().

Definition at line 256 of file r_misc.cpp.

References CAPABILITY, Com_Printf(), f, i, lengthof, and Q_strcat().

void R_PopMatrix ( void  )

Removes the current matrix from the stack.

Definition at line 248 of file r_misc.cpp.

Referenced by uiSequenceNode::draw(), SEQ_Render3D(), and UI_Transform().

void R_PushMatrix ( void  )

Push a new matrix to the stack.

Definition at line 240 of file r_misc.cpp.

Referenced by uiSequenceNode::draw(), SEQ_Render3D(), and UI_Transform().

void R_ScreenShot ( int  x,
int  y,
int  width,
int  height,
const char *  filename,
const char *  ext 
)

Take a screenshot of the frame buffer

Parameters
[in]x
[in]y
[in]width
[in]height
[in]filenameForce to use a filename. Else nullptr to autogen a filename
[in]extForce to use an image format (tga/png/jpg). Else nullptr to use value of r_screenshot_format

Definition at line 101 of file r_misc.cpp.

References Cmd_Argc(), Cmd_Argv(), Com_Printf(), Com_sprintf(), f, FILE_WRITE, FS_CheckFile(), FS_Gamedir(), FS_OpenFile(), cvar_s::integer, MAX_OSPATH, Mem_Free, Mem_PoolAllocTypeN, Q_strcasecmp, R_CheckError, r_screenshot_format, r_screenshot_jpeg_quality, R_WriteCompressedTGA(), R_WriteJPG(), R_WritePNG(), SSHOTTYPE_JPG, SSHOTTYPE_PNG, SSHOTTYPE_TGA_COMP, cvar_s::string, type, and vid_imagePool.

Referenced by CL_BattlescapeRadarGenerate_f(), and R_ScreenShot_f().

void R_ScreenShot_f ( void  )
void R_Transform ( const vec3_t  transform,
const vec3_t  rotate,
const vec3_t  scale 
)

Perform translate, rotate and scale operations on the current matrix.

Note
Every parameter may be nullptr and is ignored then
Parameters
[in]transformTranslation vector
[in]rotateRotation vector
[in]scaleScale vector (keep in mind to not set this to vec3_origin or zero)
See also
R_PushMatrix
R_PopMatrix

Definition at line 220 of file r_misc.cpp.

Referenced by UI_DrawNode(), and UI_Transform().

Variable Documentation

const byte dummytexture[4] = {255, 255, 255, 255}
static

Definition at line 43 of file r_misc.cpp.

Referenced by R_InitMiscTexture().

const byte gridtexture[8][8]
static
Initial value:
= {
{1, 1, 1, 1, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 1, 1, 1, 1, 1, 1},
}

Definition at line 32 of file r_misc.cpp.

Referenced by R_InitMiscTexture().