mirror of
https://github.com/krystalgamer/spidey-decomp.git
synced 2024-11-23 05:19:43 +00:00
Utils_ShiftFilter
This commit is contained in:
parent
3023c7e9e6
commit
5f85acffed
20
utils.cpp
20
utils.cpp
@ -434,10 +434,24 @@ void Utils_SetVisibilityInBox(CVector const * min,CVector const * max, bool visi
|
||||
Utils_SetBaddyVisibilityInBox(min, max, visible, in, BaddyList);
|
||||
}
|
||||
|
||||
// @SMALLTODO
|
||||
void Utils_ShiftFilter(i32,i32,i32,i32)
|
||||
// @Ok
|
||||
// @Test
|
||||
i32 Utils_ShiftFilter(i32 a1,i32 a2,i32 delta, i32 a4)
|
||||
{
|
||||
printf("Utils_ShiftFilter(i32,i32,i32,i32)");
|
||||
print_if_false(delta > 0, "delta must be greater than zero");
|
||||
|
||||
if (a1 > a2)
|
||||
{
|
||||
if (a1 - a2 <= a4)
|
||||
return a2;
|
||||
|
||||
return a1 - ((a1 - a2) >> delta);
|
||||
}
|
||||
|
||||
if ( a2 - a1 <= a4 )
|
||||
return a2;
|
||||
|
||||
return ((a2 - a1) >> delta) + a1;
|
||||
}
|
||||
|
||||
// @SMALLTODO
|
||||
|
2
utils.h
2
utils.h
@ -48,7 +48,7 @@ EXPORT void Utils_RotateWorldToObject(CBody *,CVector *,CVector *);
|
||||
EXPORT void Utils_SetBaddyVisibilityInBox(CVector const *,CVector const *,bool,bool,CBody *);
|
||||
EXPORT void Utils_SetVisibilityByName(char const *,i32,i32,bool);
|
||||
EXPORT void Utils_SetVisibilityInBox(CVector const *,CVector const *,bool,bool);
|
||||
EXPORT void Utils_ShiftFilter(i32,i32,i32,i32);
|
||||
EXPORT i32 Utils_ShiftFilter(i32,i32,i32,i32);
|
||||
EXPORT void Utils_VblankProcessing(void);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user