|
1 | 1 | #include "Math.hpp"
|
2 | 2 | #include <unordered_map>
|
| 3 | +#include <cstring> |
3 | 4 |
|
4 | 5 | Hyprutils::Math::eTransform wlTransformToHyprutils(wl_output_transform t) {
|
5 | 6 | switch (t) {
|
@@ -52,21 +53,21 @@ static void matrixTranslate(float mat[9], float x, float y) {
|
52 | 53 | float translate[9] = {
|
53 | 54 | 1.0f, 0.0f, x, 0.0f, 1.0f, y, 0.0f, 0.0f, 1.0f,
|
54 | 55 | };
|
55 |
| - wlr_matrix_multiply(mat, mat, translate); |
| 56 | + matrixMultiply(mat, mat, translate); |
56 | 57 | }
|
57 | 58 |
|
58 | 59 | static void matrixScale(float mat[9], float x, float y) {
|
59 | 60 | float scale[9] = {
|
60 | 61 | x, 0.0f, 0.0f, 0.0f, y, 0.0f, 0.0f, 0.0f, 1.0f,
|
61 | 62 | };
|
62 |
| - wlr_matrix_multiply(mat, mat, scale); |
| 63 | + matrixMultiply(mat, mat, scale); |
63 | 64 | }
|
64 | 65 |
|
65 | 66 | static void matrixRotate(float mat[9], float rad) {
|
66 | 67 | float rotate[9] = {
|
67 | 68 | cos(rad), -sin(rad), 0.0f, sin(rad), cos(rad), 0.0f, 0.0f, 0.0f, 1.0f,
|
68 | 69 | };
|
69 |
| - wlr_matrix_multiply(mat, mat, rotate); |
| 70 | + matrixMultiply(mat, mat, rotate); |
70 | 71 | }
|
71 | 72 |
|
72 | 73 | static std::unordered_map<eTransform, std::array<float, 9>> transforms = {
|
@@ -208,7 +209,7 @@ void projectBox(float mat[9], CBox& box, eTransform transform, float rotation, c
|
208 | 209 | matrixTranslate(mat, -width / 2, -height / 2);
|
209 | 210 | }
|
210 | 211 |
|
211 |
| - wlr_matrix_scale(mat, width, height); |
| 212 | + matrixScale(mat, width, height); |
212 | 213 |
|
213 | 214 | if (transform != HYPRUTILS_TRANSFORM_NORMAL) {
|
214 | 215 | matrixTranslate(mat, 0.5, 0.5);
|
|
0 commit comments