diff --git a/src/include/video.h b/src/include/video.h index 1cc9e3ca2..1505e229a 100644 --- a/src/include/video.h +++ b/src/include/video.h @@ -174,7 +174,7 @@ public: // minor programmatic editing features void OverlayGraphic(CGraphic *other, bool mask = false); - inline bool IsLoaded() const { return Surface != NULL; } + inline bool IsLoaded(bool flipped = false) const { return Surface != NULL && (!flipped || SurfaceFlip != NULL); } //guichan virtual void *_getData() const { return Surface; } diff --git a/src/missile/missile.cpp b/src/missile/missile.cpp index 79879b509..035085965 100644 --- a/src/missile/missile.cpp +++ b/src/missile/missile.cpp @@ -83,7 +83,7 @@ extern NumberDesc *Damage; /// Damage calculation for missile. */ void MissileType::LoadMissileSprite() { - if (this->G && !this->G->IsLoaded()) { + if (this->G && !this->G->IsLoaded(this->Flip)) { this->G->Load(); if (this->Flip) { this->G->Flip(); @@ -495,7 +495,7 @@ static int MissileVisibleInViewport(const CViewport &vp, const Missile &missile) void MissileType::DrawMissileType(int frame, const PixelPos &pos) const { #ifdef DYNAMIC_LOAD - if (!this->G->IsLoaded()) { + if (!this->G->IsLoaded(this->Flip)) { ((MissileType*)this)->LoadMissileSprite(); } #endif @@ -540,7 +540,7 @@ void Missile::DrawMissile(const CViewport &vp) const // FIXME: I should copy SourcePlayer for second level missiles. if (sunit && sunit->Player) { #ifdef DYNAMIC_LOAD - if (!this->Type->G->IsLoaded()) { + if (!this->Type->G->IsLoaded(this->Type->Flip)) { ((MissileType*)this->Type)->LoadMissileSprite(); } #endif