diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-12-24 12:31:02 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-12-24 12:31:02 +0000 |
commit | eaa16c5602d7f9081ef16c799f4492b68cc81a9c (patch) | |
tree | 5ff83fa26f7675dd6feb66c0bca2138a90ee4bf7 /src | |
parent | 3134c856230ad9d84a009ae7ed4d08a56aecaad7 (diff) | |
download | mana-client-eaa16c5602d7f9081ef16c799f4492b68cc81a9c.tar.gz mana-client-eaa16c5602d7f9081ef16c799f4492b68cc81a9c.tar.bz2 mana-client-eaa16c5602d7f9081ef16c799f4492b68cc81a9c.tar.xz mana-client-eaa16c5602d7f9081ef16c799f4492b68cc81a9c.zip |
Fringe layer draw fix and change in policy on when using OpenGL is the default.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 6 | ||||
-rw-r--r-- | src/map.cpp | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 03e6000f..7daba4bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -181,11 +181,11 @@ void init_engine() config.setValue("host", "animesites.de"); config.setValue("port", 6901); config.setValue("hwaccel", 0); - #if defined __APPLE__ || defined WIN32 || defined USE_OPENGL +#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL config.setValue("opengl", 1); - #else +#else config.setValue("opengl", 0); - #endif +#endif config.setValue("screen", 0); config.setValue("sound", 1); config.setValue("guialpha", 0.8f); diff --git a/src/map.cpp b/src/map.cpp index 449f72e9..5150bcff 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -96,18 +96,23 @@ bool spriteCompare(const Sprite *a, const Sprite *b) void Map::draw(Graphics *graphics, int scrollX, int scrollY, int layer) { + int startX = scrollX / 32; + int startY = scrollY / 32; + int endX = (graphics->getWidth() + scrollX + 31) / 32; + int endY = (graphics->getHeight() + scrollY + 31) / 32; + // If drawing the fringe layer, make sure sprites are sorted Sprites::iterator si; if (layer == 1) { mSprites.sort(spriteCompare); si = mSprites.begin(); - } - int startX = scrollX / 32; - int startY = scrollY / 32; - int endX = (graphics->getWidth() + scrollX + 31) / 32; - int endY = (graphics->getHeight() + scrollY + 31) / 32; + // Increase endY to account for high fringe tiles + // TODO: Improve this hack so that it'll dynamically account for the + // highest tile. + endY += 2; + } if (startX < 0) startX = 0; if (startY < 0) startY = 0; |