int nummodels = (int)Mem_ExpandableArray_IndexRange(&models);
dp_model_t *mod;
- SCR_PushLoadingScreen(false, "Loading models", 1.0);
+ SCR_PushLoadingScreen("Loading models", 1.0);
count = 0;
for (i = 0;i < nummodels;i++)
if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*')
if ((mod = (dp_model_t*) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*')
if (mod->used)
{
- SCR_PushLoadingScreen(true, mod->name, 1.0 / count);
+ SCR_PushLoadingScreen(mod->name, 1.0 / count);
Mod_LoadModel(mod, true, false);
SCR_PopLoadingScreen(false);
}
Cvar_RegisterVariable(&mod_generatelightmaps_vertexradius);
Cvar_RegisterVariable(&mod_generatelightmaps_gridradius);
- Cmd_AddCommand(&cmd_client, "modellist", Mod_Print_f, "prints a list of loaded models");
- Cmd_AddCommand(&cmd_client, "modelprecache", Mod_Precache_f, "load a model");
- Cmd_AddCommand(&cmd_client, "modeldecompile", Mod_Decompile_f, "exports a model in several formats for editing purposes");
- Cmd_AddCommand(&cmd_client, "mod_generatelightmaps", Mod_GenerateLightmaps_f, "rebuilds lighting on current worldmodel");
+ Cmd_AddCommand(CMD_CLIENT, "modellist", Mod_Print_f, "prints a list of loaded models");
+ Cmd_AddCommand(CMD_CLIENT, "modelprecache", Mod_Precache_f, "load a model");
+ Cmd_AddCommand(CMD_CLIENT, "modeldecompile", Mod_Decompile_f, "exports a model in several formats for editing purposes");
+ Cmd_AddCommand(CMD_CLIENT, "mod_generatelightmaps", Mod_GenerateLightmaps_f, "rebuilds lighting on current worldmodel");
}
void Mod_RenderInit(void)
if (developer_loading.integer)
Con_Printf("loading model %s\n", mod->name);
- SCR_PushLoadingScreen(true, mod->name, 1);
+ SCR_PushLoadingScreen(mod->name, 1);
// LadyHavoc: unload the existing model in this slot (if there is one)
if (mod->loaded || mod->mempool)
if (!parentname)
parentname = "";
- // if we're not dedicatd, the renderer calls will crash without video
- Host_StartVideo();
-
nummodels = (int)Mem_ExpandableArray_IndexRange(&models);
if (!name[0])
int nummodels = (int)Mem_ExpandableArray_IndexRange(&models);
dp_model_t *mod;
- SCR_PushLoadingScreen(false, "Reloading models", 1.0);
+ SCR_PushLoadingScreen("Reloading models", 1.0);
count = 0;
for (i = 0;i < nummodels;i++)
if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
for (i = 0;i < nummodels;i++)
if ((mod = (dp_model_t *) Mem_ExpandableArray_RecordAtIndex(&models, i)) && mod->name[0] && mod->name[0] != '*' && mod->used)
{
- SCR_PushLoadingScreen(true, mod->name, 1.0 / count);
+ SCR_PushLoadingScreen(mod->name, 1.0 / count);
Mod_LoadModel(mod, true, true);
SCR_PopLoadingScreen(false);
}
{
if (developer_extra.integer)
Con_DPrintf("^1%s:^7 using fallback noshader material for ^3\"%s\"\n", modelname, name);
+ texture->basematerialflags = defaultmaterialflags;
texture->supercontents = SUPERCONTENTS_SOLID | SUPERCONTENTS_OPAQUE;
}
else if (!strcmp(texture->name, "common/nodraw") || !strcmp(texture->name, "textures/common/nodraw"))
void Mod_UnloadCustomMaterial(texture_t *texture, qboolean purgeskins)
{
- int i, j;
+ long unsigned int i, j;
for (i = 0; i < sizeof(texture->shaderpasses) / sizeof(texture->shaderpasses[0]); i++)
{
if (texture->shaderpasses[i])
for (j = 0;j < mod->nummodelsurfaces;j++)
{
const msurface_t *surface = mod->data_surfaces + j + mod->firstmodelsurface;
+ if(!surface->texture)
+ continue;
t = (int)(surface->texture - mod->data_textures);
numsurfacesfortexture[t]++;
}
for (j = 0;j < mod->nummodelsurfaces;j++)
{
const msurface_t *surface = mod->data_surfaces + j + mod->firstmodelsurface;
+ if (!surface->texture)
+ continue;
t = (int)(surface->texture - mod->data_textures);
mod->sortedmodelsurfaces[firstsurfacefortexture[t]++] = j + mod->firstmodelsurface;
}
{
int i;
texture_t *t;
- for (i = 0; i < mod->num_textures; i++)
- if (!strcmp(mod->data_textures[i].name, name))
- return mod->data_textures + i;
+ int drawflag = defaultdrawflags & DRAWFLAG_MASK;
+ for (i = 0, t = mod->data_textures; i < mod->num_textures; i++, t++)
+ if (!strcmp(t->name, name) && t->mesh_drawflag == drawflag && t->mesh_defaulttexflags == defaulttexflags && t->mesh_defaultmaterialflags == defaultmaterialflags)
+ return t;
if (mod->max_textures <= mod->num_textures)
{
texture_t *oldtextures = mod->data_textures;
mod->data_surfaces[i].texture = mod->data_textures + (mod->data_surfaces[i].texture - oldtextures);
}
t = &mod->data_textures[mod->num_textures++];
- Mod_LoadTextureFromQ3Shader(mod->mempool, mod->name, t, name, false, true, defaulttexflags, defaultmaterialflags);
+ Mod_LoadTextureFromQ3Shader(mod->mempool, mod->name, t, name, true, true, defaulttexflags, defaultmaterialflags);
+ t->mesh_drawflag = drawflag;
+ t->mesh_defaulttexflags = defaulttexflags;
+ t->mesh_defaultmaterialflags = defaultmaterialflags;
switch (defaultdrawflags & DRAWFLAG_MASK)
{
case DRAWFLAG_ADDITIVE:
}
}
-void Mod_Mesh_ComputeBounds(dp_model_t *mod)
+static void Mod_Mesh_ComputeBounds(dp_model_t *mod)
{
int i;
vec_t x2a, x2b, y2a, y2b, z2a, z2b, x2, y2, z2, yawradius, rotatedradius;
}
}
-void Mod_Mesh_UploadDynamicBuffers(dp_model_t *mod)
+static void Mod_Mesh_UploadDynamicBuffers(dp_model_t *mod)
{
mod->surfmesh.data_element3s_indexbuffer = mod->surfmesh.data_element3s ? R_BufferData_Store(mod->surfmesh.num_triangles * sizeof(short[3]), mod->surfmesh.data_element3s, R_BUFFERDATA_INDEX16, &mod->surfmesh.data_element3s_bufferoffset) : NULL;
mod->surfmesh.data_element3i_indexbuffer = mod->surfmesh.data_element3i ? R_BufferData_Store(mod->surfmesh.num_triangles * sizeof(int[3]), mod->surfmesh.data_element3i, R_BUFFERDATA_INDEX32, &mod->surfmesh.data_element3i_bufferoffset) : NULL;