2023-02-13 01:33:44 +00:00
|
|
|
/* Copyright (c) 2013-2023 Jeffrey Pfau
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef GEOMETRY_H
|
|
|
|
#define GEOMETRY_H
|
|
|
|
|
|
|
|
#include <mgba-util/common.h>
|
|
|
|
|
|
|
|
CXX_GUARD_START
|
|
|
|
|
2023-03-19 10:03:55 +00:00
|
|
|
struct mSize {
|
2023-03-19 09:23:37 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
};
|
|
|
|
|
2023-03-19 10:03:55 +00:00
|
|
|
struct mRectangle {
|
2023-02-13 01:33:44 +00:00
|
|
|
int x;
|
|
|
|
int y;
|
2023-02-21 06:59:23 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
2023-02-13 01:33:44 +00:00
|
|
|
};
|
|
|
|
|
2023-03-19 10:03:55 +00:00
|
|
|
void mRectangleUnion(struct mRectangle* dst, const struct mRectangle* add);
|
2023-04-03 07:39:53 +00:00
|
|
|
bool mRectangleIntersection(struct mRectangle* dst, const struct mRectangle* add);
|
2023-03-19 10:03:55 +00:00
|
|
|
void mRectangleCenter(const struct mRectangle* ref, struct mRectangle* rect);
|
2023-02-21 06:59:23 +00:00
|
|
|
|
2023-02-13 01:33:44 +00:00
|
|
|
CXX_GUARD_END
|
|
|
|
|
|
|
|
#endif
|