title: 2D tile based game, shows gaps between the tile sprites when I zoom in with the camera?
body: <p>I am using the D3DXSPRITE method to draw my map tiles to the screen, i just added a zoom function which zooms in when you hold the up arrow, but noticed you can now see gaps between the tiles, here's some screen shots</p>
  
  <p>normal size (32x32) per tile</p>
  
  <p><img src="https://i.stack.imgur.com/ncWrn.png" alt="enter image description here"></p>
  
  <p>zoomed in (you can see white gaps between the tiles)</p>
  
  <p><img src="https://i.stack.imgur.com/yx1nY.png" alt="enter image description here"></p>
  
  <p>zoomed out (even worst!)</p>
  
  <p><img src="https://i.stack.imgur.com/kpeiB.png" alt="enter image description here"></p>
  
  <p>Here's the code snipplet which I translate and scale the world with.</p>
  
  <pre><code>D3DXMATRIX matScale, matPos;
  
  D3DXMatrixScaling(&amp;matScale, zoom_, zoom_, 0.0f);
  D3DXMatrixTranslation(&amp;matPos, xpos_, ypos_, 0.0f);
  
  device_-&gt;SetTransform(D3DTS_WORLD, &amp;(matPos * matScale));
  </code></pre>
  
  <p>And this is my drawing of the map, (tiles are in a vector of a vector of tiles.. and I haven't done culling yet)</p>
  
  <pre><code>LayerInfo *p_linfo = NULL;
    RECT rect = {0};
    D3DXVECTOR3 pos;
    pos.x = 0.0f;
    pos.y = 0.0f;
    pos.z = 0.0f;
  
    for (short y = 0; 
      y &lt; BottomTile(); ++y)
    {
      for (short x = 0; 
            x &lt; RightTile(); ++x)
      {
        for (int i = 0; i &lt; TILE_LAYER_COUNT; ++i)
        {
          p_linfo = tile_grid_[y][x].Layer(i);
  
          if (p_linfo-&gt;Visible())
          {
            p_linfo-&gt;GetTextureRect(&amp;rect);
  
            sprite_batch-&gt;Draw(
              p_engine_-&gt;GetTexture(p_linfo-&gt;texture_id), 
              &amp;rect, NULL, &amp;pos, 0xFFFFFFFF);
          }
        }
        pos.x += p_engine_-&gt;TileWidth();
      }
      pos.x = 0;
      pos.y += p_engine_-&gt;TileHeight();
    }
  </code></pre>