Commit Graph

1490 Commits

Author SHA1 Message Date
Collin Smith
a0c4a773fc Replaced mpqs iterator with array-based iteration
Concurrency issues in immutated array
2021-11-14 22:42:56 -08:00
Collin Smith
bcefe041c3 Additional test cases 2021-11-14 22:41:49 -08:00
Collin Smith
78852e4ea9 DccDecoder optimizations
Refactored 2d pixel buffer array to 1d array
Change made to try and alleviate memory usage issues on mobile
2021-11-14 20:09:44 -08:00
Collin Smith
0bd76baf8f Cleaned up some comments 2021-11-11 00:34:26 -08:00
Collin Smith
f6cd8b4447 Fixed bug where Dcc frame offsets were not read as signed integers 2021-11-10 18:24:28 -08:00
Collin Smith
5187976ccf Updated DccDecoderTest to new Dcc spec
Implemented Dcc release for each refCnt
Updated pixelCodeAndDisplacementBitStream assertion message
2021-11-10 16:46:36 -08:00
Collin Smith
6151379853 Optimized Dcc decoding to eliminate OOM errors
Refactored Cell impls to data-oriented-design approach
Added Dcc#MISSING_TEXTURE to set as the unloaded texture value
Added Dc#direction(int) to obtain the Dc.Direction
Removed old Dcc code which is no longer needed
Added accessor field for PaletteIndexedPixmap Pixmap.Format value
Added RiiabloTest#clearGdxContext() to reset Gdx fields to null
Fixed issues with LWJGL test cases not supporting more than 1 iteration
Enabled additional parameterized test cases for DccDecoderTest
Created test cases for DccLoader in DccLoaderTest using AssetManager
Removed FileHandleResolver field and accessors from AssetLoader
Added Palette decoder and PaletteLoader
Fixed issue where releasing Dcc direction was releasing all directions
Dc now implements ReferenceCounted and increments for each direction read
Removed FileHandleResolver field from AssetLoader (handled by AssetManager)
2021-11-10 15:49:49 -08:00
Collin Smith
bd8e1638d2 Implemented AssetManager#sync(long) replacing AssetManager#update()
Implemented AssetManager#sync(long) replacing AssetManager#update()
Removed load_mpq0 test case
2021-11-08 22:01:05 -08:00
Collin Smith
31960a83a1 Added support for asset dependencies
Added support for asset dependencies
Added EventExecutor AssetManager#deps for dependency loading
Added support for automatic DCC parent dependency
Separated AssetManager io task caller to AssetManager#ioAsync
Moved responsibilities of AssetManager#load to AssetManager#load0
Changed return type of AssetManager#load0 to AssetContainer
Changed visibility of PromiseCombiner to public
Moved PromiseCombiner to com.riiablo.concurrent.PromiseCombiner
Moved old AssetManager test case to load_mpq0
Modified AssetManager test case to work with dependencies
2021-11-07 23:40:50 -08:00
Collin Smith
63360dc7e1 Extracted AssetManager.SyncTuple to com.riiablo.asset.SyncMessage 2021-11-07 01:15:13 -07:00
Collin Smith
428006fde4 Sped up DccDecoderTest animation to improve fluidity 2021-11-07 00:51:41 -07:00
Collin Smith
6ef6c26f7e Implemented basic sync queue for assets which require execution on GL sync thread
Created AssetManager.SyncTuple tuple to cache asset loading state
Renamed Dcc variables in DccLoader to dcc since parent and child dcc are the same
Changed AssetContainer future from a Future to a Promise and renamed it
Asset loading changed to use promises due to loading be a promise that the asset will load at a future time
Created AssetManager#getDepNow temp method to return non-retained reference to asset
Updated AssetManagerTest mpq test case
2021-11-07 00:47:14 -07:00
Collin Smith
feee2f1a9e Added debug flag to control dev logging 2021-11-07 00:34:09 -07:00
Collin Smith
c84db7729a Fixed issue decoding files where dCell doesn't map directly to fCell
Renamed PixelBuffer#cell to PixelBuffer#lastCell
Created PixelBuffer#cell to store fCell mapping
Renamed cell variables to be more consistent for dCell vs fCell
Adjusted test cases to work better, but disabled draw_pixmaps2
2021-11-06 00:38:13 -07:00
Collin Smith
61db57060a Added support for loading Dcc bitmaps off of the GL thread
Added pixmap buffer to Dcc.Direction
Created Dcc#uploadTextures() to generate textures on GL thread and dispose pixmaps
Exposed DccDecoder#decode(Dcc,int) to public
Implemented DccDecoder into DccLoader
2021-11-04 21:59:02 -07:00
Collin Smith
cafc56dad8 Implemented DccDecoder
Created DccDecoder to decode file streams into Dcc instances
Added generic bound to MpqParams#of to <T>
Changed Dc.Direction and Dc.Frame to be static abstract classes
Made Dc.Direction implement Disposable interface to dispose all its frames
Added Dc.Frame#texture() to return the TextureRegion of that frame
Implemented Dcc.DccDirection#texture as an array of textures (not a sprite sheet)
Changed Dcc.DccDirection#pixelValues to short to ease byte to ubyte conversion
Disabled some code in Dcc which expanded box width/heights by 1 (doesn't seem to be required)
Refactored Dcc.DccFrame#box initialization to be more simple
2021-11-03 23:53:24 -07:00
Collin Smith
0a6547b1b6 Fixed buffer futures to return slices with writer index set
Fixed buffer futures to return slices with writer index set
Reorganized DecodingTest cases to make adding additional tests easier
Added additional tests to DecodingTest and validate readable bytes of `actual`
2021-09-25 20:03:58 -07:00
Collin Smith
4ac297dc1d Changed override return type for MpqFileResolver#resolve to MpqFileHandle 2021-09-25 20:02:17 -07:00
Collin Smith
c10083d1ea Cleaned up Dcc impl
Renamed optional* to extra*
Renamed flip to flipY and changed to boolean
Removed additional trace logging in favor of unit testing
2021-09-23 11:49:08 -07:00
Collin Smith
4239f92d18 Fixed releasing data-holding structs for DccLoader 2021-09-23 11:47:10 -07:00
Collin Smith
04b8421f0f Implemented Dcc direction and frames decoding
Implemented Dc and Dcc direction abstractions
Added AssetManager argument to AssetLoader#ioAsync for dependency access
Suppressed unchecked warnings in AssetDescTest test case
2021-09-23 00:23:53 -07:00
Collin Smith
b7ae431a31 Implemented MpqBufferStream#read()
Implemented MpqBufferStream#read()
DccLoader#loadAsync will now process Dcc headers
Reorganized AssetManager io code and integrated rough loadAsync execution
2021-09-22 18:04:07 -07:00
Collin Smith
f3f2d8b356 Implemented MpqBufferStream and started work on Dc decoder
Created MpqBufferStream which uses backing mpq file decoding
Created MpqFileHandle#bufferStream(EventExecutor)
Changed MpqFileResolver resolve failure to log at debug level
Work on new Dc,Dcc,Dc6 codecs for testing AssetManager
Roughed in deallocation for AssetContainer
2021-09-22 17:48:56 -07:00
Collin Smith
f207861e41 Added asset manager tests 2021-09-21 23:36:57 -07:00
Collin Smith
150c28ce80 Added improved AssetManager implementation
Work on new AssetManager using netty and futures
Removed older implementation which are now behind this one
Removed MountPoint abstraction from MpqFileResolver
Moved some static functions from Mpq.HashTable to Mpq
Added support for AssetDesc into MpqFileResolver
Created MpqFileHandle#sectorSize()
Created mockup loaders to sample API usage
2021-09-21 21:13:22 -07:00
Collin Smith
9dabe6daf2 Fixed code formatting 2021-09-20 22:16:37 -07:00
Collin Smith
5e8c3590a1 Refactored mpq_bytebuf to work using netty Future and EventExecutorGroup 2021-09-18 13:34:32 -07:00
Collin Smith
9adfa09ae4 Added MpqFileHandle#stream methods to create InputStreams 2021-09-17 23:03:32 -07:00
Collin Smith
a1bc7d1464 Removed unused BitVector field EMPTY_BIT_VECTOR 2021-09-17 17:00:10 -07:00
Collin Smith
762bcee63f Removed hacked in code to support streaming -- streaming now calls SectorDecodeTask directly 2021-09-17 16:59:28 -07:00
Collin Smith
bebcf90683 Added automated shutdown hook for DecodingService in case not shutdown properly 2021-09-16 19:17:43 -07:00
Collin Smith
31a60c37d8 Refactored local com.riiablo.file onto com.riiablo.mpq_bytebuf
Refer to c.r.m.package-info.java in this commit for more info
2021-09-16 18:03:01 -07:00
Collin Smith
7b7c442525 Revert 7525e288ea 2021-09-16 12:28:15 -07:00
Collin Smith
7525e288ea Allow instantiation of EndOfInput outside of com.riiablo.io 2021-09-16 12:27:07 -07:00
Collin Smith
474ea5b44b Integrated arg name into InstallationFinder searching methods
Integrated arg name into InstallationFinder searching methods
Refactored tools to use InstallationFinder#defaultHomeDir
Added java.lang.Exception to throws clause of Tool#handleCliOptions
Uncaught exceptions thrown by Tool#handleCliOptions will be fatal
2021-09-16 12:25:34 -07:00
Collin Smith
c5c98ce48c Integrated InstallationFinder folder searching directly into InstallationFinder 2021-09-16 11:54:30 -07:00
Collin Smith
69bfbfbf4f Parameterized RiiabloTest dirs
Added D2_TEST environment variable and getTestDirs for InstallationFinder
d2 home and d2 test home set by InstallationFinder for RiiabloTest
2021-09-15 23:07:21 -07:00
Collin Smith
e342870bd9 Extended capabilities of RiiabloTest
Added #testAsset(String) to resolve file from test home
Added #toByteArray(short[]) to simplify ubyte array creation
2021-09-15 14:01:58 -07:00
Collin Smith
0e5fc03f31 Created package-info.java for mpq_bytebuf 2021-08-29 23:46:10 -07:00
Collin Smith
c744ac149b Changed visibility of methods for easier testing 2021-08-29 23:27:48 -07:00
Collin Smith
82917f747c Created ImplUtils containing developmental functions 2021-08-20 17:51:23 -07:00
Collin Smith
a8403abd19 Expose DS1 constants to public visibility 2021-08-08 00:34:18 -07:00
Collin Smith
d067fea4de Implemented clearing array cells for primitive array types 2021-08-08 00:25:33 -07:00
Collin Smith
fa45d5d4b7 Implemented subtile flags merging from tile layers
Implemented subtile flags merging from tile layers
Fixed algebra calculating Chunk#numTiles
Hacked MapGenerator to function with test DS1
2021-08-07 00:29:22 -07:00
Collin Smith
db51859edc Fixed bug where chance initialized as 0 would select null tile 2021-08-06 17:08:07 -07:00
Collin Smith
3bbcd2c086 Changes size of Chunk#flags to subtiles size
Changes size of Chunk#flags to subtiles size
Chunk#reset() now clears Chunk#tiles[][] entries
2021-08-04 14:08:54 -07:00
Collin Smith
466d94b6fb Created Chunk#flags to store aggregated flags of chunk layers 2021-08-04 00:06:58 -07:00
Collin Smith
d3c47b5781 Reorganized code 2021-08-04 00:03:51 -07:00
Collin Smith
c3e10ed506 Restructured code to improve readability 2021-08-03 23:58:49 -07:00
Collin Smith
6f44f10d4f Removed ChunkGrid note 2021-08-03 23:55:29 -07:00