client.h gone from gl_rlight.c and sw_rlight.c.
cl_lightstyle -> r_lightstyle
This commit is contained in:
parent
f38a233786
commit
a9c9a46c37
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
qdefs.h
|
qdefs.h
|
||||||
|
|
||||||
(description)
|
ewww. this whole thing is a giant FIXME
|
||||||
|
|
||||||
Copyright (C) 1996-1997 Id Software, Inc.
|
Copyright (C) 1996-1997 Id Software, Inc.
|
||||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||||
|
|
|
@ -32,11 +32,13 @@
|
||||||
#include "QF/cvar.h"
|
#include "QF/cvar.h"
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/model.h"
|
#include "QF/model.h"
|
||||||
|
#include "QF/qdefs.h" // FIXME
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
|
|
||||||
// dynamic lights ===========================================================
|
// dynamic lights ===========================================================
|
||||||
|
|
||||||
#define MAX_DLIGHTS 32
|
#define MAX_DLIGHTS 32
|
||||||
|
|
||||||
typedef struct dlight_s
|
typedef struct dlight_s
|
||||||
{
|
{
|
||||||
int key; // so entities can reuse same entry
|
int key; // so entities can reuse same entry
|
||||||
|
@ -48,8 +50,17 @@ typedef struct dlight_s
|
||||||
float color[3]; // Don't use alpha --KB
|
float color[3]; // Don't use alpha --KB
|
||||||
} dlight_t;
|
} dlight_t;
|
||||||
|
|
||||||
|
// FIXME client_state_t should hold all pieces of the client state
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int length;
|
||||||
|
char map[MAX_STYLESTRING];
|
||||||
|
} lightstyle_t;
|
||||||
|
|
||||||
extern dlight_t r_dlights[MAX_DLIGHTS];
|
extern dlight_t r_dlights[MAX_DLIGHTS];
|
||||||
|
|
||||||
|
extern lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
|
||||||
|
|
||||||
//===============
|
//===============
|
||||||
|
|
||||||
#define TOP_RANGE 16 // soldier uniform colors
|
#define TOP_RANGE 16 // soldier uniform colors
|
||||||
|
|
|
@ -58,12 +58,6 @@ typedef struct usercmd_s
|
||||||
#endif
|
#endif
|
||||||
} usercmd_t;
|
} usercmd_t;
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
char map[MAX_STYLESTRING];
|
|
||||||
} lightstyle_t;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char name[MAX_SCOREBOARDNAME];
|
char name[MAX_SCOREBOARDNAME];
|
||||||
|
@ -281,7 +275,6 @@ extern client_state_t cl;
|
||||||
// FIXME, allocate dynamically
|
// FIXME, allocate dynamically
|
||||||
extern entity_t cl_entities[MAX_EDICTS];
|
extern entity_t cl_entities[MAX_EDICTS];
|
||||||
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
||||||
extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -88,7 +88,6 @@ entity_t cl_entities[MAX_EDICTS];
|
||||||
entity_state_t cl_baselines[MAX_EDICTS];
|
entity_state_t cl_baselines[MAX_EDICTS];
|
||||||
entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
||||||
entity_state_t cl_static_entity_baselines[MAX_STATIC_ENTITIES];
|
entity_state_t cl_static_entity_baselines[MAX_STATIC_ENTITIES];
|
||||||
lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -169,7 +168,7 @@ CL_ClearState (void)
|
||||||
// clear other arrays
|
// clear other arrays
|
||||||
memset (cl_entities, 0, sizeof (cl_entities));
|
memset (cl_entities, 0, sizeof (cl_entities));
|
||||||
memset (cl_baselines, 0, sizeof (cl_baselines));
|
memset (cl_baselines, 0, sizeof (cl_baselines));
|
||||||
memset (cl_lightstyle, 0, sizeof (cl_lightstyle));
|
memset (r_lightstyle, 0, sizeof (r_lightstyle));
|
||||||
|
|
||||||
CL_ClearTEnts ();
|
CL_ClearTEnts ();
|
||||||
|
|
||||||
|
|
|
@ -765,8 +765,8 @@ CL_ParseServerMessage (void)
|
||||||
i = MSG_ReadByte (net_message);
|
i = MSG_ReadByte (net_message);
|
||||||
if (i >= MAX_LIGHTSTYLES)
|
if (i >= MAX_LIGHTSTYLES)
|
||||||
Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
|
Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
|
||||||
strcpy (cl_lightstyle[i].map, MSG_ReadString (net_message));
|
strcpy (r_lightstyle[i].map, MSG_ReadString (net_message));
|
||||||
cl_lightstyle[i].length = strlen (cl_lightstyle[i].map);
|
r_lightstyle[i].length = strlen (r_lightstyle[i].map);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_sound:
|
case svc_sound:
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/console.h"
|
#include "QF/console.h"
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
|
#include "QF/quakefs.h"
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
|
@ -134,7 +135,7 @@ Draw_CachePic (char *path, qboolean alpha)
|
||||||
qpic_t *dat;
|
qpic_t *dat;
|
||||||
glpic_t *gl;
|
glpic_t *gl;
|
||||||
|
|
||||||
// First, check and see if its cached..
|
// First, check if its cached..
|
||||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
||||||
if ((!strcmp (path, pic->name)) && !pic->dirty)
|
if ((!strcmp (path, pic->name)) && !pic->dirty)
|
||||||
return &pic->pic;
|
return &pic->pic;
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "client.h"
|
#include "QF/render.h"
|
||||||
|
|
||||||
#include "glquake.h"
|
#include "glquake.h"
|
||||||
#include "r_shared.h"
|
#include "r_shared.h"
|
||||||
|
|
||||||
|
@ -53,12 +54,12 @@ R_AnimateLight (void)
|
||||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||||
i = (int) (r_realtime * 10);
|
i = (int) (r_realtime * 10);
|
||||||
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
||||||
if (!cl_lightstyle[j].length) {
|
if (!r_lightstyle[j].length) {
|
||||||
d_lightstylevalue[j] = 256;
|
d_lightstylevalue[j] = 256;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
k = i % cl_lightstyle[j].length;
|
k = i % r_lightstyle[j].length;
|
||||||
k = cl_lightstyle[j].map[k] - 'a';
|
k = r_lightstyle[j].map[k] - 'a';
|
||||||
k = k * 22;
|
k = k * 22;
|
||||||
d_lightstylevalue[j] = k;
|
d_lightstylevalue[j] = k;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ double r_realtime;
|
||||||
dlight_t r_dlights[MAX_DLIGHTS];
|
dlight_t r_dlights[MAX_DLIGHTS];
|
||||||
entity_t *r_view_model;
|
entity_t *r_view_model;
|
||||||
entity_t *r_player_entity;
|
entity_t *r_player_entity;
|
||||||
|
lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
|
||||||
|
|
||||||
|
|
||||||
dlight_t *
|
dlight_t *
|
||||||
R_AllocDlight (int key)
|
R_AllocDlight (int key)
|
||||||
|
@ -46,6 +48,7 @@ R_AllocDlight (int key)
|
||||||
return dl;
|
return dl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_DecayLights (double frametime)
|
R_DecayLights (double frametime)
|
||||||
{
|
{
|
||||||
|
@ -63,6 +66,7 @@ R_DecayLights (double frametime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ClearDlights (void)
|
R_ClearDlights (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
|
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
|
||||||
#include "client.h"
|
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
|
|
||||||
int r_dlightframecount;
|
int r_dlightframecount;
|
||||||
|
@ -47,12 +46,12 @@ R_AnimateLight (void)
|
||||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||||
i = (int) (r_realtime * 10);
|
i = (int) (r_realtime * 10);
|
||||||
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
||||||
if (!cl_lightstyle[j].length) {
|
if (!r_lightstyle[j].length) {
|
||||||
d_lightstylevalue[j] = 256;
|
d_lightstylevalue[j] = 256;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
k = i % cl_lightstyle[j].length;
|
k = i % r_lightstyle[j].length;
|
||||||
k = cl_lightstyle[j].map[k] - 'a';
|
k = r_lightstyle[j].map[k] - 'a';
|
||||||
k = k * 22;
|
k = k * 22;
|
||||||
d_lightstylevalue[j] = k;
|
d_lightstylevalue[j] = k;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,14 +114,6 @@ typedef struct
|
||||||
} frame_t;
|
} frame_t;
|
||||||
|
|
||||||
|
|
||||||
// client_state_t should hold all pieces of the client state
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int length;
|
|
||||||
char map[MAX_STYLESTRING];
|
|
||||||
} lightstyle_t;
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_DEMOS 8
|
#define MAX_DEMOS 8
|
||||||
#define MAX_DEMONAME 16
|
#define MAX_DEMONAME 16
|
||||||
|
|
||||||
|
@ -317,7 +309,6 @@ extern client_state_t cl;
|
||||||
// FIXME, allocate dynamically
|
// FIXME, allocate dynamically
|
||||||
extern entity_state_t cl_baselines[MAX_EDICTS];
|
extern entity_state_t cl_baselines[MAX_EDICTS];
|
||||||
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
||||||
extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
|
|
||||||
|
|
||||||
extern qboolean nomaster;
|
extern qboolean nomaster;
|
||||||
extern char *server_version; // version of server we connected to
|
extern char *server_version; // version of server we connected to
|
||||||
|
|
|
@ -635,7 +635,7 @@ CL_Record_f (void)
|
||||||
for (i = 0; i < MAX_LIGHTSTYLES; i++) {
|
for (i = 0; i < MAX_LIGHTSTYLES; i++) {
|
||||||
MSG_WriteByte (&buf, svc_lightstyle);
|
MSG_WriteByte (&buf, svc_lightstyle);
|
||||||
MSG_WriteByte (&buf, (char) i);
|
MSG_WriteByte (&buf, (char) i);
|
||||||
MSG_WriteString (&buf, cl_lightstyle[i].map);
|
MSG_WriteString (&buf, r_lightstyle[i].map);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_CL_STATS; i++) {
|
for (i = 0; i < MAX_CL_STATS; i++) {
|
||||||
|
|
|
@ -165,7 +165,6 @@ client_state_t cl;
|
||||||
entity_state_t cl_baselines[MAX_EDICTS];
|
entity_state_t cl_baselines[MAX_EDICTS];
|
||||||
efrag_t cl_efrags[MAX_EFRAGS];
|
efrag_t cl_efrags[MAX_EFRAGS];
|
||||||
entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
entity_t cl_static_entities[MAX_STATIC_ENTITIES];
|
||||||
lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
|
|
||||||
|
|
||||||
double connect_time = -1; // for connection retransmits
|
double connect_time = -1; // for connection retransmits
|
||||||
|
|
||||||
|
@ -420,7 +419,7 @@ CL_ClearState (void)
|
||||||
|
|
||||||
// clear other arrays
|
// clear other arrays
|
||||||
memset (cl_efrags, 0, sizeof (cl_efrags));
|
memset (cl_efrags, 0, sizeof (cl_efrags));
|
||||||
memset (cl_lightstyle, 0, sizeof (cl_lightstyle));
|
memset (r_lightstyle, 0, sizeof (r_lightstyle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1209,8 +1209,8 @@ CL_ParseServerMessage (void)
|
||||||
if (i >= MAX_LIGHTSTYLES)
|
if (i >= MAX_LIGHTSTYLES)
|
||||||
// Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
|
// Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
|
||||||
Host_EndGame ("svc_lightstyle > MAX_LIGHTSTYLES");
|
Host_EndGame ("svc_lightstyle > MAX_LIGHTSTYLES");
|
||||||
strcpy (cl_lightstyle[i].map, MSG_ReadString (net_message));
|
strcpy (r_lightstyle[i].map, MSG_ReadString (net_message));
|
||||||
cl_lightstyle[i].length = strlen (cl_lightstyle[i].map);
|
r_lightstyle[i].length = strlen (r_lightstyle[i].map);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_sound:
|
case svc_sound:
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/console.h"
|
#include "QF/console.h"
|
||||||
#include "QF/draw.h"
|
#include "QF/draw.h"
|
||||||
|
#include "QF/quakefs.h"
|
||||||
#include "QF/screen.h"
|
#include "QF/screen.h"
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
#include "QF/vid.h"
|
#include "QF/vid.h"
|
||||||
|
@ -134,7 +135,7 @@ Draw_CachePic (char *path, qboolean alpha)
|
||||||
qpic_t *dat;
|
qpic_t *dat;
|
||||||
glpic_t *gl;
|
glpic_t *gl;
|
||||||
|
|
||||||
// First, check and see if its cached..
|
// First, check if its cached..
|
||||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
||||||
if ((!strcmp (path, pic->name)) && !pic->dirty)
|
if ((!strcmp (path, pic->name)) && !pic->dirty)
|
||||||
return &pic->pic;
|
return &pic->pic;
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "client.h"
|
#include "QF/render.h"
|
||||||
|
|
||||||
#include "glquake.h"
|
#include "glquake.h"
|
||||||
#include "r_shared.h"
|
#include "r_shared.h"
|
||||||
|
|
||||||
|
@ -53,12 +54,12 @@ R_AnimateLight (void)
|
||||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||||
i = (int) (r_realtime * 10);
|
i = (int) (r_realtime * 10);
|
||||||
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
||||||
if (!cl_lightstyle[j].length) {
|
if (!r_lightstyle[j].length) {
|
||||||
d_lightstylevalue[j] = 256;
|
d_lightstylevalue[j] = 256;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
k = i % cl_lightstyle[j].length;
|
k = i % r_lightstyle[j].length;
|
||||||
k = cl_lightstyle[j].map[k] - 'a';
|
k = r_lightstyle[j].map[k] - 'a';
|
||||||
k = k * 22;
|
k = k * 22;
|
||||||
d_lightstylevalue[j] = k;
|
d_lightstylevalue[j] = k;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ double r_realtime;
|
||||||
dlight_t r_dlights[MAX_DLIGHTS];
|
dlight_t r_dlights[MAX_DLIGHTS];
|
||||||
entity_t *r_view_model;
|
entity_t *r_view_model;
|
||||||
entity_t *r_player_entity;
|
entity_t *r_player_entity;
|
||||||
|
lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
|
||||||
|
|
||||||
|
|
||||||
dlight_t *
|
dlight_t *
|
||||||
R_AllocDlight (int key)
|
R_AllocDlight (int key)
|
||||||
|
@ -46,6 +48,7 @@ R_AllocDlight (int key)
|
||||||
return dl;
|
return dl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_DecayLights (double frametime)
|
R_DecayLights (double frametime)
|
||||||
{
|
{
|
||||||
|
@ -63,6 +66,7 @@ R_DecayLights (double frametime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
R_ClearDlights (void)
|
R_ClearDlights (void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
|
|
||||||
#include "QF/render.h"
|
#include "QF/render.h"
|
||||||
|
|
||||||
#include "client.h"
|
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
|
|
||||||
int r_dlightframecount;
|
int r_dlightframecount;
|
||||||
|
@ -47,12 +46,12 @@ R_AnimateLight (void)
|
||||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||||
i = (int) (r_realtime * 10);
|
i = (int) (r_realtime * 10);
|
||||||
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
|
||||||
if (!cl_lightstyle[j].length) {
|
if (!r_lightstyle[j].length) {
|
||||||
d_lightstylevalue[j] = 256;
|
d_lightstylevalue[j] = 256;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
k = i % cl_lightstyle[j].length;
|
k = i % r_lightstyle[j].length;
|
||||||
k = cl_lightstyle[j].map[k] - 'a';
|
k = r_lightstyle[j].map[k] - 'a';
|
||||||
k = k * 22;
|
k = k * 22;
|
||||||
d_lightstylevalue[j] = k;
|
d_lightstylevalue[j] = k;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue