UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_renderer.h
Go to the documentation of this file.
1
4
5/*
6All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27#include "renderer/r_image.h"
28#include "renderer/r_model.h"
29#include "renderer/r_program.h"
30
31#include <SDL.h>
32
33/* e.g. used for sequences and particle editor */
34#define RDF_NOWORLDMODEL 1
35#define RDF_IRGOGGLES 2
36
37#define WEATHER_NONE 0
38#define WEATHER_FOG 1
39
40#define VID_NORM_WIDTH 1024
41#define VID_NORM_HEIGHT 768
42
43#define MAX_PTL_ART 1024
44#define MAX_PTLS 2048
45
47typedef struct corona_s {
49 float radius;
51} corona_t;
52
53#define MAX_CORONAS 128
54
55#define MAX_GL_LIGHTS 8
56
57typedef struct {
59 const char* name;
60
61 float* origin;
62 float* angles;
63 float* scale;
64 float* center;
65
67 float backlerp;
68
69 int skin;
70 int mesh;
71 float* color;
73
74typedef struct ptlCmd_s {
75 byte cmd;
76 byte type;
77 int ref;
79} ptlCmd_t;
80
89
91typedef enum artType_s {
94} artType_t;
95
96typedef struct ptlArt_s {
97 char name[MAX_VAR];
98 int frame;
99 int skin;
100 union {
103 } art;
105} ptlArt_t;
106
167
205
207
208/* threading state */
216
224
225typedef struct renderer_threadstate_s {
226 SDL_Thread* thread;
229
231
232void R_Color(const vec4_t rgba);
233
234void R_ModBeginLoading(const char* tiles, bool day, const char* pos, const char* mapName, const char* mapZone);
235void R_SwitchModelMemPoolTag(void);
236
237void R_LoadImage(const char* name, byte** pic, int* width, int* height);
238
239void R_FontShutdown(void);
240void R_FontInit(void);
241void R_FontRegister(const char* name, int size, const char* path, const char* style);
242void R_FontSetTruncationMarker(const char* marker);
243
244void R_FontTextSize(const char* fontId, const char* text, int maxWidth, longlines_t method, int* width, int* height, int* lines, bool* isTruncated);
245int 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);
threadstate_t
@ THREAD_DEAD
@ THREAD_RENDERER
@ THREAD_IDLE
@ THREAD_BSP
@ THREAD_CLIENT
void R_FontInit(void)
Definition r_font.cpp:716
void R_FontTextSize(const char *fontId, const char *text, int maxWidth, longlines_t method, int *width, int *height, int *lines, bool *isTruncated)
Supply information about the size of the text when it is linewrapped and rendered,...
Definition r_font.cpp:522
longlines_t
@ LONGLINES_WRAP
@ LONGLINES_LAST
@ LONGLINES_CHOP
@ LONGLINES_PRETTYCHOP
void R_FontSetTruncationMarker(const char *marker)
Definition r_font.cpp:112
void R_SwitchModelMemPoolTag(void)
After all static models are loaded, switch the pool tag for these models to not free them everytime R...
Definition r_model.cpp:299
renderer_threadstate_t r_threadstate
Definition r_thread.cpp:34
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)
Definition r_font.cpp:681
void R_FontRegister(const char *name, int size, const char *path, const char *style)
Definition r_font.cpp:744
void R_ModBeginLoading(const char *tiles, bool day, const char *pos, const char *mapName, const char *mapZone)
Specifies the model that will be used as the world.
void R_LoadImage(const char *name, byte **pic, int *width, int *height)
Generic image-data loading fucntion.
Definition r_image.cpp:152
#define MAX_GL_LIGHTS
Definition cl_renderer.h:55
void R_FontShutdown(void)
frees the SDL_ttf fonts
Definition r_font.cpp:144
rendererData_t refdef
Definition r_main.cpp:45
#define MAX_CORONAS
Definition cl_renderer.h:53
void R_Color(const vec4_t rgba)
Change the color to given value.
Definition r_state.cpp:1011
artType_t
particle art type
Definition cl_renderer.h:91
@ ART_MODEL
Definition cl_renderer.h:93
@ ART_PIC
Definition cl_renderer.h:92
voidpf void uLong size
Definition ioapi.h:42
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
#define MAX_STATIC_LIGHTS
Definition r_light.h:47
Brush model header file.
style_t
Definition scripts.h:124
align_t
We need this here for checking the boundaries from script values.
Definition scripts.h:89
blend_t
Definition scripts.h:113
fade_t
Definition scripts.h:135
#define MAX_VAR
Definition shared.h:36
coronas are soft, alpha-blended, rounded polys
Definition cl_renderer.h:47
vec3_t color
Definition cl_renderer.h:50
vec3_t org
Definition cl_renderer.h:48
float radius
Definition cl_renderer.h:49
a light source
Definition r_light.h:29
float * origin
Definition cl_renderer.h:61
float * center
Definition cl_renderer.h:64
float * angles
Definition cl_renderer.h:62
float backlerp
Definition cl_renderer.h:67
const char * name
Definition cl_renderer.h:59
float * color
Definition cl_renderer.h:71
model_t * model
Definition cl_renderer.h:58
float * scale
Definition cl_renderer.h:63
bool hitSolid
vec3_t scale
vec3_t offset
vec4_t color
bool physics
float fps
struct ptl_s * parent
float lightIntensity
ptlArt_t * model
vec2_t size
float t
bool stick
ptlArt_t * pic
vec3_t lightColor
vec3_t angles
vec3_t oldV
vec3_t a
float lastFrame
bool invis
int rounds
bool weather
float scrollT
fade_t frameFade
vec3_t s
struct ptl_s * next
blend_t blend
float dt
vec3_t v
int endFrame
int skin
bool autohide
bool stayalive
bool bounce
int levelFlags
bool inuse
float tps
int roundsCnt
float scrollS
int frame
ptlDef_t * ctrl
style_t style
struct ptl_s * children
float lightSustain
fade_t thinkFade
vec3_t origin
float lastThink
float life
r_program_t * program
vec3_t omega
int startTime
const image_t * image
char name[MAX_VAR]
Definition cl_renderer.h:97
artType_t type
model_t * model
byte type
Definition cl_renderer.h:76
ptlCmd_t * run
Definition cl_renderer.h:84
ptlCmd_t * think
Definition cl_renderer.h:85
ptlCmd_t * round
Definition cl_renderer.h:86
ptlCmd_t * init
Definition cl_renderer.h:83
char name[MAX_VAR]
Definition cl_renderer.h:82
ptlCmd_t * physics
Definition cl_renderer.h:87
corona_t coronas[MAX_CORONAS]
light_t staticLights[MAX_STATIC_LIGHTS]
light_t dynamicLights[MAX_GL_LIGHTS]
vec4_t ambientColor
vec4_t sunSpecularColor
vec4_t modelAmbientColor
vec4_t sunDiffuseColor
mapTiles_t * mapTiles
struct entity_s * traceEntity
static const char * mapName
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec4_t[4]
Definition ufotypes.h:40
vec_t vec2_t[2]
Definition ufotypes.h:38