Skip to content
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

HW/DVD: Refactor DVDInterface and DVDThread to classes. #11637

Merged
merged 6 commits into from Mar 10, 2023

Conversation

AdmiralCurtiss
Copy link
Contributor

No description provided.

Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we name the class DVDInterface instead of DVDInterfaceManager? Manager doesn't really add anything to the name.

Source/Core/Core/HW/DVD/DVDInterface.cpp Outdated Show resolved Hide resolved
@JosJuice
Copy link
Member

JosJuice commented Mar 10, 2023

A side note: When I created DVDThread, I designed it as something that only DVDInterface should have to deal with accessing. So it would be nice to make DVDThread a private member of the DVDInterface class instead of making it accessible through the System class... But DI.cpp is currently violating this model, so let's keep this outside the scope of the PR.

@AdmiralCurtiss
Copy link
Contributor Author

Can't we name the class DVDInterface instead of DVDInterfaceManager? Manager doesn't really add anything to the name.

The reason I added Manager for all of these is that I figured having a class be the same name as its enclosing namespace could get both confusing and annoying -- eg. if you want to access DVDInterface::DriveState (that is, namespace::enum) from within the DVDInterface::DVDInterface (that is, namespace::class) you can't just use DVDInterface::DriveState but have to use ::DVDInterface::DriveState. I do agree that Manager doesn't add much but I think it's better to have a different name than the namespace here.

A side note: When I created DVDThread, I designed it as something that only DVDInterface should have to deal with accessing. So it would be nice to make DVDThread a member of the DVDInterface class instead of the System class... But DI.cpp is currently violating this model, so let's keep this outside the scope of the PR.

Yeah I was wondering about that. That does make sense to change later.

@JosJuice
Copy link
Member

Right, I hadn't thought about the namespace. What would you think about changing the namespace to e.g. DVD?

@AdmiralCurtiss
Copy link
Contributor Author

Sure, I guess we can do it that way.

@JosJuice
Copy link
Member

Can we do the same for DVDThread? (This will mean it now shares a namespace with DVDInterface, which I think is fine. When they're in separate classes, we no longer need to use the namespace to keep them apart.)

Source/Core/Core/System.h Outdated Show resolved Hide resolved
Source/Core/Core/HW/DVD/DVDThread.h Show resolved Hide resolved
@lioncash lioncash merged commit 00a6f8c into dolphin-emu:master Mar 10, 2023
14 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the dvd-class branch March 11, 2023 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants