-
Notifications
You must be signed in to change notification settings - Fork 9
Adding a modification framework to DiveBlockData #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I have tested this code manually on windows and it works, but it's a pain to add new flags to
|
3d74d79
to
b61a38e
Compare
}; | ||
|
||
// Abstract class representing a binary block encoded in .gfxr format | ||
class DiveSingleBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious, it is named as Single
Block because there will be cases for Multi
Block in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't considered multi block units. This one is just named single block to distinguish it from DiveBlockData (which is meant to hold a bunch of single blocks. If you have different ideas for naming, any suggestions are welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simply IDiveBlock
?
|
||
// Representing a gfxr-encoded block in a buffer | ||
// If blob_ptr is undefined, that is interpreted as an empty block | ||
class DiveSingleGfxrBlockInBuffer : public DiveSingleBlock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to make sure i understand correctly, all modifications will be in DiveSingleGfxrBlockInBuffer? if that is the case, would it be better to call this DiveModificationBlock
? (and the other one as DiveOriginalBlock
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I think that might be easier naming to understand so I will change it. I picked names to describe where the actual encoded bytes of the block exist, but I think original/modified is a bit easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
Note: blocked by #234 because I want to hook this feature up to the CLI for testing |
Refactoring DiveBlockData and adding functionality to store and apply block-level modifications.
primary_index
andsecondary_index
, describing which original block it's anchored to and how it is positioned in relation to the anchor block (negative for immediately before, 0 for overwriting, positive for immediately afterwards)BlockVisitor
is defined using the Visitor design pattern to hold handles to open files (original and new gfxr files) and write block-by-block in the new order