*** empty log message ***
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1086 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+3
-2
@@ -25,10 +25,11 @@ struct dynent;
|
||||
|
||||
struct model
|
||||
{
|
||||
bool cullface;
|
||||
float scale;
|
||||
vec translate;
|
||||
|
||||
model() : scale(1), translate(0, 0, 0) {}
|
||||
|
||||
model() : cullface(true), scale(1), translate(0, 0, 0) {}
|
||||
virtual ~model() {}
|
||||
virtual void render(int anim, int varseed, float speed, int basetime, float x, float y, float z, float yaw, float pitch, dynent *d, model *vwepmdl = NULL, float scale = 1.0f) = 0;
|
||||
virtual void setskin(int tex = 0) = 0;
|
||||
|
||||
@@ -11,6 +11,14 @@ model *loadingmodel = NULL;
|
||||
|
||||
#define checkmdl if(!loadingmodel) { conoutf("not loading a model"); return; }
|
||||
|
||||
void mdlcullface(int *cullface)
|
||||
{
|
||||
checkmdl;
|
||||
loadingmodel->cullface = *cullface!=0;
|
||||
}
|
||||
|
||||
COMMAND(mdlcullface, ARG_1INT);
|
||||
|
||||
void mdlscale(int percent)
|
||||
{
|
||||
checkmdl;
|
||||
@@ -131,9 +139,11 @@ void rendermodel(char *mdl, int anim, int tex, float rad, float x, float y, floa
|
||||
glColor3fv(&light.x);
|
||||
m->setskin(tex);
|
||||
|
||||
if(anim&ANIM_MIRROR) glCullFace(GL_BACK);
|
||||
if(!m->cullface) glDisable(GL_CULL_FACE);
|
||||
else if(anim&ANIM_MIRROR) glCullFace(GL_BACK);
|
||||
m->render(anim, varseed, speed, basetime, x, y, z, yaw, pitch, d, vwep, scale);
|
||||
if(anim&ANIM_MIRROR) glCullFace(GL_FRONT);
|
||||
if(!m->cullface) glEnable(GL_CULL_FACE);
|
||||
else if(anim&ANIM_MIRROR) glCullFace(GL_FRONT);
|
||||
}
|
||||
|
||||
int findanim(const char *name)
|
||||
|
||||
Reference in New Issue
Block a user