aboutsummaryrefslogtreecommitdiff
path: root/src/core/transform.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-22 16:12:21 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-22 16:12:21 +0200
commitbab22e1946a656088804b61cf765461b48744971 (patch)
tree43ae3798e5c2f4fc63e68df72d134e742fcaf834 /src/core/transform.h
parent93522effba2f200257141189de5925a23fca93b8 (diff)
downloadnissy-core-bab22e1946a656088804b61cf765461b48744971.tar.gz
nissy-core-bab22e1946a656088804b61cf765461b48744971.zip
Update tests for oriented_cube_t
Diffstat (limited to 'src/core/transform.h')
-rw-r--r--src/core/transform.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/transform.h b/src/core/transform.h
index 28b8d93..763a4ae 100644
--- a/src/core/transform.h
+++ b/src/core/transform.h
@@ -23,7 +23,7 @@ STATIC void writetrans(uint8_t, char [static NISSY_SIZE_TRANSFORMATION]);
23STATIC cube_t transform_edges(cube_t, uint8_t); 23STATIC cube_t transform_edges(cube_t, uint8_t);
24STATIC cube_t transform_corners(cube_t, uint8_t); 24STATIC cube_t transform_corners(cube_t, uint8_t);
25STATIC cube_t transform(cube_t, uint8_t); 25STATIC cube_t transform(cube_t, uint8_t);
26STATIC cube_t applytrans(cube_t, const char *); 26STATIC oriented_cube_t applytrans(oriented_cube_t, const char *);
27STATIC_INLINE uint8_t inverse_trans(uint8_t); 27STATIC_INLINE uint8_t inverse_trans(uint8_t);
28STATIC uint8_t transform_move(uint8_t, uint8_t); 28STATIC uint8_t transform_move(uint8_t, uint8_t);
29STATIC uint64_t symmetry_mask(cube_t); 29STATIC uint64_t symmetry_mask(cube_t);
@@ -367,12 +367,12 @@ transform(cube_t c, uint8_t t)
367 } 367 }
368} 368}
369 369
370STATIC cube_t 370STATIC oriented_cube_t
371applytrans(cube_t cube, const char *buf) 371applytrans(oriented_cube_t cube, const char *buf)
372{ 372{
373 uint8_t t; 373 uint8_t t;
374 374
375 DBG_ASSERT(isconsistent(cube), ZERO_CUBE, 375 DBG_ASSERT(isconsistent(cube), ZERO_ORIENTED_CUBE,
376 "transformation error: inconsistent cube\n"); 376 "transformation error: inconsistent cube\n");
377 377
378 t = readtrans(buf); 378 t = readtrans(buf);
@@ -380,7 +380,10 @@ applytrans(cube_t cube, const char *buf)
380 if (t == UINT8_ERROR) 380 if (t == UINT8_ERROR)
381 LOG("Unknown transformation: %s\n", buf); 381 LOG("Unknown transformation: %s\n", buf);
382 382
383 return transform(cube, t); 383 return (oriented_cube_t){
384 .cube = transform(cube.cube, t),
385 .orientation = cube.orientation
386 };
384} 387}
385 388
386STATIC_INLINE uint8_t 389STATIC_INLINE uint8_t

Generated with cgit - Back to sebastiano.tronto.net