@@ -114,7 +114,7 @@ struct animmodel : model
114114 bool alphablend, cullface;
115115 shaderparamskey *key;
116116
117- skin () : owner(0 ), tex(notexture), masks(notexture), envmap(NULL ), normalmap(NULL ), shader(NULL ), alphablend(true ), cullface(true ), key(NULL ) {}
117+ skin () : owner(0 ), tex(notexture), masks(notexture), envmap(nullptr ), normalmap(nullptr ), shader(nullptr ), alphablend(true ), cullface(true ), key(nullptr ) {}
118118
119119 bool masked () const { return masks != notexture; }
120120 bool envmapped () { return envmapmax>0 && envmapmodels; }
@@ -175,7 +175,7 @@ struct animmodel : model
175175 {
176176 #define DOMODELSHADER (name, body ) \
177177 do { \
178- static Shader *name##shader = NULL ; \
178+ static Shader *name##shader = nullptr ; \
179179 if (!name##shader) name##shader = useshaderbyname (#name); \
180180 body; \
181181 } while (0 )
@@ -200,7 +200,7 @@ struct animmodel : model
200200
201201 void cleanup ()
202202 {
203- if (shader && shader->standard ) shader = NULL ;
203+ if (shader && shader->standard ) shader = nullptr ;
204204 }
205205
206206 void preloadBIH ()
@@ -297,7 +297,7 @@ struct animmodel : model
297297 char *name;
298298 bool noclip;
299299
300- mesh () : group(NULL ), name(NULL ), noclip(false )
300+ mesh () : group(nullptr ), name(nullptr ), noclip(false )
301301 {
302302 }
303303
@@ -491,7 +491,7 @@ struct animmodel : model
491491 char *name;
492492 vector<mesh *> meshes;
493493
494- meshgroup () : next(NULL ), shared(0 ), name(NULL )
494+ meshgroup () : next(nullptr ), shared(0 ), name(nullptr )
495495 {
496496 }
497497
@@ -600,7 +600,7 @@ struct animmodel : model
600600 }
601601 };
602602
603- virtual meshgroup *loadmeshes (const char *name, va_list args) { return NULL ; }
603+ virtual meshgroup *loadmeshes (const char *name, va_list args) { return nullptr ; }
604604
605605 meshgroup *sharemeshes (const char *name, ...)
606606 {
@@ -611,7 +611,7 @@ struct animmodel : model
611611 va_start (args, name);
612612 meshgroup *group = loadmeshes (name, args);
613613 va_end (args);
614- if (!group) return NULL ;
614+ if (!group) return nullptr ;
615615 meshgroups.add (group);
616616 }
617617 return meshgroups[name];
@@ -625,7 +625,7 @@ struct animmodel : model
625625 modelattach *attached;
626626 matrix4 matrix;
627627
628- linkedpart () : p(NULL ), tag(-1 ), anim(-1 ), basetime(0 ), translate(0 , 0 , 0 ), rotate(0 , 0 , 0 ), attached(NULL ) {}
628+ linkedpart () : p(nullptr ), tag(-1 ), anim(-1 ), basetime(0 ), translate(0 , 0 , 0 ), rotate(0 , 0 , 0 ), attached(nullptr ) {}
629629 };
630630
631631 struct part
@@ -640,9 +640,9 @@ struct animmodel : model
640640 float pitchscale, pitchoffset, pitchmin, pitchmax;
641641 vec translate;
642642
643- part (animmodel *model, int index = 0 ) : model(model), index(index), meshes(NULL ), numanimparts(1 ), pitchscale(1 ), pitchoffset(0 ), pitchmin(0 ), pitchmax(0 ), translate(0 , 0 , 0 )
643+ part (animmodel *model, int index = 0 ) : model(model), index(index), meshes(nullptr ), numanimparts(1 ), pitchscale(1 ), pitchoffset(0 ), pitchmin(0 ), pitchmax(0 ), translate(0 , 0 , 0 )
644644 {
645- loopk (MAXANIMPARTS) anims[k] = NULL ;
645+ loopk (MAXANIMPARTS) anims[k] = nullptr ;
646646 }
647647 virtual ~part ()
648648 {
@@ -685,7 +685,7 @@ struct animmodel : model
685685 }
686686 }
687687
688- bool link (part *p, const char *tag, const vec &translate = vec(0 , 0 , 0 ), const vec &rotate = vec(0 , 0 , 0 ), int anim = -1, int basetime = 0, modelattach *attached = NULL )
688+ bool link (part *p, const char *tag, const vec &translate = vec(0 , 0 , 0 ), const vec &rotate = vec(0 , 0 , 0 ), int anim = -1, int basetime = 0, modelattach *attached = nullptr )
689689 {
690690 int i = meshes ? meshes->findtag (tag) : -1 ;
691691 if (i<0 )
@@ -774,7 +774,7 @@ struct animmodel : model
774774 }
775775 else
776776 {
777- animspec *spec = NULL ;
777+ animspec *spec = nullptr ;
778778 if (anims[animpart])
779779 {
780780 int primaryidx = anim&ANIM_INDEX;
@@ -1009,7 +1009,7 @@ struct animmodel : model
10091009 animmodel *m = (animmodel *)a[i].m ;
10101010 if (!m)
10111011 {
1012- if (a[i].pos ) link (NULL , a[i].tag , vec (0 , 0 , 0 ), vec (0 , 0 , 0 ), 0 , 0 , &a[i]);
1012+ if (a[i].pos ) link (nullptr , a[i].tag , vec (0 , 0 , 0 ), vec (0 , 0 , 0 ), 0 , 0 , &a[i]);
10131013 continue ;
10141014 }
10151015 part *p = m->parts [0 ];
@@ -1031,14 +1031,14 @@ struct animmodel : model
10311031 }
10321032
10331033 animstate as[MAXANIMPARTS];
1034- parts[0 ]->render (anim, basetime, basetime2, pitch, axis, forward, d, NULL , as);
1034+ parts[0 ]->render (anim, basetime, basetime2, pitch, axis, forward, d, nullptr , as);
10351035
10361036 if (a) for (int i = numtags-1 ; i >= 0 ; i--)
10371037 {
10381038 animmodel *m = (animmodel *)a[i].m ;
10391039 if (!m)
10401040 {
1041- if (a[i].pos ) unlink (NULL );
1041+ if (a[i].pos ) unlink (nullptr );
10421042 continue ;
10431043 }
10441044 part *p = m->parts [0 ];
@@ -1192,7 +1192,7 @@ struct animmodel : model
11921192 return bih;
11931193 }
11941194
1195- bool link (part *p, const char *tag, const vec &translate = vec(0 , 0 , 0 ), const vec &rotate = vec(0 , 0 , 0 ), int anim = -1, int basetime = 0, modelattach *attached = NULL )
1195+ bool link (part *p, const char *tag, const vec &translate = vec(0 , 0 , 0 ), const vec &rotate = vec(0 , 0 , 0 ), int anim = -1, int basetime = 0, modelattach *attached = nullptr )
11961196 {
11971197 if (parts.empty ()) return false ;
11981198 return parts[0 ]->link (p, tag, translate, rotate, anim, basetime, attached);
@@ -1352,7 +1352,7 @@ struct animmodel : model
13521352 enablecullface = true ;
13531353 lastalphatest = -1 ;
13541354 lastvbuf = lasttcbuf = lastxbuf = lastnbuf = lastbbuf = lastebuf = lastenvmaptex = closestenvmaptex = 0 ;
1355- lasttex = lastmasks = lastnormalmap = NULL ;
1355+ lasttex = lastmasks = lastnormalmap = nullptr ;
13561356 transparent = sizescale = 1 ;
13571357 shaderparamskey::invalidate ();
13581358 }
@@ -1410,11 +1410,11 @@ bool animmodel::enabletc = false, animmodel::enablealphablend = false,
14101410 animmodel::enablecullface = true ,
14111411 animmodel::enablenormals = false , animmodel::enabletangents = false , animmodel::enablebones = false , animmodel::enabledepthoffset = false ;
14121412vec animmodel::lightdir (0 , 0 , 1 ), animmodel::lightcolor(1 , 1 , 1 );
1413- const bvec *animmodel::lightmaterial = NULL ;
1413+ const bvec *animmodel::lightmaterial = nullptr ;
14141414float animmodel::transparent = 1 , animmodel::lastalphatest = -1 , animmodel::sizescale = 1 ;
14151415GLuint animmodel::lastvbuf = 0 , animmodel::lasttcbuf = 0 , animmodel::lastnbuf = 0 , animmodel::lastxbuf = 0 , animmodel::lastbbuf = 0 ,
14161416 animmodel::lastebuf = 0 , animmodel::lastenvmaptex = 0 , animmodel::closestenvmaptex = 0 ;
1417- Texture *animmodel::lasttex = NULL , *animmodel::lastmasks = NULL , *animmodel::lastnormalmap = NULL ;
1417+ Texture *animmodel::lasttex = nullptr , *animmodel::lastmasks = nullptr , *animmodel::lastnormalmap = nullptr ;
14181418int animmodel::matrixpos = 0 ;
14191419matrix4 animmodel::matrixstack[64 ];
14201420
@@ -1441,7 +1441,7 @@ template<class MDL> struct modelloader
14411441 static bool multimeshed () { return true ; }
14421442};
14431443
1444- template <class MDL > MDL *modelloader<MDL>::loading = NULL ;
1444+ template <class MDL > MDL *modelloader<MDL>::loading = nullptr ;
14451445template <class MDL > string modelloader<MDL>::dir = {' \0 ' }; // crashes clang if "" is used here
14461446
14471447template <class MDL , class MESH > struct modelcommands
0 commit comments