mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 21:01:48 +01:00
Add window icon,
Add digging animation (Non functional)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user