use hashMapPalette in config.create()

This commit is contained in:
Tnze
2022-05-21 12:06:00 +08:00
parent 30eadedda2
commit 2b92ad6b4c

View File

@ -188,8 +188,11 @@ func (s statesCfg) create(bits int) palette[BlocksState] {
case 1, 2, 3, 4: case 1, 2, 3, 4:
return &linearPalette[BlocksState]{bits: 4, values: make([]BlocksState, 0, 1<<4)} return &linearPalette[BlocksState]{bits: 4, values: make([]BlocksState, 0, 1<<4)}
case 5, 6, 7, 8: case 5, 6, 7, 8:
// TODO: HashMapPalette return &hashPalette[BlocksState]{
return &linearPalette[BlocksState]{bits: bits, values: make([]BlocksState, 0, 1<<bits)} bits: bits,
ids: make(map[BlocksState]int),
values: make([]BlocksState, 0, 1<<bits),
}
default: default:
return &globalPalette[BlocksState]{} return &globalPalette[BlocksState]{}
} }