From e200d293b9728103574fc754a4909e4139f2d896 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 2 Jun 2007 03:19:38 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1086 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/model.h | 5 +++-- source/src/rendermodel.cpp | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/source/src/model.h b/source/src/model.h index 07c1cec6..bef7182e 100644 --- a/source/src/model.h +++ b/source/src/model.h @@ -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; diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 579666be..c18732cf 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -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)