Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. // vars
  2. int sheetMap[100][100];
  3. Surface* tileSheet;
  4.  
  5. // functions
  6. (inside map::initialise)
  7. void Map::Initialise()
  8. {
  9.     for (int Rows = 0; Rows < 25; Rows++)
  10.     {
  11.         for (int Cols = 0; Cols < 43; Cols++)
  12.         {
  13.             sheetMap[Rows][Cols] = GrabTile(Rows, Cols);
  14.             Counter++;
  15.         }
  16.     }
  17. }
  18.  
  19. int Map::GrabTile(int Rows, int Cols)
  20. {
  21.     Tile* T = new Tile();
  22.     tileSheet->KeyCopyTo(T->TGraphic, -((Cols * 32) + (Cols * 4)), -((Rows * 32) + (Rows * 4)));
  23.     Tiles.push_back(T);
  24.     T = NULL; delete T;
  25.     return Counter;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement