Commit 8cc49790 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: minor speed improvements to the voxel -> model conversion process

Not particularly exciting or useful now that the converted versions are cached.
parent 617ceff1
......@@ -189,7 +189,11 @@ typedef struct
#if (VOXUSECHAR != 0)
typedef struct { uint8_t x, y, z, u, v; } vert_t;
#else
typedef struct { uint16_t x, y, z, u, v; } vert_t;
typedef struct
{
union { struct { uint16_t x, y, z; }; vec3_u16_t xyz; };
union { struct { uint16_t u, v; }; vec2_u16_t uv; };
} vert_t;
#endif
typedef struct { vert_t v[4]; } voxrect_t;
......
......@@ -11695,7 +11695,8 @@ static void PolymostProcessVoxels(void)
LOG_F(INFO, "Generating 3D meshes from voxel model data. This may take a while...");
videoNextPage();
double time = timerGetFractionalTicks();
int cnt = 0;
for (bssize_t i=0; i<MAXVOXELS; i++)
{
if (voxfilenames[i])
......@@ -11706,8 +11707,10 @@ static void PolymostProcessVoxels(void)
voxvboalloc(voxmodels[i]);
# endif
DO_FREE_AND_NULL(voxfilenames[i]);
cnt++;
}
}
LOG_F(INFO, "Generated 3D meshes for %d voxels in %.2f ms.", cnt, timerGetFractionalTicks() - time);
}
static void PolymostFreeVBOs(void)
......
......@@ -26,8 +26,7 @@ static int32_t *vcolhashead = 0, vcolhashsizm1;
typedef struct { int32_t p, c, n; } voxcol_t;
static voxcol_t *vcol = 0; int32_t vnum = 0, vmax = 0;
typedef struct { int16_t x, y; } spoint2d;
static spoint2d *shp;
static vec2_u16_t *shp;
static int32_t *shcntmal, *shcnt = 0, shcntp;
static int32_t mytexo5, *zbit, gmaxx, gmaxy, garea, pow2m1[33];
......@@ -42,9 +41,9 @@ uint32_t gloadtex_indexed(const int32_t *picbuf, int32_t xsiz, int32_t ysiz)
const coltype *const pic = (const coltype *)picbuf;
char *pic2 = (char *)Xmalloc(xsiz*ysiz*sizeof(char));
for (bssize_t i=0; i < ysiz; i++)
for (int i=0; i < ysiz; i++)
{
for (bssize_t j=0; j < xsiz; j++)
for (int j=0; j < xsiz; j++)
{
pic2[j*ysiz+i] = pic[i*xsiz+j].a;
}
......@@ -77,7 +76,7 @@ uint32_t gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8
if (!is8bit)
{
for (bssize_t i=xsiz*ysiz-1; i>=0; i--)
for (int i=xsiz*ysiz-1; i>=0; i--)
{
coltype &tcol = pic2[i];
tcol.b = cptr[pic[i].r];
......@@ -93,7 +92,7 @@ uint32_t gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8
if (palookup[dapal] == NULL)
dapal = 0;
for (bssize_t i=xsiz*ysiz-1; i>=0; i--)
for (int i=xsiz*ysiz-1; i>=0; i--)
{
const int32_t ii = palookup[dapal][pic[i].a];
......@@ -166,14 +165,8 @@ static void setzrange1(int32_t *lptr, int32_t z0, int32_t z1)
lptr[z] |=~-(1<<SHIFTMOD32(z1));
}
static int32_t isrectfree(int32_t x0, int32_t y0, int32_t dx, int32_t dy)
static bool isrectfree(int32_t x0, int32_t y0, int32_t dx, int32_t dy)
{
#if 0
int32_t i, j, x;
i = y0*gvox->mytexx + x0;
for (dy=0; dy; dy--, i+=gvox->mytexx)
for (x=0; x<dx; x++) { j = i+x; if (zbit[j>>5]&(1<<SHIFTMOD32(j))) return 0; }
#else
int32_t i = y0*mytexo5 + (x0>>5);
dx += x0-1;
const int32_t c = (dx>>5) - (x0>>5);
......@@ -203,18 +196,11 @@ static int32_t isrectfree(int32_t x0, int32_t y0, int32_t dx, int32_t dy)
return 0;
}
}
#endif
return 1;
}
static void setrect(int32_t x0, int32_t y0, int32_t dx, int32_t dy)
{
#if 0
int32_t i, j, y;
i = y0*gvox->mytexx + x0;
for (y=0; y<dy; y++, i+=gvox->mytexx)
for (x=0; x<dx; x++) { j = i+x; zbit[j>>5] |= (1<<SHIFTMOD32(j)); }
#else
int32_t i = y0*mytexo5 + (x0>>5);
dx += x0-1;
const int32_t c = (dx>>5) - (x0>>5);
......@@ -240,7 +226,6 @@ static void setrect(int32_t x0, int32_t y0, int32_t dx, int32_t dy)
zbit[i+x] |= m1;
}
}
#endif
}
static void cntquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1, int32_t z1,
......@@ -289,56 +274,70 @@ static void addquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1,
switch (face)
{
case 0:
ny = y1; x2 = x0; x0 = x1; x1 = x2; break;
case 1:
ny = y0; y0++; y1++; y2++; break;
case 2:
nz = z1; y0 = y2; y2 = y1; y1 = y0; z0++; z1++; z2++; break;
case 3:
nz = z0; break;
case 4:
nx = x1; y2 = y0; y0 = y1; y1 = y2; x0++; x1++; x2++; break;
case 5:
nx = x0; break;
}
for (bssize_t yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (bssize_t xx=0; xx<x; xx++)
{
switch (face)
ny = y1; x2 = x0; x0 = x1; x1 = x2;
for (int yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (int xx=0; xx<x; xx++)
{
case 0:
if (i < 3) { nx = x1+x-1-xx; nz = z1+yy; } //back
else { nx = x1+y-1-yy; nz = z1+xx; }
break;
case 1:
lptr[xx] = getvox(nx, ny, nz);
}
break;
case 1:
ny = y0; y0++; y1++; y2++;
for (int yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (int xx=0; xx<x; xx++)
{
if (i < 3) { nx = x0+xx; nz = z0+yy; } //front
else { nx = x0+yy; nz = z0+xx; }
break;
case 2:
lptr[xx] = getvox(nx, ny, nz);
}
break;
case 2:
nz = z1; y0 = y2; y2 = y1; y1 = y0; z0++; z1++; z2++;
for (int yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (int xx=0; xx<x; xx++)
{
if (i < 3) { nx = x1-x+xx; ny = y1-1-yy; } //bot
else { nx = x1-1-yy; ny = y1-1-xx; }
break;
case 3:
lptr[xx] = getvox(nx, ny, nz);
}
break;
case 3:
nz = z0;
for (int yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (int xx = 0; xx < x; xx++)
{
if (i < 3) { nx = x0+xx; ny = y0+yy; } //top
else { nx = x0+yy; ny = y0+xx; }
break;
case 4:
lptr[xx] = getvox(nx, ny, nz);
}
break;
case 4:
nx = x1; y2 = y0; y0 = y1; y1 = y2; x0++; x1++; x2++;
for (int yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (int xx = 0; xx < x; xx++)
{
if (i < 3) { ny = y1+x-1-xx; nz = z1+yy; } //right
else { ny = y1+y-1-yy; nz = z1+xx; }
break;
case 5:
lptr[xx] = getvox(nx, ny, nz);
}
break;
case 5:
nx = x0;
for (int yy=0; yy<y; yy++, lptr+=gvox->mytexx)
for (int xx = 0; xx < x; xx++)
{
if (i < 3) { ny = y0+xx; nz = z0+yy; } //left
else { ny = y0+yy; nz = z0+xx; }
break;
lptr[xx] = getvox(nx, ny, nz);
}
lptr[xx] = getvox(nx, ny, nz);
}
break;
}
//Extend borders horizontally
for (bssize_t yy=VOXBORDWIDTH; yy<y+VOXBORDWIDTH; yy++)
for (bssize_t xx=0; xx<VOXBORDWIDTH; xx++)
for (int xx=0; xx<VOXBORDWIDTH; xx++)
for (int yy=VOXBORDWIDTH; yy<y+VOXBORDWIDTH; yy++)
{
lptr = &gvox->mytex[(shp[z].y+yy)*gvox->mytexx + shp[z].x];
lptr[xx] = lptr[VOXBORDWIDTH];
......@@ -346,7 +345,7 @@ static void addquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1,
}
//Extend borders vertically
for (bssize_t yy=0; yy<VOXBORDWIDTH; yy++)
for (int yy=0; yy<VOXBORDWIDTH; yy++)
{
Bmemcpy(&gvox->mytex[(shp[z].y+yy)*gvox->mytexx + shp[z].x],
&gvox->mytex[(shp[z].y+VOXBORDWIDTH)*gvox->mytexx + shp[z].x],
......@@ -362,11 +361,10 @@ static void addquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1,
qptr->v[1].x = x1; qptr->v[1].y = y1; qptr->v[1].z = z1;
qptr->v[2].x = x2; qptr->v[2].y = y2; qptr->v[2].z = z2;
for (bssize_t j=0; j<3; j++)
{
qptr->v[j].u = shp[z].x+VOXBORDWIDTH;
qptr->v[j].v = shp[z].y+VOXBORDWIDTH;
}
constexpr vec2_u16_t vbw = { VOXBORDWIDTH, VOXBORDWIDTH };
for (int j=0; j<3; j++)
qptr->v[j].uv = shp[z]+vbw;
if (i < 3)
qptr->v[1].u += x;
......@@ -376,11 +374,8 @@ static void addquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1,
qptr->v[2].u += x;
qptr->v[2].v += y;
qptr->v[3].u = qptr->v[0].u - qptr->v[1].u + qptr->v[2].u;
qptr->v[3].v = qptr->v[0].v - qptr->v[1].v + qptr->v[2].v;
qptr->v[3].x = qptr->v[0].x - qptr->v[1].x + qptr->v[2].x;
qptr->v[3].y = qptr->v[0].y - qptr->v[1].y + qptr->v[2].y;
qptr->v[3].z = qptr->v[0].z - qptr->v[1].z + qptr->v[2].z;
qptr->v[3].uv = qptr->v[0].uv - qptr->v[1].uv + qptr->v[2].uv;
qptr->v[3].xyz = qptr->v[0].xyz - qptr->v[1].xyz + qptr->v[2].xyz;
if (gqfacind[face] < 0)
gqfacind[face] = gvox->qcnt;
......@@ -390,16 +385,15 @@ static void addquad(int32_t x0, int32_t y0, int32_t z0, int32_t x1, int32_t y1,
static inline int32_t isolid(int32_t x, int32_t y, int32_t z)
{
if ((uint32_t)x >= (uint32_t)voxsiz.x) return 0;
if ((uint32_t)y >= (uint32_t)voxsiz.y) return 0;
if ((uint32_t)z >= (uint32_t)voxsiz.z) return 0;
if (((uint32_t)x >= (uint32_t)voxsiz.x) | ((uint32_t)y >= (uint32_t)voxsiz.y) | ((uint32_t)z >= (uint32_t)voxsiz.z))
return 0;
z += x*yzsiz + y*voxsiz.z;
return vbit[z>>5] & (1<<SHIFTMOD32(z));
return (vbit[z>>5] & (1<<SHIFTMOD32(z))) != 0;
}
static FORCE_INLINE int isair(int32_t i)
static FORCE_INLINE int isair(int const i)
{
return !(vbit[i>>5] & (1<<SHIFTMOD32(i)));
}
......@@ -438,22 +432,18 @@ static voxmodel_t *vox2poly()
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;
auto vdim = voxsiz;
if (x < y && x < z)
x = z;
else if (y < z)
y = z;
if (vdim.x < vdim.y && vdim.x < vdim.z)
vdim.x = vdim.z;
else if (vdim.y < vdim.z)
vdim.y = vdim.z;
if (x < y)
{
z = x;
x = y;
y = z;
}
if (vdim.x < vdim.y)
vdim = { vdim.y, vdim.z, vdim.x };
shcntp = x;
int32_t i = x*y*sizeof(int32_t);
shcntp = vdim.x;
int32_t i = vdim.x*vdim.y*sizeof(int32_t);
shcntmal = (int32_t *)Xmalloc(i);
memset(shcntmal, 0, i);
......@@ -477,7 +467,7 @@ static voxmodel_t *vox2poly()
int32_t ov, oz=0;
for (bssize_t cnt=0; cnt<2; cnt++)
for (int cnt=0; cnt<2; cnt++)
{
void (*daquad)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t) =
cnt == 0 ? cntquad : addquad;
......@@ -488,9 +478,9 @@ static voxmodel_t *vox2poly()
int32_t v = 0;
for (i=-1; i<=1; i+=2)
for (bssize_t y=0; y<voxsiz.y; y++)
for (bssize_t x=0; x<=voxsiz.x; x++)
for (bssize_t z=0; z<=voxsiz.z; z++)
for (int y=0; y<voxsiz.y; y++)
for (int x=0; x<=voxsiz.x; x++)
for (int z=0; z<=voxsiz.z; z++)
{
ov = v; v = (isolid(x, y, z) && (!isolid(x, y+i, z)));
if ((by0[z] >= 0) && ((by0[z] != oz) || (v >= ov)))
......@@ -504,9 +494,9 @@ static voxmodel_t *vox2poly()
}
for (i=-1; i<=1; i+=2)
for (bssize_t z=0; z<voxsiz.z; z++)
for (bssize_t x=0; x<=voxsiz.x; x++)
for (bssize_t y=0; y<=voxsiz.y; y++)
for (int z=0; z<voxsiz.z; z++)
for (int x=0; x<=voxsiz.x; x++)
for (int y=0; y<=voxsiz.y; y++)
{
ov = v; v = (isolid(x, y, z) && (!isolid(x, y, z-i)));
if ((by0[y] >= 0) && ((by0[y] != oz) || (v >= ov)))
......@@ -520,9 +510,9 @@ static voxmodel_t *vox2poly()
}
for (i=-1; i<=1; i+=2)
for (bssize_t x=0; x<voxsiz.x; x++)
for (bssize_t y=0; y<=voxsiz.y; y++)
for (bssize_t z=0; z<=voxsiz.z; z++)
for (int x=0; x<voxsiz.x; x++)
for (int y=0; y<=voxsiz.y; y++)
for (int z=0; z<=voxsiz.z; z++)
{
ov = v; v = (isolid(x, y, z) && (!isolid(x-i, y, z)));
if ((by0[z] >= 0) && ((by0[z] != oz) || (v >= ov)))
......@@ -537,12 +527,12 @@ static voxmodel_t *vox2poly()
if (!cnt)
{
shp = (spoint2d *)Xmalloc(gvox->qcnt*sizeof(spoint2d));
shp = (vec2_u16_t *)Xmalloc(gvox->qcnt*sizeof(vec2_u16_t));
int32_t sc = 0;
for (bssize_t y=gmaxy; y; y--)
for (bssize_t x=gmaxx; x>=y; x--)
for (int y=gmaxy; y; y--)
for (int x=gmaxx; x>=y; x--)
{
i = shcnt[y*shcntp+x]; shcnt[y*shcntp+x] = sc; //shcnt changes from counter to head index
......@@ -576,10 +566,11 @@ skindidntfit:
memset(zbit, 0, i);
v = gvox->mytexx*gvox->mytexy;
for (bssize_t z=0; z<sc; z++)
constexpr vec2_u16_t vbw = { (VOXBORDWIDTH<<1), (VOXBORDWIDTH<<1) };
for (int z=0; z<sc; z++)
{
const int32_t dx = shp[z].x + (VOXBORDWIDTH<<1);
const int32_t dy = shp[z].y + (VOXBORDWIDTH<<1);
auto d = shp[z] + vbw;
i = v;
int32_t x0, y0;
......@@ -587,11 +578,11 @@ skindidntfit:
do
{
#if (VOXUSECHAR != 0)
x0 = ((rand()&32767)*(min(gvox->mytexx, 255)-dx))>>15;
y0 = ((rand()&32767)*(min(gvox->mytexy, 255)-dy))>>15;
x0 = ((rand()&32767)*(min(gvox->mytexx, 255)-d.x))>>15;
y0 = ((rand()&32767)*(min(gvox->mytexy, 255)-d.y))>>15;
#else
x0 = ((rand()&32767)*(gvox->mytexx+1-dx))>>15;
y0 = ((rand()&32767)*(gvox->mytexy+1-dy))>>15;
x0 = ((rand()&32767)*(gvox->mytexx+1-d.x))>>15;
y0 = ((rand()&32767)*(gvox->mytexy+1-d.y))>>15;
#endif
i--;
if (i < 0) //Time-out! Very slow if this happens... but at least it still works :P
......@@ -624,14 +615,14 @@ skindidntfit:
goto skindidntfit;
}
} while (!isrectfree(x0, y0, dx, dy));
} while (!isrectfree(x0, y0, d.x, d.y));
while (y0 && isrectfree(x0, y0-1, dx, 1))
while (y0 && isrectfree(x0, y0-1, d.x, 1))
y0--;
while (x0 && isrectfree(x0-1, y0, 1, dy))
while (x0 && isrectfree(x0-1, y0, 1, d.y))
x0--;
setrect(x0, y0, dx, dy);
setrect(x0, y0, d.x, d.y);
shp[z].x = x0; shp[z].y = y0; //Overwrite size with top-left location
}
......@@ -654,17 +645,14 @@ skindidntfit:
for (int i = 0; i < gvox->qcnt; i++)
{
const vert_t *const vptr = &gquad[i].v[0];
const int32_t xx = vptr[0].x + vptr[2].x;
const int32_t yy = vptr[0].y + vptr[2].y;
const int32_t zz = vptr[0].z + vptr[2].z;
auto const vptr = &gquad[i].v[0];
auto const vsum = vptr[0].xyz + vptr[2].xyz;
for (int j=0; j<4; j++)
{
gvox->vertex[((i<<2)+j)*5+0] = ((float)vptr[j].x) - phack[xx>vptr[j].x*2] + phack[xx<vptr[j].x*2];
gvox->vertex[((i<<2)+j)*5+1] = ((float)vptr[j].y) - phack[yy>vptr[j].y*2] + phack[yy<vptr[j].y*2];
gvox->vertex[((i<<2)+j)*5+2] = ((float)vptr[j].z) - phack[zz>vptr[j].z*2] + phack[zz<vptr[j].z*2];
gvox->vertex[((i<<2)+j)*5+0] = ((float)vptr[j].x) - phack[vsum.x>(vptr[j].x<<1)] + phack[vsum.x<(vptr[j].x<<1)];
gvox->vertex[((i<<2)+j)*5+1] = ((float)vptr[j].y) - phack[vsum.y>(vptr[j].y<<1)] + phack[vsum.y<(vptr[j].y<<1)];
gvox->vertex[((i<<2)+j)*5+2] = ((float)vptr[j].z) - phack[vsum.z>(vptr[j].z<<1)] + phack[vsum.z<(vptr[j].z<<1)];
gvox->vertex[((i<<2)+j)*5+3] = ((float)vptr[j].u)*ru;
gvox->vertex[((i<<2)+j)*5+4] = ((float)vptr[j].v)*rv;
......@@ -679,6 +667,8 @@ skindidntfit:
gvox->index[((i<<1)+1)*3+2] = (i<<2)+3;
}
DO_FREE_AND_NULL(gquad);
return gvox;
}
......@@ -701,7 +691,7 @@ static void read_pal(buildvfs_kfd fil, int32_t pal[256])
{
klseek(fil, -768, SEEK_END);
for (bssize_t i=0; i<256; i++)
for (int i=0; i<256; i++)
{
char c[3];
kread(fil, c, 3);
......@@ -738,12 +728,12 @@ static int32_t loadvox(const char *filnam)
char *const tbuf = (char *)Xmalloc(voxsiz.z*sizeof(uint8_t));
klseek(fil, 12, SEEK_SET);
for (bssize_t x=0; x<voxsiz.x; x++)
for (bssize_t y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
for (int x=0; x<voxsiz.x; x++)
for (int y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
{
kread(fil, tbuf, voxsiz.z);
for (bssize_t z=voxsiz.z-1; z>=0; z--)
for (int z=voxsiz.z-1; z>=0; z--)
if (tbuf[z] != 255)
{
const int32_t i = j+z;
......@@ -752,17 +742,17 @@ static int32_t loadvox(const char *filnam)
}
klseek(fil, 12, SEEK_SET);
for (bssize_t x=0; x<voxsiz.x; x++)
for (bssize_t y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
for (int x=0; x<voxsiz.x; x++)
for (int y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
{
kread(fil, tbuf, voxsiz.z);
for (bssize_t z=0; z<voxsiz.z; z++)
for (int z=0; z<voxsiz.z; z++)
{
if (tbuf[z] == 255)
continue;
if (!x || !y || !z || x == voxsiz.x-1 || y == voxsiz.y-1 || z == voxsiz.z-1)
if (!x | !y | !z | (x == voxsiz.x-1) | (y == voxsiz.y-1) | (z == voxsiz.z-1))
{
putvox(x, y, z, pal[tbuf[z]]);
continue;
......@@ -770,9 +760,9 @@ static int32_t loadvox(const char *filnam)
const int32_t k = j+z;
if (isair(k-yzsiz) || isair(k+yzsiz) ||
isair(k-voxsiz.z) || isair(k+voxsiz.z) ||
isair(k-1) || isair(k+1))
if (isair(k-yzsiz) | isair(k+yzsiz) |
isair(k-voxsiz.z) | isair(k+voxsiz.z) |
isair(k-1) | isair(k+1))
{
putvox(x, y, z, pal[tbuf[z]]);
continue;
......@@ -837,8 +827,8 @@ static int32_t loadkvx(const char *filnam)
char *cptr = tbuf;
for (bssize_t x=0; x<voxsiz.x; x++) //Set surface voxels to 1 else 0
for (bssize_t y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
for (int x=0; x<voxsiz.x; x++) //Set surface voxels to 1 else 0
for (int y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
{
i = xyoffs[x*ysizp1+y+1] - xyoffs[x*ysizp1+y];
if (!i)
......@@ -860,7 +850,7 @@ static int32_t loadkvx(const char *filnam)
setzrange1(vbit, j+z0, j+z1); // PK: oob in AMC TC dev if vbit alloc'd w/o +1
for (bssize_t z=z0; z<z1; z++)
for (int z=z0; z<z1; z++)
putvox(x, y, z, pal[*cptr++]);
}
}
......@@ -917,8 +907,8 @@ static int32_t loadkv6(const char *filnam)
vcolhashsizm1--;
alloc_vcolhashead();
for (bssize_t x=0; x<voxsiz.x; x++)
for (bssize_t y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
for (int x=0; x<voxsiz.x; x++)
for (int y=0, j=x*yzsiz; y<voxsiz.y; y++, j+=voxsiz.z)
{
int32_t z1 = voxsiz.z;
......@@ -996,8 +986,8 @@ voxmodel_t *voxload(const char *filnam)
{
vm->mdnum = 1; //VOXel model id
vm->scale = vm->bscale = 1.f;
vm->siz.x = voxsiz.x; vm->siz.y = voxsiz.y; vm->siz.z = voxsiz.z;
vm->piv.x = voxpiv.x; vm->piv.y = voxpiv.y; vm->piv.z = voxpiv.z;
vm->siz = voxsiz;
vm->piv = voxpiv;
vm->is8bit = is8bit;
vm->texid = (uint32_t*)Xcalloc(MAXPALOOKUPS, sizeof(uint32_t));
......
Supports Markdown
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