aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libjin-lua/modules/graphics/je_lua_page.cpp8
-rw-r--r--src/libjin-lua/modules/graphics/je_lua_particle_system.cpp16
-rw-r--r--src/libjin-lua/modules/graphics/je_lua_sprite.cpp4
-rw-r--r--src/libjin/graphics/fonts/je_texture_font.cpp26
-rw-r--r--src/libjin/graphics/fonts/je_ttf.cpp76
-rw-r--r--src/libjin/graphics/je_graphic.cpp18
-rw-r--r--src/libjin/graphics/je_mesh.cpp14
-rw-r--r--src/libjin/graphics/je_sprite.cpp6
-rw-r--r--src/libjin/graphics/je_window.cpp6
-rw-r--r--src/libjin/graphics/particles/je_particle.cpp2
-rw-r--r--src/libjin/graphics/particles/je_particle_emitter.cpp8
-rw-r--r--src/libjin/graphics/particles/je_particle_system.cpp4
-rw-r--r--src/libjin/input/je_event.h8
-rw-r--r--src/libjin/math/je_matrix.cpp4
-rw-r--r--src/libjin/math/je_transform.cpp14
-rw-r--r--src/libjin/math/je_vector2.hpp7
16 files changed, 111 insertions, 110 deletions
diff --git a/src/libjin-lua/modules/graphics/je_lua_page.cpp b/src/libjin-lua/modules/graphics/je_lua_page.cpp
index 5a312e2..8b4043e 100644
--- a/src/libjin-lua/modules/graphics/je_lua_page.cpp
+++ b/src/libjin-lua/modules/graphics/je_lua_page.cpp
@@ -31,22 +31,22 @@ namespace JinEngine
LUA_IMPLEMENT int l_getSize(lua_State* L)
{
Page* page = getPage(L);
- luax_pushinteger(L, page->size.w);
- luax_pushinteger(L, page->size.h);
+ luax_pushinteger(L, page->size.w());
+ luax_pushinteger(L, page->size.h());
return 2;
}
LUA_IMPLEMENT int l_getWidth(lua_State* L)
{
Page* page = getPage(L);
- luax_pushinteger(L, page->size.w);
+ luax_pushinteger(L, page->size.w());
return 1;
}
LUA_IMPLEMENT int l_getHeight(lua_State* L)
{
Page* page = getPage(L);
- luax_pushinteger(L, page->size.h);
+ luax_pushinteger(L, page->size.h());
return 1;
}
diff --git a/src/libjin-lua/modules/graphics/je_lua_particle_system.cpp b/src/libjin-lua/modules/graphics/je_lua_particle_system.cpp
index 0c42209..70511f7 100644
--- a/src/libjin-lua/modules/graphics/je_lua_particle_system.cpp
+++ b/src/libjin-lua/modules/graphics/je_lua_particle_system.cpp
@@ -147,10 +147,10 @@ namespace JinEngine
return 1;
}
Vector2<float> floor, ceil;
- floor.x = luax_rawgetnumber(L, 2, 1);
- floor.y = luax_rawgetnumber(L, 2, 2);
- ceil.x = luax_rawgetnumber(L, 3, 1);
- ceil.y = luax_rawgetnumber(L, 3, 2);
+ floor.x() = luax_rawgetnumber(L, 2, 1);
+ floor.y() = luax_rawgetnumber(L, 2, 2);
+ ceil.x() = luax_rawgetnumber(L, 3, 1);
+ ceil.y() = luax_rawgetnumber(L, 3, 2);
ps->setEmitPosition(floor, ceil);
}
else if (luax_gettop(L) >= 2)
@@ -161,8 +161,8 @@ namespace JinEngine
return 1;
}
Vector2<float> pos;
- pos.x = luax_rawgetnumber(L, 2, 1);
- pos.y = luax_rawgetnumber(L, 2, 2);
+ pos.x() = luax_rawgetnumber(L, 2, 1);
+ pos.y() = luax_rawgetnumber(L, 2, 2);
ps->setEmitPosition(pos);
}
return 0;
@@ -194,8 +194,8 @@ namespace JinEngine
return 1;
}
Vector2<float> ac;
- ac.x = luax_rawgetnumber(L, 2, 1);
- ac.y = luax_rawgetnumber(L, 2, 2);
+ ac.x() = luax_rawgetnumber(L, 2, 1);
+ ac.y() = luax_rawgetnumber(L, 2, 2);
ps->setParticleLinearAccelaration(ac);
return 0;
}
diff --git a/src/libjin-lua/modules/graphics/je_lua_sprite.cpp b/src/libjin-lua/modules/graphics/je_lua_sprite.cpp
index f1bc6aa..f48e32d 100644
--- a/src/libjin-lua/modules/graphics/je_lua_sprite.cpp
+++ b/src/libjin-lua/modules/graphics/je_lua_sprite.cpp
@@ -46,8 +46,8 @@ namespace JinEngine
{
Sprite* sprite = checkSprite(L);
Vector2<int> size = sprite->getSize();
- luax_pushinteger(L, size.x);
- luax_pushinteger(L, size.y);
+ luax_pushinteger(L, size.x());
+ luax_pushinteger(L, size.y());
return 1;
}
diff --git a/src/libjin/graphics/fonts/je_texture_font.cpp b/src/libjin/graphics/fonts/je_texture_font.cpp
index 7737f90..97f1f2f 100644
--- a/src/libjin/graphics/fonts/je_texture_font.cpp
+++ b/src/libjin/graphics/fonts/je_texture_font.cpp
@@ -25,15 +25,15 @@ namespace JinEngine
Vector2<int> count(bitmap->getWidth() / cellw, bitmap->getHeight() / cellh);
glyph.w = cellw;
glyph.h = cellh;
- for (int y = 0; y < count.row; ++y)
+ for (int y = 0; y < count.row(); ++y)
{
glyph.y = y * cellh;
- for (int x = 0; x < count.colum; ++x)
+ for (int x = 0; x < count.colum(); ++x)
{
glyph.x = x * cellw;
- if (x + y * count.colum >= codepoints.size())
+ if (x + y * count.colum() >= codepoints.size())
return;
- glyphs.insert(std::pair<Codepoint, TextureGlyph>(codepoints[x + y * count.colum], glyph));
+ glyphs.insert(std::pair<Codepoint, TextureGlyph>(codepoints[x + y * count.colum()], glyph));
}
}
}
@@ -135,15 +135,15 @@ namespace JinEngine
// newline
if (c == 0x0A)
{
- p.y += lineheight;
- p.x = 0;
+ p.y() += lineheight;
+ p.x() = 0;
continue;
}
if (c == 0x09)
{
// tab = 4*space
unsigned cw = getCharWidth(0x20);
- p.x += cw * 4;
+ p.x() += cw * 4;
continue;
}
glyph = findGlyph(c);
@@ -162,14 +162,14 @@ namespace JinEngine
float w = getWidth(), h = getHeight();
float nx = glyph->x / w, ny = glyph->y / h;
float nw = glyph->w / w, nh = glyph->h / h;
- glyphvertices_push(p.x, p.y, nx, ny);
- glyphvertices_push(p.x, p.y + glyph->h, nx, ny + nh);
- glyphvertices_push(p.x + glyph->w, p.y + glyph->h, nx + nw, ny + nh);
- glyphvertices_push(p.x + glyph->w, p.y, nx + nw, ny);
- p.x += glyph->w + spacing;
+ glyphvertices_push(p.x(), p.y(), nx, ny);
+ glyphvertices_push(p.x(), p.y() + glyph->h, nx, ny + nh);
+ glyphvertices_push(p.x() + glyph->w, p.y() + glyph->h, nx + nw, ny + nh);
+ glyphvertices_push(p.x() + glyph->w, p.y(), nx + nw, ny);
+ p.x() += glyph->w + spacing;
i += 4;
}
- getTextBox(text, &page->size.w, &page->size.h, lineheight, spacing);
+ getTextBox(text, &page->size.w(), &page->size.h(), lineheight, spacing);
return page;
}
diff --git a/src/libjin/graphics/fonts/je_ttf.cpp b/src/libjin/graphics/fonts/je_ttf.cpp
index 904617a..5d341fa 100644
--- a/src/libjin/graphics/fonts/je_ttf.cpp
+++ b/src/libjin/graphics/fonts/je_ttf.cpp
@@ -233,30 +233,30 @@ namespace JinEngine
Vector2<int> p(0, 0);
int i = 0;
-#define glyphvertices_push(_x, _y, _u, _v) \
- vertex.x = _x; vertex.y = _y;\
- vertex.u = _u; vertex.v = _v;\
- glyphvertices.push_back(vertex);
-
-#define glyphlize(c)\
- do{\
- glyph = &findGlyph(c); \
- if (texture != glyph->atlas) \
- { \
- GlyphArrayDrawInfo info; \
- info.start = i; \
- info.count = 0; \
- info.texture = glyph->atlas; \
- texture = glyph->atlas; \
- glyphinfolist.push_back(info); \
- } \
- glyphinfolist[glyphinfolist.size() - 1].count += 4; \
- TTFGlyph::Bbox& bbox = glyph->bbox; \
- glyphvertices_push(p.x, p.y, bbox.x, bbox.y); \
- glyphvertices_push(p.x, p.y + glyph->height, bbox.x, bbox.y + bbox.h); \
- glyphvertices_push(p.x + glyph->width, p.y + glyph->height, bbox.x + bbox.w, bbox.y + bbox.h); \
- glyphvertices_push(p.x + glyph->width, p.y, bbox.x + bbox.w, bbox.y); \
- }while(0)
+ #define glyphvertices_push(_x, _y, _u, _v) \
+ vertex.x = _x; vertex.y = _y;\
+ vertex.u = _u; vertex.v = _v;\
+ glyphvertices.push_back(vertex);
+
+ #define glyphlize(c)\
+ do{\
+ glyph = &findGlyph(c); \
+ if (texture != glyph->atlas) \
+ { \
+ GlyphArrayDrawInfo info; \
+ info.start = i; \
+ info.count = 0; \
+ info.texture = glyph->atlas; \
+ texture = glyph->atlas; \
+ glyphinfolist.push_back(info); \
+ } \
+ glyphinfolist[glyphinfolist.size() - 1].count += 4; \
+ TTFGlyph::Bbox& bbox = glyph->bbox; \
+ glyphvertices_push(p.x(), p.y(), bbox.x, bbox.y); \
+ glyphvertices_push(p.x(), p.y() + glyph->height, bbox.x, bbox.y + bbox.h); \
+ glyphvertices_push(p.x() + glyph->width, p.y() + glyph->height, bbox.x + bbox.w, bbox.y + bbox.h); \
+ glyphvertices_push(p.x() + glyph->width, p.y(), bbox.x + bbox.w, bbox.y); \
+ }while(0)
for (Codepoint c : text)
{
@@ -265,22 +265,22 @@ namespace JinEngine
if (c == 0x0A)
{
/* new line */
- p.y += lineheight;
- p.x = 0;
+ p.y() += lineheight;
+ p.x() = 0;
continue;
}
if (c == 0x09)
{
// tab = 4*space
unsigned cw = getCharWidth(0x20);
- p.x += cw * 4;
+ p.x() += cw * 4;
continue;
}
glyphlize(c);
- p.x += glyph->width + spacing;
+ p.x() += glyph->width + spacing;
i += 4;
}
- getTextBox(text, &page->size.w, &page->size.h, lineheight, spacing);
+ getTextBox(text, &page->size.w(), &page->size.h(), lineheight, spacing);
return page;
}
@@ -411,32 +411,32 @@ namespace JinEngine
/* bake glyph */
ttf->getHMetrics(character, &adw, &lsb);
ttf->popTTFsize();
- if (cursor.x + adw > textureWidth)
+ if (cursor.x() + adw > textureWidth)
{
- cursor.x = 0;
- cursor.y += descent;
- if (cursor.y + descent * 2 > textureHeight)
+ cursor.x() = 0;
+ cursor.y() += descent;
+ if (cursor.y() + descent * 2 > textureHeight)
{
/* create new atlas */
atlas = createAtlas();
- cursor.y = 0;
+ cursor.y() = 0;
}
}
gl.bindTexture(atlas);
- gl.texSubImage(cursor.x + xoff, cursor.y + yoff + baseline, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bitmap);
+ gl.texSubImage(cursor.x() + xoff, cursor.y() + yoff + baseline, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bitmap);
gl.bindTexture();
delete[] bitmap;
}
TTFGlyph glyph;
glyph.atlas = atlas;
- glyph.bbox.x = cursor.x / (float)textureWidth;
- glyph.bbox.y = cursor.y / (float)textureHeight;
+ glyph.bbox.x = cursor.x() / (float)textureWidth;
+ glyph.bbox.y = cursor.y() / (float)textureHeight;
glyph.bbox.w = adw / (float)textureWidth;
glyph.bbox.h = descent / (float)textureHeight;
glyph.width = adw;
glyph.height = descent;
glyphs.insert(std::pair<unsigned int, TTFGlyph>(character, glyph));
- cursor.x += adw;
+ cursor.x() += adw;
return glyphs[character];
}
diff --git a/src/libjin/graphics/je_graphic.cpp b/src/libjin/graphics/je_graphic.cpp
index 1e18995..964d0e5 100644
--- a/src/libjin/graphics/je_graphic.cpp
+++ b/src/libjin/graphics/je_graphic.cpp
@@ -27,8 +27,8 @@ namespace JinEngine
Graphic::Graphic(const Bitmap* bitmap)
: mTexture(0)
{
- mSize.w = bitmap->getWidth();
- mSize.h = bitmap->getHeight();
+ mSize.w() = bitmap->getWidth();
+ mSize.h() = bitmap->getHeight();
const Color* pixels = bitmap->getPixels();
@@ -36,7 +36,7 @@ namespace JinEngine
gl.bindTexture(mTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- gl.texImage(GL_RGBA8, mSize.w, mSize.h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ gl.texImage(GL_RGBA8, mSize.w(), mSize.h(), GL_RGBA, GL_UNSIGNED_BYTE, pixels);
gl.bindTexture(0);
}
@@ -94,10 +94,10 @@ namespace JinEngine
vertexCoords[4] = slice.w; vertexCoords[5] = slice.h;
vertexCoords[6] = slice.w; vertexCoords[7] = 0;
// Set texture coordinates.
- float slx = slice.x / mSize.w;
- float sly = slice.y / mSize.h;
- float slw = slice.w / mSize.w;
- float slh = slice.h / mSize.h;
+ float slx = slice.x / mSize.w();
+ float sly = slice.y / mSize.h();
+ float slw = slice.w / mSize.w();
+ float slh = slice.h / mSize.h();
textureCoords[0] = slx; textureCoords[1] = sly;
textureCoords[2] = slx; textureCoords[3] = sly + slh;
textureCoords[4] = slx + slw; textureCoords[5] = sly + slh;
@@ -124,7 +124,7 @@ namespace JinEngine
Vector2<float> origin = transform.getOrigin();
Vector2<float> scale = transform.getScale();
float angle = transform.getRotation();
- render(position.x, position.y, scale.x, scale.y, angle, origin.x, origin.y);
+ render(position.x(), position.y(), scale.x(), scale.y(), angle, origin.x(), origin.y());
}
void Graphic::render(const Math::Quad& slice, const Math::Transform& transform) const
@@ -133,7 +133,7 @@ namespace JinEngine
Vector2<float> origin = transform.getOrigin();
Vector2<float> scale = transform.getScale();
float angle = transform.getRotation();
- render(slice, position.x, position.y, scale.x, scale.y, angle, origin.x, origin.y);
+ render(slice, position.x(), position.y(), scale.x(), scale.y(), angle, origin.x(), origin.y());
}
//void Graphic::setFilter(GLint min, GLint max)
diff --git a/src/libjin/graphics/je_mesh.cpp b/src/libjin/graphics/je_mesh.cpp
index b96a4ff..d220bcb 100644
--- a/src/libjin/graphics/je_mesh.cpp
+++ b/src/libjin/graphics/je_mesh.cpp
@@ -24,8 +24,8 @@ namespace JinEngine
void Mesh::pushVertex(float x, float y, float u, float v, Color color)
{
Vertex vert;
- vert.xy.x = x; vert.xy.y = y;
- vert.uv.u = u; vert.uv.v = v;
+ vert.xy.x() = x; vert.xy.y() = y;
+ vert.uv.u() = u; vert.uv.v() = v;
vert.color = color;
pushVertex(vert);
}
@@ -37,14 +37,14 @@ namespace JinEngine
if (mVertices.size() == 2)
{
const Vertex& v0 = mVertices[0];
- mBound.l = min(v0.xy.x, vert.xy.x);
- mBound.r = max(v0.xy.x, vert.xy.x);
- mBound.t = min(v0.xy.y, vert.xy.y);
- mBound.b = max(v0.xy.y, vert.xy.y);
+ mBound.l = min(v0.xy.x(), vert.xy.x());
+ mBound.r = max(v0.xy.x(), vert.xy.x());
+ mBound.t = min(v0.xy.y(), vert.xy.y());
+ mBound.b = max(v0.xy.y(), vert.xy.y());
}
else
{
- float x = vert.xy.x, y = vert.xy.y;
+ float x = vert.xy.x(), y = vert.xy.y();
mBound.l = x < mBound.l ? x : mBound.l;
mBound.r = x > mBound.r ? x : mBound.r;
mBound.t = y < mBound.t ? y : mBound.t;
diff --git a/src/libjin/graphics/je_sprite.cpp b/src/libjin/graphics/je_sprite.cpp
index 789fd26..bddb353 100644
--- a/src/libjin/graphics/je_sprite.cpp
+++ b/src/libjin/graphics/je_sprite.cpp
@@ -49,15 +49,15 @@ namespace JinEngine
void Sprite::render(float x, float y, float sx, float sy, float r) const
{
if (mGraphic != nullptr)
- mGraphic->render(mQuad, x, y, sx, sy, r, mOrigin.x, mOrigin.y);
+ mGraphic->render(mQuad, x, y, sx, sy, r, mOrigin.x(), mOrigin.y());
}
void Sprite::setOrigin(Origin origin)
{
int l = 0, r = 0, t = 0, b = 0;
Vector2<int> size = getSize();
- r = size.w;
- b = size.h;
+ r = size.w();
+ b = size.h();
Vector2<float>* org = const_cast<Vector2<float>*>(&mOrigin);
switch (origin)
{
diff --git a/src/libjin/graphics/je_window.cpp b/src/libjin/graphics/je_window.cpp
index 8ebddb9..6cbea15 100644
--- a/src/libjin/graphics/je_window.cpp
+++ b/src/libjin/graphics/je_window.cpp
@@ -28,8 +28,8 @@ namespace JinEngine
return false;
const Setting* setting = (Setting*)s;
- mSize.w = setting->width;
- mSize.h = setting->height;
+ mSize.w() = setting->width;
+ mSize.h() = setting->height;
mFps = setting->fps;
bool vsync = setting->vsync;
const char* title = setting->title;
@@ -65,7 +65,7 @@ namespace JinEngine
if (setting->fullscreen) flag |= SDL_WINDOW_FULLSCREEN;
if (setting->resizable) flag |= SDL_WINDOW_RESIZABLE;
- mWnd = SDL_CreateWindow(title, wx, wy, mSize.w, mSize.h, flag);
+ mWnd = SDL_CreateWindow(title, wx, wy, mSize.w(), mSize.h(), flag);
if (mWnd == NULL)
return false;
diff --git a/src/libjin/graphics/particles/je_particle.cpp b/src/libjin/graphics/particles/je_particle.cpp
index 71c0426..c6bbf42 100644
--- a/src/libjin/graphics/particles/je_particle.cpp
+++ b/src/libjin/graphics/particles/je_particle.cpp
@@ -179,7 +179,7 @@ namespace JinEngine
Vector2<float>& position = transform.getPosition();
Vector2<float>& scale = transform.getScale();
float r = transform.getRotation();
- sprite->render(position.x, position.y, scale.x, scale.y, r);
+ sprite->render(position.x(), position.y(), scale.x(), scale.y(), r);
}
gl.setColor(c);
gl.setBlendMode(blend);
diff --git a/src/libjin/graphics/particles/je_particle_emitter.cpp b/src/libjin/graphics/particles/je_particle_emitter.cpp
index 47957b6..644fd6e 100644
--- a/src/libjin/graphics/particles/je_particle_emitter.cpp
+++ b/src/libjin/graphics/particles/je_particle_emitter.cpp
@@ -53,10 +53,10 @@ namespace JinEngine
// Init position.
if (mDef.positionDef.enableRandom)
{
- float x = rng.randf(mDef.positionDef.position.random.floor.x, mDef.positionDef.position.random.ceil.x, ACCURACY_4);
- float y = rng.randf(mDef.positionDef.position.random.floor.y, mDef.positionDef.position.random.ceil.y, ACCURACY_4);
- x += mPS.mPosition.x;
- y += mPS.mPosition.y;
+ float x = rng.randf(mDef.positionDef.position.random.floor.x(), mDef.positionDef.position.random.ceil.x(), ACCURACY_4);
+ float y = rng.randf(mDef.positionDef.position.random.floor.y(), mDef.positionDef.position.random.ceil.y(), ACCURACY_4);
+ x += mPS.mPosition.x();
+ y += mPS.mPosition.y();
p->transform.setPosition(x, y);
}
else
diff --git a/src/libjin/graphics/particles/je_particle_system.cpp b/src/libjin/graphics/particles/je_particle_system.cpp
index d0cd4e0..ec25163 100644
--- a/src/libjin/graphics/particles/je_particle_system.cpp
+++ b/src/libjin/graphics/particles/je_particle_system.cpp
@@ -30,8 +30,8 @@ namespace JinEngine
void ParticleSystem::setPosition(float x, float y)
{
- mPosition.x = x;
- mPosition.y = y;
+ mPosition.x() = x;
+ mPosition.y() = y;
}
void ParticleSystem::update(float dt)
diff --git a/src/libjin/input/je_event.h b/src/libjin/input/je_event.h
index 9fe34ff..7a90334 100644
--- a/src/libjin/input/je_event.h
+++ b/src/libjin/input/je_event.h
@@ -99,13 +99,13 @@ namespace JinEngine
/*
inline const char* getWheelName(Wheel wheel)
{
- if (wheel.x == -1)
+ if (wheel.x() == -1)
return "left";
- else if (wheel.x == 1)
+ else if (wheel.x() == 1)
return "right";
- else if (wheel.y == -1)
+ else if (wheel.y() == -1)
return "near";
- else if (wheel.y == 1)
+ else if (wheel.y() == 1)
return "far";
else
return "none";
diff --git a/src/libjin/math/je_matrix.cpp b/src/libjin/math/je_matrix.cpp
index 96eae86..ad7d1e5 100644
--- a/src/libjin/math/je_matrix.cpp
+++ b/src/libjin/math/je_matrix.cpp
@@ -184,8 +184,8 @@ namespace JinEngine
for (int i = 0; i<size; ++i)
{
// Store in temp variables in case src = dst
- float x = (e[0] * src[i].xy.x) + (e[4] * src[i].xy.y) + (0) + (e[12]);
- float y = (e[1] * src[i].xy.x) + (e[5] * src[i].xy.y) + (0) + (e[13]);
+ float x = (e[0] * src[i].xy.x()) + (e[4] * src[i].xy.y()) + (0) + (e[12]);
+ float y = (e[1] * src[i].xy.x()) + (e[5] * src[i].xy.y()) + (0) + (e[13]);
dst[i].xy.set(x, y);
}
diff --git a/src/libjin/math/je_transform.cpp b/src/libjin/math/je_transform.cpp
index fba63fa..95ca14d 100644
--- a/src/libjin/math/je_transform.cpp
+++ b/src/libjin/math/je_transform.cpp
@@ -38,13 +38,13 @@ namespace JinEngine
void Transform::scale(float sx, float sy)
{
- mScale.x *= sx;
- mScale.y *= sy;
+ mScale.x() *= sx;
+ mScale.y() *= sy;
}
void Transform::setPosition(const Vector2<float>& p)
{
- setPosition(p.x, p.y);
+ setPosition(p.x(), p.y());
}
void Transform::setPosition(float x, float y)
@@ -59,13 +59,13 @@ namespace JinEngine
void Transform::move(float x, float y)
{
- mPosition.x += x;
- mPosition.y += y;
+ mPosition.x() += x;
+ mPosition.y() += y;
}
void Transform::move(const Vector2<float>& v)
{
- move(v.x, v.y);
+ move(v.x(), v.y());
}
void Transform::setOrigin(float x, float y)
@@ -96,7 +96,7 @@ namespace JinEngine
Matrix Transform::getMatrix() const
{
Matrix m;
- m.setTransformation(mPosition.x, mPosition.y, mRotation, mScale.x, mScale.y, mOrigin.x, mOrigin.y);
+ m.setTransformation(mPosition.x(), mPosition.y(), mRotation, mScale.x(), mScale.y(), mOrigin.x(), mOrigin.y());
return m;
}
diff --git a/src/libjin/math/je_vector2.hpp b/src/libjin/math/je_vector2.hpp
index 4be30fb..2e34784 100644
--- a/src/libjin/math/je_vector2.hpp
+++ b/src/libjin/math/je_vector2.hpp
@@ -64,9 +64,10 @@ namespace JinEngine
T A() const { return data[0]; }\
T B() const { return data[1]; }
- _aliases(x, y)
- _aliases(w, h)
- _aliases(colum, row)
+ _aliases(x, y);
+ _aliases(w, h);
+ _aliases(u, v);
+ _aliases(colum, row);
#undef _aliases