|
|
1.1 root 1:
2: // refresh.h -- public interface to refresh functions
3:
4: #define MAXCLIPPLANES 11
5:
6: #define TOP_RANGE 16 // soldier uniform colors
7: #define BOTTOM_RANGE 96
8:
9: //=============================================================================
10:
11: typedef struct efrag_s
12: {
13: struct mleaf_s *leaf;
14: struct efrag_s *leafnext;
15: struct entity_s *entity;
16: struct efrag_s *entnext;
17: } efrag_t;
18:
19:
20: typedef struct entity_s
21: {
22: qboolean forcelink; // model changed
23:
24: int update_type;
25:
26: entity_state_t baseline; // to fill in defaults in updates
27:
28: double msgtime; // time of last update
29: vec3_t msg_origins[2]; // last two updates (0 is newest)
30: vec3_t origin;
31: vec3_t msg_angles[2]; // last two updates (0 is newest)
32: vec3_t angles;
33: struct model_s *model; // NULL = no model
34: struct efrag_s *efrag; // linked list of efrags
35: int frame;
36: float syncbase; // for client-side animations
37: byte *colormap;
38: int effects; // light, particals, etc
39: int skinnum; // for Alias models
40: int visframe; // last frame this entity was
41: // found in an active leaf
42:
43: int dlightframe; // dynamic lighting
44: int dlightbits;
45:
46: // FIXME: could turn these into a union
47: int trivial_accept;
48: struct mnode_s *topnode; // for bmodels, first world node
49: // that splits bmodel, or NULL if
50: // not split
51: } entity_t;
52:
53: // !!! if this is changed, it must be changed in asm_draw.h too !!!
54: typedef struct
55: {
56: vrect_t vrect; // subwindow in video for refresh
57: // FIXME: not need vrect next field here?
58: vrect_t aliasvrect; // scaled Alias version
59: int vrectright, vrectbottom; // right & bottom screen coords
60: int aliasvrectright, aliasvrectbottom; // scaled Alias versions
61: float vrectrightedge; // rightmost right edge we care about,
62: // for use in edge list
63: float fvrectx, fvrecty; // for floating-point compares
64: float fvrectx_adj, fvrecty_adj; // left and top edges, for clamping
65: int vrect_x_adj_shift20; // (vrect.x + 0.5 - epsilon) << 20
66: int vrectright_adj_shift20; // (vrectright + 0.5 - epsilon) << 20
67: float fvrectright_adj, fvrectbottom_adj;
68: // right and bottom edges, for clamping
69: float fvrectright; // rightmost edge, for Alias clamping
70: float fvrectbottom; // bottommost edge, for Alias clamping
71: float horizontalFieldOfView; // at Z = 1.0, this many X is visible
72: // 2.0 = 90 degrees
73: float xOrigin; // should probably allways be 0.5
74: float yOrigin; // between be around 0.3 to 0.5
75:
76: vec3_t vieworg;
77: vec3_t viewangles;
78:
79: int ambientlight;
80: } refdef_t;
81:
82:
83: //
84: // refresh
85: //
86: extern int reinit_surfcache;
87:
88:
89: extern refdef_t r_refdef;
90: extern vec3_t r_origin, vpn, vright, vup;
91:
92: extern struct texture_s *r_notexture_mip;
93:
94:
95: void R_Init (void);
96: void R_InitTextures (void);
97: void R_InitEfrags (void);
98: void R_RenderView (void); // must set r_refdef first
99: void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect);
100: // called whenever r_refdef or vid change
101: void R_InitSky (struct texture_s *mt); // called at level load
102:
103: void R_AddEfrags (entity_t *ent);
104: void R_RemoveEfrags (entity_t *ent);
105:
106: void R_NewMap (void);
107:
108:
109: void R_ParseParticleEffect (void);
110: void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
111: void R_RocketTrail (vec3_t start, vec3_t end, int type);
112:
113: void R_EntityParticles (entity_t *ent);
114: void R_BlobExplosion (vec3_t org);
115: void R_ParticleExplosion (vec3_t org);
116: void R_LavaSplash (vec3_t org);
117: void R_TeleportSplash (vec3_t org);
118:
119: void R_PushDlights (void);
120:
121:
122: //
123: // surface cache related
124: //
125: extern int reinit_surfcache; // if 1, surface cache is currently empty and
126: extern qboolean r_cache_thrash; // set if thrashing the surface cache
127:
128: int D_SurfaceCacheForRes (int width, int height);
129: void D_FlushCaches (void);
130: void D_DeleteSurfaceCache (void);
131: void D_InitCaches (void *buffer, int size);
132: void R_SetVrect (vrect_t *pvrect, vrect_t *pvrectin, int lineadj);
133:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.