client.h gone from gl_rlight.c and sw_rlight.c.

cl_lightstyle -> r_lightstyle
This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-21 03:08:07 +00:00
parent f38a233786
commit a9c9a46c37
17 changed files with 47 additions and 44 deletions

View File

@ -1,7 +1,7 @@
/*
qdefs.h
(description)
ewww. this whole thing is a giant FIXME
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project

View File

@ -32,11 +32,13 @@
#include "QF/cvar.h"
#include "QF/mathlib.h"
#include "QF/model.h"
#include "QF/qdefs.h" // FIXME
#include "QF/vid.h"
// dynamic lights ===========================================================
#define MAX_DLIGHTS 32
typedef struct dlight_s
{
int key; // so entities can reuse same entry
@ -48,8 +50,17 @@ typedef struct dlight_s
float color[3]; // Don't use alpha --KB
} 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 lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
//===============
#define TOP_RANGE 16 // soldier uniform colors

View File

@ -58,12 +58,6 @@ typedef struct usercmd_s
#endif
} usercmd_t;
typedef struct
{
int length;
char map[MAX_STYLESTRING];
} lightstyle_t;
typedef struct
{
char name[MAX_SCOREBOARDNAME];
@ -281,7 +275,6 @@ extern client_state_t cl;
// FIXME, allocate dynamically
extern entity_t cl_entities[MAX_EDICTS];
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
/*

View File

@ -88,7 +88,6 @@ entity_t cl_entities[MAX_EDICTS];
entity_state_t cl_baselines[MAX_EDICTS];
entity_t cl_static_entities[MAX_STATIC_ENTITIES];
entity_state_t cl_static_entity_baselines[MAX_STATIC_ENTITIES];
lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
void
@ -169,7 +168,7 @@ CL_ClearState (void)
// clear other arrays
memset (cl_entities, 0, sizeof (cl_entities));
memset (cl_baselines, 0, sizeof (cl_baselines));
memset (cl_lightstyle, 0, sizeof (cl_lightstyle));
memset (r_lightstyle, 0, sizeof (r_lightstyle));
CL_ClearTEnts ();

View File

@ -765,8 +765,8 @@ CL_ParseServerMessage (void)
i = MSG_ReadByte (net_message);
if (i >= MAX_LIGHTSTYLES)
Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
strcpy (cl_lightstyle[i].map, MSG_ReadString (net_message));
cl_lightstyle[i].length = strlen (cl_lightstyle[i].map);
strcpy (r_lightstyle[i].map, MSG_ReadString (net_message));
r_lightstyle[i].length = strlen (r_lightstyle[i].map);
break;
case svc_sound:

View File

@ -41,6 +41,7 @@
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/draw.h"
#include "QF/quakefs.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/vid.h"
@ -134,7 +135,7 @@ Draw_CachePic (char *path, qboolean alpha)
qpic_t *dat;
glpic_t *gl;
// First, check and see if its cached..
// First, check if its cached..
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
if ((!strcmp (path, pic->name)) && !pic->dirty)
return &pic->pic;

View File

@ -39,7 +39,8 @@
#include <math.h>
#include <stdio.h>
#include "client.h"
#include "QF/render.h"
#include "glquake.h"
#include "r_shared.h"
@ -53,12 +54,12 @@ R_AnimateLight (void)
// 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (r_realtime * 10);
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
if (!cl_lightstyle[j].length) {
if (!r_lightstyle[j].length) {
d_lightstylevalue[j] = 256;
continue;
}
k = i % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
k = i % r_lightstyle[j].length;
k = r_lightstyle[j].map[k] - 'a';
k = k * 22;
d_lightstylevalue[j] = k;
}

View File

@ -10,6 +10,8 @@ double r_realtime;
dlight_t r_dlights[MAX_DLIGHTS];
entity_t *r_view_model;
entity_t *r_player_entity;
lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
dlight_t *
R_AllocDlight (int key)
@ -46,6 +48,7 @@ R_AllocDlight (int key)
return dl;
}
void
R_DecayLights (double frametime)
{
@ -63,6 +66,7 @@ R_DecayLights (double frametime)
}
}
void
R_ClearDlights (void)
{

View File

@ -32,7 +32,6 @@
#include "QF/render.h"
#include "client.h"
#include "r_local.h"
int r_dlightframecount;
@ -47,12 +46,12 @@ R_AnimateLight (void)
// 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (r_realtime * 10);
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
if (!cl_lightstyle[j].length) {
if (!r_lightstyle[j].length) {
d_lightstylevalue[j] = 256;
continue;
}
k = i % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
k = i % r_lightstyle[j].length;
k = r_lightstyle[j].map[k] - 'a';
k = k * 22;
d_lightstylevalue[j] = k;
}

View File

@ -114,14 +114,6 @@ typedef struct
} 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_DEMONAME 16
@ -317,7 +309,6 @@ extern client_state_t cl;
// FIXME, allocate dynamically
extern entity_state_t cl_baselines[MAX_EDICTS];
extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
extern qboolean nomaster;
extern char *server_version; // version of server we connected to

View File

@ -635,7 +635,7 @@ CL_Record_f (void)
for (i = 0; i < MAX_LIGHTSTYLES; i++) {
MSG_WriteByte (&buf, svc_lightstyle);
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++) {

View File

@ -165,7 +165,6 @@ client_state_t cl;
entity_state_t cl_baselines[MAX_EDICTS];
efrag_t cl_efrags[MAX_EFRAGS];
entity_t cl_static_entities[MAX_STATIC_ENTITIES];
lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
double connect_time = -1; // for connection retransmits
@ -420,7 +419,7 @@ CL_ClearState (void)
// clear other arrays
memset (cl_efrags, 0, sizeof (cl_efrags));
memset (cl_lightstyle, 0, sizeof (cl_lightstyle));
memset (r_lightstyle, 0, sizeof (r_lightstyle));
}

View File

@ -1209,8 +1209,8 @@ CL_ParseServerMessage (void)
if (i >= MAX_LIGHTSTYLES)
// Sys_Error ("svc_lightstyle > MAX_LIGHTSTYLES");
Host_EndGame ("svc_lightstyle > MAX_LIGHTSTYLES");
strcpy (cl_lightstyle[i].map, MSG_ReadString (net_message));
cl_lightstyle[i].length = strlen (cl_lightstyle[i].map);
strcpy (r_lightstyle[i].map, MSG_ReadString (net_message));
r_lightstyle[i].length = strlen (r_lightstyle[i].map);
break;
case svc_sound:

View File

@ -41,6 +41,7 @@
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/draw.h"
#include "QF/quakefs.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/vid.h"
@ -134,7 +135,7 @@ Draw_CachePic (char *path, qboolean alpha)
qpic_t *dat;
glpic_t *gl;
// First, check and see if its cached..
// First, check if its cached..
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
if ((!strcmp (path, pic->name)) && !pic->dirty)
return &pic->pic;

View File

@ -39,7 +39,8 @@
#include <math.h>
#include <stdio.h>
#include "client.h"
#include "QF/render.h"
#include "glquake.h"
#include "r_shared.h"
@ -53,12 +54,12 @@ R_AnimateLight (void)
// 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (r_realtime * 10);
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
if (!cl_lightstyle[j].length) {
if (!r_lightstyle[j].length) {
d_lightstylevalue[j] = 256;
continue;
}
k = i % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
k = i % r_lightstyle[j].length;
k = r_lightstyle[j].map[k] - 'a';
k = k * 22;
d_lightstylevalue[j] = k;
}

View File

@ -10,6 +10,8 @@ double r_realtime;
dlight_t r_dlights[MAX_DLIGHTS];
entity_t *r_view_model;
entity_t *r_player_entity;
lightstyle_t r_lightstyle[MAX_LIGHTSTYLES];
dlight_t *
R_AllocDlight (int key)
@ -46,6 +48,7 @@ R_AllocDlight (int key)
return dl;
}
void
R_DecayLights (double frametime)
{
@ -63,6 +66,7 @@ R_DecayLights (double frametime)
}
}
void
R_ClearDlights (void)
{

View File

@ -32,7 +32,6 @@
#include "QF/render.h"
#include "client.h"
#include "r_local.h"
int r_dlightframecount;
@ -47,12 +46,12 @@ R_AnimateLight (void)
// 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (r_realtime * 10);
for (j = 0; j < MAX_LIGHTSTYLES; j++) {
if (!cl_lightstyle[j].length) {
if (!r_lightstyle[j].length) {
d_lightstylevalue[j] = 256;
continue;
}
k = i % cl_lightstyle[j].length;
k = cl_lightstyle[j].map[k] - 'a';
k = i % r_lightstyle[j].length;
k = r_lightstyle[j].map[k] - 'a';
k = k * 22;
d_lightstylevalue[j] = k;
}