-
Notifications
You must be signed in to change notification settings - Fork 11
/
tilemap.h
40 lines (30 loc) · 889 Bytes
/
tilemap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
#include "marduinotypes.h"
#ifndef TILEMAP_H
#define TILEMAP_H
class TileMap {
private:
TILEMAPSET * _tileMapID;
unsigned int _tileWidth;
unsigned int _tileHeight;
unsigned int _tileMapWidth;
unsigned int _tileMapHeight;
Adafruit_PCD8544 * _display; //pointer to display
public:
TileMap();
void getTileIndexByPos(int, int, int *);
void getPosByTileIndex(int, int, int *);
unsigned int getMapWidth();
unsigned int getMapHeight();
unsigned int getTileWidth();
unsigned int getTileHeight();
void setDisplayPointer(Adafruit_PCD8544 *); //using Adafruit display
void setMapSize(unsigned int, unsigned int);
void setTileSize(unsigned int, unsigned int);
void setTileMap(TILEMAPSET *);
void drawTile(const unsigned int, int, int);
void drawMap(int, int);
};
#endif