|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include "d2waypoints.h"
int isWaypointActivated(D2WaypointsData* d, unsigned int waypoint, unsigned int difficulty) {
if(waypoint > D2S_WAYPOINTSDATA_NUMWAYPOINTS) {
return -1;
}
unsigned int byte = waypoint / 8;
unsigned int offset = waypoint % 8;
return (d->waypoints[difficulty].waypointData[byte] & (1 << offset)) >> offset;
}
// TODO: Return success
void setWaypointActivated(D2WaypointsData* d, unsigned int waypoint, unsigned int difficulty, int activated) {
if(waypoint > D2S_WAYPOINTSDATA_NUMWAYPOINTS) {
return;
}
unsigned int byte = waypoint / 8;
unsigned int offset = waypoint % 8;
d->waypoints[difficulty].waypointData[byte] |= (1 << offset);
}
|