2V2-e.5a: restore 40250 min-max helpers for camera update
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "EterBase/StdAfx.h"
|
||||
#include "EterBase/Utils.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
int main()
|
||||
{
|
||||
int failures = 0;
|
||||
auto check = [&failures](bool ok, const char *name) {
|
||||
if (!ok) {
|
||||
std::fprintf(stderr, "FAIL %s\n", name);
|
||||
++failures;
|
||||
}
|
||||
};
|
||||
check(MIN(-3, 8) == -3 && MIN(8, -3) == -3, "MIN order/sign");
|
||||
check(MAX(-3, 8) == 8 && MAX(8, -3) == 8, "MAX order/sign");
|
||||
check(MINMAX(2, -5, 9) == 2, "MINMAX lower");
|
||||
check(MINMAX(2, 20, 9) == 9, "MINMAX upper");
|
||||
check(MINMAX(9, 4, 2) == 9, "MINMAX reversed bounds");
|
||||
check(fMIN(-3.5f, 8.5f) == -3.5f, "fMIN sign");
|
||||
check(fMAX(200.0f, 0.0f) == 200.0f, "fMAX camera floor");
|
||||
check(fMINMAX(2.0f, -5.0f, 9.0f) == 2.0f, "fMINMAX lower");
|
||||
check(fMINMAX(2.0f, 20.0f, 9.0f) == 9.0f, "fMINMAX upper");
|
||||
return failures ? 1 : 0;
|
||||
}
|
||||
Reference in New Issue
Block a user