|
|
@@ -10,52 +10,49 @@
|
|
|
|
|
|
TEST_CASE("easing", "")
|
|
|
{
|
|
|
- if (BX_ENABLED(false) )
|
|
|
- {
|
|
|
- bx::WriterI* writer = bx::getStdOut();
|
|
|
+ bx::WriterI* writer = bx::getNullOut();
|
|
|
|
|
|
- for (uint32_t ee = 0; ee < bx::Easing::Count; ++ee)
|
|
|
- {
|
|
|
- bx::writePrintf(writer, "\n\n%d\n", ee);
|
|
|
+ for (uint32_t ee = 0; ee < bx::Easing::Count; ++ee)
|
|
|
+ {
|
|
|
+ bx::writePrintf(writer, "\n\n%d\n", ee);
|
|
|
|
|
|
- const bx::EaseFn easing = bx::getEaseFunc(bx::Easing::Enum(ee) );
|
|
|
+ const bx::EaseFn easing = bx::getEaseFunc(bx::Easing::Enum(ee) );
|
|
|
|
|
|
- const int32_t nx = 64;
|
|
|
- const int32_t ny = 10;
|
|
|
+ const int32_t nx = 64;
|
|
|
+ const int32_t ny = 10;
|
|
|
|
|
|
- bx::writePrintf(writer, "\t/// ^\n");
|
|
|
+ bx::writePrintf(writer, "\t/// ^\n");
|
|
|
|
|
|
- for (int32_t yy = ny+4; yy >= -5; --yy)
|
|
|
- {
|
|
|
- const float ys = float(yy )/float(ny);
|
|
|
- const float ye = float(yy+1.0)/float(ny);
|
|
|
+ for (int32_t yy = ny+4; yy >= -5; --yy)
|
|
|
+ {
|
|
|
+ const float ys = float(yy )/float(ny);
|
|
|
+ const float ye = float(yy+1.0)/float(ny);
|
|
|
|
|
|
- bx::writePrintf(writer, "\t/// %c", yy != 0 ? '|' : '+');
|
|
|
+ bx::writePrintf(writer, "\t/// %c", yy != 0 ? '|' : '+');
|
|
|
|
|
|
- for (int32_t xx = 0; xx < nx; ++xx)
|
|
|
+ for (int32_t xx = 0; xx < nx; ++xx)
|
|
|
+ {
|
|
|
+ int32_t jj = 0;
|
|
|
+ for (; jj < 10; ++jj)
|
|
|
{
|
|
|
- int32_t jj = 0;
|
|
|
- for (; jj < 10; ++jj)
|
|
|
- {
|
|
|
- const float tt = float(xx*10+jj)/10.0f/float(nx);
|
|
|
- const float vv = easing(tt);
|
|
|
-
|
|
|
- if (vv >= ys
|
|
|
- && vv < ye)
|
|
|
- {
|
|
|
- bx::writePrintf(writer, "*");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ const float tt = float(xx*10+jj)/10.0f/float(nx);
|
|
|
+ const float vv = easing(tt);
|
|
|
|
|
|
- if (jj == 10)
|
|
|
+ if (vv >= ys
|
|
|
+ && vv < ye)
|
|
|
{
|
|
|
- bx::writePrintf(writer, "%c", yy != 0 ? ' ' : '-');
|
|
|
+ bx::writePrintf(writer, "*");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- bx::writePrintf(writer, "%s\n", yy != 0 ? "" : ">");
|
|
|
+ if (jj == 10)
|
|
|
+ {
|
|
|
+ bx::writePrintf(writer, "%c", yy != 0 ? ' ' : '-');
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ bx::writePrintf(writer, "%s\n", yy != 0 ? "" : ">");
|
|
|
}
|
|
|
}
|
|
|
}
|