summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-07-16 23:11:13 +0200
committerkdx <kikoodx@paranoici.org>2023-07-16 23:11:13 +0200
commit0ee4ab4fac1ad82e08a29f1ee6e71b983be5d227 (patch)
tree0caaed642eb2dc3d138d0666667239666cd99b95
parent21af10a4faf14932784668ea01019c63276a422a (diff)
downloadstudy-sttky-0ee4ab4fac1ad82e08a29f1ee6e71b983be5d227.tar.gz
Revert "i'm sleeping"HEADmain
This reverts commit 71ad1d06efe2545da874951fd1d4367fd9ba6f61.
-rw-r--r--src/camera.c4
-rw-r--r--src/main.c38
2 files changed, 21 insertions, 21 deletions
diff --git a/src/camera.c b/src/camera.c
index 1b24afd..c58d8c6 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -39,11 +39,11 @@ camera_update(double dest[2])
int
camera_x(double scale)
{
- return -cam[0] * scale + DWIDTH / 2.0 + off[0];// - 2 + rand() % 5;
+ return -cam[0] * scale + DWIDTH / 2.0 + off[0] - 2 + rand() % 5;
}
int
camera_y(double scale)
{
- return -cam[1] * scale + DHEIGHT / 2.0 + off[1];// - 2 + rand() % 5;
+ return -cam[1] * scale + DHEIGHT / 2.0 + off[1] - 2 + rand() % 5;
}
diff --git a/src/main.c b/src/main.c
index 3000bef..0c623ec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,7 +13,7 @@ static Game *game = NULL;
static void deinit(void);
static int main_loop(void *udata);
-//static void acid(const Game *game);
+static void acid(const Game *game);
int
main(int argc, char **argv)
@@ -87,27 +87,27 @@ main_loop(void *udata)
pxCls(0);
pxPalt(0, true);
game_draw(game);
- //acid(game);
+ acid(game);
pxFlip();
if (TZR_DrawEnd())
return 1;
return 0;
}
-//static void
-//acid(const Game *game)
-//{
-// PxCol cols[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
-// const int bg = (game->queue_restart_scene != 0);
-// for (int i = 0; i < 1024; i++) {
-// const int i = !bg + rand() % (7 + bg);
-// const int k = !bg + rand() % (7 + bg);
-// if (i == k)
-// continue;
-// cols[i] ^= cols[k];
-// cols[k] ^= cols[i];
-// cols[i] ^= cols[k];
-// }
-// for (int i = 0; i < 8; i++)
-// pxSpal(i, cols[i]);
-//}
+static void
+acid(const Game *game)
+{
+ PxCol cols[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ const int bg = (game->queue_restart_scene != 0);
+ for (int i = 0; i < 1024; i++) {
+ const int i = !bg + rand() % (7 + bg);
+ const int k = !bg + rand() % (7 + bg);
+ if (i == k)
+ continue;
+ cols[i] ^= cols[k];
+ cols[k] ^= cols[i];
+ cols[i] ^= cols[k];
+ }
+ for (int i = 0; i < 8; i++)
+ pxSpal(i, cols[i]);
+}