-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The simplified model rotation introduced with d1616a5 is not accurate enough. The model will only be rotated if the mouse movement was larger than a certain minimum threshold which makes aiming impossible. Although, this was a nice commit in terms of performance and cutting down the code, it is just not sufficient. All changes have been reverted.
- Loading branch information
Showing
5 changed files
with
49 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Input and controls manipulation | ||
* | ||
* G2 Free Aim v0.1.2 - Free aiming for the video game Gothic 2 by Piranha Bytes | ||
* Copyright (C) 2016 mud-freak (@szapp) | ||
* | ||
* This file is part of G2 Free Aim. | ||
* <http://github.com/szapp/g2freeAim> | ||
* | ||
* G2 Free Aim is free software: you can redistribute it and/or modify | ||
* it under the terms of the MIT License. | ||
* On redistribution this notice must remain intact and all copies must | ||
* identify the original author. | ||
* | ||
* G2 Free Aim is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* MIT License for more details. | ||
* | ||
* You should have received a copy of the MIT License | ||
* along with G2 Free Aim. If not, see <http://opensource.org/licenses/MIT>. | ||
*/ | ||
|
||
/* Mouse handling for manually turning the player model by mouse input */ | ||
func void freeAimManualRotation() { | ||
if (!freeAimIsActive()) { return; }; | ||
var int deltaX; deltaX = mulf(mkf(MEM_ReadInt(mouseDeltaX)), MEM_ReadInt(mouseSensX)); // Get mouse change in x | ||
if (deltaX == FLOATNULL) { return; }; // Only rotate if there was movement along x position | ||
deltaX = mulf(deltaX, castToIntf(FREEAIM_ROTATION_SCALE)); // Turn rate | ||
var int hAniCtrl; hAniCtrl = MEM_ReadInt(_@(hero)+2432); // oCNpc.anictrl | ||
const int call = 0; var int null; | ||
if (CALL_Begin(call)) { | ||
CALL_IntParam(_@(null)); // 0 = disable turn animation (there is none while aiming anyways) | ||
CALL_FloatParam(_@(deltaX)); | ||
CALL__thiscall(_@(hAniCtrl), oCAniCtrl_Human__Turn); | ||
call = CALL_End(); | ||
}; | ||
}; | ||
|
||
/* Disable damage animation. Taken from http://forum.worldofplayers.de/forum/threads/1474431?p=25057480#post25057480 */ | ||
func void freeAimDmgAnimation() { | ||
var C_Npc victim; victim = _^(ECX); | ||
if (Npc_IsPlayer(victim)) && (freeAimIsActive()) { EAX = 0; }; // Disable damage animation while aiming | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters