aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authorAndy <drumsetmonkey@gmail.com>2016-10-24 07:55:41 -0400
committerAndy <drumsetmonkey@gmail.com>2016-10-24 07:55:41 -0400
commitd7884127950260dd0f1b24aee0bfe64d847f990c (patch)
tree067751efc3b0e3d7ec9111b4764170bd69bacec7 /src/world.cpp
parent2dd2f42ff1c683331e7192b4bfb832e41543d2df (diff)
Better sprites
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 78de9ed..e44406e 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -354,10 +354,8 @@ void WorldSystem::load(const std::string& file)
} else if (tname == "Sprite") {
auto sprite = entity.assign<Sprite>();
auto tex = abcd->Attribute("image");
- auto dim = Texture::imageDim(tex);
- sprite->addSpriteSegment(SpriteData(game::sprite_l.loadSprite(tex),
- vec2(0, 0),
- vec2(dim.x, dim.y) * 2),
+ sprite->addSpriteSegment(SpriteData(tex,
+ vec2(0, 0)),
vec2(0, 0));
}
@@ -752,7 +750,7 @@ void WorldSystem::render(void)
std::vector<vec2> bg_tex;
bgTex++;
- dim2 mountainDim = bgTex.getTextureDim();
+ vec2 mountainDim = bgTex.getTextureDim();
auto xcoord = width / 2 * -1 + offset.x * 0.85f;
for (int i = 0; i <= width / mountainDim.x; i++) {
bg_items.emplace_back(mountainDim.x * i + xcoord, GROUND_HEIGHT_MINIMUM, 8.0f);