Skip to content

Instantly share code, notes, and snippets.

@m0r13
Created January 30, 2014 19:55
Show Gist options
  • Save m0r13/8717488 to your computer and use it in GitHub Desktop.
Save m0r13/8717488 to your computer and use it in GitHub Desktop.
diff --git a/src/renderer/tilerenderworker.cpp b/src/renderer/tilerenderworker.cpp
index 286a3bf..8740068 100644
--- a/src/renderer/tilerenderworker.cpp
+++ b/src/renderer/tilerenderworker.cpp
@@ -83,17 +83,16 @@
render_context.tileset->getTileOffset(), image);
render_work_result.tiles_rendered++;
- /*
// draws a border on the tile
- int size = settings.tile_size;
+ int border = 2;
+ int size = image.getWidth();
for (int x = 0; x < size; x++)
for (int y = 0; y < size; y++) {
- if (x < 5 || x > size-5)
- tile.setPixel(x, y, rgba(0, 0, 255, 255));
- if (y < 5 || y > size-5)
- tile.setPixel(x, y, rgba(0, 0, 255, 255));
+ if (x < border || x > size-border)
+ image.setPixel(x, y, rgba(0, 0, 255, 255));
+ if (y < border || y > size-border)
+ image.setPixel(x, y, rgba(0, 0, 255, 255));
}
- */
// save it
saveTile(tile, image);
@@ -133,16 +132,14 @@
image.simpleblit(resized, size / 2, size / 2);
}
- /*
- // draws a border on the tile
+ int border = 2;
for (int x = 0; x < size; x++)
for (int y = 0; y < size; y++) {
- if (x < 5 || x > size-5)
- tile.setPixel(x, y, rgba(255, 0, 0, 255));
- if (y < 5 || y > size-5)
- tile.setPixel(x, y, rgba(255, 0, 0, 255));
+ if (x < border || x > size-border)
+ image.setPixel(x, y, rgba(0, 0, 255, 255));
+ if (y < border || y > size-border)
+ image.setPixel(x, y, rgba(0, 0, 255, 255));
}
- */
// then save the tile
saveTile(tile, image);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment