summaryrefslogtreecommitdiff
path: root/SpriteObjects.cpp
diff options
context:
space:
mode:
authorJapa2011-02-19 19:11:19 +0000
committerJapa2011-02-19 19:11:19 +0000
commitf1cd36716229dd3f0795824197b14dcd0d979540 (patch)
treea9391276cc5f0c569fe531996964a6cb57d2263e /SpriteObjects.cpp
parentd8523cd32f9aea85ce0ef0c6fb12c8562922dad2 (diff)
parentc2f73a1f356890e8ed6ada37a4613ce4836d4712 (diff)
downloadstonesense-f1cd36716229dd3f0795824197b14dcd0d979540.tar.gz
stonesense-f1cd36716229dd3f0795824197b14dcd0d979540.tar.bz2
stonesense-f1cd36716229dd3f0795824197b14dcd0d979540.tar.xz
merged in the multithreaded branch.
Diffstat (limited to 'SpriteObjects.cpp')
-rw-r--r--SpriteObjects.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/SpriteObjects.cpp b/SpriteObjects.cpp
index 402576a..7b75f4d 100644
--- a/SpriteObjects.cpp
+++ b/SpriteObjects.cpp
@@ -527,13 +527,13 @@ void c_sprite::draw_screen(int x, int y)
}
}
-void c_sprite::draw_world(int x, int y, int z, bool chop)
+void c_sprite::draw_world(int x, int y, int z, Block * b, bool chop)
{
- draw_world_offset(x, y, z, 0, chop);
+ draw_world_offset(x, y, z, b, 0, chop);
}
-void c_sprite::draw_world_offset(int x, int y, int z, int tileoffset, bool chop)
+void c_sprite::draw_world_offset(int x, int y, int z, Block * b, int tileoffset, bool chop)
{
if(defaultsheet == 0) defaultsheet = IMGObjectSheet;
//sprites can be offset by a random amount, both animationwise, and just variationwise.
@@ -550,8 +550,8 @@ void c_sprite::draw_world_offset(int x, int y, int z, int tileoffset, bool chop)
if(variations)
randoffset = rando%variations;
- Block* b = viewedSegment->getBlock(x, y, z);
-
+ if(!b)
+ return;
//if the xml says that this is a blood sprite, and offset is set here for proper pooling. this over-rides the random offset.
if(bloodsprite)
randoffset = getBloodOffset(b);
@@ -591,7 +591,7 @@ void c_sprite::draw_world_offset(int x, int y, int z, int tileoffset, bool chop)
correctBlockForSegmetOffset( drawx, drawy, drawz);
- correctBlockForRotation( drawx, drawy, drawz);
+ correctBlockForRotation( drawx, drawy, drawz, b->ownerSegment->rotation);
int32_t viewx = drawx;
int32_t viewy = drawy;
int32_t viewz = drawz;
@@ -663,7 +663,7 @@ void c_sprite::draw_world_offset(int x, int y, int z, int tileoffset, bool chop)
{
for(int i = 0; i < subsprites.size(); i++)
{
- subsprites.at(i).draw_world_offset(x, y, z, tileoffset, chop);
+ subsprites.at(i).draw_world_offset(x, y, z, b, tileoffset, chop);
}
}
}