From 87018a5da0b6005adb83c4dffb57745aefff449a Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Wed, 23 Aug 2000 23:42:49 +0000 Subject: [PATCH] HalfLife texture transparency fixed, pmodel enhanced (Nehahra). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 12 ++++++++++-- client.h | 1 + host_cmd.c | 5 ++++- model_brush.c | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cl_main.c b/cl_main.c index bcd3e47c..0a9d3879 100644 --- 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); diff --git a/client.h b/client.h index c5cbffde..ca030ddc 100644 --- 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; diff --git a/host_cmd.c b/host_cmd.c index d70508ef..48149b1a 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -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; diff --git a/model_brush.c b/model_brush.c index e62b5272..b3625c79 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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; + } } } } -- 2.39.2