Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 7 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
3 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
44 lignes
Copier tout
4 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
45 lignes
Copier tout
Copier
Copié
Copier
Copié
#include <keyboard.gph>
// TOGGLES
// TOGGLES
bool bAntiRecoil = TRUE;
bool bAntiRecoil = TRUE;
bool key_f2_event; // F2
bool key_f2_event; // F2
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// VARIABLES & DEFINES [SETTINGS]
// VARIABLES & DEFINES [SETTINGS]
Copier
Copié
Copier
Copié
#define StickNoise 4.32
fix32 RECOIL_V = 4.5; // Adjust Vertical Anti-Recoil //
fix32 RECOIL_V = 4.5; // Adjust Vertical Anti-Recoil //
fix32 RECOIL_H = 0.0; // Adjust Horizontal Anti-Recoil //
fix32 RECOIL_H = 0.0; // Adjust Horizontal Anti-Recoil //
Copier
Copié
Copier
Copié
#define ANTI_RECOIL_KEY KEY_F2 // F2 " Anti-Recoil //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Anti-Recoil
// Anti-Recoil
main {
main {
// toggle
// toggle
if(key_status(ANTI_RECOIL_KEY)) {
if(key_status(ANTI_RECOIL_KEY)) {
if(!key_f2_event) {
if(!key_f2_event) {
key_f2_event = TRUE;
key_f2_event = TRUE;
bAntiRecoil = !bAntiRecoil;
bAntiRecoil = !bAntiRecoil;
}
}
} else key_f2_event = FALSE;
} else key_f2_event = FALSE;
if (bAntiRecoil && get_val(BUTTON_5)) {
if (bAntiRecoil && get_val(BUTTON_5)) {
// Remove small unwanted movement as your controller sticks may not return to zero exactly after release.
// Remove small unwanted movement as your controller sticks may not return to zero exactly after release.
if(abs(get_actual(STICK_1_X)) < StickNoise) { set_val(STICK_1_X, 0.0); }
if(abs(get_actual(STICK_1_X)) < StickNoise) { set_val(STICK_1_X, 0.0); }
if(abs(get_actual(STICK_1_Y)) < StickNoise) { set_val(STICK_1_Y, 0.0); }
if(abs(get_actual(STICK_1_Y)) < StickNoise) { set_val(STICK_1_Y, 0.0); }
AntiRecoil(STICK_1_Y,RECOIL_V); // Y Axis - vertical recoil compensation
AntiRecoil(STICK_1_Y,RECOIL_V); // Y Axis - vertical recoil compensation
AntiRecoil(STICK_1_X,RECOIL_H); // X Axis - horizontal recoil compensation
AntiRecoil(STICK_1_X,RECOIL_H); // X Axis - horizontal recoil compensation
}
}
Copier
Copié
Copier
Copié
}
// this is the function applying the anti recoil
// this is the function applying the anti recoil
void AntiRecoil (uint8 axis, fix32 recoil)
void AntiRecoil (uint8 axis, fix32 recoil)
{
{
fix32 RY = get_actual(STICK_1_Y); // read the actual stick y value
fix32 RY = get_actual(STICK_1_Y); // read the actual stick y value
fix32 RX = get_actual(STICK_1_X); // read the actual sitck x value
fix32 RX = get_actual(STICK_1_X); // read the actual sitck x value
// only apply anti recoil if the actual movement of x&y is lower than the recoil to apply
// only apply anti recoil if the actual movement of x&y is lower than the recoil to apply
if (get_val(BUTTON_5) && (sqrt(RX*RX + RY*RY)) <= abs(recoil))
if (get_val(BUTTON_5) && (sqrt(RX*RX + RY*RY)) <= abs(recoil))
{
{
if(abs(RY) <= abs(recoil)) // only apply when y movement is lower than the recoil to apply
if(abs(RY) <= abs(recoil)) // only apply when y movement is lower than the recoil to apply
{
{
set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_val(axis));
set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_val(axis));
}
}
}
}
}
}
Copier
Copié
Copier
Copié
}
Différences enregistrées
Texte d'origine
Ouvrir un fichier
// TOGGLES bool bAntiRecoil = TRUE; bool key_f2_event; // F2 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // VARIABLES & DEFINES [SETTINGS] fix32 RECOIL_V = 4.5; // Adjust Vertical Anti-Recoil // fix32 RECOIL_H = 0.0; // Adjust Horizontal Anti-Recoil // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Anti-Recoil main { // toggle if(key_status(ANTI_RECOIL_KEY)) { if(!key_f2_event) { key_f2_event = TRUE; bAntiRecoil = !bAntiRecoil; } } else key_f2_event = FALSE; if (bAntiRecoil && get_val(BUTTON_5)) { // Remove small unwanted movement as your controller sticks may not return to zero exactly after release. if(abs(get_actual(STICK_1_X)) < StickNoise) { set_val(STICK_1_X, 0.0); } if(abs(get_actual(STICK_1_Y)) < StickNoise) { set_val(STICK_1_Y, 0.0); } AntiRecoil(STICK_1_Y,RECOIL_V); // Y Axis - vertical recoil compensation AntiRecoil(STICK_1_X,RECOIL_H); // X Axis - horizontal recoil compensation } // this is the function applying the anti recoil void AntiRecoil (uint8 axis, fix32 recoil) { fix32 RY = get_actual(STICK_1_Y); // read the actual stick y value fix32 RX = get_actual(STICK_1_X); // read the actual sitck x value // only apply anti recoil if the actual movement of x&y is lower than the recoil to apply if (get_val(BUTTON_5) && (sqrt(RX*RX + RY*RY)) <= abs(recoil)) { if(abs(RY) <= abs(recoil)) // only apply when y movement is lower than the recoil to apply { set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_val(axis)); } } } }
Texte modifié
Ouvrir un fichier
#include <keyboard.gph> // TOGGLES bool bAntiRecoil = TRUE; bool key_f2_event; // F2 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // VARIABLES & DEFINES [SETTINGS] #define StickNoise 4.32 fix32 RECOIL_V = 4.5; // Adjust Vertical Anti-Recoil // fix32 RECOIL_H = 0.0; // Adjust Horizontal Anti-Recoil // #define ANTI_RECOIL_KEY KEY_F2 // F2 " Anti-Recoil // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Anti-Recoil main { // toggle if(key_status(ANTI_RECOIL_KEY)) { if(!key_f2_event) { key_f2_event = TRUE; bAntiRecoil = !bAntiRecoil; } } else key_f2_event = FALSE; if (bAntiRecoil && get_val(BUTTON_5)) { // Remove small unwanted movement as your controller sticks may not return to zero exactly after release. if(abs(get_actual(STICK_1_X)) < StickNoise) { set_val(STICK_1_X, 0.0); } if(abs(get_actual(STICK_1_Y)) < StickNoise) { set_val(STICK_1_Y, 0.0); } AntiRecoil(STICK_1_Y,RECOIL_V); // Y Axis - vertical recoil compensation AntiRecoil(STICK_1_X,RECOIL_H); // X Axis - horizontal recoil compensation } } // this is the function applying the anti recoil void AntiRecoil (uint8 axis, fix32 recoil) { fix32 RY = get_actual(STICK_1_Y); // read the actual stick y value fix32 RX = get_actual(STICK_1_X); // read the actual sitck x value // only apply anti recoil if the actual movement of x&y is lower than the recoil to apply if (get_val(BUTTON_5) && (sqrt(RX*RX + RY*RY)) <= abs(recoil)) { if(abs(RY) <= abs(recoil)) // only apply when y movement is lower than the recoil to apply { set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_val(axis)); } } }
Trouver la différence