From 2cc1f144497606c87f50675203f10b271af531ea Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:16:31 +0100 Subject: [PATCH 01/22] templated in ui.cpp --- src/engine/interface/ui.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/engine/interface/ui.cpp b/src/engine/interface/ui.cpp index 91345feeb..df3deba53 100644 --- a/src/engine/interface/ui.cpp +++ b/src/engine/interface/ui.cpp @@ -68,7 +68,7 @@ namespace UI gle::attribf(x, y+h); gle::attribf(tx, ty+th); } - static void quad(float x, float y, float w, float h, const vec2 tc[4]) + static void quad(float x, float y, float w, float h, const vec2 tc[4]) { gle::defvertex(2); gle::deftexcoord0(); @@ -794,7 +794,7 @@ namespace UI uint *contents, *onshow, *onhide; bool allowinput, eschide, abovehud; float px, py, pw, ph; - vec2 sscale, soffset; + vec2 sscale, soffset; Window(const char *name, const char *contents, const char *onshow, const char *onhide) : name(newstring(name)), @@ -950,8 +950,8 @@ namespace UI void calcscissor(float x1, float y1, float x2, float y2, int &sx1, int &sy1, int &sx2, int &sy2, bool clip = true) { - vec2 s1 = vec2(x1, y2).mul(sscale).add(soffset), - s2 = vec2(x2, y1).mul(sscale).add(soffset); + vec2 s1 = vec2(x1, y2).mul(sscale).add(soffset), + s2 = vec2(x2, y1).mul(sscale).add(soffset); sx1 = static_cast(std::floor(s1.x*hudw + 0.5f)); sy1 = static_cast(std::floor(s1.y*hudh + 0.5f)); sx2 = static_cast(std::floor(s2.x*hudw + 0.5f)); @@ -2381,7 +2381,7 @@ namespace UI struct Triangle : Shape { - vec2 a, b, c; + vec2 a, b, c; void setup(const Color &color_, float w = 0, float h = 0, int angle = 0, int type_ = SOLID) { @@ -2390,16 +2390,16 @@ namespace UI c = vec2(w/2, h/3); if(angle) { - vec2 rot = sincosmod360(-angle); + vec2 rot = sincosmod360(-angle); a.rotate_around_z(rot); b.rotate_around_z(rot); c.rotate_around_z(rot); } - vec2 bbmin = vec2(a).min(b).min(c); + vec2 bbmin = vec2(a).min(b).min(c); a.sub(bbmin); b.sub(bbmin); c.sub(bbmin); - vec2 bbmax = vec2(a).max(b).max(c); + vec2 bbmax = vec2(a).max(b).max(c); Shape::setup(color_, type_, bbmax.x, bbmax.y); } @@ -2486,7 +2486,7 @@ namespace UI float r = radius <= 0 ? std::min(w, h)/2 : radius; color.init(); - vec2 center(sx + r, sy + r); + vec2 center(sx + r, sy + r); if(type == OUTLINE) { gle::begin(GL_LINE_LOOP); @@ -2501,7 +2501,7 @@ namespace UI gle::attribf(center.x + r, center.y); for(int angle = 360/15; angle < 360; angle += 360/15) { - vec2 p = vec2(sincos360[angle]).mul(r).add(center); + vec2 p = vec2(sincos360[angle]).mul(r).add(center); gle::attrib(p); gle::attrib(p); } @@ -4260,7 +4260,7 @@ namespace UI changedraw(Change_Shader | Change_Color); SETSHADER(hudrgb); - vec2 tc[4] = { vec2(0, 0), vec2(1, 0), vec2(1, 1), vec2(0, 1) }; + vec2 tc[4] = { vec2(0, 0), vec2(1, 0), vec2(1, 1), vec2(0, 1) }; int xoff = vslot.offset.x, yoff = vslot.offset.y; if(vslot.rotation) From e3d62e96bd6c003416b4223fec1a92002cf03e7d Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:16:57 +0100 Subject: [PATCH 02/22] templated in animmodel.h --- src/engine/model/animmodel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/model/animmodel.h b/src/engine/model/animmodel.h index b05ae806d..566d2d250 100644 --- a/src/engine/model/animmodel.h +++ b/src/engine/model/animmodel.h @@ -276,9 +276,9 @@ class animmodel : public model vec e1 = vec(verts[t.vert[1]].pos).sub(e0), e2 = vec(verts[t.vert[2]].pos).sub(e0); - const vec2 &tc0 = tcverts[t.vert[0]].tc, - &tc1 = tcverts[t.vert[1]].tc, - &tc2 = tcverts[t.vert[2]].tc; + const vec2 &tc0 = tcverts[t.vert[0]].tc, + &tc1 = tcverts[t.vert[1]].tc, + &tc2 = tcverts[t.vert[2]].tc; float u1 = tc1.x - tc0.x, v1 = tc1.y - tc0.y, u2 = tc2.x - tc0.x, From aff67005643846f9e7a71d3a986efaa4ba10de6a Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:19:26 +0100 Subject: [PATCH 03/22] updated .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0c592c3df..2cf53cdaf 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,6 @@ src/tess_server *.srctrlprj # Files auto-produced by VSCode. .vscode/ +.ionide/ # Documentation files in the docs folder. docs From 209b22182a78b57c349b2af4cdeab850725d7d5b Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:19:39 +0100 Subject: [PATCH 04/22] md5.h and obj.cpp --- src/engine/model/md5.h | 2 +- src/engine/model/obj.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/model/md5.h b/src/engine/model/md5.h index 14d3eb265..5bf595aab 100644 --- a/src/engine/model/md5.h +++ b/src/engine/model/md5.h @@ -15,7 +15,7 @@ struct md5weight struct md5vert { - vec2 tc; + vec2 tc; ushort start, count; }; diff --git a/src/engine/model/obj.cpp b/src/engine/model/obj.cpp index abee2c37e..810eada68 100644 --- a/src/engine/model/obj.cpp +++ b/src/engine/model/obj.cpp @@ -190,7 +190,7 @@ bool obj::objmeshgroup::load(const char *filename, float smooth) v.norm = vkey.z < 0 ? vec(0, 0, 0) : attrib[2][vkey.z]; v.norm = vec(v.norm.z, -v.norm.x, v.norm.y); tcvert &tcv = tcverts.add(); - tcv.tc = vkey.y < 0 ? vec2(0, 0) : vec2(attrib[1][vkey.y].x, 1-attrib[1][vkey.y].y); + tcv.tc = vkey.y < 0 ? vec2(0.f, 0.f) : vec2(attrib[1][vkey.y].x, 1-attrib[1][vkey.y].y); } if(v0 < 0) { From 5304855114f9b17c4a2c69051cb3800eecd055ef Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:20:53 +0100 Subject: [PATCH 05/22] used new vec2 template instead of genericvec2 --- src/engine/model/skelmodel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/model/skelmodel.h b/src/engine/model/skelmodel.h index 3265b8b7d..d6e85f9b9 100644 --- a/src/engine/model/skelmodel.h +++ b/src/engine/model/skelmodel.h @@ -26,7 +26,7 @@ struct skelmodel : animmodel struct vert { vec pos, norm; - vec2 tc; + vec2 tc; quat tangent; int blend, interpindex; }; @@ -34,14 +34,14 @@ struct skelmodel : animmodel struct vvert { vec pos; - GenericVec2 tc; + vec2 tc; squat tangent; }; struct vvertg { vec4 pos; - GenericVec2 tc; + vec2 tc; squat tangent; }; From 183a574155909684d7cc6ffa7b6fd416e58e3b1c Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:22:06 +0100 Subject: [PATCH 06/22] used new vec2 instead of GeneriVec2 --- src/engine/model/vertmodel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/model/vertmodel.h b/src/engine/model/vertmodel.h index a69b598b3..b1438f475 100644 --- a/src/engine/model/vertmodel.h +++ b/src/engine/model/vertmodel.h @@ -9,14 +9,14 @@ struct vertmodel : animmodel struct vvert { vec pos; - GenericVec2 tc; + vec2 tc; squat tangent; }; struct vvertg { vec4 pos; - GenericVec2 tc; + vec2 tc; squat tangent; }; From 0be2eea405124ef6e48b03ff0c1eff3ef3a54088 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:22:35 +0100 Subject: [PATCH 07/22] more vec2 --- src/engine/model/vertmodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/model/vertmodel.h b/src/engine/model/vertmodel.h index b1438f475..e2a4bc5f4 100644 --- a/src/engine/model/vertmodel.h +++ b/src/engine/model/vertmodel.h @@ -22,7 +22,7 @@ struct vertmodel : animmodel struct tcvert { - vec2 tc; + vec2 tc; }; struct tri From b792f97db199505898f2eff1891de7634a64ddde Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:28:18 +0100 Subject: [PATCH 08/22] aa.cpp --- src/engine/render/aa.cpp | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/engine/render/aa.cpp b/src/engine/render/aa.cpp index aed0121bc..c12b0cb86 100644 --- a/src/engine/render/aa.cpp +++ b/src/engine/render/aa.cpp @@ -415,24 +415,24 @@ namespace //internal functions incl. AA implementations smaasearchdatainited = true; } - vec2 areaunderortho(const vec2 &p1, const vec2 &p2, float x) + vec2 areaunderortho(const vec2 &p1, const vec2 &p2, float x) { - vec2 d(p2.x - p1.x, p2.y - p1.y); + vec2 d(p2.x - p1.x, p2.y - p1.y); float y1 = p1.y + (x - p1.x)*d.y/d.x, y2 = p1.y + (x+1 - p1.x)*d.y/d.x; if((x < p1.x || x >= p2.x) && (x+1 <= p1.x || x+1 > p2.x)) { - return vec2(0, 0); + return vec2(0.f, 0.f); } if((y1 < 0) == (y2 < 0) || std::fabs(y1) < 1e-4f || std::fabs(y2) < 1e-4f) { float a = (y1 + y2) / 2; - return a < 0.0f ? vec2(-a, 0) : vec2(0, a); + return a < 0.0f ? vec2(-a, 0.f) : vec2(0.f, a); } x = -p1.y*d.x/d.y + p1.x; float a1 = x > p1.x ? y1*std::fmod(x, 1.0f)/2 : 0, a2 = x < p2.x ? y2*(1-std::fmod(x, 1.0f))/2 : 0; - vec2 a(std::fabs(a1), std::fabs(a2)); + vec2 a(std::fabs(a1), std::fabs(a2)); if((a.x > a.y ? a1 : -a2) >= 0) { std::swap(a.x, a.y); @@ -446,21 +446,21 @@ namespace //internal functions incl. AA implementations {0, 1}, {3, 1}, {0, 4}, {3, 4}, {1, 1}, {4, 1}, {1, 4}, {4, 4} }; - vec2 areaortho(float p1x, float p1y, float p2x, float p2y, float left) + vec2 areaortho(float p1x, float p1y, float p2x, float p2y, float left) { return areaunderortho(vec2(p1x, p1y), vec2(p2x, p2y), left); } - void smootharea(float d, vec2 &a1, vec2 &a2) + void smootharea(float d, vec2 &a1, vec2 &a2) { - vec2 b1(sqrtf(a1.x*2)*0.5f, sqrtf(a1.y*2)*0.5f), - b2(sqrtf(a2.x*2)*0.5f, sqrtf(a2.y*2)*0.5f); + vec2 b1(sqrtf(a1.x*2)*0.5f, sqrtf(a1.y*2)*0.5f), + b2(sqrtf(a2.x*2)*0.5f, sqrtf(a2.y*2)*0.5f); float p = std::clamp(d / 32.0f, 0.0f, 1.0f); a1.lerp(b1, a1, p); a2.lerp(b2, a2, p); } - vec2 areaortho(int pattern, float left, float right, float offset) + vec2 areaortho(int pattern, float left, float right, float offset) { float d = left + right + 1, o1 = offset + 0.5f, @@ -469,33 +469,33 @@ namespace //internal functions incl. AA implementations { case 0: { - return vec2(0, 0); + return vec2(0.f, 0.f); } case 1: { - return left <= right ? areaortho(0, o2, d/2, 0, left) : vec2(0, 0); + return left <= right ? areaortho(0, o2, d/2, 0, left) : vec2(0.f, 0.f); } case 2: { - return left >= right ? areaortho(d/2, 0, d, o2, left) : vec2(0, 0); + return left >= right ? areaortho(d/2, 0, d, o2, left) : vec2(0.f, 0.f); } case 3: { - vec2 a1 = areaortho(0, o2, d/2, 0, left), a2 = areaortho(d/2, 0, d, o2, left); + vec2 a1 = areaortho(0, o2, d/2, 0, left), a2 = areaortho(d/2, 0, d, o2, left); smootharea(d, a1, a2); return a1.add(a2); } case 4: { - return left <= right ? areaortho(0, o1, d/2, 0, left) : vec2(0, 0); + return left <= right ? areaortho(0, o1, d/2, 0, left) : vec2(0.f, 0.f); } case 5: { - return vec2(0, 0); + return vec2(0.f, 0.f); } case 6: { - vec2 a = areaortho(0, o1, d, o2, left); + vec2 a = areaortho(0, o1, d, o2, left); if(std::fabs(offset) > 0) { a.avg(areaortho(0, o1, d/2, 0, left).add(areaortho(d/2, 0, d, o2, left))); @@ -508,11 +508,11 @@ namespace //internal functions incl. AA implementations } case 8: { - return left >= right ? areaortho(d/2, 0, d, o1, left) : vec2(0, 0); + return left >= right ? areaortho(d/2, 0, d, o1, left) : vec2(0.f, 0.f); } case 9: { - vec2 a = areaortho(0, o2, d, o1, left); + vec2 a = areaortho(0, o2, d, o1, left); if(std::fabs(offset) > 0) { a.avg(areaortho(0, o2, d/2, 0, left).add(areaortho(d/2, 0, d, o1, left))); @@ -521,7 +521,7 @@ namespace //internal functions incl. AA implementations } case 10: { - return vec2(0, 0); + return vec2(0.f, 0.f); } case 11: { @@ -529,8 +529,8 @@ namespace //internal functions incl. AA implementations } case 12: { - vec2 a1 = areaortho(0, o1, d/2, 0, left), - a2 = areaortho(d/2, 0, d, o1, left); + vec2 a1 = areaortho(0, o1, d/2, 0, left), + a2 = areaortho(d/2, 0, d, o1, left); smootharea(d, a1, a2); return a1.add(a2); } @@ -544,15 +544,15 @@ namespace //internal functions incl. AA implementations } case 15: { - return vec2(0, 0); + return vec2(0.f, 0.f); } } - return vec2(0, 0); + return vec2(0.f, 0.f); } - float areaunderdiag(const vec2 &p1, const vec2 &p2, const vec2 &p) + float areaunderdiag(const vec2 &p1, const vec2 &p2, const vec2 &p) { - vec2 d(p2.y - p1.y, p1.x - p2.x); + vec2 d(p2.y - p1.y, p1.x - p2.x); float dp = d.dot(vec2(p1).sub(p)); if(!d.x) { @@ -625,9 +625,9 @@ namespace //internal functions incl. AA implementations return 1; } - vec2 areadiag(const vec2 &p1, const vec2 &p2, float left) + vec2 areadiag(const vec2 &p1, const vec2 &p2, float left) { - return vec2(1 - areaunderdiag(p1, p2, vec2(1, 0).add(left)), areaunderdiag(p1, p2, vec2(1, 1).add(left))); + return vec2(1 - areaunderdiag(p1, p2, vec2(1.f, 0.f).add(left)), areaunderdiag(p1, p2, vec2(1.f, 1.f).add(left))); } constexpr int edgesdiag[][2] = @@ -636,10 +636,10 @@ namespace //internal functions incl. AA implementations {0, 1}, {1, 1}, {0, 3}, {1, 3}, {2, 1}, {3, 1}, {2, 3}, {3, 3} }; - vec2 areadiag(float p1x, float p1y, float p2x, float p2y, float d, float left, const vec2 &offset, int pattern) + vec2 areadiag(float p1x, float p1y, float p2x, float p2y, float d, float left, const vec2 &offset, int pattern) { - vec2 p1(p1x, p1y), - p2(p2x+d, p2y+d); + vec2 p1(p1x, p1y), + p2(p2x+d, p2y+d); if(edgesdiag[pattern][0]) { p1.add(offset); @@ -651,12 +651,12 @@ namespace //internal functions incl. AA implementations return areadiag(p1, p2, left); } - vec2 areadiag2(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y, float p4x, float p4y, float d, float left, const vec2 &offset, int pattern) + vec2 areadiag2(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y, float p4x, float p4y, float d, float left, const vec2 &offset, int pattern) { - vec2 p1(p1x, p1y), - p2(p2x+d, p2y+d), - p3(p3x, p3y), - p4(p4x+d, p4y+d); + vec2 p1(p1x, p1y), + p2(p2x+d, p2y+d), + p3(p3x, p3y), + p4(p4x+d, p4y+d); if(edgesdiag[pattern][0]) { p1.add(offset); @@ -670,7 +670,7 @@ namespace //internal functions incl. AA implementations return areadiag(p1, p2, left).avg(areadiag(p3, p4, left)); } - vec2 areadiag(int pattern, float left, float right, const vec2 &offset) + vec2 areadiag(int pattern, float left, float right, const vec2 &offset) { float d = left + right + 1; switch(pattern) @@ -692,7 +692,7 @@ namespace //internal functions incl. AA implementations case 14: return areadiag2(1, 1, 1, 1, 1, 1, 1, 0, d, left, offset, pattern); case 15: return areadiag2(1, 1, 1, 1, 1, 0, 1, 0, d, left, offset, pattern); } - return vec2(0, 0); + return vec2(0.f, 0.f); } constexpr float offsetsortho[] = { 0.0f, -0.25f, 0.25f, -0.125f, 0.125f, -0.375f, 0.375f }; @@ -723,7 +723,7 @@ namespace //internal functions incl. AA implementations { for(int x = 0; x < 16; ++x) { - vec2 a = areaortho(pattern, x*x, y*y, offsetsortho[offset]); + vec2 a = areaortho(pattern, x*x, y*y, offsetsortho[offset]); dst[0] = static_cast(255*a.x); dst[1] = static_cast(255*a.y); dst += 2; @@ -743,7 +743,7 @@ namespace //internal functions incl. AA implementations { for(int x = 0; x < 20; ++x) { - vec2 a = areadiag(pattern, x, y, vec2(offsetsdiag[offset][0], offsetsdiag[offset][1])); + vec2 a = areadiag(pattern, x, y, vec2(offsetsdiag[offset][0], offsetsdiag[offset][1])); dst[0] = static_cast(255*a.x); dst[1] = static_cast(255*a.y); dst += 2; @@ -1068,7 +1068,7 @@ void GBuffer::setaavelocityparams(GLenum tmu) matrix4 reproject; reproject.muld(tqaaframe ? tqaaprevscreenmatrix : screenmatrix, worldmatrix); - vec2 jitter = tqaaframe&1 ? vec2(0.5f, 0.5f) : vec2(-0.5f, -0.5f); + vec2 jitter = tqaaframe&1 ? vec2(0.5f, 0.5f) : vec2(-0.5f, -0.5f); if(multisampledaa()) { jitter.x *= 0.5f; @@ -1111,7 +1111,7 @@ void jitteraa() nojittermatrix = projmatrix; if(!drawtex && tqaa) { - vec2 jitter = tqaaframe&1 ? vec2(0.25f, 0.25f) : vec2(-0.25f, -0.25f); + vec2 jitter = tqaaframe&1 ? vec2(0.25f, 0.25f) : vec2(-0.25f, -0.25f); if(multisampledaa()) { jitter.x *= 0.5f; From 49b055bc811571aa39f26b90e4ede1a1ede071f3 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:30:20 +0100 Subject: [PATCH 09/22] csm.cpp --- src/engine/render/csm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/render/csm.cpp b/src/engine/render/csm.cpp index 56e11ba48..aa5c2394c 100644 --- a/src/engine/render/csm.cpp +++ b/src/engine/render/csm.cpp @@ -217,7 +217,7 @@ void cascadedshadowmap::getprojmatrix() int border = smfilter > 2 ? smborder2 : smborder; const float pradius = std::ceil(radius * csmpradiustweak), step = (2*pradius) / (sm.size - 2*border); - vec2 offset = vec2(tc).sub(pradius).div(step); + vec2 offset = vec2(tc).sub(pradius).div(step); offset.x = std::floor(offset.x); offset.y = std::floor(offset.y); split.center = vec(vec2(offset).mul(step).add(pradius), -0.5f*(minz + maxz)); From 37ce06b988e9f715928643c69c1913ab3e081b20 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:31:11 +0100 Subject: [PATCH 10/22] grass and hud :) --- src/engine/render/grass.cpp | 2 +- src/engine/render/hud.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/render/grass.cpp b/src/engine/render/grass.cpp index 41dc1120a..f10cb6d4f 100644 --- a/src/engine/render/grass.cpp +++ b/src/engine/render/grass.cpp @@ -48,7 +48,7 @@ namespace //internal functionality not seen by other files { vec pos; vec4 color; - vec2 tc; + vec2 tc; }; std::vector grassverts; diff --git a/src/engine/render/hud.cpp b/src/engine/render/hud.cpp index 4faf7cb11..639b831f2 100644 --- a/src/engine/render/hud.cpp +++ b/src/engine/render/hud.cpp @@ -65,9 +65,9 @@ namespace m.translate(0, offset, 0); m.scale(size*scale); - gle::attrib(m.transform(vec2(1, 1))); - gle::attrib(m.transform(vec2(-1, 1))); - gle::attrib(m.transform(vec2(0, 0))); + gle::attrib(m.transform(vec2(1.f, 1.f))); + gle::attrib(m.transform(vec2(-1.f, 1.f))); + gle::attrib(m.transform(vec2(0.f, 0.f))); // fade in log space so short blips don't disappear too quickly scale -= static_cast(curtime)/damagecompassfade; From 637cd7b7807859d4a4a3b507dea83ff053b78e23 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:33:45 +0100 Subject: [PATCH 11/22] octarender, radiancehints and rendergl --- src/engine/render/octarender.cpp | 2 +- src/engine/render/radiancehints.cpp | 2 +- src/engine/render/rendergl.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/render/octarender.cpp b/src/engine/render/octarender.cpp index c1df642f0..10af536e6 100644 --- a/src/engine/render/octarender.cpp +++ b/src/engine/render/octarender.cpp @@ -1237,7 +1237,7 @@ namespace return vec(0, 0, 1); } norm--; - const vec2 &yaw = sincos360[norm%360], + const vec2 &yaw = sincos360[norm%360], &pitch = sincos360[norm/360+270]; return vec(-yaw.y*pitch.x, yaw.x*pitch.x, pitch.y); } diff --git a/src/engine/render/radiancehints.cpp b/src/engine/render/radiancehints.cpp index 58c6cba29..17cb9f497 100644 --- a/src/engine/render/radiancehints.cpp +++ b/src/engine/render/radiancehints.cpp @@ -961,7 +961,7 @@ void reflectiveshadowmap::getprojmatrix() model.transform(c, tc); const float pradius = std::ceil((radius + gidist) * rsmpradiustweak), step = (2*pradius) / rsmsize; - vec2 tcoff = vec2(tc).sub(pradius).div(step); + vec2 tcoff = vec2(tc).sub(pradius).div(step); tcoff.x = std::floor(tcoff.x); tcoff.y = std::floor(tcoff.y); center = vec(vec2(tcoff).mul(step).add(pradius), -0.5f*(minz + maxz)); diff --git a/src/engine/render/rendergl.cpp b/src/engine/render/rendergl.cpp index bf1c7e3ce..3db0cb801 100644 --- a/src/engine/render/rendergl.cpp +++ b/src/engine/render/rendergl.cpp @@ -1488,7 +1488,7 @@ static void setupscreenquad() { glGenBuffers_(1, &screenquadvbo); gle::bindvbo(screenquadvbo); - vec2 verts[4] = { vec2(1, -1), vec2(-1, -1), vec2(1, 1), vec2(-1, 1) }; + vec2 verts[4] = { vec2(1.ff, -1.f), vec2(-1.f, -1.f), vec2(1.f, 1.f), vec2(-1.f, 1.f) }; glBufferData_(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW); gle::clearvbo(); } @@ -1508,7 +1508,7 @@ void screenquad() setupscreenquad(); gle::bindvbo(screenquadvbo); gle::enablevertex(); - gle::vertexpointer(sizeof(vec2), (const vec2 *)0, GL_FLOAT, 2); + gle::vertexpointer(sizeof(vec2), (const vec2 *)0, GL_FLOAT, 2); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); gle::disablevertex(); gle::clearvbo(); From a79ac368b4e943e8fed6407c7b27e5677467f4b4 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:34:56 +0100 Subject: [PATCH 12/22] renderlights --- src/engine/render/renderlights.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/render/renderlights.cpp b/src/engine/render/renderlights.cpp index a05b15930..5c612098d 100644 --- a/src/engine/render/renderlights.cpp +++ b/src/engine/render/renderlights.cpp @@ -50,7 +50,7 @@ int hdrclear = 0; int spotlights = 0, volumetriclights = 0, nospeclights = 0; -std::vector msaapositions; +std::vector> msaapositions; //`g`-buffer `scale` VARFP(gscale, 25, 100, 100, gbuf.cleanupgbuffer()); //size of g buffer, approximately correlates to g buffer linear dimensions @@ -2184,7 +2184,7 @@ static void setlightglobals(bool transparent = false) } else { - GLOBALPARAM(aoscale, aotex[2] ? vec2(1, 1) : vec2(static_cast(aow)/vieww, static_cast(aoh)/viewh)); + GLOBALPARAM(aoscale, aotex[2] ? vec2(1.f, 1.f) : vec2(static_cast(aow)/vieww, static_cast(aoh)/viewh)); GLOBALPARAMF(aoparams, aomin, 1.0f-aomin, aosunmin, 1.0f-aosunmin); } } @@ -2228,7 +2228,7 @@ static LocalShaderParam lightpos("lightpos"), shadowparams("shadowparams"), shadowoffset("shadowoffset"); static vec4 lightposv[8], lightcolorv[8], spotparamsv[8], shadowparamsv[8]; -static vec2 shadowoffsetv[8]; +static vec2 shadowoffsetv[8]; static void setlightparams(int i, const lightinfo &l) { From c2b9c91d4330daf9281699c0727cff18fb394817 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:35:22 +0100 Subject: [PATCH 13/22] renderlights part 2 --- src/engine/render/renderlights.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/render/renderlights.h b/src/engine/render/renderlights.h index 906a24b50..5e45cd24c 100644 --- a/src/engine/render/renderlights.h +++ b/src/engine/render/renderlights.h @@ -248,7 +248,7 @@ extern int calcspherersmsplits(const vec ¢er, float radius); inline bool sphereinsidespot(const vec &dir, int spot, const vec ¢er, float radius) { - const vec2 &sc = sincos360[spot]; + const vec2 &sc = sincos360[spot]; float cdist = dir.dot(center), cradius = radius + sc.y*cdist; return sc.x*sc.x*(center.dot(center) - cdist*cdist) <= cradius*cradius; } @@ -262,7 +262,7 @@ extern matrix4 worldmatrix, screenmatrix; extern int gw, gh, gdepthformat, ghasstencil; extern int msaasamples, msaalight; -extern std::vector msaapositions; +extern std::vector> msaapositions; extern bool inoq; extern int rhinoq; From efbf23036092fe8648d047e1cc85448f53841d91 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:37:55 +0100 Subject: [PATCH 14/22] renderparticles --- src/engine/render/renderparticles.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engine/render/renderparticles.cpp b/src/engine/render/renderparticles.cpp index 3269149f2..a2dce7878 100644 --- a/src/engine/render/renderparticles.cpp +++ b/src/engine/render/renderparticles.cpp @@ -204,7 +204,7 @@ struct partvert { vec pos; //x,y,z of particle vec4 color; //r,g,b,a color - vec2 tc; //texture coordinate + vec2 tc; //texture coordinate }; static constexpr float collideradius = 8.0f; @@ -536,7 +536,7 @@ class meterrenderer : public listrenderer gle::begin(GL_TRIANGLE_STRIP); for(int k = 0; k < 10; ++k) { - const vec2 &sc = sincos360[k*(180/(10-1))]; + const vec2 &sc = sincos360[k*(180/(10-1))]; float c = (0.5f + 0.1f)*sc.y, s = 0.5f - (0.5f + 0.1f)*sc.x; gle::attrib(m.transform(vec2(-c, s))); @@ -555,7 +555,7 @@ class meterrenderer : public listrenderer gle::begin(GL_TRIANGLE_STRIP); for(int k = 0; k < 10; ++k) { - const vec2 &sc = sincos360[k*(180/(10-1))]; + const vec2 &sc = sincos360[k*(180/(10-1))]; float c = 0.5f*sc.y, s = 0.5f - 0.5f*sc.x; gle::attrib(m.transform(vec2(left + c, s))); @@ -569,7 +569,7 @@ class meterrenderer : public listrenderer gle::begin(GL_TRIANGLE_FAN); for(int k = 0; k < 10; ++k) { - const vec2 &sc = sincos360[k*(180/(10-1))]; + const vec2 &sc = sincos360[k*(180/(10-1))]; float c = (0.5f + 0.1f)*sc.y, s = 0.5f - (0.5f + 0.1f)*sc.x; gle::attrib(m.transform(vec2(left + c, s))); @@ -581,7 +581,7 @@ class meterrenderer : public listrenderer gle::begin(GL_TRIANGLE_STRIP); for(int k = 0; k < 10; ++k) { - const vec2 &sc = sincos360[k*(180/(10-1))]; + const vec2 &sc = sincos360[k*(180/(10-1))]; float c = 0.5f*sc.y, s = 0.5f - 0.5f*sc.x; gle::attrib(m.transform(vec2(-c, s))); @@ -694,10 +694,10 @@ void genrotpos(const vec &o, const vec &d, float size, int grav, int ts, partver //==================================================================== ROTCOEFFS #define ROTCOEFFS(n) { \ - vec2(-1, 1).rotate_around_z(n*2*M_PI/32.0f), \ - vec2( 1, 1).rotate_around_z(n*2*M_PI/32.0f), \ - vec2( 1, -1).rotate_around_z(n*2*M_PI/32.0f), \ - vec2(-1, -1).rotate_around_z(n*2*M_PI/32.0f) \ + vec2(-1.f, 1.f).rotate_around_z(n*2*M_PI/32.0f), \ + vec2( 1.f, 1.f).rotate_around_z(n*2*M_PI/32.0f), \ + vec2( 1.f, -1.f).rotate_around_z(n*2*M_PI/32.0f), \ + vec2(-1.f, -1.f).rotate_around_z(n*2*M_PI/32.0f) \ } static const vec2 rotcoeffs[32][4] = { From e755b8b9a6eb5845a3fc187eb41cc45e54dd1faa Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:38:28 +0100 Subject: [PATCH 15/22] renderparticles part 2 --- src/engine/render/renderparticles.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/render/renderparticles.cpp b/src/engine/render/renderparticles.cpp index a2dce7878..de7cce85d 100644 --- a/src/engine/render/renderparticles.cpp +++ b/src/engine/render/renderparticles.cpp @@ -699,7 +699,7 @@ void genrotpos(const vec &o, const vec &d, float size, int grav, int ts, partver vec2( 1.f, -1.f).rotate_around_z(n*2*M_PI/32.0f), \ vec2(-1.f, -1.f).rotate_around_z(n*2*M_PI/32.0f) \ } -static const vec2 rotcoeffs[32][4] = +static const vec2 rotcoeffs[32][4] = { ROTCOEFFS(0), ROTCOEFFS(1), ROTCOEFFS(2), ROTCOEFFS(3), ROTCOEFFS(4), ROTCOEFFS(5), ROTCOEFFS(6), ROTCOEFFS(7), ROTCOEFFS(8), ROTCOEFFS(9), ROTCOEFFS(10), ROTCOEFFS(11), ROTCOEFFS(12), ROTCOEFFS(13), ROTCOEFFS(14), ROTCOEFFS(15), @@ -898,10 +898,10 @@ struct varenderer : partrenderer v1 = v1c, \ v2 = v2c; \ body; \ - vs[0].tc = vec2(u1, v1); \ - vs[1].tc = vec2(u2, v1); \ - vs[2].tc = vec2(u2, v2); \ - vs[3].tc = vec2(u1, v2); \ + vs[0].tc = vec2(u1, v1); \ + vs[1].tc = vec2(u2, v1); \ + vs[2].tc = vec2(u2, v2); \ + vs[3].tc = vec2(u1, v2); \ } if(type&PT_RND4) { @@ -1742,7 +1742,7 @@ static void regularshape(int type, int radius, int color, int dir, int num, int vec to, from; if(dir < 12) { - const vec2 &sc = sincos360[randomint(360)]; + const vec2 &sc = sincos360[randomint(360)]; to[dir%3] = sc.y*radius; to[(dir+1)%3] = sc.x*radius; to[(dir+2)%3] = 0.0; From 615af3f3c85f6ca5e2f46e34966d5423c5b4d9b8 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:39:17 +0100 Subject: [PATCH 16/22] renderva --- src/engine/render/renderva.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/render/renderva.cpp b/src/engine/render/renderva.cpp index 47092dc21..72ac52b89 100644 --- a/src/engine/render/renderva.cpp +++ b/src/engine/render/renderva.cpp @@ -643,7 +643,7 @@ namespace GLuint textures[7]; Slot *slot, *texgenslot; VSlot *vslot, *texgenvslot; - vec2 texgenscroll; + vec2 texgenscroll; int texgenorient, texgenmillis; renderstate() : colormask(true), depthmask(true), alphaing(0), vbuf(0), vattribs(false), @@ -1070,7 +1070,7 @@ namespace const texrotation &r = texrotations[vslot.rotation]; float xs = r.flipx ? -tex->xs : tex->xs, ys = r.flipy ? -tex->ys : tex->ys; - vec2 scroll(vslot.scroll); + vec2 scroll(vslot.scroll); if(r.swapxy) { std::swap(scroll.x, scroll.y); From 55fffcfa42f3da2186066b099be41af02359048d Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:41:55 +0100 Subject: [PATCH 17/22] stain.cpp and texture.h --- src/engine/render/stain.cpp | 2 +- src/engine/render/texture.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/render/stain.cpp b/src/engine/render/stain.cpp index a8a5e9038..e0552e015 100644 --- a/src/engine/render/stain.cpp +++ b/src/engine/render/stain.cpp @@ -34,7 +34,7 @@ struct stainvert { vec pos; vec4 color; - vec2 tc; + vec2 tc; }; struct staininfo diff --git a/src/engine/render/texture.h b/src/engine/render/texture.h index 320ee7b48..b12e99a51 100644 --- a/src/engine/render/texture.h +++ b/src/engine/render/texture.h @@ -476,7 +476,7 @@ struct GlobalShaderParam setf(v.x, v.y, v.z, w); } - void set(const vec2 &v, float z = 0, float w = 0) + void set(const vec2 &v, float z = 0, float w = 0) { setf(v.x, v.y, z, w); } @@ -658,7 +658,7 @@ struct LocalShaderParam setf(v.x, v.y, v.z, w); } - void set(const vec2 &v, float z = 0, float w = 0) + void set(const vec2 &v, float z = 0, float w = 0) { setf(v.x, v.y, z, w); } @@ -691,7 +691,7 @@ struct LocalShaderParam } } - void setv(const vec2 *v, int n = 1) + void setv(const vec2 *v, int n = 1) { ShaderParamBinding *b = resolve(); if(b) From 7ded47c3dbf1b486fd54401e98030d4fb19c96da Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:42:47 +0100 Subject: [PATCH 18/22] bih.cpp --- src/engine/world/bih.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/world/bih.cpp b/src/engine/world/bih.cpp index 58f7141cc..24fa74de4 100644 --- a/src/engine/world/bih.cpp +++ b/src/engine/world/bih.cpp @@ -88,9 +88,9 @@ bool BIH::triintersect(const mesh &m, int tidx, const vec &mo, const vec &mray, float invdet = 1/det; if(m.flags&Mesh_Alpha && (mode&Ray_Shadow)==Ray_Shadow && (m.tex->alphamask || loadalphamask(m.tex))) { - vec2 at = m.gettc(t.vert[0]), - bt = m.gettc(t.vert[1]).sub(at).mul(v*invdet), - ct = m.gettc(t.vert[2]).sub(at).mul(w*invdet); + vec2 at = m.gettc(t.vert[0]), + bt = m.gettc(t.vert[1]).sub(at).mul(v*invdet), + ct = m.gettc(t.vert[2]).sub(at).mul(w*invdet); at.add(bt).add(ct); int si = std::clamp(static_cast(m.tex->xs * at.x), 0, m.tex->xs-1), ti = std::clamp(static_cast(m.tex->ys * at.y), 0, m.tex->ys-1); @@ -498,19 +498,19 @@ bool mmintersect(const extentity &e, const vec &o, const vec &ray, float maxdist //reorientation of rotated mmodels if(yaw != 0) { - const vec2 &rot = sincosmod360(-yaw); + const vec2 &rot = sincosmod360(-yaw); mo.rotate_around_z(rot); mray.rotate_around_z(rot); } if(pitch != 0) { - const vec2 &rot = sincosmod360(-pitch); + const vec2 &rot = sincosmod360(-pitch); mo.rotate_around_x(rot); mray.rotate_around_x(rot); } if(roll != 0) { - const vec2 &rot = sincosmod360(roll); + const vec2 &rot = sincosmod360(roll); mo.rotate_around_y(rot); mray.rotate_around_y(rot); } From d9ed9d94c9b8840b1a9170c06d6d4d9ac1b0cbba Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:43:23 +0100 Subject: [PATCH 19/22] bih.h --- src/engine/world/bih.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/world/bih.h b/src/engine/world/bih.h index fd96c818d..75397e471 100644 --- a/src/engine/world/bih.h +++ b/src/engine/world/bih.h @@ -72,9 +72,9 @@ class BIH { return *reinterpret_cast(pos + i*posstride); } - vec2 gettc(int i) const + vec2 gettc(int i) const { - return *reinterpret_cast(tc + i*tcstride); + return *reinterpret_cast *>(tc + i*tcstride); } }; From 02d1a3a7aa2113d4807c8b93a56337c7030aa0f1 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:44:04 +0100 Subject: [PATCH 20/22] octaedit.cpp --- src/engine/world/octaedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/world/octaedit.cpp b/src/engine/world/octaedit.cpp index 81f8179db..1a3dab19c 100644 --- a/src/engine/world/octaedit.cpp +++ b/src/engine/world/octaedit.cpp @@ -1909,7 +1909,7 @@ void rendertexturepanel(int w, int h) sy = std::min(1.0f, tex->ys/static_cast(tex->xs)); int x = w*1800/h-s-50, r = s; - vec2 tc[4] = { vec2(0, 0), vec2(1, 0), vec2(1, 1), vec2(0, 1) }; + vec2 tc[4] = { vec2(0.f, 0.f), vec2(1.f, 0.f), vec2(1.f, 1.f), vec2(0.f, 1.f) }; float xoff = vslot.offset.x, yoff = vslot.offset.y; if(vslot.rotation) From 82f38216f54b2cb4fbd6d1f805d919d355617ac6 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:45:39 +0100 Subject: [PATCH 21/22] physics.cpp --- src/engine/world/physics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/world/physics.cpp b/src/engine/world/physics.cpp index 8a23bc2ee..9c9cae82b 100644 --- a/src/engine/world/physics.cpp +++ b/src/engine/world/physics.cpp @@ -526,13 +526,13 @@ static bool fuzzycollideellipse(physent *d, const vec &dir, float cutoff, const } case 2: { - vec2 ln(mdlvol.orient.transform(entvol.center().sub(mdlvol.o))); + vec2 ln(mdlvol.orient.transform(entvol.center().sub(mdlvol.o))); float r = ln.magnitude(); if(r < 1e-6f) { continue; } - vec2 lw = vec2(ln.x*radius.y, ln.y*radius.x).normalize(); + vec2 lw = vec2(ln.x*radius.y, ln.y*radius.x).normalize(); w = mdlvol.orient.transposedtransform(lw); dist = -vec2(ln.x*radius.x, ln.y*radius.y).dot(lw)/r; break; From c0070c14acede5e7931931892a1ad89ac4f08325 Mon Sep 17 00:00:00 2001 From: Duskhorn Date: Sat, 22 Jan 2022 11:46:57 +0100 Subject: [PATCH 22/22] geom.cpp and glemu.cpp --- src/shared/geom.cpp | 2 +- src/shared/glemu.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shared/geom.cpp b/src/shared/geom.cpp index d0cfa67b4..b02b06e53 100644 --- a/src/shared/geom.cpp +++ b/src/shared/geom.cpp @@ -258,7 +258,7 @@ int polyclip(const vec *in, int numin, const vec &dir, float below, float above, //LUT used for fast angle calculations ingame //range 0 to 720 degrees to allow using offsets without needing slow modulus operators -extern const vec2 sincos360[721] = +extern const vec2 sincos360[721] = { vec2(1.00000000, 0.00000000), vec2(0.99984770, 0.01745241), vec2(0.99939083, 0.03489950), vec2(0.99862953, 0.05233596), vec2(0.99756405, 0.06975647), vec2(0.99619470, 0.08715574), // 0 vec2(0.99452190, 0.10452846), vec2(0.99254615, 0.12186934), vec2(0.99026807, 0.13917310), vec2(0.98768834, 0.15643447), vec2(0.98480775, 0.17364818), vec2(0.98162718, 0.19080900), // 6 diff --git a/src/shared/glemu.cpp b/src/shared/glemu.cpp index a8bc8d7ee..27ae1dd17 100644 --- a/src/shared/glemu.cpp +++ b/src/shared/glemu.cpp @@ -500,7 +500,7 @@ namespace gle void vertexf(float x, float y, float z, float w) { glVertexAttrib4f_(Attribute_Vertex, x, y, z, w); } void vertex(const vec &v) { glVertexAttrib3fv_(Attribute_Vertex, v.v); } void vertex(const vec &v, float w) { glVertexAttrib4f_(Attribute_Vertex, v.x, v.y, v.z, w); } - void vertex(const vec2 &v) { glVertexAttrib2fv_(Attribute_Vertex, v.v); } + void vertex(const vec2 &v) { glVertexAttrib2fv_(Attribute_Vertex, v.v); } void vertex(const vec4 &v) { glVertexAttrib4fv_(Attribute_Vertex, v.v); } void colorf(float x) { glVertexAttrib1f_(Attribute_Color, x); } @@ -510,7 +510,7 @@ namespace gle void color(const vec &v) { glVertexAttrib3fv_(Attribute_Color, v.v); } void color(const vec &v, float w) { glVertexAttrib4f_(Attribute_Color, v.x, v.y, v.z, w); } - void color(const vec2 &v) { glVertexAttrib2fv_(Attribute_Color, v.v); } + void color(const vec2 &v) { glVertexAttrib2fv_(Attribute_Color, v.v); } void color(const vec4 &v) { glVertexAttrib4fv_(Attribute_Color, v.v); } void colorub(uchar x, uchar y, uchar z, uchar w) { glVertexAttrib4Nub_(Attribute_Color, x, y, z, w); } @@ -523,7 +523,7 @@ namespace gle void texcoord0(const vec &v) { glVertexAttrib3fv_(Attribute_TexCoord0, v.v); } void texcoord0(const vec &v, float w) { glVertexAttrib4f_(Attribute_TexCoord0, v.x, v.y, v.z, w); } - void texcoord0(const vec2 &v) { glVertexAttrib2fv_(Attribute_TexCoord0, v.v); } + void texcoord0(const vec2 &v) { glVertexAttrib2fv_(Attribute_TexCoord0, v.v); } void texcoord0(const vec4 &v) { glVertexAttrib4fv_(Attribute_TexCoord0, v.v); } void texcoord1f(float x) { glVertexAttrib1f_(Attribute_TexCoord1, x); } void texcoord1f(float x, float y) { glVertexAttrib2f_(Attribute_TexCoord1, x, y); } @@ -531,7 +531,7 @@ namespace gle void texcoord1f(float x, float y, float z, float w) { glVertexAttrib4f_(Attribute_TexCoord1, x, y, z, w); } void texcoord1(const vec &v) { glVertexAttrib3fv_(Attribute_TexCoord1, v.v); } void texcoord1(const vec &v, float w) { glVertexAttrib4f_(Attribute_TexCoord1, v.x, v.y, v.z, w); } - void texcoord1(const vec2 &v) { glVertexAttrib2fv_(Attribute_TexCoord1, v.v); } + void texcoord1(const vec2 &v) { glVertexAttrib2fv_(Attribute_TexCoord1, v.v); } void texcoord1(const vec4 &v) { glVertexAttrib4fv_(Attribute_TexCoord1, v.v); } void normal(float x, float y, float z) { glVertexAttrib4f_(Attribute_Normal, x, y, z, 0.0f); } void normal(const vec &v) { glVertexAttrib4f_(Attribute_Normal, v.x, v.y, v.z, 0.0f); } @@ -658,7 +658,7 @@ namespace gle void attrib(const vec &v) { attribf(v.x, v.y, v.z); } void attrib(const vec &v, float w) { attribf(v.x, v.y, v.z, w); } - void attrib(const vec2 &v) { attribf(v.x, v.y); } + void attrib(const vec2 &v) { attribf(v.x, v.y); } void attrib(const vec4 &v) { attribf(v.x, v.y, v.z, v.w); } void attrib(const ivec &v) { attribi(v.x, v.y, v.z); } void attrib(const ivec &v, int w) { attribi(v.x, v.y, v.z, w); }