1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-16 20:35:24 +00:00
Commit Graph

857 Commits

Author SHA1 Message Date
Intyre
c66a3d5e7a
Fixed bug in palette.go (#575) 2020-07-10 23:04:35 -04:00
Intyre
aecd047cf3
Replaced restruct with StreamReader (#574) 2020-07-10 23:02:45 -04:00
Intyre
9e58b134e5
Refactored d2enum (#567)
* Refactored animation mode enum

* More d2enum changes

* Refactored tile enum

* Refactored weapon class enum

* Refactored more enums

* Refactored item event enum

* Fixed init_functions animation mode

* Removed string2enum from MonsterAnimationMode

* Refactored ItemStatCost description

* Last enum lint errors

* Regenerated monster stringer file
2020-07-09 23:12:28 -04:00
dk
6030f68632
removing inventory grid test for now because it causes builds to fail on github (#570) 2020-07-09 19:58:55 -04:00
danhale-git
6104adc700
D2map lint warnings (#566)
* Comments and newlines in engine.go

* Comments and newlines in object.go

* Comments and newlines in animated_entity.go

* Comments and newlines in missile.go

* Comments and newlines in npc.go

* Comments and newlines in player.go

* Removed object.go (incorrectly merged it in during rebase).

* Comments and newlines in renderer.go.

* Comments and newlines in map_entity.go.

* Comments and newlines in walk_mesh.go.

* Comments and newlines in viewport.go and tile_cache.go.

* Comments and newlines in stamp.go and wilderness_tile_types.go.

* Comments and newlines in everything else.
2020-07-09 16:11:01 -04:00
danhale-git
029cb62972
Vector float64 (#565)
* Fixed nil pointer in Copy()

* Position added

Added Floor() and String() methods to Vector.

Also added Position which declares an embedded Vector2 and returns various forms of it.

* d2vector.Vector2 renamed to d2vector.BigFloat

* vector.go renamed to big_float.go

* Float64 stub and more renaming

* Vector value getters

* Separate vector types with initial methods.

* Divide and lint warnings.

* Distance and Length.

* Scale, Abs and Negate.

* CompareFloat64Fuzzy delta direction reversed.

* Refactor vector_test.go.

* Renamed Approx methods.

* Distance and Length.

* Distance and Length.

* Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests.

* Angle, SignedAngle and other small functions.

* Receiver rename.

* SingedAngle and test fixed

* Rotate.

* SetLength.

* Cross.

* NinetyAnti and NinetyClock.

* Lerp and Clamp.

* Reflect and ReflectSurface.

* Cardinal convenience functions.

* Comments.

* Panic on NaN and Inf in Position.

* Lint warnings and comments.
2020-07-09 08:30:55 -04:00
Ziemas
e2e8a303c2
Use our own DrawEffects enum for draw effects (#564)
* Add PushEffect, handle effects in renderer

* Set effects instead of blend

* Stop using PushCompositeMode, use PushEffect

* Remove remaining composite mode things
2020-07-08 21:57:35 -04:00
Intyre
a10a53be26
Renamed EquippedSlot enum (#563) 2020-07-08 19:08:07 -04:00
Ziemas
1ad3c72211
Standardize indexed color to RGBA conversion to one function (#562)
* Common function for indexed color to rgba

* Use ImgIndexToRGBA when decoding tiles

* Pass DrawEffect down to animation
2020-07-08 17:46:45 -04:00
Maxime Lavigne (malavv)
f18ede6e66
Removing Clone of Font() since all material is sharable, Fixes #515 (#561)
* Removing Clone of Font() since all material is sharable, Fixes #515

* Removed Clone() from the Font interface, as deep copies are not needed.
2020-07-08 11:25:40 -04:00
Gürkan Kaymak
d1f499fb79
lint fixes for the d2common package (#558) 2020-07-08 09:16:56 -04:00
Intyre
db5e844aac
Removed Configuration interface (#560) 2020-07-08 09:16:16 -04:00
Maxime Lavigne (malavv)
f7e0912f5f
Fixing D2GUI based event propagation with d2input. #531 (#559)
d2input made the move to immutable events. (ex. MouseMove) but
d2gui was using "local events" for its recursive layouts. Meaning
when entering a sub-layout, the original event was modified to have
the cursor relative to the x, and y of the parent layout.

After tossing ideas with Grav, we considered (1) making events modifiable,
(2) having an event constructor, (3) changing sub-Layout to use screen layout.

We choose (3), and this is the relevant commit.
2020-07-08 09:15:20 -04:00
Ziemas
38213e749a
Some slight DC6 cleanup (#557) 2020-07-08 09:14:09 -04:00
Maxime Lavigne (malavv)
0a78a1adcc
Centralized usage of Fonts to fix cache #515 (#556)
The split between d2ui and d2asset Font version caused incorrect caching between the two. After looking at d2interface.Font, I saw the d2asset was the most recent and more tightly and cleanly packaged.

I therefore removed the old d2ui.Font and embedded the d2asset version in the d2ui.Label and d2ui.Button.

Looking at the code of d2ui, it would be logical to completly swap it for their d2gui version. But at least for the moment, the d2ui.Button as more functionality since it embeds a Label (instead of a font), and this label now has multiline horizontal alignement.
2020-07-07 20:16:22 -04:00
Ziemas
252e6c6c23
Clean up monstats2 (#555) 2020-07-07 15:04:18 -04:00
Gürkan Kaymak
76862b756c
cleaned globals of the d2render/ebiten package (#554) 2020-07-07 08:57:40 -04:00
Intyre
04c7ff543a
d2datadict reading changes (#553)
* Read excel files with csv.Reader

* Read LvlWarp from txt file

* Fix lint issues in d2datadict

* changed ID back to Id
2020-07-07 08:56:31 -04:00
Ziemas
af0fb11a54
Apply NPC speed from monsats (#551) 2020-07-06 21:32:39 -04:00
dk
60e6fcb7ac
moving enumerations out of d2interface (#552)
* moved filter constants back to d2enum

* moving key and mouse button enums into d2enum

* moving render type enum into d2enum

* moving input even priority enums into d2enum

* moving terminal enums into d2enum
2020-07-06 21:26:08 -04:00
Gürkan Kaymak
473a0b3b19
Remaining lint fixes for the d2gamescreen package (#550)
* lint fixes for the game.go

* lint fixes for the gui_testing.go

* lint fixes for the blizzard_intro.go, map_engine_testing.go and select_hero_class.go

* added package comment for the d2gamescreen package

* fixes after merge
2020-07-06 20:13:55 -04:00
Ziemas
5212270c44
Split up DCC/DC6 animation implementations, decode directions on demand (#548)
* Split DCC and decode direction on demand

* Clean up

* More cleanup

* Make dc6 animation it's own type

* Make base animation private

* Also decode DC6 directions on demand
2020-07-06 20:13:06 -04:00
Ziemas
e473dc2cc5
Apply some more object animation settings (#549)
* Init torches with random start mode

* Apply more object animation settings

Also add ability to start object animation on random frame
2020-07-06 20:12:53 -04:00
dk
321a353461
Font manager abstraction (#545)
* abstracted palettes, colors, and palette manager

* make asset manager use the palette manager interface

* added BGRA setter/getter, fixed lint errors

* abstraction for animation and animation manager

* abstracted font and font manager
2020-07-05 15:56:48 -04:00
dk
c1a88c9cf7
Animation manager abstraction (#544)
* abstracted palettes, colors, and palette manager

* make asset manager use the palette manager interface

* added BGRA setter/getter, fixed lint errors

* abstraction for animation and animation manager
2020-07-05 13:01:44 -04:00
dk
8809fb2c22
Made abstractiong for the file manager (#542)
I realized that the file manager is actually managing file access
to the archives, but it's doing so through the archive manager.

I've renamed it, it's now called ArchivedFileManager because that
is really what it is.
2020-07-05 00:00:00 -04:00
dk
0a72ccaf16
Abstraction for archives and archive manager (#541)
* archive abstraction

* archive manager abstraction

* fixinglint errors

* archive abstraction

* archive manager abstraction

* fixinglint errors
2020-07-04 22:37:13 -04:00
danhale-git
07d90e9681
Position struct for managing world coordinates (#540)
* Fixed nil pointer in Copy()

* Position added

Added Floor() and String() methods to Vector.

Also added Position which declares an embedded Vector2 and returns various forms of it.

* Position tests improved
2020-07-04 19:25:53 -04:00
danhale-git
853ad7ae64
Cardinal vectors (#539)
* Comments and newlines in vector.go

* Added cardinal direction functions.

* Moved vector.go into d2vector.
2020-07-04 08:02:47 -04:00
dk
cf35285b48
abstracted d2config to an interface (still have a singleton, though) (#538) 2020-07-04 00:49:16 -04:00
Ziemas
3757ff1ac5
New package d2object, first object initFun (#537)
* Move MapEntity to d2interface

* New package d2object, first object initFun

Moves objects out to their own package and implements the very first
init function, torches/braziers now gets their animation mode set at creation.

* Apply name again

* Turn on waypoints
2020-07-04 00:48:31 -04:00
Ziemas
6269726316
Composite work (#536)
* Quit using ObjectLookupRecord in composite

* Unexport SetMode in map entities

* Get rid of weaponClass from MapEntity

* Pass ObjectType to composite instead of string

* Use layer weaponclass from cof

* Manage more stuff directly in composite

* Explicitly index when picking equipment
2020-07-03 22:52:50 -04:00
dk
4c3ff12cba
abstracted cache to an interface (#535) 2020-07-03 21:23:44 -04:00
dk
de116e8367
moving package comments into doc.go files (#534) 2020-07-03 18:33:46 -04:00
dk
18003a8543
fixed lint errors in d2astar (#533)
* fixed lint errors in d2astar

* Update astar.go
2020-07-03 18:33:14 -04:00
dk
62b8a610c0
D2input abstraction (#532)
* abstract d2input manager/service/events/keys/buttons to interface

* abstract d2input manager/service/events/keys/buttons to interface

* fixing lint error
2020-07-03 15:09:16 -04:00
Tim Sarbin
5bfec3ccb0 Removed render singleton. Updated refs. 2020-07-03 14:00:56 -04:00
Ziemas
7ce01ab694
Create objects by passing the object record to CreateObject (#530)
* Create object by Objects.txt entry

Get graphics token from objectType

* Unexport some unused ObjectRecord stuff.
2020-07-03 10:38:22 -04:00
dk
ec0bddc01e
bugfix for issue #528 (#529) 2020-07-03 03:03:44 -04:00
dk
48bde64a7e
vector implementation with big.Float (#527) 2020-07-03 02:26:59 -04:00
Ziemas
e21e39e227
Fix d2datadict.Objects index (#525) 2020-07-02 21:55:10 -04:00
Intyre
5b9a0fe5bc
Fixes #523, unbind the escapeMenu when game is unloaded (#524) 2020-07-02 20:03:15 -04:00
danhale-git
6367929688
Tidy remote_client_connection.go and resolve lint warnings (#522)
* Added automap.go stub

* Fixed bad error handling

* Handle header error from io.Copy()

* d2client.ClientConnection renamed to ServerConnection

Having two interfaces named ClientConnection in adjacent packages was a point of confusion for me. Renamed the client ClientConnection to ServerConnection since clients connect to servers and servers to clients.

* Fix lint warnings in remote_client_connection.go

* Tidying and lint warnings in remote_client_connection.go

* Switch statement in remote_client_connection.go now has matching blocks.

* RemoteClientConnection.serverListener refactor.

The switch statement is still repetitive but now it's separate. I think we would need generics to make it smaller.

* Receiver name change from l to r.

* Comments and other adjustments.

* Old commits

* Fixed bad error handling

* Cleaned up remote_client_connection.go

* SendPacketToClient removed.
2020-07-02 16:29:28 -04:00
Gürkan Kaymak
9c2b1dccaf
Lint fixes for the d2game/d2gamescreen (#516)
* more lint fixes for the d2core/d2term

* lint fixes for the escape_menu.go

* fixed lint issues of credits screen

* more lint fixes for the d2gamescreen

* lint fixes for the main menu of d2game/d2gamescreen package

* lint fixes for the main menu and map engine testing of d2game/d2gamescreen package

* more lint fixes for the main menu of d2game/d2gamescreen package

* lint fixes for the character select screen of d2game/d2gamescreen package
2020-07-02 13:55:43 -04:00
Intyre
8e2c7d1f38
Check and start profiler first (#520) 2020-07-01 19:24:09 -04:00
David Carrell
c8ec4c018e
first pass at resolving linting issues in d2asset (#518) 2020-07-01 14:09:18 -04:00
Maxime Lavigne (malavv)
973e969002
Working on d2input.go for #487 (#514)
d2input/ is now clear of lint.
2020-07-01 14:03:40 -04:00
Ziemas
0272b593fb
Cof direction lookup (#517)
Generated these based on the d2dcc direction lookup hopefully they're
correct (they seem to be at least)
2020-07-01 14:02:47 -04:00
Natureknight
04ed9466f4
fixed linting issues in d2screen and d2render (#487) (#512) 2020-07-01 08:59:24 -04:00
thetogi
5b26624cb8
lint updates for /d2astar (#507) 2020-07-01 00:13:25 -04:00