]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
Rename q3shaderinfo_t to shader_t, to be in line with other engines
[xonotic/darkplaces.git] / cl_main.c
index 4eae28940e67a5e8d0ec511165d891b3d78101b2..c03ff082eed865106b5265008e07f9d613194027 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -209,8 +209,8 @@ void CL_ClearState(void)
        CL_Screen_NewMap();
 }
 
-extern cvar_t topcolor;
-extern cvar_t bottomcolor;
+extern cvar_t cl_topcolor;
+extern cvar_t cl_bottomcolor;
 
 void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allowstarkey, qboolean allowmodel, qboolean quiet)
 {
@@ -259,12 +259,12 @@ void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allo
                else if (!strcasecmp(key, "topcolor"))
                {
                        MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
-                       MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", atoi(value), bottomcolor.integer));
+                       MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", atoi(value), cl_bottomcolor.integer));
                }
                else if (!strcasecmp(key, "bottomcolor"))
                {
                        MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
-                       MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", topcolor.integer, atoi(value)));
+                       MSG_WriteString(&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", cl_topcolor.integer, atoi(value)));
                }
                else if (!strcasecmp(key, "rate"))
                {
@@ -503,7 +503,7 @@ CL_EstablishConnection
 Host should be either "local" or a net address
 =====================
 */
-void CL_EstablishConnection(const char *host, int firstarg)
+void CL_EstablishConnection(const char *address, int firstarg)
 {
        if (cls.state == ca_dedicated)
                return;
@@ -523,7 +523,7 @@ void CL_EstablishConnection(const char *host, int firstarg)
        // make sure the client ports are open before attempting to connect
        NetConn_UpdateSockets();
 
-       if (LHNETADDRESS_FromString(&cls.connect_address, host, 26000) && (cls.connect_mysocket = NetConn_ChooseClientSocketForAddress(&cls.connect_address)))
+       if (LHNETADDRESS_FromString(&cls.connect_address, address, 26000) && (cls.connect_mysocket = NetConn_ChooseClientSocketForAddress(&cls.connect_address)))
        {
                cls.connect_trying = true;
                cls.connect_remainingtries = 3;
@@ -749,11 +749,11 @@ entity_render_t *CL_NewTempEntity(double shadertime)
        return render;
 }
 
-void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float framerate)
+void CL_Effect(vec3_t org, dp_model_t *model, int startframe, int framecount, float framerate)
 {
        int i;
        cl_effect_t *e;
-       if (!modelindex) // sanity check
+       if (!model) // sanity check
                return;
        if (framerate < 1)
        {
@@ -771,7 +771,7 @@ void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float
                        continue;
                e->active = true;
                VectorCopy(org, e->origin);
-               e->modelindex = modelindex;
+               e->model = model;
                e->starttime = cl.time;
                e->startframe = startframe;
                e->endframe = startframe + framecount;
@@ -1771,7 +1771,7 @@ static void CL_RelinkEffects(void)
                                }
 
                                // normal stuff
-                               entrender->model = CL_GetModelByIndex(e->modelindex);
+                               entrender->model = e->model;
                                entrender->alpha = 1;
                                VectorSet(entrender->colormod, 1, 1, 1);
                                VectorSet(entrender->glowmod, 1, 1, 1);
@@ -2759,6 +2759,8 @@ void CL_Init (void)
        //
        // register our commands
        //
+               CL_InitCommands();
+
                Cvar_RegisterVariable (&cl_upspeed);
                Cvar_RegisterVariable (&cl_forwardspeed);
                Cvar_RegisterVariable (&cl_backspeed);