[renderer] Support multiple entity queues

While there's currently only the one still, this will allow the entities
to be multiply queued for multi-pass rendering (eg, shadows). As the
avoidance of putting an entity in the same queue more than once relies
on the entity id, all entities now come from the scene (which is stored
in cl_world in the client code for nq and qw), thus the extensive
changes in the clients.
This commit is contained in:
Bill Currie 2022-03-05 01:48:10 +09:00
parent 6573acbc74
commit d69355f521
53 changed files with 741 additions and 618 deletions

View file

@ -31,9 +31,16 @@
#ifndef __client_entities_h
#define __client_entities_h
#include "QF/darray.h"
#include "QF/msg.h"
#include "QF/qtypes.h"
#include "QF/simd/types.h"
typedef struct entitystateset_s DARRAY_TYPE (struct entity_state_s)
entitystateset_t;
extern entitystateset_t cl_static_entities;
// entity_state_t is the information conveyed from the server
// in an update message
typedef struct entity_state_s {

View file

@ -96,15 +96,12 @@ typedef enum TE_qwEffect {
//FIXME find a better way to get this info from the parser
typedef struct TEntContext_s {
vec4f_t simorg;
struct model_s *worldModel;
int playerEntity;
} TEntContext_t;
struct msg_s;
struct entity_s;
extern struct scene_s *cl_scene;
void CL_TEnts_Init (void);
void CL_Init_Entity (struct entity_s *ent);
void CL_ClearTEnts (void);

70
include/client/world.h Normal file
View file

@ -0,0 +1,70 @@
/*
world.h
Client world scene management
Copyright (C) 2022 Bill Currie <bill@taniwha.org>
Author: Bill Currie <bill@taniwha.org>
Date: 2022/3/4
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#ifndef __client_world_h
#define __client_world_h
#include "QF/darray.h"
#include "QF/msg.h"
#include "QF/qtypes.h"
#include "QF/simd/types.h"
typedef struct modelset_s DARRAY_TYPE (struct model_s *) modelset_t;
typedef struct worldscene_s {
struct scene_s *scene;
struct plitem_s *edicts;
struct plitem_s *worldspawn;
struct model_s *worldmodel;
modelset_t models;
} worldscene_t;
extern worldscene_t cl_world;
struct msg_s;
struct entity_state_s;
void CL_World_Init (void);
// PROTOCOL_FITZQUAKE -- flags for entity baseline messages
#define B_LARGEMODEL (1<<0) // modelindex is short instead of byte
#define B_LARGEFRAME (1<<1) // frame is short instead of byte
#define B_ALPHA (1<<2) // 1 byte, uses ENTALPHA_ENCODE, not sent if ENTALPHA_DEFAULT
void CL_ParseBaseline (struct msg_s *msg, struct entity_state_s *baseline,
int version);
/*
Static entities are non-interactive world objects like torches
*/
void CL_ParseStatic (struct msg_s *msg, int version);
void CL_MapCfg (const char *mapname);
void CL_World_NewMap (const char *mapname, const char *skyname);
#endif//__client_world_h