cl_renderer.h File Reference

#include "renderer/r_image.h"
#include "renderer/r_model.h"
#include "renderer/r_program.h"
#include <SDL.h>
Include dependency graph for cl_renderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  corona_s
 coronas are soft, alpha-blended, rounded polys More...
struct  light_t
struct  sustain_s
 sustains are light flashes which slowly decay More...
struct  modelInfo_t
struct  ptlCmd_s
struct  ptlDef_s
struct  ptlArt_s
struct  ptl_s
struct  rendererData_t
struct  renderer_threadstate_s

Defines

#define RDF_NOWORLDMODEL   1
#define RDF_IRGOGGLES   2
#define RF_TRANSLUCENT   0x00000001
#define RF_BOX   0x00000002
#define RF_PATH   0x01000000
#define RF_ARROW   0x02000000
#define RF_SHADOW   0x00000004
#define RF_BLOOD   0x00000008
#define RF_SELECTED   0x00000010
#define RF_MEMBER   0x00000020
#define RF_ALLIED   0x00000040
#define RF_ACTOR   0x00000080
#define RF_PULSE   0x00000100
#define RF_IRGOGGLES   0x00000200
#define EARTH_RADIUS   8192.0f
#define MOON_RADIUS   1024.0f
#define SUN_RADIUS   1024.0f
#define WEATHER_NONE   0
#define WEATHER_FOG   1
#define VID_NORM_WIDTH   1024
#define VID_NORM_HEIGHT   768
#define MAX_PTL_ART   1024
#define MAX_PTLS   2048
#define MAX_CORONAS   128
#define MAX_GL_LIGHTS   8

Typedefs

typedef struct corona_s corona_t
 coronas are soft, alpha-blended, rounded polys
typedef struct sustain_s sustain_t
 sustains are light flashes which slowly decay
typedef struct ptlCmd_s ptlCmd_t
typedef struct ptlDef_s ptlDef_t
typedef enum artType_s artType_t
 particle art type
typedef struct ptlArt_s ptlArt_t
typedef struct ptl_s ptl_t
typedef struct
renderer_threadstate_s 
renderer_threadstate_t

Enumerations

enum  artType_s { ART_PIC, ART_MODEL }
 

particle art type

More...
enum  threadstate_t {
  THREAD_DEAD, THREAD_IDLE, THREAD_CLIENT, THREAD_BSP,
  THREAD_RENDERER
}
enum  longlines_t { LONGLINES_WRAP, LONGLINES_CHOP, LONGLINES_PRETTYCHOP, LONGLINES_LAST }

Functions

struct model_sR_RegisterModelShort (const char *name)
 Tries to load a model.
const image_tR_RegisterImage (const char *name)
 Searches for an image in the image array.
void R_Color (const vec4_t rgba)
 Change the color to given value.
void R_ModBeginLoading (const char *tiles, qboolean day, const char *pos, const char *mapName)
 Specifies the model that will be used as the world.
void R_SwitchModelMemPoolTag (void)
 After all static models are loaded, switch the pool tag for these models to not free them everytime R_ShutdownModels is called.
void R_LoadImage (const char *name, byte **pic, int *width, int *height)
 Generic image-data loading fucntion.
void R_FontShutdown (void)
 frees the SDL_ttf fonts
void R_FontInit (void)
void R_FontRegister (const char *name, int size, const char *path, const char *style)
void R_FontSetTruncationMarker (const char *marker)
void R_FontTextSize (const char *fontId, const char *text, int maxWidth, longlines_t method, int *width, int *height, int *lines, qboolean *isTruncated)
 Supply information about the size of the text when it is linewrapped and rendered, without actually rendering it. Any of the output parameters may be NULL.
int R_FontDrawString (const char *fontId, align_t align, int x, int y, int absX, int maxWidth, int lineHeight, const char *c, int boxHeight, int scrollPos, int *curLine, longlines_t method)

Variables

rendererData_t refdef
renderer_threadstate_t r_threadstate

Detailed Description

Definition in file cl_renderer.h.


Define Documentation

#define EARTH_RADIUS   8192.0f

Definition at line 54 of file cl_renderer.h.

Referenced by R_SphereInit().

#define MAX_CORONAS   128

Definition at line 74 of file cl_renderer.h.

Referenced by R_AddCorona().

#define MAX_GL_LIGHTS   8
#define MAX_PTL_ART   1024

Definition at line 64 of file cl_renderer.h.

Referenced by CL_ParticleGetArt().

#define MAX_PTLS   2048

Definition at line 65 of file cl_renderer.h.

Referenced by CL_ParticleSpawn().

#define MOON_RADIUS   1024.0f

Definition at line 55 of file cl_renderer.h.

Referenced by R_SphereInit().

#define RDF_IRGOGGLES   2

actor is using ir goggles and everything with RF_IRGOGGLES is visible for him

Definition at line 36 of file cl_renderer.h.

Referenced by CL_ActorDoShoot(), CL_ClearState(), and CL_DoEndRound().

#define RDF_NOWORLDMODEL   1
#define RF_ACTOR   0x00000080

this is an actor

Definition at line 50 of file cl_renderer.h.

Referenced by CL_AddActor(), and CL_AddUGV().

#define RF_ALLIED   0x00000040

actor in an allied team (controlled by another player)

Definition at line 49 of file cl_renderer.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

#define RF_ARROW   0x02000000

arrow, debugging only

Definition at line 42 of file cl_renderer.h.

Referenced by CL_AddArrow(), R_DrawEntities(), and R_DrawSpecialEntities().

#define RF_BLOOD   0x00000008

blood (when dead) for this entity

Definition at line 46 of file cl_renderer.h.

Referenced by CL_AddActor(), and R_DrawEntityEffects().

#define RF_BOX   0x00000002

actor selection box

Definition at line 40 of file cl_renderer.h.

Referenced by CL_AddEdictFunc(), CL_AddTargetingBox(), R_DrawEntities(), R_DrawEntityEffects(), and R_DrawSpecialEntities().

#define RF_IRGOGGLES   0x00000200

this is visible if the actor uses ir goggles

Definition at line 52 of file cl_renderer.h.

Referenced by CL_AddActor().

#define RF_MEMBER   0x00000020

actor in the same team

Definition at line 48 of file cl_renderer.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

#define RF_PATH   0x01000000

pathing marker, debugging only

Definition at line 41 of file cl_renderer.h.

Referenced by CL_AddPathingBox(), R_DrawEntities(), and R_DrawSpecialEntities().

#define RF_PULSE   0x00000100

glowing entity

Definition at line 51 of file cl_renderer.h.

Referenced by SP_misc_model().

#define RF_SELECTED   0x00000010

selected actor

Definition at line 47 of file cl_renderer.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

#define RF_SHADOW   0x00000004

the following ent flags also draw entity effects shadow (when living) for this entity

Definition at line 45 of file cl_renderer.h.

Referenced by CL_AddActor(), CL_AddUGV(), and R_DrawEntityEffects().

#define RF_TRANSLUCENT   0x00000001

entity->flags (render flags)

Definition at line 39 of file cl_renderer.h.

Referenced by R_DrawEntities().

#define SUN_RADIUS   1024.0f

Definition at line 56 of file cl_renderer.h.

#define VID_NORM_HEIGHT   768
#define VID_NORM_WIDTH   1024
#define WEATHER_FOG   1

Definition at line 59 of file cl_renderer.h.

Referenced by R_EnableFog().

#define WEATHER_NONE   0

Definition at line 58 of file cl_renderer.h.

Referenced by CL_ViewLoadMedia().


Typedef Documentation

typedef enum artType_s artType_t

particle art type

typedef struct corona_s corona_t

coronas are soft, alpha-blended, rounded polys

typedef struct ptl_s ptl_t
typedef struct ptlArt_s ptlArt_t
typedef struct ptlCmd_s ptlCmd_t
typedef struct ptlDef_s ptlDef_t
typedef struct sustain_s sustain_t

sustains are light flashes which slowly decay


Enumeration Type Documentation

enum artType_s

particle art type

Enumerator:
ART_PIC 
ART_MODEL 

Definition at line 126 of file cl_renderer.h.

Enumerator:
LONGLINES_WRAP 
LONGLINES_CHOP 
LONGLINES_PRETTYCHOP 
LONGLINES_LAST 

Definition at line 237 of file cl_renderer.h.

Enumerator:
THREAD_DEAD 
THREAD_IDLE 
THREAD_CLIENT 
THREAD_BSP 
THREAD_RENDERER 

Definition at line 229 of file cl_renderer.h.


Function Documentation

void R_Color ( const vec4_t  rgba  ) 
int R_FontDrawString ( const char *  fontId,
align_t  align,
int  x,
int  y,
int  absX,
int  maxWidth,
int  lineHeight,
const char *  c,
int  boxHeight,
int  scrollPos,
int *  curLine,
longlines_t  method 
)
Parameters:
[in] fontId the font id (defined in ufos/fonts.ufo)
[in] x Current x position (may differ from absX due to tabs e.g.)
[in] y Current y position (may differ from absY due to linebreaks)
[in] absX Absolute x value for this string
[in] absY Absolute y value for this string
[in] maxWidth Max width - relative from absX
[in] lineHeight The lineheight of that node
[in] c The string to draw
[in] scrollPos Starting line in this node (due to scrolling)
[in] curLine Current line (see lineHeight)
Note:
the x, y, width and height values are all normalized here - don't use the viddef settings for drawstring calls - make them all relative to VID_NORM_WIDTH and VID_NORM_HEIGHT
Todo:
This could be replaced with a set of much simpler interfaces.

Definition at line 675 of file r_font.c.

References chunk(), wrapCache_s::chunkIdx, i, chunkCache_t::linenum, wrapCache_s::numChunks, wrapCache_s::numLines, R_FontDrawTexture(), R_FontGenerateTexture(), R_FontWrapText(), R_GetFont(), chunkCache_t::texnum, chunkCache_t::texsize, and chunkCache_t::width.

Referenced by UI_BaseInventoryNodeDraw2(), and UI_DrawString().

void R_FontInit ( void   ) 

Definition at line 713 of file r_font.c.

References Com_Error(), Com_Printf(), ERR_FATAL, numChunks, numFonts, and numWraps.

Referenced by CL_NewLanguage(), and R_Init().

void R_FontRegister ( const char *  name,
int  size,
const char *  path,
const char *  style 
)

Definition at line 741 of file r_font.c.

References i, NUM_FONT_STYLES, Q_strcasecmp, R_FontAnalyze(), and fontRenderStyle_t::renderStyle.

Referenced by UI_RegisterFont().

void R_FontSetTruncationMarker ( const char *  marker  ) 

Definition at line 112 of file r_font.c.

References Q_strncpyz(), and truncmarker.

Referenced by CL_NewLanguage().

void R_FontShutdown ( void   ) 

frees the SDL_ttf fonts

See also:
R_FontCleanCache

Definition at line 146 of file r_font.c.

References FS_FreeFile(), i, numFonts, and R_FontCleanCache().

Referenced by CL_NewLanguage(), and R_Shutdown().

void R_FontTextSize ( const char *  fontId,
const char *  text,
int  maxWidth,
longlines_t  method,
int *  width,
int *  height,
int *  lines,
qboolean isTruncated 
)

Supply information about the size of the text when it is linewrapped and rendered, without actually rendering it. Any of the output parameters may be NULL.

Parameters:
[out] width receives width in pixels of the longest line in the text
[out] height receives height in pixels when rendered with standard line height
[out] lines receives total number of lines in text, including blank ones

Definition at line 523 of file r_font.c.

References wrapCache_s::chunkIdx, font_s::height, i, font_s::lineSkip, wrapCache_s::numChunks, wrapCache_s::numLines, R_FontWrapText(), R_GetFont(), chunkCache_t::truncated, and chunkCache_t::width.

Referenced by HUD_DrawMouseCursorText(), HUD_UpdateCursor(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_DrawNotice(), UI_DrawTooltip(), UI_MessageGetLines(), UI_StringNodeDrawTooltip(), UI_TabNodeDraw(), UI_TabNodeTabAtPosition(), and UI_TextNodeDrawText().

void R_LoadImage ( const char *  name,
byte **  pic,
int *  width,
int *  height 
)

Generic image-data loading fucntion.

Parameters:
[in] name (Full) pathname to the image to load. Extension (if given) will be ignored.
[out] pic Image data.
[out] width Width of the loaded image.
[out] height Height of the loaded image.
See also:
R_FindImage

Definition at line 141 of file r_image.c.

References Com_Error(), Com_StripExtension(), ERR_FATAL, Img_LoadImage(), MAX_QPATH, Mem_PoolAlloc, and vid_imagePool.

Referenced by MAP_Init().

void R_ModBeginLoading ( const char *  tiles,
qboolean  day,
const char *  pos,
const char *  mapName 
)

Specifies the model that will be used as the world.

Parameters:
[in] tiles The tiles string can be only one map or a list of space seperated map tiles for random assembly. In case of random assembly we also need the pos string. Every tile needs an entry in the pos string, too.
[in] day Load the day lightmap
[in] pos In case of a random map assembly this is the string that holds the world grid positions of the tiles. The positions are x, y and z values. They are just written one after another for every tile in the tiles string and every of the three components must exists for every tile.
[in] mapName The mapname that the get from the server (used to identify the correct name for the materials in case of a random assembly).
See also:
R_ModAddMapTile
CM_LoadMap
Note:
This function is called for listen servers, too. This loads the bsp struct for rendering it. The CM_LoadMap code only loads the collision and pathfinding stuff.
See also:
UI_BuildRadarImageList

Definition at line 1017 of file r_model_brush.c.

References Com_Error(), Com_Parse(), Com_sprintf(), ERR_DROP, i, MAX_QPATH, MAX_VAR, name, PATHFINDING_HEIGHT, PATHFINDING_WIDTH, Q_strncpyz(), R_BeginBuildingLightmaps(), R_ClearActiveLights(), R_FreeWorldImages(), R_ModAddMapTile(), R_ModEndLoading(), r_numMapTiles, and r_numModelsInline.

Referenced by CL_ViewLoadMedia().

const image_t* R_RegisterImage ( const char *  name  ) 

Searches for an image in the image array.

Parameters:
[in] name The name of the image relative to pics/
Note:
name may not be null and has to be longer than 4 chars
Returns:
NULL on error or image_t pointer on success
See also:
R_FindImage

Definition at line 195 of file r_draw.c.

References it_pic, R_FindImage(), r_noTexture, and va().

Referenced by CL_ParticleLoadArt(), and SEQ_ExecutePrecache().

struct model_s* R_RegisterModelShort ( const char *  name  )  [read]

Tries to load a model.

Parameters:
[in] name The model path or name (with or without extension) - see notes this parameter is always relativ to the game base dir - it can also be relative to the models/ dir in the game folder
Note:
trying all supported model formats is only supported when you are using a name without extension and relative to models/ dir
if first char of name is a '*' - this is an inline model
if there is not extension in the given filename the function will try to load one of the supported model formats
Returns:
NULL if no model could be found with the given name, model_t otherwise

Definition at line 197 of file r_model.c.

References Com_Printf(), Com_sprintf(), i, MAX_QPATH, mod_extensions, qfalse, and R_ModForName().

Referenced by CL_AddBrushModel(), CL_ParseConfigString(), CL_ParticleLoadArt(), CL_PrecacheCharacterModels(), CL_ViewLoadMedia(), CL_ViewPrecacheModels(), LM_Register(), R_Draw2DMapMarkers(), R_Draw3DMapMarkers(), R_DrawModelDirect(), SEQ_ExecuteModel(), SEQ_ExecutePrecache(), UI_DrawModelNode(), and UI_DrawModelNodeWithUIModel().

void R_SwitchModelMemPoolTag ( void   ) 

After all static models are loaded, switch the pool tag for these models to not free them everytime R_ShutdownModels is called.

See also:
CL_InitAfter
R_FreeWorldImages

Definition at line 228 of file r_model.c.

References model_s::alias, Com_Printf(), i, it_static, Mem_ChangeTag, MEM_TAG_STATIC_MODELS, mAliasModel_s::meshes, model_s::name, mAliasModel_s::num_meshes, mAliasMesh_s::num_skins, r_noTexture, r_numModels, r_numModelsStatic, mAliasSkin_s::skin, mAliasMesh_s::skins, image_s::type, and vid_modelPool.

Referenced by CL_ViewPrecacheModels().


Variable Documentation

Definition at line 32 of file r_thread.c.

Referenced by CL_ViewRender(), R_RenderFrame(), and SCR_TimeRefresh_f().


Generated by  doxygen 1.6.2