карты. рисуем от руки или раскладываем в колоды
Post on 07-Aug-2015
348 Views
Preview:
TRANSCRIPT
О чем расскажу?
-Откуда берутся карты
-Карта это очень много картинок
-Как же все это хранить, разворачивать, и отдавать
-Правильно храним дерево файлов в ФС
-Инструменты и наши решения
http://trac.openstreetmap.org/browser/applications/utils/mod_tile/dir_utils.c
// We attempt to cluster the tiles so that a 16x16 square of tiles will be in a single directory// Hash stores our 40 bit result of mixing the 20 bits of the x & y co-ordinates// 4 bits of x & y are used per byte of output
unsigned char i, hash[5];for (i=0; i<5; i++) { hash[i] = ((x & 0x0f) << 4) | (y & 0x0f); x >>= 4; y >>= 4;}
/hash[4]/hash[3]/hash[2]/hash[1]/hash[0].png
top related