wok view celestia/stuff/make-dereferenced-temporaries-explicit @ rev 23214

updated nagvis and nagvis-doc (1.9.11 -> 1.9.18)
author Hans-G?nter Theisgen
date Sat Mar 21 15:07:17 2020 +0100 (2020-03-21)
parents
children
line source
1 --- celestia-1.6.0+dfsg.orig/src/celengine/vecgl.h
2 +++ celestia-1.6.0+dfsg/src/celengine/vecgl.h
3 @@ -89,17 +89,20 @@ inline void glScale(const Vec3f& v)
5 inline void glLightDirection(GLenum light, const Vec3f& dir)
6 {
7 - glLightfv(light, GL_POSITION, &(Vec4f(dir.x, dir.y, dir.z, 0.0f).x));
8 + Vec4f dir4(dir.x, dir.y, dir.z, 0.0f);
9 + glLightfv(light, GL_POSITION, &dir4.x);
10 }
12 inline void glLightPosition(GLenum light, const Point3f& pos)
13 {
14 - glLightfv(light, GL_POSITION, &(Vec4f(pos.x, pos.y, pos.z, 1.0f).x));
15 + Vec4f pos4(pos.x, pos.y, pos.z, 1.0f);
16 + glLightfv(light, GL_POSITION, &pos4.x);
17 }
19 inline void glLightColor(GLenum light, GLenum which, const Vec3f& color)
20 {
21 - glLightfv(light, which, &(Vec4f(color.x, color.y, color.z, 1.0f).x));
22 + Vec4f color4(color.x, color.y, color.z, 1.0f);
23 + glLightfv(light, which, &color4.x);
24 }
26 inline void glLightColor(GLenum light, GLenum which, const Vec4f& color)
27 @@ -109,15 +112,14 @@ inline void glLightColor(GLenum light, G
29 inline void glLightColor(GLenum light, GLenum which, const Color& color)
30 {
31 - glLightfv(light, which,
32 - &(Vec4f(color.red(), color.green(), color.blue(), color.alpha()).x));
33 + Vec4f color4(color.red(), color.green(), color.blue(), color.alpha());
34 + glLightfv(light, which, &color4.x);
35 }
37 inline void glAmbientLightColor(const Color& color)
38 {
39 - glLightModelfv(GL_LIGHT_MODEL_AMBIENT,
40 - &(Vec4f(color.red(), color.green(), color.blue(),
41 - color.alpha()).x));
42 + Vec4f color4(color.red(), color.green(), color.blue(), color.alpha());
43 + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, &color4.x);
44 }
46 #endif // _VECGL_H_