Skip to content

Commit b4491b1

Browse files
committed
header -> .cpp
1 parent 643f7a4 commit b4491b1

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/TileStorage.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@
2525
#include <math.h>
2626
#include <sstream>
2727
#include <stdlib.h>
28+
29+
inline uint64_t tilechecksum(uint8_t* data)
30+
{
31+
uint64_t r = 0;
32+
for (int x = 0; x < 32 * 32 * 4; x++) {
33+
r += data[x] * 63018038201L * x * x;
34+
r ^= 13091204281L;
35+
r *= 13091204281L * x;
36+
r *= 108086391056891903ULL * data[x];
37+
}
38+
Crc32 c;
39+
c.AddData(data, 32 * 32 * 4);
40+
r *= c.GetCrc32();
41+
return r;
42+
}
43+
2844
inline float tilediff(uint8_t* t1, uint8_t* t2)
2945
{
3046
float diff = 0.0;

src/TileStorage.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,7 @@
2424
#include <stdint.h>
2525
#include <stdio.h>
2626
#include <vector>
27-
inline uint64_t tilechecksum(uint8_t* data)
28-
{
29-
uint64_t r = 0;
30-
for (int x = 0; x < 32 * 32 * 4; x++) {
31-
r += data[x] * 63018038201L * x * x;
32-
r ^= 13091204281L;
33-
r *= 13091204281L * x;
34-
r *= 108086391056891903ULL * data[x];
35-
}
36-
Crc32 c;
37-
c.AddData(data, 32 * 32 * 4);
38-
r *= c.GetCrc32();
39-
return r;
40-
}
27+
4128
class InvalidTileIndexException
4229
{
4330
};

0 commit comments

Comments
 (0)