Skip to content
Permalink
Browse files

Merge pull request #1012 from devnexen/asb_to_fabs

Using proper functions for type at hand.
  • Loading branch information...
xycaleth committed May 12, 2019
2 parents 5f3389a + beba93f commit 94866c43789ec8d352d4a4ddecf26297fdd0520f
Showing with 14 additions and 14 deletions.
  1. +1 −1 code/game/bg_panimate.cpp
  2. +1 −1 codemp/game/ai_main.c
  3. +12 −12 codemp/ui/ui_shared.c
@@ -4717,7 +4717,7 @@ void PM_SetAnimFinal(int *torsoAnim,int *legsAnim,
const bool animSync = (g_synchSplitAnims->integer!=0 && !animRestart);
float animCurrent = (-1.0f);
float animSpeed = (50.0f / curAnim.frameLerp * timeScaleMod); // animSpeed is 1.0 if the frameLerp (ms/frame) is 50 (20 fps).
const float animFPS = (fabsf(curAnim.frameLerp));
const float animFPS = (::abs(curAnim.frameLerp));
const int animDurMSec = (int)(((curAnim.numFrames - 1) * animFPS) / timeScaleMod);
const int animHoldMSec = ((animHoldless && timeScaleMod==1.0f)?((animDurMSec>1)?(animDurMSec-1):(animFPS)):(animDurMSec));
int animFlags = (curAnim.loopFrames!=-1)?(BONE_ANIM_OVERRIDE_LOOP):(BONE_ANIM_OVERRIDE_FREEZE);
@@ -625,7 +625,7 @@ void BotInputToUserCommand(bot_input_t *bi, usercmd_t *ucmd, int delta_angles[3]
//set the view independent movement
f = DotProduct(forward, bi->dir);
r = DotProduct(right, bi->dir);
u = abs(forward[2]) * bi->dir[2];
u = fabs(forward[2]) * bi->dir[2];
m = fabs(f);

if (fabs(r) > m) {
@@ -1550,10 +1550,10 @@ void Menu_TransitionItemByName(menuDef_t *menu, const char *p, const rectDef_t *
item->window.offsetTime = time;
memcpy(&item->window.rectClient, rectFrom, sizeof(rectDef_t));
memcpy(&item->window.rectEffects, rectTo, sizeof(rectDef_t));
item->window.rectEffects2.x = abs(rectTo->x - rectFrom->x) / amt;
item->window.rectEffects2.y = abs(rectTo->y - rectFrom->y) / amt;
item->window.rectEffects2.w = abs(rectTo->w - rectFrom->w) / amt;
item->window.rectEffects2.h = abs(rectTo->h - rectFrom->h) / amt;
item->window.rectEffects2.x = fabs(rectTo->x - rectFrom->x) / amt;
item->window.rectEffects2.y = fabs(rectTo->y - rectFrom->y) / amt;
item->window.rectEffects2.w = fabs(rectTo->w - rectFrom->w) / amt;
item->window.rectEffects2.h = fabs(rectTo->h - rectFrom->h) / amt;

Item_UpdatePosition(item);
}
@@ -1601,17 +1601,17 @@ void Menu_Transition3ItemByName(menuDef_t *menu, const char *p, const float minx

// VectorSet(modelptr->g2maxs2, maxx, maxy, maxz);

modelptr->g2maxsEffect[0] = abs(modelptr->g2maxs2[0] - modelptr->g2maxs[0]) / amt;
modelptr->g2maxsEffect[1] = abs(modelptr->g2maxs2[1] - modelptr->g2maxs[1]) / amt;
modelptr->g2maxsEffect[2] = abs(modelptr->g2maxs2[2] - modelptr->g2maxs[2]) / amt;
modelptr->g2maxsEffect[0] = fabs(modelptr->g2maxs2[0] - modelptr->g2maxs[0]) / amt;
modelptr->g2maxsEffect[1] = fabs(modelptr->g2maxs2[1] - modelptr->g2maxs[1]) / amt;
modelptr->g2maxsEffect[2] = fabs(modelptr->g2maxs2[2] - modelptr->g2maxs[2]) / amt;

modelptr->g2minsEffect[0] = abs(modelptr->g2mins2[0] - modelptr->g2mins[0]) / amt;
modelptr->g2minsEffect[1] = abs(modelptr->g2mins2[1] - modelptr->g2mins[1]) / amt;
modelptr->g2minsEffect[2] = abs(modelptr->g2mins2[2] - modelptr->g2mins[2]) / amt;
modelptr->g2minsEffect[0] = fabs(modelptr->g2mins2[0] - modelptr->g2mins[0]) / amt;
modelptr->g2minsEffect[1] = fabs(modelptr->g2mins2[1] - modelptr->g2mins[1]) / amt;
modelptr->g2minsEffect[2] = fabs(modelptr->g2mins2[2] - modelptr->g2mins[2]) / amt;


modelptr->fov_Effectx = abs(modelptr->fov_x2 - modelptr->fov_x) / amt;
modelptr->fov_Effecty = abs(modelptr->fov_y2 - modelptr->fov_y) / amt;
modelptr->fov_Effectx = fabs(modelptr->fov_x2 - modelptr->fov_x) / amt;
modelptr->fov_Effecty = fabs(modelptr->fov_y2 - modelptr->fov_y) / amt;
}
}
}

0 comments on commit 94866c4

Please sign in to comment.
You can’t perform that action at this time.