Skip to content

Commit

Permalink
Fixed linting issues (OpenDiablo2#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
essial authored Jun 24, 2020
1 parent 46ccce5 commit 954670d
Show file tree
Hide file tree
Showing 19 changed files with 399 additions and 296 deletions.
234 changes: 132 additions & 102 deletions d2common/d2data/d2compression/huffman.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions d2common/d2data/d2datadict/object_lookup.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package d2datadict

//nolint // This is a data dump file.
var objectLookups = []ObjectLookupRecord{
{Act: 1, Type: ObjectTypeCharacter, Id: 0, Description: "gheed-ACT 1 TABLE", ObjectsTxtId: -1, MonstatsTxtId: -1, Direction: -1, Base: "/Data/Global/Monsters", Token: "GH", Mode: "NU", Class: "HTH", TR: "LIT", Index: -1},
{Act: 1, Type: ObjectTypeCharacter, Id: 1, Description: "cain1-ACT 1 TABLE", ObjectsTxtId: -1, MonstatsTxtId: -1, Direction: -1, Base: "/Data/Global/Monsters", Token: "DC", Mode: "NU", Class: "HTH", TR: "LIT", Index: -1},
Expand Down
4 changes: 2 additions & 2 deletions d2common/d2fileformats/d2dcc/dcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type DCC struct {
Version int
NumberOfDirections int
FramesPerDirection int
Directions []DCCDirection
Directions []*DCCDirection
}

func LoadDCC(fileData []byte) (*DCC, error) {
Expand All @@ -32,7 +32,7 @@ func LoadDCC(fileData []byte) (*DCC, error) {
for i := 0; i < result.NumberOfDirections; i++ {
directionOffsets[i] = int(bm.GetInt32())
}
result.Directions = make([]DCCDirection, result.NumberOfDirections)
result.Directions = make([]*DCCDirection, result.NumberOfDirections)
for i := 0; i < result.NumberOfDirections; i++ {
result.Directions[i] = CreateDCCDirection(d2common.CreateBitMuncher(fileData, directionOffsets[i]*8), *result)
}
Expand Down
4 changes: 2 additions & 2 deletions d2common/d2fileformats/d2dcc/dcc_direction.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type DCCDirection struct {
PixelBuffer []DCCPixelBufferEntry
}

func CreateDCCDirection(bm *d2common.BitMuncher, file DCC) DCCDirection {
result := DCCDirection{}
func CreateDCCDirection(bm *d2common.BitMuncher, file DCC) *DCCDirection {
result := &DCCDirection{}
result.OutSizeCoded = int(bm.GetUInt32())
result.CompressionFlags = int(bm.GetBits(2))
result.Variable0Bits = int(crazyBitTable[bm.GetBits(4)])
Expand Down
4 changes: 2 additions & 2 deletions d2common/d2fileformats/d2dcc/dcc_direction_frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type DCCDirectionFrame struct {
valid bool
}

func CreateDCCDirectionFrame(bits *d2common.BitMuncher, direction DCCDirection) *DCCDirectionFrame {
func CreateDCCDirectionFrame(bits *d2common.BitMuncher, direction *DCCDirection) *DCCDirectionFrame {
result := &DCCDirectionFrame{}
bits.GetBits(direction.Variable0Bits) // Variable0
result.Width = int(bits.GetBits(direction.WidthBits))
Expand All @@ -46,7 +46,7 @@ func CreateDCCDirectionFrame(bits *d2common.BitMuncher, direction DCCDirection)
return result
}

func (v *DCCDirectionFrame) CalculateCells(direction DCCDirection) {
func (v *DCCDirectionFrame) CalculateCells(direction *DCCDirection) {
var w = 4 - ((v.Box.Left - direction.Box.Left) % 4) // Width of the first column (in pixels)
if (v.Width - w) <= 1 {
v.HorizontalCellCount = 1
Expand Down
7 changes: 0 additions & 7 deletions d2common/d2fileformats/d2ds1/common_data.go

This file was deleted.

Loading

0 comments on commit 954670d

Please sign in to comment.