* Bootstrap MxSmack
* Add comment about incorrect structure
* Fix naming
* Fix name
* Add a comment about SDK
* Add names from Smacker SDK
* Use SMACK.LIB and interface
* Use RAD.H defined types
* Use different commets
* Fix member offset
* Update mxsmack.cpp
* Implement/match more of MxCompositePresenter
* Use parameter to `DeleteAll` instead of separate function
* StartAction match
* Implement/match rest of MxCompositePresenter
* Move annotation
* Add parameter name
* Merge
* Remove junk
* Move annotation
* Fixes
* Open discussion
* Move annotations of header-implemented functions back to `.h` files
* Adjust `README.md`
* Relocate annotation
* linter
* Comment markers in headers only, rename script, update github actions
* type hint compat
* Rename github action, better argparse for linter
* Type hints, working test for byname ignore
* Move annotation
* CI rename and enable warnfail, enforce mode always on
* Two step linting
* or one step
* continue on error
* two jobs instead
* Fixes
---------
Co-authored-by: disinvite <disinvite@users.noreply.github.com>
* LegoWorldList
* Refactor list cursors
* Add decomp markers for list cursors
* Fix decomp markers
* MxRegionListCursor edit to prevent accuracy drop
* Better fix for MxRegionListCursor
* Bootstrap decomp of D3DRM rendering code
* This PR kicks off work on decompiling the D3D Retained Mode (D3DRM)
rendering part of the codebase.
* High level overview:
* There is a base IMxDirect3DRMObject class which all of the D3DRM
rendering objects inherit from. Its only virtual method is one to get
the underlying object handle.
* A hierarchy of abstract classes inherits from this base class, which
I've called "IMxDirect3DRM<class>". These classes only have pure
virtual methods on them and don't contain any data.
* Each one of the abstract classes has exactly one concrete
implementation, which I've called "MxDirect3DRM<class>". These classes
have exactly one piece of data, which is a pointer to the underlying
D3D Retained Mode object.
* If the classes need to store additional data, they store it in a
userdata blob which is attached to the D3DRM object rather than the
additional data being stored in the class itself.
* I've worked out about twice this many classes related to D3DRM
rendering so far but the PR was getting large enough as is, so I'm
cutting it here for now.
* I decomped sufficiently many methods of these classe to convince
myself that the above observations are correct. About 60% of the
decomped methods here are perfect matches, including at least one
non-trivial method per class.
* Formatting
* Restructure changes using Tgl naming / details
* Restructure the changes to use the naming that we know from Tgl.
* Fill in some parts of the implementation I couldn't initially figure
out using the details from Tgl (got more 100% matches).
* Move d3drm link requirement
* Fixups FloatMatrix -> FloatMatrix4
* Fix order
* Full fix for ordering problems
* Put back accidentally removed include.
* Fix call which should have been Release
* Use new and delete for DeepClone
* Missing Tgl:: on CreateRenderer
* Revert change to bool return value.
* Rename Something -> Unk
* Return paramter naming convention to what Tgl used
* Add scalar ddtor to verify inline destructor
* Fix order
* Change malloc/free -> new/delete in Tgl
* Remove duplicate destructor.
* Check all inline destructors
* Fix dtor comments
* Third time's the charm
* Alphabetical sort
* Decomp adjustments
* Add d3drm files to clang-format
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Adjustments to "decomp" language
* Fix a comment
* Fix accidental clang-formatting
* Fix order
* Fix order
* Remove junk
* Fix OFFSET
* Adjustments based on new suggestions
* Annotate globals
* Globals in ISLE
* More globals
* Merge from parser2 branch
* Allow prepending space for exact marker match
* To eliminate noise, require the 0x prefix on offset for marker match
* fix test from previous
* Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise
* FUNCTION to SYNTHETIC where needed
* Missed marker conversion on SetAtomId
* pylint cleanup, remove unused code
* Fix unexpected function end, add more unit tests
* Be more strict about synthetic name syntax
* Revert "Missed marker conversion on SetAtomId"
This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2.
* Revert "FUNCTION to SYNTHETIC where needed"
This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8.
* Implicit lookup by name for functions
* Fix VTABLE SYNTHETIC and other decomp markers
* Get vtable class name
* Vtable marker should identify struct
* No colon for SIZE comment
* Update README.md
* Update README.md
* Update CONTRIBUTING.md
* Update README.md
* Update README.md
* Update CONTRIBUTING.md
* Update README.md
* Update CONTRIBUTING.md
* Fix destructor/annotation
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
---------
Co-authored-by: disinvite <disinvite@users.noreply.github.com>
* MxFlcPresenter: vtable70
* begin work on MxFlcPresenter's m_unk64
* Add another function that makes use of the FLIC header
* Remove space
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Implement/match remaining MxWavePresenter functions
* Name m_unk65
* Match WriteToSoundBuffer
* Remove header
* Match StreamingTickle
* Name more variables
* Give names to some things
* First commit of order tool
* More flexible match on module name. Bugfix on blank_or_comment
* Report inexact offset comments in verbose mode. Bugfix for exact regex
* Refactor checkorder into reusable isledecomp module
* Find bad comments in one pass, add awareness of TEMPLATE
* Refactor of state machine to prepare for reccmp integration
* Use isledecomp lib in reccmp
* Build isledecomp in GH actions, fix mypy complaint
* Ensure unit test cpp files will be ignored by reccmp
* Allow multiple offset markers, pep8 cleanup
* Remove unused variable
* Code style, remove unneeded module and TODO
* Final renaming and type hints
* Fix checkorder issues, add GH action and enforce (#2)
* Fix checkorder issues
* Add GH action
* Test error case
* Works
* Fixes
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Implement ViewROI and base classes
* Clean up Orientable header
* Move tgl to tgl subdirectory, and use target_include_directories
* Move classes to submodules
* Fix some missed references
* Fix/match UpdateWorldData
* Renaming / removing MxTypes / refactoring
* Consistent naming for Matrix
* Adjust format action
* Add Vector3/Vector4 to Data vector
* Add TGL comment
* Add a comment about Matrix4Impl
* Add ROI comment
---------
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
* LegoPalettePresenter - destroy function and destructor
* Update legopalettepresenter.h
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Bootstrap MxMediaPresenter
* Implement/match MxMediaPresenter::Tickle and related
* Implement AppendChunk and Enable
* Implement/match most of MxVideoPresenter
* Add missing offset
* MxQueue and parts of LegoInputManager
* Missed clang-format on mxqueue.h
* Fix declarations
* MxParamType -> NotificationId
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Add missing ClassName's and IsA's
Exceptions: LegoAnimActor as it does something weird with a call to another private/inlined function(?) and RaceStandsEntity which seems to have two vtables
* clang-format
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* commit code
* commit code
* Update mxdiskstreamprovider.cpp
* Update mxstreamprovider.h
* improve match + add html file to gitignore
* improve match of MxRAMStreamController::Open
* MxDiskStreamController::Open
* Match some functions, relocate m_target to `MxThread`
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Rename some functions and members
* Match LegoWorld::Notify to 100%
* Match MxOmni::Destroy to 100%
* Fix parameter prefix
* Fix another parameter
* Fix CR at EOF
* Fix CR at EOF
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* implement/match CalcLocalTransform
* fix odd build error
* address feedback
move vec.h to thirdparty folder
update vec.h
move all realtime code to realtime folder
move calclocaltransform out of legoutil and into realtime
cast shift to MxS32
add additional unroll hack to CalcLocalTransform to prevent msvc entropy
* Implement MxDSBuffer constructor, match FUN_100bffd0
* Match to 100%, minor style fixes
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxSoundPresenter
Destructor, destroy, function adding itself to the sound manager and vtable38.
* Fix virtual function declarations
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* mxvideopresenter
* Update mxvideopresenter.cpp
* use inline getter for rectange width/height
* Update mxvideopresenter.cpp
* Match MxVideoPresenter::Destroy to ~88%
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxMIDIPresenter destructor, stub Destroy for now
* MxMIDIPresenter::EndMIDIAction + update param name
m_MIDIInitialized is definitely public, since it is accessed from the global
MusicManager.
* Add getter for MIDIInitialized, fix virtual function decl
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Only include decomps
* One more function
* Add offset to endOfVariables
* Remove leftover header
* Use undefined where applicable
* Fixes, refactorings
* Fixes
* Fix calling convention
* Added offset comment
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Implemented the function wrapper for SetMatrixProduct labeled as
SetMatrixProductWrapper with 100% match.
* Rename for consistency
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxMusicPresenter destroy
* Implement MxMusicPresenter's Destroy method and move MxMediaPresenter's Destroy method to "protected"
* MxMediaPresenter Destroy to "protected", for real
* MxMusicPresenter Destroy
* MxStreamProvider and MxRamStreamProvider vtable
* Update mxramstreamprovider.h
* Match IsA
* Fixes, improvements
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxMusicPresenter vtable
vtable+0x34 adds the current presenter to the music manager
vtable+0x38 calls destroy with the param as "FALSE"
* Update mxmusicpresenter.cpp
* Update mxmusicpresenter.cpp
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* implement mxomni::create, and match MxStreamController::Open
* Use enum for mxparam type
* Fix return type
* Match MxOmni::Notify
* Remove unused variable
* Added override keywords
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Minor improvements all related to SetupCopyRect
* Rename inline getters. malloc/free -> new/delete
* MxTypes in TransitionManager. Remove stub marker (oops)
* MxSoundManager: dtor, destroy, update types
Also make MxThread's destructor public
* Minor adjustments
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Implement MxTransitionManager::EndTransition and GetCurrentWorld
* Match EndTransition
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxTransitionManager::Dissolve
* Some comments and better names
* use refs instead of pointers
* slightly improved name for rect
* Use MxS32 instead of int
* Pizza: fix type of m_unk98
* Fix pizza constructor
* Match Pizza::Pizza
* Use undefined type
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxDiskStreamProvider constructor
* Add work-in-progress list struct to MxDiskStreamProvider
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* LegoFullScreenMovie variable and related
* Changes after review
- Reduce scope on global strings
- Size assert for LegoGameState (based on the constructor references only)
- 1 -> TRUE for EnableFullScreenMovie
* implement some of MxTransitionManager
start working on MxTransitionManager::StartTransition
add TransitionType enum
implement/match MxTransitionManager::GetDDrawSurfaceFromVideoManager
implement/match global function SetAppCursor
* remove offset comment from mxomni.h
* remove misc offset comments from mxtransitionmanager.h
* address feedback
* merge m_unk20-24 into pad
* LegoEntity parse action string
* Reduced size assert for MxEntity
* remove override keyword for LegoEntity function
* Move global strings to new define.cpp file
* MxAudioManager: Destructor, LockedReinitialize
* MxAudioManager::Reinitialize, fix LockedReinitialize logic
* MxAudioManager cleanup
- fix param in LockedReinitialize, mark that function as private/give it a better param name
* Match LockedReinitialize, fix function declarations, add/match InitPresenters
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* MxDirect3D Constructor
* Implement MxDirect3D::Clear (not yet matching)
* Match MxDirect3D::Clear
* Building out MxDirect3D, link dxguid, add size asserts
* Move a few things around on the Enumerate context obj
* remove dupe mxdirect3d
* Match BuildErrorString and _DoEnumerate
* Fix style
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
Co-authored-by: disinvite <disinvite@users.noreply.github.com>
* pizza: fix type m_unk90
* Initial implementation of a lot of IslePathActor's
All IslePathActor's seem to have (for the most part), the same few variables in common,
probably some ID. SkateBoard, Pizza and TowTrack seem to be a bit more complicated with additional
fields surrounding it.
* Add missing ClassName(s) and IsA(s)
* Add decomp size asserts
* Fix size assertions
* Make legopathactor fields protected for now, fix a type in Pizza
* Fix TowTrack structure
---------
Co-authored-by: Christian Semmler <mail@csemmler.com>
* Match MxBitmap::vtable+40 (CopyColorData)
It's basically a call to StretchDIBits, which copies color data for a rectangle
* Name a ternary raster op
* Name variable m_unk18 (m_bmiColorsProvided)
Since this variable is passed to StretchDIBits, we can see what its supposed to mean.
We dont have DX5 docs, but we have docs of the current day, and this as its 'iUsage':
"Specifies whether the bmiColors member of the BITMAPINFO structure was provided and, if so, whether bmiColors contains explicit red, green, blue (RGB) values or indexes."
The second part (about what the bmiColors contains) seems redundant, since we know this is a boolean.
Source: https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-stretchdibits
* MxBitmap::CreatePalette is now up to 60%
* Add progress on MxBitmap::LoadFile, add the global bitmap signature, add Clone call in CreatePalette
* getting closer
* Implement MxBitmap::vtable18
* Got vtable18 into a better state
It's progress doesn't affect the status of CopyColorData, which is
back at 100%, as it makes sense the loop is a memcpy
* if you want to do more of vtable18 have fun
* Cleanup MxBitmap::LoadFile
* Begin work on FUN_100bd450 (ImportColorsToPalette)
This took a lot of time, finally I got a good understanding of it.
Primarily what's left now is the loop
https://hackmd.io/@KsNMFSBHTO2gxDyRIPRQ1g/H1LCVQXon
* Don’t include class name in method declaration
* yolo vtable38 (I can't test the build atm)
I moved up ImportColorsToPalette so other functions, including this one can use it
* Cleanup while i keep getting bored of matching these functions that wont match
* likely malloc is an operator new
* A few things for MxBitmap
* new struct MxBITMAPINFO
* vtable18 and ImportPalette 100%
* ImportColorsToPalette improvement
* Match vtable1c and vtable3c
* use MxResult return types
* CreatePalette - Use MxResult to track success
* Define types for the bit depth
That boolean is not really a boolean, its just a variable to store
the bit depth as some DWORD. 0 = 256 color, 1 = High Color (16-bit).
* Match MxBitmap::CreatePalette
* Match LoadFile
YEGYEEHEEHEHEHEHEHE3 YES THIS IS FINALLY DONE OMFG
* Reorder variable placement in CreatePalette
* Start vtable14
* Match MxBitmap vtable14, down to reg swap.
Maybe some import function?
* Name MxBitmap vtable functions
---------
Co-authored-by: disinvite <disinvite@users.noreply.github.com>
Co-authored-by: Christian Semmler <mail@csemmler.com>
* LegoNavController: Match CalculateNewTargetSpeed
Ghidra showed this correctly too, but the asm showed the problem simply, an incorrect comparison
* Match a MxPresenter vtable function
* Match known functions in LegoPhonemePresenter
* Revert "LegoNavController: Match CalculateNewTargetSpeed"
This reverts commit 718489923b4dd5a3f12d53510d299033924c5dea.
* MxPresenter: rename tickle flag fields
* LegoPhonemePresenter: add size assert
---------
Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com>
* Implement MxAtomId and reference counter (stl set)
* Partial success in hiding 4786 warning spam.
* Build out most of MxOmni::Destroy since it also touches the set
* Add some size asserts