BMAPSZTOLEV
bmp->db_maxlevel = BMAPSZTOLEV(bmp->db_mapsize);
bmp->db_aglevel = BMAPSZTOLEV(bmp->db_agsize);