summaryrefslogtreecommitdiff
path: root/opengl/libagl/matrix.cpp
diff options
context:
space:
mode:
author Jean-Baptiste Queru <jbq@google.com> 2009-11-15 12:06:20 -0800
committer Jean-Baptiste Queru <jbq@google.com> 2009-11-15 12:06:23 -0800
commit478de466ce0504b9af639c3338b883893670a8e8 (patch)
tree61aba455baf06a4821a65b82d1115929619b49bd /opengl/libagl/matrix.cpp
parent2b63ff51d5202eb2b458e937d4b65b326238733e (diff)
parent9db3d07b9620b4269ab33f78604a36327e536ce1 (diff)
merge from eclair
Diffstat (limited to 'opengl/libagl/matrix.cpp')
-rw-r--r--opengl/libagl/matrix.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/opengl/libagl/matrix.cpp b/opengl/libagl/matrix.cpp
index 21ef50e6b622..3c5097708648 100644
--- a/opengl/libagl/matrix.cpp
+++ b/opengl/libagl/matrix.cpp
@@ -741,20 +741,19 @@ void point4__generic(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
void point4__mvui(transform_t const* mx, vec4_t* lhs, vec4_t const* rhs) {
// this used for transforming light positions back to object space.
- // Lights have 3 components positions, so w is always 1.
- // however, it is used as a switch for directional lights, so we need
+ // w is used as a switch for directional lights, so we need
// to preserve it.
const GLfixed* const m = mx->matrix.m;
const GLfixed rx = rhs->x;
const GLfixed ry = rhs->y;
const GLfixed rz = rhs->z;
- lhs->x = mla3a(rx, m[ 0], ry, m[ 4], rz, m[ 8], m[12]);
- lhs->y = mla3a(rx, m[ 1], ry, m[ 5], rz, m[ 9], m[13]);
- lhs->z = mla3a(rx, m[ 2], ry, m[ 6], rz, m[10], m[14]);
- lhs->w = rhs->w;
+ const GLfixed rw = rhs->w;
+ lhs->x = mla4(rx, m[ 0], ry, m[ 4], rz, m[ 8], rw, m[12]);
+ lhs->y = mla4(rx, m[ 1], ry, m[ 5], rz, m[ 9], rw, m[13]);
+ lhs->z = mla4(rx, m[ 2], ry, m[ 6], rz, m[10], rw, m[14]);
+ lhs->w = rw;
}
-
void point2__nop(transform_t const*, vec4_t* lhs, vec4_t const* rhs) {
lhs->z = 0;
lhs->w = 0x10000;