The prototype of chunk loading system, multi-thread needs additional attention

This commit is contained in:
Tnze
2022-06-18 18:11:00 +08:00
parent 7c80f1e7c0
commit e405acaa02
4 changed files with 34 additions and 94 deletions

View File

@ -28,6 +28,12 @@ func In(cx, cz int) (int, int) {
return cx & 31, cz & 31
}
// At calculate the region's coordinates where the chunk in
// 计算chunk在哪一个region中
func At(cx, cz int) (int, int) {
return cx >> 5, cz >> 5
}
// Open a .mca file and read the head.
// Close the Region after used.
func Open(name string) (r *Region, err error) {