Removed BBox, renamed position to origin

I've replaced the BBox class with a pair of inline functions in
check_bounds.hpp. I've also renamed the 'position' variable to 'origin' in
several locations.

These changes are mostly to alleviate ambiguity.
This commit is contained in:
Kayne Ruse
2014-06-02 21:05:49 +10:00
parent d2f03b98dc
commit fb6fba9564
14 changed files with 107 additions and 120 deletions
+3 -3
View File
@@ -23,10 +23,10 @@
void CharacterData::Update(double delta) {
if (motion.x && motion.y) {
position += motion * delta * CHARACTER_WALKING_MOD;
origin += motion * delta * CHARACTER_WALKING_MOD;
}
else if (motion != 0) {
position += motion * delta;
origin += motion * delta;
}
#ifdef GRAPHICS
sprite.Update(delta);
@@ -36,7 +36,7 @@ void CharacterData::Update(double delta) {
#ifdef GRAPHICS
void CharacterData::DrawTo(SDL_Surface* const dest, int camX, int camY) {
sprite.DrawTo(dest, position.x - camX, position.y - camY);
sprite.DrawTo(dest, origin.x - camX, origin.y - camY);
}
void CharacterData::CorrectSprite() {