return Mod_DecompressVis (leaf->compressed_vis, model);
}
-byte *mod_base;
+extern byte *mod_base;
extern cvar_t r_fullbrights;
mt->offsets[j] = LittleLong (mt->offsets[j]);
if ( (mt->width & 15) || (mt->height & 15) )
- Sys_Error ("Texture %s is not 16 aligned", mt->name);
+ Host_Error ("Texture %s is not 16 aligned", mt->name);
// LordHavoc: rewriting the map texture loader for GLQuake
tx = Hunk_AllocName (sizeof(texture_t), loadname );
loadmodel->textures[i] = tx;
freeimage = TRUE;
bytesperpixel = 4;
fullbrights = FALSE;
- transparent = FALSE;
- data = loadimagepixels(mt->name, FALSE, tx->width, tx->height);
+ transparent = TRUE;
+ data = loadimagepixels(mt->name, FALSE, 0, 0); //tx->width, tx->height);
if (!data) // no external texture found
{
freeimage = FALSE;
+ transparent = FALSE;
bytesperpixel = 1;
if (!hlbsp && mt->offsets[0]) // texture included
{
}
else
{
- for (j = 0;j < image_width*image_height;j++)
- if (data[j*4+3] < 255)
- {
- transparent = TRUE;
- break;
- }
+ tx->width = image_width;
+ tx->height = image_height;
}
- if (!hlbsp && !strncmp(mt->name,"sky",3)) // LordHavoc: HL sky textures are entirely unrelated
+ if (!hlbsp && !strncmp(mt->name,"sky",3) && tx->width == 256 && tx->height == 128) // LordHavoc: HL sky textures are entirely unrelated
{
tx->transparent = FALSE;
R_InitSky (data, bytesperpixel);
altmax = num+1;
}
else
- Sys_Error ("Bad animating texture %s", tx->name);
+ Host_Error ("Bad animating texture %s", tx->name);
}
#define ANIM_CYCLE 2
{
tx2 = anims[j];
if (!tx2)
- Sys_Error ("Missing frame %i of %s",j, tx->name);
+ Host_Error ("Missing frame %i of %s",j, tx->name);
tx2->anim_total = max * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE;
{
tx2 = altanims[j];
if (!tx2)
- Sys_Error ("Missing frame %i of %s",j, tx->name);
+ Host_Error ("Missing frame %i of %s",j, tx->name);
tx2->anim_total = altmax * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
{
out->texture = r_notexture_mip; // checkerboard texture
out->flags = 0;
+ out->texture->transparent = FALSE;
}
else
{
if (miptex >= loadmodel->numtextures)
- Sys_Error ("miptex >= loadmodel->numtextures");
+ Host_Error ("miptex >= loadmodel->numtextures");
out->texture = loadmodel->textures[miptex];
if (!out->texture)
{
out->texture = r_notexture_mip; // texture not found
out->flags = 0;
- }
- else
out->texture->transparent = FALSE;
+ }
}
}
}
s->texturemins[i] = bmins[i] * 16;
s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
if ( !(tex->flags & TEX_SPECIAL) && s->extents[i] > 512 /* 256 */ )
- Sys_Error ("Bad surface extents");
+ Host_Error ("Bad surface extents");
}
}
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
{
j = LittleShort(in[i]);
if (j >= loadmodel->numsurfaces)
- Sys_Error ("Mod_ParseMarksurfaces: bad surface number");
+ Host_Error ("Mod_ParseMarksurfaces: bad surface number");
out[i] = loadmodel->surfaces + j;
}
}
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
- Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
+ Host_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
i = LittleLong (header->version);
if (i != BSPVERSION & i != 30)
- Sys_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i or 30 (HalfLife))", mod->name, i, BSPVERSION);
+ Host_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i or 30 (HalfLife))", mod->name, i, BSPVERSION);
hlbsp = i == 30;
halflifebsp.value = hlbsp;