This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
2022-02-03 22:33:33 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tinyengine/libmath.hpp"
|
2022-02-04 14:07:03 +08:00
|
|
|
#include "tinyengine/tool.hpp"
|
2022-02-03 22:33:33 +08:00
|
|
|
|
|
|
|
#define TEST_TRUE(condition) do { \
|
|
|
|
if (!(condition)) { \
|
|
|
|
std::cout << "[TEST_TRUE] " << #condition << " test failed!" << std::endl; \
|
2022-02-04 14:07:03 +08:00
|
|
|
FATAL_ERROR("TEST TRUE failed"); \
|
2022-02-03 22:33:33 +08:00
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
#define TEST_FALSE(condition) do { \
|
|
|
|
if (condition) { \
|
|
|
|
std::cout << "[TEST FALSE] " << #condition << " test failed!" << std::endl; \
|
2022-02-04 14:07:03 +08:00
|
|
|
FATAL_ERROR("TEST FALSE failed"); \
|
2022-02-03 22:33:33 +08:00
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
inline Mat44 CreateTextureTransform(const Size& size, const Point& pos) {
|
|
|
|
return Mat44({
|
|
|
|
size.w, 0, 0, pos.x,
|
|
|
|
0, size.h, 0, pos.y,
|
|
|
|
0, 0, 1, 0,
|
|
|
|
0, 0, 0, 1,
|
|
|
|
});
|
|
|
|
}
|