1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-07-22 21:14:18 -04:00
Commit Graph

103 Commits

Author SHA1 Message Date
gravestench
d268a987f3
Merge branch 'master' into data-encoder-dat 2021-02-10 12:05:10 -08:00
gravestench
0c5a3ae54c
Merge branch 'master' into data-encoding2 2021-02-10 11:52:00 -08:00
gucio321
004787597e
Merge branch 'master' into data-encoder-dt1 2021-02-10 19:43:32 +01:00
gucio321
6c230f66d7
d2dat encoder: removed typo in comment 2021-02-10 13:03:59 +01:00
M. Sz
7d0eeb0fd3 hotfix: d2cof encoder: changed way of pushing weapon class 2021-02-10 12:59:07 +01:00
M. Sz
1010353071 hotfix: d2cof encoder: removed magic number (len of weapon class) 2021-02-10 12:35:35 +01:00
M. Sz
8a15c0b074 hotfix: cof encoder: coding weapon class 2021-02-10 08:33:29 +01:00
M. Sz
622e54dfce dc6 refactor: lintfix 2021-02-08 18:50:58 +01:00
M. Sz
6d098de778 d2dc6 refactor + unit test for it 2021-02-08 18:50:58 +01:00
gucio321
b74bc3d0b6
Merge branch 'master' into data-encoder-dat 2021-02-08 18:43:58 +01:00
gucio321
98c38b0dbf
Merge branch 'master' into data-encoder-dt1 2021-02-08 18:40:27 +01:00
Tim Sarbin
a85a7a18c1
Merge branch 'master' into master 2021-02-08 12:37:46 -05:00
M. Sz
a76ce059e8 dat decoder: fixed lints 2021-02-08 10:03:34 +01:00
M. Sz
b6cb6f88a6 data encoder: d2dat 2021-02-08 09:49:43 +01:00
M. Sz
20f0d8a3d5 removed some of nolint:govet 2021-02-06 19:10:15 +01:00
M. Sz
215ac8cfc5 ds1: splited loading function 2021-02-06 18:58:15 +01:00
M. Sz
32570d6ae5 replaced nolint:gomnd directives with "magic numbers'" names 2021-02-06 18:28:01 +01:00
gucio321
ac8794015e Merge branch 'master' into data-encoder-dt1 2021-02-06 17:30:10 +01:00
gravestench
248eaf9d79 Minor refactor of d2cof
* Changed `Load` to `Unmarshal`
* made `Marshal` and `Unmarshal` into methods of `COF`
* added `New` function which creates a new, empty COF instance
* added helper functions `Marshal` and `Unmarshal`
* Changed `StreamReader.ReadBytes` to account for edge case of reading 0
bytes (this was returning an error when it should not have)
* added really simple unit tests for COF
2021-02-05 14:43:42 -08:00
M. Sz
b3a754a4a6 ds1 encoder: Marshal method was splited to avoid nolint directive 2021-02-05 15:05:11 +01:00
M. Sz
9227de3418 d2ds1 encoder: fixed lint errors 2021-02-05 14:54:35 +01:00
M. Sz
5702d96cac ds1 encoder: fixed bug, when decoded and encoded back data wasn't the same = records' encoding methods was rewritten to use streamWriter.Pushbit 2021-02-05 14:45:22 +01:00
M. Sz
3dafb3ebcd dt1 encoder: moved record encoders and decoders to appropriate files 2021-02-05 14:07:51 +01:00
M. Sz
9f56574066 data encoder: ds1 2021-02-05 12:52:51 +01:00
gucio321
1b8da9ec8e
Merge branch 'master' into data-encoding2 2021-02-03 16:28:10 +01:00
Tim Sarbin
ffe4e68108
Merge branch 'master' into data-encoder-dt1 2021-02-03 09:57:46 -05:00
M. Sz
9f9c882653 data encoder: dt1 2021-02-02 19:25:27 +01:00
gucio321
73ca325a6b
Merge branch 'master' into data-converting 2021-02-02 17:01:05 +01:00
gucio321
5aded8de66
Merge branch 'master' into data-encoding2 2021-02-02 17:00:19 +01:00
M. Sz
909a0a9939 lintfix: gomnd 2021-02-02 12:02:11 +01:00
M. Sz
5a0571763e data encoding: tbl 2021-02-02 10:08:32 +01:00
M. Sz
84c87b2eb8 data encoding: DC6 2021-02-01 12:57:02 +01:00
M. Sz
7781b2cd6b removed PushByte method from StreamWriter 2021-02-01 11:20:44 +01:00
M. Sz
0fec9473ed rename: PushBytes(b []byte) -> PushBytes(b ...byte) 2021-02-01 11:15:42 +01:00
M. Sz
0f32ad5d62 data encoder: COF remade Cof encoder to use stream writter 2021-01-31 19:14:18 +01:00
gucio321
c5eb602de0
Update cof.go 2021-01-31 12:11:54 +01:00
gucio321
d0288e309f
removed WIP code 2021-01-30 18:31:44 +01:00
M. Sz
157f110105 data encoding: added COF encoder 2021-01-30 18:23:00 +01:00
gravestench
87d531814d d2datautil.StreamReader refactor
*`StreamReader.Read` methods now return errors

The other edits in this commit are related to cleaning up lint errors
caused by the changes to StreamReader
2021-01-12 10:26:27 -08:00
gravestench
2c0f3d9cd9 d2tbl.LoadTextDictionary now returns an error 2021-01-11 01:12:46 -08:00
Tim Sarbin
c99810ad0e Fixed various bugs, crashes, and slowdowns. 2021-01-10 02:44:42 -05:00
Intyre
db83814527
d2mpq refactored (#1020)
* d2mpq refactor

* d2mpq refactor last standing lint error

* d2mpq refactor: less linter noise

* d2mpq refactor: more linter issues
2021-01-08 12:46:11 -08:00
gravestench
af1f0a0eda
removed string table singleton from d2common/d2fileformats/d2tbl/ (#900) 2020-11-03 11:10:11 -08:00
Gürkan Kaymak
ec9c0c3d95
fixes #767, implemented deepCopy for the dcc_animation and dc6_animation (#852) 2020-10-26 09:13:08 -04:00
gravestench
aa9f6be411
Lint cleanup gocyclo (#847)
* d2player/inventory.go: fixed gocyclo error, broke up render method to smaller methods

* d2client/game_client.go: suppressing gocyclo error for OnPacketReceived, doesnt make sense to split

* d2remoteclient/remote_client_connection.go: suppressing gocyclo error for decodeToPacket, doesnt make sense to split

* d2dcc/dcc_direction.go: suppressing gocyclo error in generateFrames
2020-10-26 02:24:04 -07:00
gravestench
6f8b43f8d6
Various lint error fixes and suppressions (#846)
* suppressing the magic number lint errors in mapgen, it will get a heavy refactor soon, hopefully...

* adding string token constants for SkillClass

* adding panic on error to left/right skill select render

* fixed cuddle lint error

* fixed unnecessary conversion, unused func param lint errors in dcc_animation.go

* adding comment for skill class tokens

* fixed typo in comment

* removed unused parameter in dcc/dc6 animations

* supress warning about Object.setMode always being passed direction value of 0

* fixed all invalid golint directives

* fixed a couple gocritic lint errors
2020-10-26 02:04:50 -07:00
gravestench
025ee94e50
Removed all TODO's in project (#831)
* removed the rest of the magic number errors from d2game

* hotfix for bug i added in map engine test

* removed all TODO's in project, made issues on github for each one
2020-10-25 18:36:12 -04:00
gravestench
783993470e
Lint error cleanup1 (#779)
* fixed lint error in d2app/app.go

* go fmt entire project

* adding doc.go for d2records

* fixed lint issues in d2core/d2map

* fixed lint error in d2interface/palette.go

* fixed lint error in  d2core/d2hero/hero_state_factory.go

* adding dov.go to d2common/d2geom

* fixing lint errors in d2common/d2loader

* adding doc.go to d2common/d2cache

* adding doc files for d2datautils, d2util, d2path

* adding package doc strings for mapgen, in-geam help screen, and tcp client connection

* removed all cuddling lint errors

* changed stamina equality check to '<=' instead of '<'
2020-10-22 01:12:06 -04:00
Brendan Porter
ca45be0948
Adds error handling everywhere (#743)
* adds error handling, returns early from funcs where it makes sense

* fixes build errors

* merge ballresin PR with upstream

* adds error handling, returns early from funcs where it makes sense

* fixes build errors

* merge ballresin PR with upstream

Co-authored-by: dknuth <dknuth0101@gmail.com>
2020-09-23 13:30:54 -04:00
lord
7e3aff557b
Decouple asset manager from renderer (#730)
* improve AssetManager implementation

Notable changes are:
 * removed the individual managers inside of d2asset, only one asset manager
 * AssetManager now has caches for the types of files it loads
 * created a type for TextDictionary (the txt file structs)
 * fixed a file path bug in d2loader Source
 * fixed a asset stream bug in d2loader Asset
 * d2loader.Loader now needs a d2config.Config on creation (for resolving locale files)
 * updated the mpq file in d2asset test data, added test case for "sub-directory"
 * added a Data method to d2asset.Asset. The data is cached on first full read.
 * renamed ArchiveDataStream to DataStream in d2interface
 * moved palette utility func out of d2asset and into d2util
 * bugfix for MacOS mpq loader issue

* lint fixes, added data caching to filesystem asset

* adding comment for mpq asset close

* Decouple d2asset from d2render

Notable changes in d2common:
 * d2dcc.Load now fully decodes the dcc and stores the directions/frames in the dcc struct
 * un-exported dcc.decodeDirection, it is only used in d2dcc
 * removed font interface from d2interface, we only have one font implementation
 * added `Renderer` method to d2interface.Surface, animations use this to bind to a renderer and create surfaces as they need
 * added `BindRenderer` method to animation interface

Notable changes in d2common/d2asset:
 * **d2asset.NewAssetManager only needs to be passed a d2config.Config**, it is decoupled from d2render
 * exported Animation
 * Animation implementation binds to the renderer to create surfaces only on the first time it is rendered
 * font, dcc, dc6 initialization logic moved out of asset_manager.go
 * for dc6 and dcc animations, the process of decoding and creating render surfaces has been broken into different methods
 * the d2asset.Font struct now stores font table data for initialization purposes

Notable changes in d2core/d2render:
 * Surfaces store a renderer reference, this allows animations to bind to the renderer and create a surface just-in-time

**These last changes should have been a separate PR, sorry.**
Notable changes in d2core/d2ui:
 * ui.NewSprite now handles creating an animation internally, only needs image and palette path as arguments

Notable Changes in d2game:
Because of the change in d2ui, all instances of this code pattern...
```golang
animation, err := screen.asset.LoadAnimation(imgPath, palettePath)
sprite, err := screen.ui.NewSprite(animation)
```
... becomes this ...
```golang
sprite, err := screen.ui.NewSprite(imgPath, palettePath)
```
2020-09-14 17:31:45 -04:00