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

Borderlands 2 Audio plugin #158

Closed
wants to merge 54 commits into from

Conversation

@CleyFaye
Copy link

commented May 12, 2013

Hi,

I don't know if this is the right way to do this, but here's an updated version of the Borderlands 2 Positional audio plugin. This one work well with the 1.5.0, the current version on Steam. Also included are informations on how to update it for future versions, in case I don't do it.

  • Update for Borderlands 2 version 1.5.0
  • Fixed invalid version checking
  • Added details on how to peek the vectors for future references
Kissaki and others added 28 commits Jan 12, 2013
Rename header guard defines to not use c++-reserved names
* as pointed out in issue #842
adjust names to match other header files
Adjust header guard defines for uniformity
* Append underline to header guard defines to match the others (except ui_)
* Add guard to header files GlobalShortcut
* Adjust mklic.pl script to add guard to licenses.h,
and add updated licenses.h.
Prepend Projectname to header guard defines
* some few (4?) files actually already had it
add 256px icon layer to mumble icon
* this was suggested by submitted patch 321.
This shouldn’t hurt, only increasing file-size a bit.
Although probably very rarely in use, the patch showed interest/usage of it.
Ensure that the MAX macro is always defined.
On some systems, none of the (directly or indirectly) included headers does
provide that macro. First reported in https://bugs.gentoo.org/460524
add new translation pt-PT to project files
* add new pt-PT translation to mumble project files
* qt-pt is already added (for the pt_BR translation)
Apply patch #960: add preprocessor #if for OpenBSD
It seems the include file <netinet/in_systm.h> has to be included not only by FreeBSD but also OpenBSD, as reported and patch supplied in #960.
Update Hebrew translation by patch #366
#366 submitted an updated ts file. This has been integrated.
Add Hebrew translation to project files
It was removed for the 1.2.4 release because it was unfinished. Now that we have an updated translation, as because this is after 1.2.4 add it again.
lupdate translation files - mainly for HE
Lupdate the translation files. This changes mostly just line-numbers. But for HE this fixes the markup, and escapes certain characters.
Adds positional audio plugin for Sub Rosa
Does not include context or identity information.
Implement copy constructors, minor cleaning
* Implement copy constructors for classes with allocated memory.
** ServerDB gets a private not implemented copy constructor to effectively prevent copying, as it uses the static db field as a member.
* Fail hard on subsequent ServerDB instantiations
Prevent overlay from disappearing on D3D DLL reloading.
This is confirmed to fix the missing overlay in Guild Wars 2.

When D3D was used by a process thus loading the DLL, but then unloaded we did not inject on subsequent loading of the D3D DLL (in the same exe). Guild Wars 2 did un- and reload the DLL when switching from their launcher to the game.
This commit introduces HardHook::reset() and checks for inactive hardhooks for a newly loaded DLL.

The changes were submitted on sourceforge
https://sourceforge.net/p/mumble/bugs/909/#bf9e
Code formatting, smaller refacs, robustness.
* Performance: Prefix increment in loops.
* Check VirtualAlloc return
* Check for successful memory allocation in cloneCode
* Swap assignment of pCode and uiCode
(if alloc were to fail and not assign, uiCode shouldn't be nulled either)
* declare statics before non-static members
* Introduce variables replacing magic constants
* Reduce varscopes
Extend Windows Overlay code and clean it up.
Extend to handle library freeing.
Codeformatting and -cleanup, robustness, and make debugoutput more consistent.

* Indroduce hook for freeing loaded DLLs.
This separates logic between loading and freeing, leading to adjustments to the recently introduced checks for freed DLLs.
* In HardHook::reset() do a clean and complete reset rather than minimal.
* Memvarinitialisation in HardHook
* Remove logically unused variable bPresenting in d3d9.cpp (always false)
* In d3d9.cpp change bHooked to hold the HMODULE, to be able to reset hooks on freeing the library (recognize the module on unloading).
* In d3d10.cpp prefix debugoutput with D3D10 consistently; no more DXGI which is ambiguous with a d3d11 file that also uses DXGI.
* Consistently use ods instead of fods in the overlay files.
Not in HardHook yet, as that class is used in the Mumble client as well atm.
* Fix forwareded return value types (LONG to ULONG)
* TODOs for hook-call-logic in multiple places
* Commenting, formatting and scope / order adjustments
* Introduce variables with constant values (replacing magic/undescriptive constants/numbers)
Fix overlay code; don’t restore after freeing
After potentially unloading the module, the hook on the module was restoring the code in-memory. This is obviously wrong. Now, the hook restores original code before (pot.) unloading.
Remove never executed logic
The change from the last commit didn’t make sense.
Like this, the hook-restore is never executed. We don’t know the internal (systems/processes) module reference count, thus don’t know if the module *will* be unloaded (on the next free).
Thus, just remove this code which was only for clean logic anyway, and as far as results go wouldn’t effectively change anything.
@hacst

This comment has been minimized.

Copy link
Member

commented on overlay/HardHook.cpp in 189344a Apr 22, 2013

typo

@hacst

This comment has been minimized.

Copy link
Member

commented on overlay/HardHook.cpp in 189344a Apr 22, 2013

I don't think we elevate anything. How about "(tried to make jump target readable and executable)".

@Kissaki

This comment has been minimized.

Copy link
Member

commented May 15, 2013

I see pullrequest #155 did update to borderlands 2 1.5.0 already as well. Maybe we can extend that with the commenting you did.

@CleyFaye

This comment has been minimized.

Copy link
Author

commented May 15, 2013

Ah, the things that happen when you mix different editors with different policies on tab/spaces.

I agree with you, the other pull request seems better, since it seems he found a place where the coordinates are easier to get.
The comment block I added is still interesting though, as the coordinate are the same. You'll just have to remove the line saying that the coordinates Z and Y are swapped, since there obviously is a place in the game memory where they aren't.

Should I do this myself (pulling this version, adding comment, etc) or will you handle it?

@CleyFaye CleyFaye closed this May 23, 2013

Fixes and improvements to the swedish translation.
Merge pull request #161 from Vertig0/master
* Fixed a lot of small errors and made some improvements to the translation.
@hacst

This comment has been minimized.

Copy link
Member

commented on overlay/d3d10.cpp in 72413a6 May 30, 2013

We should think about allowing the C++11 override keyword here. Unfortunately we probably can't use it. Would have to check how many Linux compilers for ancient distros out there support it.

@hacst

This comment has been minimized.

Copy link
Member

commented on overlay_gl/overlay.c in c252daf May 30, 2013

Yes it should be ;) At least according to the manpage

@Kissaki

This comment has been minimized.

Copy link
Member

commented May 31, 2013

I applied the other PR. See #155 (comment)
Even after fixing the whitespace indendation I get a conflict when I try to rebase your changes onto the now current code-base as the detected_version address changed in the other PR.

Would you be willing to re-apply your changes to the new code-base?

Gabriel Paul 'Cley Faye' Risterucci added 2 commits May 31, 2013

@CleyFaye CleyFaye reopened this May 31, 2013

@CleyFaye

This comment has been minimized.

Copy link
Author

commented May 31, 2013

Ok, so it look like I seriously messed my repository here, sorry for that. I merged cleanly my info in the last version of the plugin, though, but I'm still fighting with the github fork stuff :(

@CleyFaye CleyFaye closed this May 31, 2013

@CleyFaye

This comment has been minimized.

Copy link
Author

commented May 31, 2013

If you could just take the current version of the borderlands2.cpp file, it should cleanly replace the current version in the after-1.2.4 branch.

@Kissaki

This comment has been minimized.

Copy link
Member

commented May 31, 2013

Uuuuh, what did you even try to do?
I don’t see any useful changes.

Oh wait, did you put the "fix" and your addition into one commit there?
That makes it … not easy to merge/see. :)

Kissaki added a commit that referenced this pull request May 31, 2013
Cherry-pick changes as per pull request #158
* Variable initialization
* Fix indent
* Documentation
* #158 (comment)
@Kissaki

This comment has been minimized.

Copy link
Member

commented May 31, 2013

I could not apply it (rebase it onto) after-1.2.4 because of conflics.

However, as you suggested, I was able to just copy the file contents.
Please check if the result is correct/as you intended.

@CleyFaye

This comment has been minimized.

Copy link
Author

commented May 31, 2013

Yes, it's all there.

Sorry for the repository issue, I'm not really used to branches in git; adding work with multiples remotes was too much for me right now :\

@Kissaki

This comment has been minimized.

Copy link
Member

commented May 31, 2013

No problem. :)

Not merging after-1.2.4 and me cherry-picking the commit would have probably worked out better.

Or you doing a new commit onto after-1.2.4 and open a new pull request.

@mkrautz

This comment has been minimized.

Copy link
Member

commented on src/murmur/ServerDB.h in 3c5976d Jun 4, 2013

This isn't private. It's public.

@mkrautz

This comment has been minimized.

Copy link
Member

commented on src/murmur/ServerDB.cpp in 3c5976d Jun 4, 2013

Can we please use qFatal? We don't throw anywhere else that I'm aware of.

This comment has been minimized.

Copy link
Member Author

replied Jun 4, 2013

is fixed in a later commit
see d6a572f#L2L80

@mkrautz

This comment has been minimized.

Copy link
Member

commented on fe03a9d Jun 4, 2013

Not very fond of this.

@mkrautz

This comment has been minimized.

Copy link
Member

commented on ce3dd72 Jun 4, 2013

I'm not fond of this either.

Kissaki added a commit that referenced this pull request Jun 4, 2013
Cherry-pick changes as per pull request #158
* Variable initialization
* Fix indent
* Documentation
* #158 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.