summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
-rw-r--r--src/map.cpp15
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;