]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_cmds.c
added r_rtworld, r_rtworldshadows, r_rtdlight, r_rtdlightshadows, and r_lightmapinten...
[xonotic/darkplaces.git] / pr_cmds.c
index 32fe4cf7b15177565993092ed1b698e7689617f4..8bdb8f0f5e3407723d333b1be9c2444b6790f3b7 100644 (file)
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -153,6 +153,7 @@ char *ENGINE_EXTENSIONS =
 "KRIMZON_SV_PARSECLIENTCOMMAND "
 "NEH_CMD_PLAY2 "
 "NEH_RESTOREGAME "
+"NXQ_GFX_LETTERBOX "
 "TENEBRAE_GFX_DLIGHTS "
 "TW_SV_STEPCONTROL "
 ;
@@ -522,7 +523,7 @@ void PF_vectoyaw (void)
                yaw = 0;
        else
        {
-               yaw = (int) (atan2(value1[1], value1[0]) * 180 / M_PI);
+               yaw = (atan2(value1[1], value1[0]) * 180 / M_PI);
                if (yaw < 0)
                        yaw += 360;
        }
@@ -540,11 +541,9 @@ vector vectoangles(vector)
 */
 void PF_vectoangles (void)
 {
-       float   *value1;
-       float   forward;
-       float   yaw, pitch;
+       double value1[3], forward, yaw, pitch;
 
-       value1 = G_VECTOR(OFS_PARM0);
+       VectorCopy(G_VECTOR(OFS_PARM0), value1);
 
        if (value1[1] == 0 && value1[0] == 0)
        {
@@ -569,14 +568,12 @@ void PF_vectoangles (void)
                        yaw = 270;
 
                forward = sqrt(value1[0]*value1[0] + value1[1]*value1[1]);
-               pitch = (int) (atan2(value1[2], forward) * 180 / M_PI);
+               pitch = (atan2(value1[2], forward) * 180 / M_PI);
                if (pitch < 0)
                        pitch += 360;
        }
 
-       G_FLOAT(OFS_RETURN+0) = pitch;
-       G_FLOAT(OFS_RETURN+1) = yaw;
-       G_FLOAT(OFS_RETURN+2) = 0;
+       VectorSet(G_VECTOR(OFS_RETURN), pitch, yaw, 0);
 }
 
 /*
@@ -1877,10 +1874,7 @@ void PF_WriteLong (void)
 
 void PF_WriteAngle (void)
 {
-       if (sv.protocol == PROTOCOL_DARKPLACES5)
-               MSG_WriteAngle16i (WriteDest(), G_FLOAT(OFS_PARM1));
-       else
-               MSG_WriteAngle8i (WriteDest(), G_FLOAT(OFS_PARM1));
+       MSG_WriteAngle (WriteDest(), G_FLOAT(OFS_PARM1), sv.protocol);
 }
 
 void PF_WriteCoord (void)
@@ -1934,7 +1928,7 @@ void PF_makestatic (void)
        for (i=0 ; i<3 ; i++)
        {
                MSG_WriteCoord(&sv.signon, ent->v->origin[i], sv.protocol);
-               MSG_WriteAngle8i(&sv.signon, ent->v->angles[i]);
+               MSG_WriteAngle(&sv.signon, ent->v->angles[i], sv.protocol);
        }
 
 // throw the entity away now
@@ -2048,17 +2042,13 @@ void PF_GetLight (void)
        VectorMA(ambientcolor, 0.5, diffusecolor, G_VECTOR(OFS_RETURN));
 }
 
-#define MAX_QC_CVARS 128
-cvar_t qc_cvar[MAX_QC_CVARS];
-int currentqc_cvar;
-
 void PF_registercvar (void)
 {
        char *name, *value;
-       cvar_t *variable;
        name = G_STRING(OFS_PARM0);
        value = G_STRING(OFS_PARM1);
        G_FLOAT(OFS_RETURN) = 0;
+
 // first check to see if it has already been defined
        if (Cvar_FindVar (name))
                return;
@@ -2070,18 +2060,8 @@ void PF_registercvar (void)
                return;
        }
 
-       if (currentqc_cvar >= MAX_QC_CVARS)
-               PF_ERROR("PF_registercvar: ran out of cvar slots\n");
-
-// copy the name and value
-       variable = &qc_cvar[currentqc_cvar++];
-       variable->name = Z_Malloc (strlen(name)+1);
-       strcpy (variable->name, name);
-       variable->string = Z_Malloc (strlen(value)+1);
-       strcpy (variable->string, value);
-       variable->value = atof (value);
+       Cvar_Get(name, value, 0);
 
-       Cvar_RegisterVariable(variable);
        G_FLOAT(OFS_RETURN) = 1; // success
 }