Skip to content

Commit

Permalink
Updated CSSDK
Browse files Browse the repository at this point in the history
Updated CSSDK
  • Loading branch information
SmileYzn committed Jun 17, 2024
1 parent 5727055 commit 7bc811a
Show file tree
Hide file tree
Showing 84 changed files with 3,528 additions and 4,993 deletions.
835 changes: 426 additions & 409 deletions AccuracyFix/include/cssdk/common/const.h

Large diffs are not rendered by default.

59 changes: 52 additions & 7 deletions AccuracyFix/include/cssdk/common/mathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,64 @@ inline T& operator&= (T& a, T b) { return (T&)((type&)a &= (type)b); }
template<class T, class type=typename std::underlying_type<T>::type>
inline T& operator^= (T& a, T b) { return (T&)((type&)a ^= (type)b); }

inline double M_sqrt(int value) {
return sqrt(value);
}

inline float M_sqrt(float value) {
return _mm_cvtss_f32(_mm_sqrt_ss(_mm_load_ss(&value)));
}

inline double M_sqrt(double value) {
double ret;
auto v = _mm_load_sd(&value);
_mm_store_sd(&ret, _mm_sqrt_sd(v, v));
return ret;
return _mm_cvtsd_f64(_mm_sqrt_sd(v, v));
}

template<typename T>
inline double M_sqrt(T value) {
return sqrt(value);
}

inline float M_min(float a, float b) {
return _mm_cvtss_f32(_mm_min_ss(_mm_load_ss(&a), _mm_load_ss(&b)));
}

inline double M_min(double a, double b) {
return _mm_cvtsd_f64(_mm_min_sd(_mm_load_sd(&a), _mm_load_sd(&b)));
}

template<typename T>
inline T M_min(T a, T b) {
return min(a, b);
}

inline float M_max(float a, float b) {
return _mm_cvtss_f32(_mm_max_ss(_mm_load_ss(&a), _mm_load_ss(&b)));
}

inline double M_max(double a, double b) {
return _mm_cvtsd_f64(_mm_max_sd(_mm_load_sd(&a), _mm_load_sd(&b)));
}

template<typename T>
inline T M_max(T a, T b) {
return max(a, b);
}

inline float M_clamp(float a, float min, float max) {
return _mm_cvtss_f32(_mm_min_ss(_mm_max_ss(_mm_load_ss(&a), _mm_load_ss(&min)), _mm_load_ss(&max)));
}

inline double M_clamp(double a, double min, double max) {
return _mm_cvtsd_f64(_mm_min_sd(_mm_max_sd(_mm_load_sd(&a), _mm_load_sd(&min)), _mm_load_sd(&max)));
}

template<typename T>
inline T M_clamp(T a, T min, T max) {
return clamp(a, min, max);
}

template<class T>
inline void SWAP(T &first, T &second) {
T temp = first;
first = second;
second = temp;
}

#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];}
Expand Down
129 changes: 0 additions & 129 deletions AccuracyFix/include/cssdk/dlls/API/CSEntity.h

This file was deleted.

186 changes: 0 additions & 186 deletions AccuracyFix/include/cssdk/dlls/API/CSPlayer.h

This file was deleted.

Loading

0 comments on commit 7bc811a

Please sign in to comment.