Commit cb6f5158 authored by Dino Bollinger's avatar Dino Bollinger
Browse files

Engine: Fix a bug introduced with voxel caching in fa3d6784

The texturecache file shouldn't be affected I think
parent 9c9518fd
......@@ -922,7 +922,7 @@ voxmodel_t* voxcache_fetchvoxmodel(const char* const cacheid)
voxcachedat_t voxd = {};
size_t vertexsize, indexsize, mytexsize, totalsize;
voxmodel_t* vm = (voxmodel_t*)Xmalloc(sizeof(voxmodel_t));
voxmodel_t* vm = (voxmodel_t*)Xcalloc(1, sizeof(voxmodel_t));
texcache.dataFilePos = texcache.entries[i]->offset;
texcache_readdata(&voxd, sizeof(voxd));
......
......@@ -435,8 +435,7 @@ void voxvbofree(voxmodel_t *vm)
static voxmodel_t *vox2poly()
{
gvox = (voxmodel_t *)Xmalloc(sizeof(voxmodel_t));
memset(gvox, 0, sizeof(voxmodel_t));
gvox = (voxmodel_t *)Xcalloc(1, sizeof(voxmodel_t));
//x is largest dimension, y is 2nd largest dimension
int32_t x = voxsiz.x, y = voxsiz.y, z = voxsiz.z;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment