diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-06 19:18:33 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-06 19:18:33 +0000 |
commit | 819c303db467086d714ad663b285b44cde6329cf (patch) | |
tree | c32af1bb58379bfc790fd27fe2e4889ffab36df5 /src/gui/minimap.cpp | |
parent | 5ec4143bde0fd67c7aca841804a5d165c794bdf0 (diff) | |
download | mana-819c303db467086d714ad663b285b44cde6329cf.tar.gz mana-819c303db467086d714ad663b285b44cde6329cf.tar.bz2 mana-819c303db467086d714ad663b285b44cde6329cf.tar.xz mana-819c303db467086d714ad663b285b44cde6329cf.zip |
Mostly making map tile data dynamically allocated.
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index a1104b8a..a58ed83c 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -18,7 +18,7 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $IdS + * $Id$ */ #define MINIMAP_W 100 @@ -52,11 +52,12 @@ void Minimap::draw(gcn::Graphics *graphics) getAbsolutePosition(x, y); - if ( (mapBackground->w != getWidth()) || (mapBackground->h != getHeight()) ) + if ((mapBackground->w != getWidth()) || (mapBackground->h != getHeight())) { SDL_FreeSurface(mapBackground); - mapBackground = SDL_AllocSurface(SDL_SWSURFACE, getWidth(), getHeight(), - (screen->format->BytesPerPixel*8), 0, 0, 0, 0); + mapBackground = SDL_AllocSurface(SDL_SWSURFACE, + getWidth(), getHeight(), + (screen->format->BytesPerPixel * 8), 0, 0, 0, 0); Uint32 mapColor = SDL_MapRGB(screen->format, 52, 149, 210); SDL_Rect sourceRect; sourceRect.x = sourceRect.y = 0; @@ -75,10 +76,11 @@ void Minimap::draw(gcn::Graphics *graphics) screenRect.h = getHeight(); screenRect.x = x; screenRect.y = y; - if ( mapBackground ) SDL_BlitSurface(mapBackground, NULL, screen, &screenRect); + if (mapBackground) + SDL_BlitSurface(mapBackground, NULL, screen, &screenRect); graphics->drawRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight())); graphics->setColor(gcn::Color(209, 52, 61)); - graphics->fillRectangle(gcn::Rectangle(player_node->x /2, + graphics->fillRectangle(gcn::Rectangle(player_node->x / 2, player_node->y / 2, 3, 3)); -}
\ No newline at end of file +} |