Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Encode Method #15

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Use a separate increment a separate index when write colors
  • Loading branch information
sigismondm committed Aug 15, 2015
commit 4f05bddbd57e74f8ca7247e3bc9193b514371558
7 changes: 6 additions & 1 deletion ase.go
Original file line number Diff line number Diff line change
@@ -144,6 +144,10 @@ func Encode(ase ASE, w io.Writer) (err error) {
//Group index
k := 0

//Color index
l := 0


// itereate based on our block count
for i := 0; i < int(ase.numBlocks); i++ {

@@ -158,7 +162,8 @@ func Encode(ase ASE, w io.Writer) (err error) {
c := Color{}

if g.Name == "" {
c = ase.Colors[i]
c = ase.Colors[l]
l++
} else {
c = g.Colors[j]
j++