Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2cc1f14
templated in ui.cpp
Duskhorn Jan 22, 2022
e3d62e9
templated in animmodel.h
Duskhorn Jan 22, 2022
aff6700
updated .gitignore
Duskhorn Jan 22, 2022
209b221
md5.h and obj.cpp
Duskhorn Jan 22, 2022
5304855
used new vec2 template instead of genericvec2
Duskhorn Jan 22, 2022
183a574
used new vec2<T> instead of GeneriVec2
Duskhorn Jan 22, 2022
0be2eea
more vec2<float>
Duskhorn Jan 22, 2022
b792f97
aa.cpp
Duskhorn Jan 22, 2022
49b055b
csm.cpp
Duskhorn Jan 22, 2022
37ce06b
grass and hud :)
Duskhorn Jan 22, 2022
637cd7b
octarender, radiancehints and rendergl
Duskhorn Jan 22, 2022
a79ac36
renderlights
Duskhorn Jan 22, 2022
c2b9c91
renderlights part 2
Duskhorn Jan 22, 2022
efbf230
renderparticles
Duskhorn Jan 22, 2022
e755b8b
renderparticles part 2
Duskhorn Jan 22, 2022
615af3f
renderva
Duskhorn Jan 22, 2022
55fffcf
stain.cpp and texture.h
Duskhorn Jan 22, 2022
7ded47c
bih.cpp
Duskhorn Jan 22, 2022
d9ed9d9
bih.h
Duskhorn Jan 22, 2022
02d1a3a
octaedit.cpp
Duskhorn Jan 22, 2022
82f3821
physics.cpp
Duskhorn Jan 22, 2022
c0070c1
geom.cpp and glemu.cpp
Duskhorn Jan 22, 2022
ea15fcb
fixed merge
Duskhorn Jan 23, 2022
3cb0d36
Merge branch 'project-imprimis:main' into vec2
Duskhorn Jan 27, 2022
692b489
Merge branch 'project-imprimis:main' into vec2
Duskhorn Jan 28, 2022
6fd9a94
Merge branch 'project-imprimis:main' into vec2
Duskhorn Jan 31, 2022
9304b6b
Merge remote-tracking branch 'origin' into vec2
Duskhorn Feb 2, 2022
84302ff
Merge branch 'project-imprimis:main' into vec2
Duskhorn Feb 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ src/tess_server
*.srctrlprj
# Files auto-produced by VSCode.
.vscode/
.ionide/
# Documentation files in the docs folder.
docs
22 changes: 11 additions & 11 deletions src/engine/interface/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,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<float> tc[4])
{
gle::defvertex(2);
gle::deftexcoord0();
Expand Down Expand Up @@ -795,7 +795,7 @@ namespace UI
uint *contents, *onshow, *onhide;
bool allowinput, eschide, abovehud;
float px, py, pw, ph;
vec2 sscale, soffset;
vec2<float> sscale, soffset;

Window(const char *name, const char *contents, const char *onshow, const char *onhide) :
name(newstring(name)),
Expand Down Expand Up @@ -951,8 +951,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<float> s1 = vec2(x1, y2).mul(sscale).add(soffset),
s2 = vec2(x2, y1).mul(sscale).add(soffset);
sx1 = static_cast<int>(std::floor(s1.x*hudw + 0.5f));
sy1 = static_cast<int>(std::floor(s1.y*hudh + 0.5f));
sx2 = static_cast<int>(std::floor(s2.x*hudw + 0.5f));
Expand Down Expand Up @@ -2382,7 +2382,7 @@ namespace UI

struct Triangle : Shape
{
vec2 a, b, c;
vec2<float> a, b, c;

void setup(const Color &color_, float w = 0, float h = 0, int angle = 0, int type_ = SOLID)
{
Expand All @@ -2391,16 +2391,16 @@ namespace UI
c = vec2(w/2, h/3);
if(angle)
{
vec2 rot = sincosmod360(-angle);
vec2<float> 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<float> 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<float> bbmax = vec2(a).max(b).max(c);

Shape::setup(color_, type_, bbmax.x, bbmax.y);
}
Expand Down Expand Up @@ -2487,7 +2487,7 @@ namespace UI

float r = radius <= 0 ? std::min(w, h)/2 : radius;
color.init();
vec2 center(sx + r, sy + r);
vec2<float> center(sx + r, sy + r);
if(type == OUTLINE)
{
gle::begin(GL_LINE_LOOP);
Expand All @@ -2502,7 +2502,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<float> p = vec2(sincos360[angle]).mul(r).add(center);
gle::attrib(p);
gle::attrib(p);
}
Expand Down Expand Up @@ -4261,7 +4261,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<float> 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)
Expand Down
6 changes: 3 additions & 3 deletions src/engine/model/animmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<float> &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,
Expand Down
2 changes: 1 addition & 1 deletion src/engine/model/md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct md5weight

struct md5vert
{
vec2 tc;
vec2<float> tc;
ushort start, count;
};

Expand Down
2 changes: 1 addition & 1 deletion src/engine/model/obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,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)
{
Expand Down
6 changes: 3 additions & 3 deletions src/engine/model/skelmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ struct skelmodel : animmodel
struct vert
{
vec pos, norm;
vec2 tc;
vec2<float> tc;
quat tangent;
int blend, interpindex;
};

struct vvert
{
vec pos;
GenericVec2<half> tc;
vec2<half> tc;
squat tangent;
};

struct vvertg
{
vec4<half> pos;
GenericVec2<half> tc;
vec2<half> tc;
squat tangent;
};

Expand Down
6 changes: 3 additions & 3 deletions src/engine/model/vertmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ struct vertmodel : animmodel
struct vvert
{
vec pos;
GenericVec2<half> tc;
vec2<half> tc;
squat tangent;
};

struct vvertg
{
vec4<half> pos;
GenericVec2<half> tc;
vec2<half> tc;
squat tangent;
};

struct tcvert
{
vec2 tc;
vec2<float> tc;
};

struct tri
Expand Down
Loading