Commits

Lars Viklund committed eccfc9e

Fix accumulation of source images across pages, generate full-sized pages

  • Participants
  • Parent commits 5e14713

Comments (0)

Files changed (1)

File Katla/src/layout.cc

          I != groups.end();
          ++I)
     {
-        TilemapDesc desc;
         char buf[100] = {};
         int w = I->first.width, h = I->first.height;
         int ch = I->first.channels;
         std::vector<std::string>::const_iterator SI = I->second.begin(), SE;
         for (size_t p = 0; p < dims.size(); ++p)
         {
+            TilemapDesc desc;
             Page const& page = dims[p];
             sprintf(buf, "-%dx%d-%dch-%d", w, h, ch, p+1);
             desc.filename = input.tilemapBasename + buf + ".png";
 {
     int wholeX = maxW / tileW;
     int wholeY = maxH / tileH;
+    Page wholePage = { wholeX, wholeY };
     while (tileCount > wholeX*wholeY)
     {
-        Page page = { wholeX, wholeY };
-        dims.push_back(page);
+        dims.push_back(wholePage);
         tileCount -= wholeX*wholeY;
     }
     if (tileCount == 0)
         return;
 
+    dims.push_back(wholePage);
+    return;
+
     int bestRows = wholeX , bestCols = wholeY;
     int (*next)(int) = (needPoT ? &Double : &Increment);
     for (int cols = 1; cols <= wholeX; cols = next(cols))