From 28bda9a25bc7d6240a66f83ad6c62d68a339abe9 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 11 Aug 2011 12:35:20 +0000 Subject: [PATCH] core: fix a bug in vector casts; vec2 -> vec3 promotion for instance would forget to zero the 3rd coordinate. --- src/matrix.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/matrix.h b/src/matrix.h index 89d9fa7d..26d11cf4 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -66,6 +66,8 @@ namespace lol Vec##dest ret; \ for (int n = 0; n < elems && n < dest; n++) \ ret[n] = (*this)[n]; \ + for (int n = elems; n < dest; n++) \ + ret[n] = 0; \ return ret; \ }