Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8793 → Rev 8794

/source/build/include/mdsprite.h
194,8 → 194,8
//WARNING: This top block is a union of md2model,md3model,voxmodel: Make sure it matches!
int32_t mdnum; //VOX=1, MD2=2, MD3=3. NOTE: must be first in structure!
int32_t shadeoff;
float scale, bscale, zadd;
uint32_t *texid, texid8bit; // skins for palettes
float scale, bscale, zadd, yoffset;
uint32_t *texid; // skins for palettes
int32_t flags;
 
//VOX specific stuff:
204,6 → 204,7
vec3_t siz;
vec3f_t piv;
int32_t is8bit;
uint32_t texid8bit;
GLuint vbo, vboindex;
} voxmodel_t;
 
/source/build/src/engine.cpp
10549,6 → 10549,15
if (voxmodels[i])
voxvboalloc(voxmodels[i]);
}
 
if (models)
{
for (bssize_t i = 0; i < nextmodelid; i++)
{
if (models[i]->mdnum == 1)
voxvboalloc((voxmodel_t*)models[i]);
}
}
# endif
 
if (g_haveVoxels != 1)
10565,6 → 10574,9
{
voxmodels[i] = voxload(voxfilenames[i]);
voxmodels[i]->scale = voxscale[i]*(1.f/65536.f);
# ifdef USE_GLEXT
voxvboalloc(voxmodels[i]);
# endif
DO_FREE_AND_NULL(voxfilenames[i]);
}
}
10578,6 → 10590,15
if (voxmodels[i])
voxvbofree(voxmodels[i]);
}
 
if (models)
{
for (bssize_t i = 0; i < nextmodelid; i++)
{
if (models[i]->mdnum == 1)
voxvbofree((voxmodel_t*)models[i]);
}
}
# endif
}
#endif
/source/build/src/voxmodel.cpp
402,6 → 402,8
#ifdef USE_GLEXT
void voxvboalloc(voxmodel_t *vm)
{
if (!r_vbos)
return;
const float phack[2] = { 0, 1.f / 256.f };
glGenBuffers(1, &vm->vbo);
glGenBuffers(1, &vm->vboindex);
450,8 → 452,11
 
void voxvbofree(voxmodel_t *vm)
{
if (!vm->vbo)
return;
glDeleteBuffers(1, &vm->vbo);
glDeleteBuffers(1, &vm->vboindex);
vm->vbo = 0;
}
#endif
 
669,11 → 674,6
 
Xfree(shp); Xfree(zbit); Xfree(bx0);
 
#ifdef USE_GLEXT
if (r_vbos)
voxvboalloc(gvox);
#endif
 
return gvox;
}
 
887,9 → 887,9
voxsiz.y = B_LITTLE32(voxsiz.y);
voxsiz.z = B_LITTLE32(voxsiz.z);
#endif
kread(fil, &i, 4); voxpiv.x = (float)B_LITTLE32(i);
kread(fil, &i, 4); voxpiv.y = (float)B_LITTLE32(i);
kread(fil, &i, 4); voxpiv.z = (float)B_LITTLE32(i);
kread(fil, &i, 4); i = B_LITTLE32(i); voxpiv.x = *(float*)&i;
kread(fil, &i, 4); i = B_LITTLE32(i); voxpiv.y = *(float*)&i;
kread(fil, &i, 4); i = B_LITTLE32(i); voxpiv.z = *(float*)&i;
 
int32_t numvoxs;
kread(fil, &numvoxs, 4); numvoxs = B_LITTLE32(numvoxs);