#define EF_SELECTABLE 16384 // LordHavoc: highlights when PRYDON_CLIENTCURSOR mouse is over it
#define EF_DOUBLESIDED 32768 //[515]: disable cull face for this entity
+#define EF_FLAG1QW 16777216 // internal client use only
+#define EF_FLAG2QW 33554432 // internal client use only
#define EF_STEP 0x80000000 // internal client use only - present on MOVETYPE_STEP entities, not QC accessible (too many bits)
// flags for the pflags field of entities
#define svc_hidelmp 36 // [string] slotname
#define svc_skybox 37 // [string] skyname
-// LordHavoc: my svc_ range, 50-59
-#define svc_cgame 50 // [short] length [bytes] data
+// LordHavoc: my svc_ range, 50-69
+#define svc_downloaddata 50 // [int] start [short] size
#define svc_updatestatubyte 51 // [byte] stat [byte] value
#define svc_effect 52 // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
#define svc_effect2 53 // [vector] org [short] modelindex [short] startframe [byte] framecount [byte] framerate
#define svc_entities 57 // [int] deltaframe [int] thisframe [float vector] eye [variable length] entitydata
#define svc_csqcentities 58 // [short] entnum [variable length] entitydata ... [short] 0x0000
#define svc_spawnstaticsound2 59 // [coord3] [short] samp [byte] vol [byte] aten
+#define svc_trailparticles 60 // [short] entnum [short] effectnum [vector] start [vector] end
+#define svc_pointparticles 61 // [short] effectnum [vector] start [vector] end [short] count
//
// client to server
// LordHavoc: my clc_ range, 50-59
#define clc_ackframe 50 // [int] framenumber
-#define clc_unusedlh1 51
+#define clc_ackdownloaddata 51 // [int] start [short] size (note: exact echo of latest values received in svc_downloaddata, packet-loss handling is in the server)
#define clc_unusedlh2 52
#define clc_unusedlh3 53
#define clc_unusedlh4 54
#define RENDER_COLORMAPPED 32
#define RENDER_SHADOW 65536 // cast shadow
#define RENDER_LIGHT 131072 // receive light
-#define RENDER_TRANSPARENT 262144 // can't light during opaque stage
-#define RENDER_NOCULLFACE 524288 // render as double sided (disable GL_CULL_FACE)
+#define RENDER_NOSELFSHADOW 262144 // render lighting on this entity before its own shadow is added to the scene
+// (note: all RENDER_NOSELFSHADOW entities are grouped together and rendered in a batch before their shadows are rendered, so they can not shadow eachother either)
-// this is 88 bytes
+// this is 96 bytes
typedef struct entity_state_s
{
// ! means this is not sent to client
double time; // ! time this state was built (used on client for interpolation)
+ float netcenter[3]; // ! for network prioritization, this is the center of the bounding box (which may differ from the origin)
float origin[3];
float angles[3];
int number; // entity number this state is for
unsigned char tagindex;
unsigned char colormod[3];
// padding to a multiple of 8 bytes (to align the double time)
- unsigned char unused[6];
+ unsigned char unused[2];
}
entity_state_t;
#define qw_clc_upload 7 // teleport request, spectator only
// QUAKEWORLD
// playerinfo flags from server
-// playerinfo allways sends: playernum, flags, origin[] and framenumber
-#define PF_MSEC (1<<0)
-#define PF_COMMAND (1<<1)
-#define PF_VELOCITY1 (1<<2)
-#define PF_VELOCITY2 (1<<3)
-#define PF_VELOCITY3 (1<<4)
-#define PF_MODEL (1<<5)
-#define PF_SKINNUM (1<<6)
-#define PF_EFFECTS (1<<7)
-#define PF_WEAPONFRAME (1<<8) // only sent for view player
-#define PF_DEAD (1<<9) // don't block movement any more
-#define PF_GIB (1<<10) // offset the view height differently
-#define PF_NOGRAV (1<<11) // don't apply gravity for prediction
+// playerinfo always sends: playernum, flags, origin[] and framenumber
+#define QW_PF_MSEC (1<<0)
+#define QW_PF_COMMAND (1<<1)
+#define QW_PF_VELOCITY1 (1<<2)
+#define QW_PF_VELOCITY2 (1<<3)
+#define QW_PF_VELOCITY3 (1<<4)
+#define QW_PF_MODEL (1<<5)
+#define QW_PF_SKINNUM (1<<6)
+#define QW_PF_EFFECTS (1<<7)
+#define QW_PF_WEAPONFRAME (1<<8) // only sent for view player
+#define QW_PF_DEAD (1<<9) // don't block movement any more
+#define QW_PF_GIB (1<<10) // offset the view height differently
+#define QW_PF_NOGRAV (1<<11) // don't apply gravity for prediction
// QUAKEWORLD
// if the high bit of the client to server byte is set, the low bits are
// client move cmd bits
#define QW_TE_TELEPORT 11
#define QW_TE_BLOOD 12
#define QW_TE_LIGHTNINGBLOOD 13
+// QUAKEWORLD
+// effect flags
+#define QW_EF_BRIGHTFIELD 1
+#define QW_EF_MUZZLEFLASH 2
+#define QW_EF_BRIGHTLIGHT 4
+#define QW_EF_DIMLIGHT 8
+#define QW_EF_FLAG1 16
+#define QW_EF_FLAG2 32
+#define QW_EF_BLUE 64
+#define QW_EF_RED 128
+
+#define QW_UPDATE_BACKUP 64
+#define QW_UPDATE_MASK (QW_UPDATE_BACKUP - 1)
+#define QW_MAX_PACKET_ENTITIES 64
+
+// note: QW stats are directly compatible with NQ
+// (but FRAGS, WEAPONFRAME, and VIEWHEIGHT are unused)
+// so these defines are not actually used by darkplaces, but kept for reference
+#define QW_STAT_HEALTH 0
+//#define QW_STAT_FRAGS 1
+#define QW_STAT_WEAPON 2
+#define QW_STAT_AMMO 3
+#define QW_STAT_ARMOR 4
+//#define QW_STAT_WEAPONFRAME 5
+#define QW_STAT_SHELLS 6
+#define QW_STAT_NAILS 7
+#define QW_STAT_ROCKETS 8
+#define QW_STAT_CELLS 9
+#define QW_STAT_ACTIVEWEAPON 10
+#define QW_STAT_TOTALSECRETS 11
+#define QW_STAT_TOTALMONSTERS 12
+#define QW_STAT_SECRETS 13 // bumped on client side by svc_foundsecret
+#define QW_STAT_MONSTERS 14 // bumped by svc_killedmonster
+#define QW_STAT_ITEMS 15
+//#define QW_STAT_VIEWHEIGHT 16
+
+// build entity data in this, to pass to entity read/write functions
+typedef struct entityframeqw_snapshot_s
+{
+ double time;
+ qboolean invalid;
+ int num_entities;
+ entity_state_t entities[QW_MAX_PACKET_ENTITIES];
+}
+entityframeqw_snapshot_t;
+
+typedef struct entityframeqw_database_s
+{
+ entityframeqw_snapshot_t snapshot[QW_UPDATE_BACKUP];
+}
+entityframeqw_database_t;
+
+entityframeqw_database_t *EntityFrameQW_AllocDatabase(mempool_t *pool);
+void EntityFrameQW_FreeDatabase(entityframeqw_database_t *d);
+void EntityStateQW_ReadPlayerUpdate(void);
+void EntityFrameQW_CL_ReadFrame(qboolean delta);
#endif