… | |
… | |
887 | |
887 | |
888 | /* Nothing changed */ |
888 | /* Nothing changed */ |
889 | return 0; |
889 | return 0; |
890 | } |
890 | } |
891 | |
891 | |
892 | //-GPL |
|
|
893 | |
|
|
894 | // prefetch some flat area around the player |
|
|
895 | static void |
|
|
896 | prefetch_surrounding_area (object *op, maptile *map, int range) |
|
|
897 | { |
|
|
898 | for (maprect *rect = map->split_to_tiles (mapwalk_buf, |
|
|
899 | op->x - range , op->y - range , |
|
|
900 | op->x + range + 1, op->y + range + 1); |
|
|
901 | rect->m; |
|
|
902 | ++rect) |
|
|
903 | { |
|
|
904 | rect->m->touch (); |
|
|
905 | rect->m->activate (); |
|
|
906 | } |
|
|
907 | } |
|
|
908 | |
|
|
909 | // prefetch a generous area around the player, also up and down |
|
|
910 | void |
|
|
911 | object::prefetch_surrounding_maps () |
|
|
912 | { |
|
|
913 | prefetch_surrounding_area (this, map, 40); |
|
|
914 | |
|
|
915 | if (maptile *m = map->tile_available (TILE_DOWN)) |
|
|
916 | prefetch_surrounding_area (this, m, 20); |
|
|
917 | |
|
|
918 | if (maptile *m = map->tile_available (TILE_UP)) |
|
|
919 | prefetch_surrounding_area (this, m, 20); |
|
|
920 | } |
|
|
921 | |
|
|
922 | //+GPL |
|
|
923 | |
|
|
924 | /** |
892 | /** |
925 | * Draws client map. |
893 | * Draws client map. |
926 | */ |
894 | */ |
927 | void |
895 | void |
928 | draw_client_map (player *pl) |
896 | draw_client_map (player *pl) |