I know there is probably something simple causing this not to work right, but for some reason my map engine draws all the maps 90 degrees counterclockwise! I don't feel like turning my head evertime I change the map around! I adjusted for temporary purposes, the height and width of the map, so it's not that, I rotated the array 90 degrees on purpose. Here is some source. (I am using Allegro)
Code:
  short int cell[26][26]=
  {
   {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   };
Code:
void draw_map()
// Map drawing
{
 int right=0;      // Position in the X axis in the map file
 int down=0;       // Position in the Y axis in the map file
 int drawpointx=0; // Position in the X axis on the screen
 int drawpointy=0; // Position in the Y axis on the screen
 while (right!=25 && down!=18)
   // print cells to the back buffer until you reach the end of the file
   {
   blit(CURRENT_TILE,buffer,0,0,drawpointx,drawpointy,Tiles[0]->w,Tiles[0]->h);
   drawpointx+=TILE_SIZE; // Move drawing point forward
   right++; // Go to the next tile
   if (right==25) // If you get to the end of a row, go down a column
   {
   right=0; // Reset the X position
   drawpointy+=TILE_SIZE; // Move drawing point down a tile
   drawpointx=0; // Reset the X screen position
   down++; // Go down one column
   }
   }
}