PokeMe64/include/core/common.h
Philippe Symons f7a687b147 Various changes
- Add "Pikachu Bed" and "Tentacool Doll" decoration unlock options for
  gen 2
- bugfix for unsafe behaviour
- attempt to make the RESET button work for cartridge switching. It
  failed though. (not reliable). Therefore I just added a warning
  message instead.
- Work on new ScrollWidget for Credits/About screen (Work In Progress)
2024-07-31 22:29:21 +02:00

54 lines
1.0 KiB
C
Executable File

#ifndef _CORE_COMMON_H
#define _CORE_COMMON_H
typedef struct Point
{
int x;
int y;
} Point;
typedef struct FloatPoint
{
float x;
float y;
} FloatPoint;
typedef Point Vector;
typedef FloatPoint FloatVector;
typedef struct Dimensions
{
int width;
int height;
} Dimensions;
typedef struct Rectangle
{
int x;
int y;
int width;
int height;
} Rectangle;
/**
* Whether or not the rectangle has a size of 0.
*/
bool isZeroSizeRectangle(const Rectangle& rect);
/**
* @brief This function adds the x,y coordinates of rectangle b
* to rectangle a and returns a new rectangle with these combined x,y coords and
* the width and height of rectangle a
*/
Rectangle addOffset(const Rectangle& a, const Rectangle& b);
bool isPointInsideRectangle(const Rectangle& a, const Point& p);
bool doRectanglesOverlap(const Rectangle& a, const Rectangle& b);
/**
* @brief Extract a Dimensions struct from a Rectangle that only contains the width and height
*/
Dimensions getDimensions(const Rectangle& r);
#endif