UFO: Alien Invasion
Loading...
Searching...
No Matches
r_model_md2.cpp File Reference

md2 alias model loading More...

#include "r_local.h"
Include dependency graph for r_model_md2.cpp:

Go to the source code of this file.

Functions

static void R_ModLoadTags (model_t *mod, void *buffer, int bufSize)
static void R_ModLoadAliasMD2MeshUnindexed (model_t *mod, const dMD2Model_t *md2, int bufSize, bool loadNormals)
 Assume that the indexArray is NOT filled, and load data for the model accordingly.
static void R_ModLoadAliasMD2MeshIndexed (model_t *mod, const dMD2Model_t *md2, int bufSize)
 Assume that the indexArray is already filled, and load data for the model accordingly.
static void R_ModLoadAliasMD2Mesh (model_t *mod, const dMD2Model_t *md2, int bufSize, bool loadNormals)
 See if the model has an MDX file, and then load the model data appropriately for either case.
static void R_ModLoadLevelOfDetailData (model_t *mod, bool loadNormals)
 Adds new meshes to md2 models for different level of detail meshes.
void R_ModLoadAliasMD2Model (model_t *mod, byte *buffer, int bufSize, bool loadNormals)
 Load MD2 models from file.

Detailed Description

md2 alias model loading

Definition in file r_model_md2.cpp.

Function Documentation

◆ R_ModLoadAliasMD2Mesh()

void R_ModLoadAliasMD2Mesh ( model_t * mod,
const dMD2Model_t * md2,
int bufSize,
bool loadNormals )
static

◆ R_ModLoadAliasMD2MeshIndexed()

void R_ModLoadAliasMD2MeshIndexed ( model_t * mod,
const dMD2Model_t * md2,
int bufSize )
static

◆ R_ModLoadAliasMD2MeshUnindexed()

void R_ModLoadAliasMD2MeshUnindexed ( model_t * mod,
const dMD2Model_t * md2,
int bufSize,
bool loadNormals )
static

Assume that the indexArray is NOT filled, and load data for the model accordingly.

Todo
Should we check skin image versus this size?

Definition at line 101 of file r_model_md2.cpp.

References AABB::add(), model_t::alias, bufSize, Com_Error(), Com_Printf(), ERR_DROP, mAliasFrame_t::fBox, mAliasModel_t::frames, dMD2Model_t::framesize, i, index, mAliasMesh_t::indexes, LittleFloat, LittleLong, LittleShort, mAliasCoord_t, MAX_ALIAS_VERTS, AABB::maxs, MD2_MAX_SKINNAME, MD2_MAX_SKINS, MD2_MAX_TRIANGLES, MD2_MAX_VERTS, Mem_Free, Mem_PoolAllocTypeN, mAliasModel_t::meshes, AABB::mins, model_t::modBox, image_t::name, mAliasMesh_t::name, mAliasSkin_t::name, model_t::name, dMD2Model_t::num_frames, mAliasModel_t::num_frames, mAliasMesh_t::num_indexes, mAliasModel_t::num_meshes, dMD2Model_t::num_skins, mAliasMesh_t::num_skins, dMD2Model_t::num_tris, mAliasMesh_t::num_tris, dMD2Model_t::num_verts, mAliasMesh_t::num_verts, dMD2Model_t::ofs_frames, dMD2Model_t::ofs_skins, dMD2Model_t::ofs_st, dMD2Model_t::ofs_tris, mAliasVertex_t::point, Q_strncpyz(), Q_strstart(), R_AliasModelGetSkin(), R_LoadActorSkinsFromModel(), R_ModCalcUniqueNormalsAndTangents(), R_UseActorSkin(), dMD2Frame_t::scale, mAliasFrame_t::scale, mAliasSkin_t::skin, mAliasMesh_t::skinHeight, dMD2Model_t::skinheight, mAliasMesh_t::skins, mAliasMesh_t::skinWidth, dMD2Model_t::skinwidth, mAliasMesh_t::stcoords, dMD2Frame_t::translate, mAliasFrame_t::translate, v, VectorCopy, VectorMA(), mAliasMesh_t::vertexes, dMD2Frame_t::verts, and vid_modelPool.

Referenced by R_ModLoadAliasMD2Mesh().

◆ R_ModLoadAliasMD2Model()

◆ R_ModLoadLevelOfDetailData()

void R_ModLoadLevelOfDetailData ( model_t * mod,
bool loadNormals )
static

Adds new meshes to md2 models for different level of detail meshes.

Parameters
modThe model to load the lod models for
loadNormalsIf true, load vertex normals
Note
We support three different levels here

Definition at line 450 of file r_model_md2.cpp.

References bufSize, Com_Printf(), Com_sprintf(), Com_StripExtension(), FS_CheckFile(), FS_FreeFile(), FS_LoadFile(), i, MAX_QPATH, model_t::name, and R_ModLoadAliasMD2Mesh().

Referenced by R_ModLoadAliasMD2Model().

◆ R_ModLoadTags()