HalfLife texture transparency fixed, pmodel enhanced (Nehahra).
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 23:42:49 +0000 (23:42 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 23 Aug 2000 23:42:49 +0000 (23:42 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
client.h
host_cmd.c
model_brush.c

index bcd3e47..0a9d387 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // these two are not intended to be set directly
 cvar_t cl_name = {"_cl_name", "player", true};
 cvar_t cl_color = {"_cl_color", "0", true};
+cvar_t cl_pmodel = {"_cl_pmodel", "0", true};
 
 cvar_t cl_shownet = {"cl_shownet","0"};        // can be 0, 1, or 2
 cvar_t cl_nolerp = {"cl_nolerp","0"};
@@ -197,10 +198,16 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
                MSG_WriteString (&cls.message, "prespawn");
                break;
                
-       case 2:         
+       case 2:
+               if (cl_pmodel.value)
+               {
+                       MSG_WriteByte (&cls.message, clc_stringcmd);
+                       MSG_WriteString (&cls.message, va("pmodel %f\n", cl_pmodel.value));
+               }
+
                MSG_WriteByte (&cls.message, clc_stringcmd);
                MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string));
-       
+
                MSG_WriteByte (&cls.message, clc_stringcmd);
                MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color.value)>>4, ((int)cl_color.value)&15));
        
@@ -791,6 +798,7 @@ void CL_Init (void)
 //
        Cvar_RegisterVariable (&cl_name);
        Cvar_RegisterVariable (&cl_color);
+       Cvar_RegisterVariable (&cl_pmodel);
        Cvar_RegisterVariable (&cl_upspeed);
        Cvar_RegisterVariable (&cl_forwardspeed);
        Cvar_RegisterVariable (&cl_backspeed);
index c5cbffd..ca030dd 100644 (file)
--- a/client.h
+++ b/client.h
@@ -232,6 +232,7 @@ typedef struct
 //
 extern cvar_t  cl_name;
 extern cvar_t  cl_color;
+extern cvar_t  cl_pmodel;
 
 extern cvar_t  cl_upspeed;
 extern cvar_t  cl_forwardspeed;
index d70508e..48149b1 100644 (file)
@@ -1650,13 +1650,16 @@ void Host_PModel_f (void)
 
        if (Cmd_Argc () == 1)
        {
-               Con_Printf ("usage: pmodel modelnumber\n");
+               Con_Printf ("\"pmodel\" is \"%s\"\n", cl_pmodel.string);
                return;
        }
        i = atoi(Cmd_Argv(1));
 
        if (cmd_source == src_command)
        {
+               if (cl_pmodel.value == i)
+                       return;
+               Cvar_SetValue ("_cl_pmodel", i);
                if (cls.state == ca_connected)
                        Cmd_ForwardToServer ();
                return;
index e62b527..b3625c7 100644 (file)
@@ -597,6 +597,7 @@ void Mod_LoadTexinfo (lump_t *l)
                {
                        out->texture = r_notexture_mip; // checkerboard texture
                        out->flags = 0;
+                       out->texture->transparent = FALSE;
                }
                else
                {
@@ -607,9 +608,8 @@ void Mod_LoadTexinfo (lump_t *l)
                        {
                                out->texture = r_notexture_mip; // texture not found
                                out->flags = 0;
-                       }
-                       else
                                out->texture->transparent = FALSE;
+                       }
                }
        }
 }