Add window icon,

Add digging animation (Non functional)
This commit is contained in:
Bram Verhulst
2024-05-02 12:28:03 +02:00
parent 64915567dc
commit b6be73019f
16 changed files with 140 additions and 101 deletions

View File

@@ -692,6 +692,12 @@ float utils::map(float value, float start1, float stop1, float start2, float sto
float newVal = (value - start1) / (stop1 - start1) * (stop2 - start2) + start2;
return newVal;
}
float utils::clamp(float value, float min, float max) {
return std::max(min, std::min(value, max));
}
Vector2f utils::clamp(const Vector2f& value, const Vector2f& min, const Vector2f& max) {
return Vector2f { clamp(value.x, min.x, max.x), clamp(value.y, min.y, max.y) };
}
bool utils::isKeyDown(int keycode) {
const Uint8* pStates = SDL_GetKeyboardState(nullptr);
if (pStates != nullptr) {