cvar_t csqc_progcrc = {CVAR_CLIENT | CVAR_READONLY, "csqc_progcrc","-1","CRC of csprogs.dat file to load (-1 is none), only used during level changes and then reset to -1"};
cvar_t csqc_progsize = {CVAR_CLIENT | CVAR_READONLY, "csqc_progsize","-1","file size of csprogs.dat file to load (-1 is none), only used during level changes and then reset to -1"};
cvar_t csqc_usedemoprogs = {CVAR_CLIENT, "csqc_usedemoprogs","1","use csprogs stored in demos"};
+cvar_t csqc_polygons_defaultmaterial_nocullface = {CVAR_CLIENT, "csqc_polygons_defaultmaterial_nocullface", "0", "use 'cull none' behavior in the default shader for rendering R_PolygonBegin - warning: enabling this is not consistent with FTEQW behavior on this feature"};
cvar_t cl_shownet = {CVAR_CLIENT, "cl_shownet","0","1 = print packet size, 2 = print packet message list"};
cvar_t cl_nolerp = {CVAR_CLIENT, "cl_nolerp", "0","network update smoothing"};
NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, 0, false);
NetConn_Close(cls.netcon);
cls.netcon = NULL;
+ Con_Printf("Disconnected\n");
}
cls.state = ca_disconnected;
cl.islocalgame = false;
cls.demoplayback = cls.timedemo = false;
cls.signon = 0;
+
+ // If we're dropped mid-connection attempt, it won't clear otherwise.
+ SCR_ClearLoadingScreen(false);
}
void CL_Disconnect_f(cmd_state_t *cmd)
#ifdef CONFIG_MENU
M_Update_Return_Reason("");
#endif
- cls.demonum = -1;
- // stop demo loop in case this fails
- if (cls.demoplayback)
- CL_StopPlayback();
-
- // if downloads are running, cancel their finishing action
- Curl_Clear_forthismap();
+ // Disconnect from the current server, or stop a running demo.
+ CL_Disconnect();
// make sure the client ports are open before attempting to connect
NetConn_UpdateSockets();
{
// link stuff
CL_RelinkWorld();
+ // the scene mesh is added first for easier debugging (consistent spot in render entities list)
+ CL_MeshEntities_Scene_AddRenderEntity();
CL_RelinkStaticEntities();
CL_RelinkBeams();
CL_RelinkEffects();
// update view blend
V_CalcViewBlend();
-
- CL_MeshEntities_AddToScene();
}
/*
// when csqc is loaded, it will call this in CSQC_UpdateView
if (!cl.csqc_loaded)
+ {
+ // clear the CL_Mesh_Scene() used for some engine effects
+ CL_MeshEntities_Scene_Clear();
+ // add engine entities and effects
CSQC_RelinkAllEntities(ENTMASK_ENGINE | ENTMASK_ENGINEVIEWMODELS);
+ }
// decals, particles, and explosions will be updated during rneder
}
if (VectorCompare(loc->mins, loc->maxs))
break;
if (loc)
- Con_Printf("Warning: writing loc file containing a mixture of qizmo-style points and proquake-style boxes may not work in qizmo or proquake!\n");
+ Con_Warnf("Warning: writing loc file containing a mixture of qizmo-style points and proquake-style boxes may not work in qizmo or proquake!\n");
}
for (loc = cl.locnodes;loc;loc = loc->next)
{
dp_model_t cl_meshentitymodels[NUM_MESHENTITIES];
const char *cl_meshentitynames[NUM_MESHENTITIES] =
{
- "MESH_DEBUG",
- "MESH_CSQC_POLYGONS",
- "MESH_PARTICLES",
+ "MESH_SCENE",
"MESH_UI",
};
ent = cl_meshentities + i;
ent->state_current.active = true;
ent->render.model = cl_meshentitymodels + i;
- ent->render.alpha = 0.999999f; // not quite 1 so that MATERIALFLAG_ALPHA is always set.
+ Mod_Mesh_Create(ent->render.model, cl_meshentitynames[i]);
+ ent->render.alpha = 1;
ent->render.flags = RENDER_SHADOW | RENDER_LIGHT;
ent->render.framegroupblend[0].lerp = 1;
ent->render.frameblend[0].lerp = 1;
R_RegisterModule("cl_meshentities", CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
}
-void CL_MeshEntities_AddToScene(void)
+void CL_MeshEntities_Scene_Clear(void)
{
- int i;
- entity_t *ent;
- for (i = 0; i < NUM_MESHENTITIES && r_refdef.scene.numentities < r_refdef.scene.maxentities; i++)
- {
- ent = cl_meshentities + i;
- if (ent->render.model->num_surfaces == 0)
- continue;
- Mod_Mesh_Finalize(ent->render.model);
- VectorCopy(ent->render.model->normalmins, ent->render.mins);
- VectorCopy(ent->render.model->normalmaxs, ent->render.maxs);
- r_refdef.scene.entities[r_refdef.scene.numentities++] = &ent->render;
- }
+ Mod_Mesh_Reset(CL_Mesh_Scene());
}
-void CL_MeshEntities_Reset(void)
+void CL_MeshEntities_Scene_AddRenderEntity(void)
{
- int i;
- entity_t *ent;
- for (i = 0; i < NUM_MESHENTITIES && r_refdef.scene.numentities < r_refdef.scene.maxentities; i++)
- {
- ent = cl_meshentities + i;
- Mod_Mesh_Reset(ent->render.model);
- }
+ entity_t* ent = &cl_meshentities[MESH_SCENE];
+ r_refdef.scene.entities[r_refdef.scene.numentities++] = &ent->render;
+}
+
+void CL_MeshEntities_Scene_FinalizeRenderEntity(void)
+{
+ entity_t *ent = &cl_meshentities[MESH_SCENE];
+ Mod_Mesh_Finalize(ent->render.model);
+ VectorCopy(ent->render.model->normalmins, ent->render.mins);
+ VectorCopy(ent->render.model->normalmaxs, ent->render.maxs);
}
static void CL_MeshEntities_Shutdown(void)
for (q = 0; q < 3; q++)
a[q] = c[q] = dir[q] = 0;
+ ent->render_lightgrid = false;
ent->render_modellight_forced = false;
ent->render_rtlight_disabled = false;
ent->render_modellight_forced = true;
ent->render_rtlight_disabled = true;
}
+ else if (((ent->model && !ent->model->lit) || (ent->model == r_refdef.scene.worldmodel ? mod_q3bsp_lightgrid_world_surfaces.integer : mod_q3bsp_lightgrid_bsp_surfaces.integer))
+ && r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->lit && r_refdef.scene.worldmodel->brushq3.lightgridtexture && mod_q3bsp_lightgrid_texture.integer)
+ {
+ ent->render_lightgrid = true;
+ // no need to call R_CompleteLightPoint as we base it on render_lightmap_*
+ }
else if (r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->lit && r_refdef.scene.worldmodel->brush.LightPoint)
R_CompleteLightPoint(a, c, dir, shadingorigin, LP_LIGHTMAP, r_refdef.scene.lightmapintensity, r_refdef.scene.ambientintensity);
else if (r_fullbright_directed.integer)
Cmd_AddCommand(&cmd_client, "locs_reload", CL_Locs_Reload_f, "reload .loc file for this map");
Cmd_AddCommand(&cmd_client, "locs_save", CL_Locs_Save_f, "save .loc file for this map containing currently defined points and boxes");
+ Cvar_RegisterVariable(&csqc_polygons_defaultmaterial_nocullface);
+
CL_Parse_Init();
CL_Particles_Init();
CL_Screen_Init();