mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-03 08:30:45 +02:00
Pass pointer to Colors struct around which makes it easier to eg. find transparent colors.
This commit is contained in:
@ -63,7 +63,7 @@ type posBuf struct {
|
||||
Pos int
|
||||
}
|
||||
|
||||
func NewDecodedBlock(data []byte, nameIndex map[string]int32) (db *DecodedBlock, err error) {
|
||||
func NewDecodedBlock(data []byte, colors *Colors) (db *DecodedBlock, err error) {
|
||||
version := data[0]
|
||||
|
||||
contentWidth := int(data[2])
|
||||
@ -155,7 +155,7 @@ func NewDecodedBlock(data []byte, nameIndex map[string]int32) (db *DecodedBlock,
|
||||
case "ignore":
|
||||
ignoreId = nodeId
|
||||
default:
|
||||
if index, found := nameIndex[name]; found {
|
||||
if index, found := colors.NameIndex[name]; found {
|
||||
indexMap[nodeId] = index
|
||||
} else {
|
||||
log.Printf("Missing color entry for %s.", name)
|
||||
|
Reference in New Issue
Block a user