41#define MAX_DATA_LENGTH 512
43struct sequenceContext_s;
51typedef struct seqCmd_s {
57typedef struct sequence_s {
63typedef struct seqCamera_s {
77typedef struct seqEnt_s {
97typedef struct seq2D_s {
117#define MAX_SEQCMDS 768
118#define MAX_SEQUENCES 32
119#define MAX_SEQENTS 128
120#define MAX_SEQ2DS 128
135typedef struct sequenceContext_s {
221 if (!context->
size[0] || !context->
size[1])
369 s2d->
pos[1] += height;
373 for (
int j = 0; j < 4; j++) {
375 if (s2d->
color[j] < 0.0)
377 else if (s2d->
color[j] > 1.0)
380 for (
int j = 0; j < 2; j++) {
394 if (s2d->
image[0] !=
'\0') {
412 int maxWidth = (
int) s2d->
size[0];
439 context->
pos[0] = pos[0];
440 context->
pos[1] = pos[1];
489 if (context->
time >
cl.time) {
498 while (context->
time <=
cl.time) {
520 if (!context->
size[0] || !context->
size[1])
575 context->
time += 1000;
689 if (se->
model ==
nullptr)
692 if (se->
model ==
nullptr)
750 for (
i = 0;
i < 4;
i++)
838#define SEQ_NUMCMDS lengthof(seqCmdName)
880 const char* errhead =
"CL_ParseSequence: unexpected end of file (sequence ";
889 Com_Printf(
"CL_ParseSequence: sequence def \"%s\" with same name found, second ignored\n",
name);
905 if (!*text || *token !=
'{') {
906 Com_Printf(
"CL_ParseSequence: sequence def \"%s\" without body ignored\n",
name);
952 if (maxLength <= 0) {
962 else if (*token ==
'}')
966 data += strlen(token) + 1;
967 maxLength -= (strlen(token) + 1);
970 }
else if (*token ==
'(') {
977 for (
linkedList_t* element = list; element !=
nullptr; element = element->
next) {
978 if (maxLength <= 0) {
982 const char*
v = (
char*)element->data;
984 data += strlen(
v) + 1;
985 maxLength -= (strlen(
v) + 1);
992 Com_Printf(
"CL_ParseSequence: unknown command \"%s\" ignored (sequence %s)\n", token,
name);
const char * CL_Translate(const char *t)
memPool_t * cl_genericPool
void R_Color(const vec4_t rgba)
Change the color to given value.
static int SEQ_ExecuteObj2D(sequenceContext_t *context, const char *name, const char *data)
Parse 2D objects like text and images.
bool SEQ_InitContext(sequenceContext_t *context, const char *name)
Initialize a sequence context from data of a named script sequence.
static void SEQ_SetCamera(sequenceContext_t *context)
Set the camera values for a sequence.
void CL_ParseSequence(const char *name, const char **text)
Reads the sequence values from given text-pointer.
static const value_t seq2D_vals[]
valid id names for 2d entity
static int SEQ_ExecuteDelete(sequenceContext_t *context, const char *name, const char *data)
Removed a sequence entity from the current sequence.
static sequenceHandler_t seqCmdFunc[]
Function to exeute all available commands.
static const value_t seqEnt_vals[]
valid entity names for a sequence
void SEQ_SendClickEvent(sequenceContext_t *context)
Unlock a click event for the current sequence or ends the current sequence if not locked.
void SEQ_FreeContext(sequenceContext_t *context)
Free a sequence context.
static int SEQ_ExecuteMusic(sequenceContext_t *context, const char *name, const char *data)
Changes the music in the sequence.
static int SEQ_ExecuteAnimSpeed(sequenceContext_t *context, const char *name, const char *data)
Set the animation speed, default value is 1000.
void SEQ_SetView(sequenceContext_t *context, vec2_t pos, vec2_t size)
Define the position of the viewport on the screen.
static const value_t seqCamera_vals[]
valid id names for camera
static int SEQ_ExecuteWait(sequenceContext_t *context, const char *name, const char *data)
Increase the sequence time.
static int SEQ_ExecuteClick(sequenceContext_t *context, const char *name, const char *data)
Wait until someone clicks with the mouse.
static void SEQ_Render3D(sequenceContext_t *context)
static int CL_FindSequenceCommand(const char *commandName)
static void SEQ_StopSequence(sequenceContext_t *context)
static seqEnt_t * SEQ_FindEnt(sequenceContext_t *context, const char *name)
Finds a given entity in all sequence entities.
static int SEQ_ExecuteCamera(sequenceContext_t *context, const char *name, const char *data)
Parse the values for the camera like given in seqCamera.
static char const *const seqCmdName[]
int(* sequenceHandler_t)(struct sequenceContext_s *context, const char *name, const char *data)
execution function of a command
static int SEQ_ExecuteSound(sequenceContext_t *context, const char *name, const char *data)
Plays a sound in a sequence.
sequenceContext_t * SEQ_AllocContext(void)
Allocate a sequence context.
static int SEQ_ExecuteModel(sequenceContext_t *context, const char *name, const char *data)
Parse values for a sequence model.
static bool SEQ_Execute(sequenceContext_t *context)
Move the sequence to the right position according to the current time.
static void SEQ_Render2D(sequenceContext_t *context, bool backgroundObjects)
Renders text and images.
static sequence_t sequences[MAX_SEQUENCES]
static seqCmd_t * seqCmds
static int SEQ_ExecuteCommand(sequenceContext_t *context, const char *name, const char *data)
Executes a sequence command.
static int SEQ_ExecutePrecache(sequenceContext_t *context, const char *name, const char *data)
Precaches the models and images for a sequence.
bool SEQ_Render(sequenceContext_t *context)
Execute and render a sequence.
static seq2D_t * SEQ_Find2D(sequenceContext_t *context, const char *name)
Finds a given 2d object in the current sequence data.
void CL_ViewUpdateRenderData(void)
Updates the refdef.
void CL_ViewCalcFieldOfViewX(void)
Calculates refdef's FOV_X. Should generally be called after any changes are made to the zoom level (v...
Primary header for client.
void Cbuf_AddText(const char *format,...)
Adds command text at the end of the buffer.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Error(int code, const char *fmt,...)
void Com_Printf(const char *const fmt,...)
cvar_t * Cvar_Set(const char *varName, const char *value,...)
Sets a cvar value.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
void LIST_Delete(linkedList_t **list)
void VectorMA(const vec3_t veca, const float scale, const vec3_t vecb, vec3_t outVector)
Sets vector_out (vc) to vevtor1 (va) + scale * vector2 (vb).
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Create the rotation matrix in order to rotate something.
#define Mem_PoolAllocTypeN(type, n, pool)
#define Mem_PoolStrDupTo(in, out, pool, tagNum)
#define Mem_AllocType(type)
const char * Com_Parse(const char *data_p[], char *target, size_t size, bool replaceWhitespaces)
Parse a token out of a string.
void Com_UnParseLastToken(void)
Put back the last token into the parser The next call of Com_Parse will return the same token again.
Shared parsing functions.
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_DrawImage(float x, float y, const image_t *image)
Draws an image or parts of it.
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.
int R_AddEntity(const entity_t *ent)
Adds a copy of the specified entity to the list of all known render entities.
entity_t * R_GetFreeEntity(void)
Get the next free entry in the entity list (the last one).
void R_EntitySetOrigin(entity_t *ent, const vec3_t origin)
setter for entity origin
QGL_EXTERN int GLboolean GLfloat * v
QGL_EXTERN GLsizei const GLvoid * data
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
image_t * R_FindImage(const char *pname, imagetype_t type)
Finds or loads the given image.
const image_t * R_FindPics(const char *name)
Searches for an image in the image array.
void R_AnimRun(animState_t *as, const model_t *mod, int msec)
Run the animation of the given model.
void R_AnimChange(animState_t *as, const model_t *mod, const char *name)
Changes the animation for md2 models.
void R_PopMatrix(void)
Removes the current matrix from the stack.
void R_PushMatrix(void)
Push a new matrix to the stack.
model_t * R_FindModel(const char *name)
Tries to load a model.
void S_StartLocalSample(const char *s, float volume)
Plays a sample without spatialization.
#define SND_VOLUME_DEFAULT
const char * Com_EParse(const char **text, const char *errhead, const char *errinfo, char *target, size_t size)
Parsing function that prints an error message when there is no text in the buffer.
bool Com_ParseList(const char **text, linkedList_t **list)
int Com_EParseValue(void *base, const char *token, valueTypes_t type, int ofs, size_t size)
align_t
We need this here for checking the boundaries from script values.
T & Com_GetValue(void *const object, value_t const *const value)
#define MEMBER_SIZEOF(TYPE, MEMBER)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
Represents a text object or image object.
sequenceHandler_t handler
char data[MAX_DATA_LENGTH]
seq2D_t obj2Ds[MAX_SEQ2DS]
seqEnt_t ents[MAX_SEQENTS]
int UI_DrawString(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, bool increaseLine, longlines_t method)
void UI_Transform(const vec3_t transform, const vec3_t rotate, const vec3_t scale)
Pushes a new matrix, normalize to current resolution and move, rotate and scale the matrix to the giv...
#define VectorCopy(src, dest)
#define VectorSet(v, x, y, z)