wok annotate celestia/stuff/make-dereferenced-temporaries-explicit @ rev 21519

mosh: update patch
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 03 16:47:04 2019 +0200 (2019-05-03)
parents
children
rev   line source
pascal@12929 1 --- celestia-1.6.0+dfsg.orig/src/celengine/vecgl.h
pascal@12929 2 +++ celestia-1.6.0+dfsg/src/celengine/vecgl.h
pascal@12929 3 @@ -89,17 +89,20 @@ inline void glScale(const Vec3f& v)
pascal@12929 4
pascal@12929 5 inline void glLightDirection(GLenum light, const Vec3f& dir)
pascal@12929 6 {
pascal@12929 7 - glLightfv(light, GL_POSITION, &(Vec4f(dir.x, dir.y, dir.z, 0.0f).x));
pascal@12929 8 + Vec4f dir4(dir.x, dir.y, dir.z, 0.0f);
pascal@12929 9 + glLightfv(light, GL_POSITION, &dir4.x);
pascal@12929 10 }
pascal@12929 11
pascal@12929 12 inline void glLightPosition(GLenum light, const Point3f& pos)
pascal@12929 13 {
pascal@12929 14 - glLightfv(light, GL_POSITION, &(Vec4f(pos.x, pos.y, pos.z, 1.0f).x));
pascal@12929 15 + Vec4f pos4(pos.x, pos.y, pos.z, 1.0f);
pascal@12929 16 + glLightfv(light, GL_POSITION, &pos4.x);
pascal@12929 17 }
pascal@12929 18
pascal@12929 19 inline void glLightColor(GLenum light, GLenum which, const Vec3f& color)
pascal@12929 20 {
pascal@12929 21 - glLightfv(light, which, &(Vec4f(color.x, color.y, color.z, 1.0f).x));
pascal@12929 22 + Vec4f color4(color.x, color.y, color.z, 1.0f);
pascal@12929 23 + glLightfv(light, which, &color4.x);
pascal@12929 24 }
pascal@12929 25
pascal@12929 26 inline void glLightColor(GLenum light, GLenum which, const Vec4f& color)
pascal@12929 27 @@ -109,15 +112,14 @@ inline void glLightColor(GLenum light, G
pascal@12929 28
pascal@12929 29 inline void glLightColor(GLenum light, GLenum which, const Color& color)
pascal@12929 30 {
pascal@12929 31 - glLightfv(light, which,
pascal@12929 32 - &(Vec4f(color.red(), color.green(), color.blue(), color.alpha()).x));
pascal@12929 33 + Vec4f color4(color.red(), color.green(), color.blue(), color.alpha());
pascal@12929 34 + glLightfv(light, which, &color4.x);
pascal@12929 35 }
pascal@12929 36
pascal@12929 37 inline void glAmbientLightColor(const Color& color)
pascal@12929 38 {
pascal@12929 39 - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,
pascal@12929 40 - &(Vec4f(color.red(), color.green(), color.blue(),
pascal@12929 41 - color.alpha()).x));
pascal@12929 42 + Vec4f color4(color.red(), color.green(), color.blue(), color.alpha());
pascal@12929 43 + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, &color4.x);
pascal@12929 44 }
pascal@12929 45
pascal@12929 46 #endif // _VECGL_H_