Pass pointer to Colors struct around which makes it easier to eg. find transparent colors.

This commit is contained in:
Sascha L. Teichmann
2014-10-19 21:05:38 +02:00
parent 2a48fc3c35
commit c03d382ca6
4 changed files with 13 additions and 13 deletions

View File

@ -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)