[spring] - Lua compile fix should hopefully work now.
Gilboa Davara
gilboa at fedoraproject.org
Wed Mar 16 13:08:07 UTC 2011
commit 0485c76745a760a4f1de8497ebaa644c689209bb
Author: Gilboa Davara <gilboa at gilboa-home-dev.localdomain>
Date: Wed Mar 16 15:07:32 2011 +0200
- Lua compile fix should hopefully work now.
spring-lua-compile-fix.patch | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/spring-lua-compile-fix.patch b/spring-lua-compile-fix.patch
index 8b628b1..dfd0d31 100644
--- a/spring-lua-compile-fix.patch
+++ b/spring-lua-compile-fix.patch
@@ -1,12 +1,29 @@
--- rts/Lua/LuaMaterial.cpp.old 2011-03-16 11:34:10.123708670 +0200
-+++ rts/Lua/LuaMaterial.cpp 2011-03-16 11:36:09.792570595 +0200
-@@ -379,7 +379,8 @@
++++ rts/Lua/LuaMaterial.cpp 2011-03-16 14:44:23.736824894 +0200
+@@ -379,7 +379,25 @@
}
if (shadowParamsLoc >= 0) {
- glUniform4fv(shadowParamsLoc, 1, const_cast<float*>(&(shadowHandler->GetShadowParams().x)));
-+ const float *pfShadowParams = &shadowHandler->GetShadowParams().x;
-+ glUniform4fv(shadowParamsLoc, 1, pfShadowParams);
++ /*
++ * GCC 4.6 barfs on having a temporary copy of float4
++ * passed as pointer to glUniform4fv.
++ * Pending a cleaner solution that will include
++ * changes to shadowHandler and float4,
++ * the only thing remaining is to manually copy
++ * the members to temporary stack array and pass
++ * it down to glUniform4fv.
++ */
++ float4 shadowFloat4 =
++ shadowHandler->GetShadowParams();
++ float shadowFloatArr[4];
++
++ shadowFloatArr[0] = shadowFloat4.x;
++ shadowFloatArr[1] = shadowFloat4.y;
++ shadowFloatArr[2] = shadowFloat4.z;
++ shadowFloatArr[3] = shadowFloat4.w;
++
++ glUniform4fv(shadowParamsLoc, 1, shadowFloatArr);
}
const int maxTex = std::max(texCount, prev.texCount);
More information about the scm-commits
mailing list