summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-01-19 02:27:36 +0100
committerkdx <kikoodx@paranoici.org>2023-01-19 02:56:43 +0100
commit4d46c2bc8a01d3d28e84a3164640a7447f19773b (patch)
tree49ddcd78baf89eb793208a91e37c2b51fb364628
parentfc3fc2ba5eca1f898a8339920adc5aedf0a97e73 (diff)
download005-4d46c2bc8a01d3d28e84a3164640a7447f19773b.tar.gz
wtf
-rw-r--r--Cursor.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/Cursor.cpp b/Cursor.cpp
index 79d712a..cacc62e 100644
--- a/Cursor.cpp
+++ b/Cursor.cpp
@@ -1,7 +1,9 @@
#include "Cursor.hpp"
#include "lzr.h"
+#include "cfg.hpp"
#include <stdlib.h>
#include <math.h>
+#include <SDL2/SDL_log.h>
Cursor::Cursor() : _angle(0.0), _xscale(1.0), _yscale(1.0),
x(0), y(0), down(false), erase(false)
@@ -15,19 +17,19 @@ void Cursor::update()
erase = LZR_BUTTON(MOUSE_R);
if (erase) {
_angle -= 1.0 / 16;
- _xscale = sin(LZR_GetTick());
- _yscale = cos(LZR_GetTick());
+ _xscale = sin(float(LZR_GetTick()) * 2.0);
+ _yscale = cos(float(LZR_GetTick()) * 3.0);
while (_angle < -2.0)
_angle += 1.0;
} else if (down) {
_angle += 1.0 / 16;
- _xscale = sin(LZR_GetTick());
- _yscale = cos(LZR_GetTick());
+ _xscale = 2.0 * sin(float(LZR_GetTick()) * 2.0);
+ _yscale = 2.0 * cos(float(LZR_GetTick()) * 3.0);
while (_angle > 2.0)
_angle -= 1.0;
} else {
- double target_angle = 0.0;
- _angle += target_angle - _angle * 0.1;
+ const double target_angle = 0.0;
+ _angle = target_angle - _angle * 0.1;
_xscale = 1.0 - _xscale * 0.1;
_yscale = 1.0 - _yscale * 0.1;
}