From: Ryan C. Gordon Date: Sat, 15 May 2010 06:50:03 +0000 (-0400) Subject: Fixed compiler warnings about taking the address of a temporary. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=3e62c80a3b70d79d89d8d911aa4256a4efd762b3;p=lugaru.git Fixed compiler warnings about taking the address of a temporary. --- diff --git a/Source/Person.cpp b/Source/Person.cpp index 388f787..6a1def9 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -6449,7 +6449,7 @@ void Person::DoStuff(){ flatfacing=DoRotation(flatfacing,0,rotation,0); facing=flatfacing; - ReflectVector(&facing,&terrainnormal); + ReflectVector(&facing,terrainnormal); Normalise(&facing); if(isRun()||targetanimation==sneakanim||targetanimation==rollanim||targetanimation==walkanim){ @@ -6502,7 +6502,7 @@ void Person::DoStuff(){ velocity*=velspeed; } velocity.y+=gravity*multiplier*20; - ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); + ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); velocity=flatfacing*velspeed; } @@ -6516,7 +6516,7 @@ void Person::DoStuff(){ velocity*=velspeed; } velocity.y+=gravity*multiplier*20; - ReflectVector(&velocity,&terrain.getNormal(coords.x,coords.z)); + ReflectVector(&velocity,terrain.getNormal(coords.x,coords.z)); velspeed=findLength(&velocity); if(velspeedx*dotprod; - vn.y=n->y*dotprod; - vn.z=n->z*dotprod; + dotprod=dotproduct(&n,vel); + vn.x=n.x*dotprod; + vn.y=n.y*dotprod; + vn.z=n.z*dotprod; vt.x=vel->x-vn.x; vt.y=vel->y-vn.y; @@ -277,7 +283,7 @@ inline void ReflectVector(XYZ *vel, XYZ *n) vel->z = vt.z - vn.z; } -inline float dotproduct(XYZ *point1, XYZ *point2){ +inline float dotproduct(const XYZ *point1, const XYZ *point2){ static GLfloat returnvalue; returnvalue=(point1->x*point2->x+point1->y*point2->y+point1->z*point2->z); return returnvalue;