28 #include "../idlib/precompiled.h"
41 #define LL(x) x=LittleLong(x)
66 if (!size || size<0 ) {
75 common->
Warning(
"InitFromFile: %s has wrong version (%i should be %i)",
97 common->
Warning(
"InitFromFile: %s has no frames", fileName );
106 for ( j = 0 ; j < 3 ; j++ ) {
116 for ( j = 0 ; j < 3 ; j++ ) {
141 common->
Error(
"InitFromFile: %s has more than %i verts on a surface (%i)",
145 common->
Error(
"InitFromFile: %s has more than %i triangles on a surface (%i)",
153 int slen = (
int)strlen( surf->
name );
154 for( j = 0; j < slen; j++ ) {
155 surf->
name[
j] = tolower( surf->
name[j] );
160 j = strlen( surf->
name );
161 if ( j > 2 && surf->
name[j-2] ==
'_' ) {
167 for ( j = 0 ; j < surf->
numShaders ; j++, shader++ ) {
184 for ( j = 0 ; j < surf->
numVerts ; j++, st++ ) {
223 short *oldXyz, *newXyz;
224 float oldXyzScale, newXyzScale;
234 if ( backlerp == 0 ) {
238 for (vertNum=0 ; vertNum < numVerts ; vertNum++, newXyz += 4 ) {
242 outvert->
xyz.
x = newXyz[0] * newXyzScale;
243 outvert->
xyz.
y = newXyz[1] * newXyzScale;
244 outvert->
xyz.
z = newXyz[2] * newXyzScale;
256 for (vertNum=0 ; vertNum < numVerts ; vertNum++, oldXyz += 4, newXyz += 4 ) {
261 outvert->
xyz.
x = oldXyz[0] * oldXyzScale + newXyz[0] * newXyzScale;
262 outvert->
xyz.
y = oldXyz[1] * oldXyzScale + newXyz[1] * newXyzScale;
263 outvert->
xyz.
z = oldXyz[2] * oldXyzScale + newXyz[2] * newXyzScale;
319 for (j = 0 ; j < indexes ; j++) {
324 texCoords = (
float *) ((
byte *)surface + surface->
ofsSt);
327 for ( j = 0; j < numVerts; j++ ) {
329 stri->
st[0] = texCoords[j*2+0];
330 stri->
st[1] = texCoords[j*2+1];
const int SHADERPARM_MD3_BACKLERP
const idMaterial * shader
void LerpMeshVertexes(srfTriangles_t *tri, const struct md3Surface_s *surf, const float backlerp, const int frame, const int oldframe) const
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
idFileSystem * fileSystem
const idMaterial * shader
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
srfTriangles_t * R_AllocStaticTriSurf(void)
#define SHADER_MAX_VERTEXES
virtual void FreeFile(void *buffer)=0
virtual void InitFromFile(const char *fileName)
bool AddPoint(const idVec3 &v)
virtual idBounds Bounds(const struct renderEntity_s *ent) const
srfTriangles_t * geometry
virtual idRenderModel * InstantiateDynamicModel(const struct renderEntity_s *ent, const struct viewDef_s *view, idRenderModel *cachedModel)
#define SHADER_MAX_INDEXES
void R_BoundTriSurf(srfTriangles_t *tri)
const int SHADERPARM_MD3_FRAME
idDeclManager * declManager
const int SHADERPARM_MD3_LASTFRAME
short LittleShort(short l)
float LittleFloat(float l)
void R_AllocStaticTriSurfIndexes(srfTriangles_t *tri, int numIndexes)
void * Mem_Alloc(const int size)
virtual void Error(const char *fmt,...) id_attribute((format(printf
void R_AllocStaticTriSurfVerts(srfTriangles_t *tri, int numVerts)
virtual dynamicModel_t IsDynamicModel() const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
float shaderParms[MAX_ENTITY_SHADER_PARMS]
virtual void AddSurface(modelSurface_t surface)