Loosened the requirements for constructing a MapPager

This is so that I can configure the size of the pages in the config.cfg
file.
This commit is contained in:
Kayne Ruse
2014-03-15 19:15:58 +11:00
parent dd786ba579
commit 7e500027e3
6 changed files with 46 additions and 20 deletions
+7 -2
View File
@@ -34,8 +34,7 @@ using namespace std;
//-------------------------
EditorScene::EditorScene(ConfigUtility* const arg1):
config(*arg1),
pager(20, 20, 3)
config(*arg1)
{
//create the debugging "window"
debugInfo.CreateSurface(256, 256);
@@ -56,6 +55,11 @@ EditorScene::EditorScene(ConfigUtility* const arg1):
{"Debug", "Debug On", "Debug Off", "Toggle", "Testificate"}
});
//setup the map
pager.SetRegionWidth(config.Int("map.pager.width"));
pager.SetRegionHeight(config.Int("map.pager.height"));
pager.SetRegionDepth(config.Int("map.pager.depth"));
//debug
tsheet.Load("rsc\\graphics\\tilesets\\sand.bmp", 12, 3);
}
@@ -85,6 +89,7 @@ void EditorScene::Render(SDL_Surface* const screen) {
for (int i = 0; i < pager.GetRegionWidth()*2; i++) {
for (int j = 0; j < pager.GetRegionHeight()*2; j++) {
for (int k = 0; k < pager.GetRegionDepth(); k++) {
//TODO: skip the out-of-bounds regions
tsheet.DrawTo(
screen,
i*tsheet.GetTileW()-camera.x,