1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2025-02-04 15:46:51 -05:00

fixed a couple lint errors in d2term (#697)

This commit is contained in:
lord 2020-08-05 19:32:23 -07:00 committed by GitHub
parent ca7412aea6
commit c1ed5a2381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@ package d2term
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2math"
"image/color" "image/color"
"log" "log"
"math" "math"
@ -14,15 +13,17 @@ import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2math"
) )
const ( const (
termCharWidth = 6 termCharWidth = 6
termCharHeight = 16 termCharHeight = 16
termRowCount = 24 termCharDoubleWidth = termCharWidth * 2
termRowCountMax = 32 termRowCount = 24
termColCountMax = 128 termRowCountMax = 32
termAnimLength = 0.5 termColCountMax = 128
termAnimLength = 0.5
) )
const ( const (
@ -231,9 +232,9 @@ func (t *terminal) Render(surface d2interface.Surface) error {
historyEntry := t.outputHistory[historyIndex] historyEntry := t.outputHistory[historyIndex]
surface.PushTranslation(termCharWidth*2, outputHeight-(i+1)*termCharHeight) surface.PushTranslation(termCharDoubleWidth, outputHeight-(i+1)*termCharHeight)
surface.DrawTextf(historyEntry.text) surface.DrawTextf(historyEntry.text)
surface.PushTranslation(-termCharWidth*2, 0) surface.PushTranslation(-termCharDoubleWidth, 0)
switch historyEntry.category { switch historyEntry.category {
case d2enum.TermCategoryInfo: case d2enum.TermCategoryInfo: