diff options
| author | Japa | 2011-01-20 04:14:21 +0000 |
|---|---|---|
| committer | Japa | 2011-01-20 04:14:21 +0000 |
| commit | 89dfda82b905eb4a14d3a1bc602aef5e7e3216ea (patch) | |
| tree | c472b3b24c56b4056abad6dac85ed610115eff2d /SpriteObjects.cpp | |
| parent | a70e0aabbf9a1c4463591ab0614f25d41477046e (diff) | |
| download | stonesense-89dfda82b905eb4a14d3a1bc602aef5e7e3216ea.tar.gz stonesense-89dfda82b905eb4a14d3a1bc602aef5e7e3216ea.tar.bz2 stonesense-89dfda82b905eb4a14d3a1bc602aef5e7e3216ea.tar.xz | |
first working multithreaded version.
Diffstat (limited to 'SpriteObjects.cpp')
| -rw-r--r-- | SpriteObjects.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/SpriteObjects.cpp b/SpriteObjects.cpp index de9413e..2186ffc 100644 --- a/SpriteObjects.cpp +++ b/SpriteObjects.cpp @@ -427,13 +427,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.
@@ -450,8 +450,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);
@@ -465,7 +465,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;
@@ -536,7 +536,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);
}
}
}
|
