RMTile.h
907 Bytes
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
41
42
43
44
45
46
47
/*
* Tile.h
* Images
*
* Created by Joseph Gentle on 29/08/08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#ifndef _TILE_H_
#define _TILE_H_
#include <CoreGraphics/CGGeometry.h>
#include <stdint.h>
typedef struct{
uint32_t x, y;
short zoom;
} RMTile;
typedef struct{
RMTile tile;
CGPoint offset;
} RMTilePoint;
typedef struct{
RMTilePoint origin;
CGSize size;
} RMTileRect;
char RMTilesEqual(RMTile one, RMTile two);
char RMTileIsDummy(RMTile tile);
RMTile RMTileDummy();
// Return a hash of the tile
uint64_t RMTileHash(RMTile tile);
// Round the rectangle to whole numbers of tiles
RMTileRect RMTileRectRound(RMTileRect rect);
/*
// Calculate and return the intersection of two rectangles
TileRect TileRectIntersection(TileRect one, TileRect two);
// Calculate and return the union of two rectangles
TileRect TileRectUnion(TileRect one, TileRect two);
*/
#endif