PocketEmpires/System.cpp

67 lines
2.2 KiB
C++

/* *******************************************************************
* Includes
* ******************************************************************/
#include <Arduino.h>
#include <Gamebuino.h>
/* *******************************************************************
* Defines
* ******************************************************************/
#define mCHECK_COLLISION(x1, y1, w1, h1, x2, y2, w2, h2) \
(!( ((x1) >= (x2) + (w2)) \
|| \
((x2) >= (x1) + (w1)) \
|| \
((y1) >= (y2) + (h2)) \
|| \
((y2) >= (y1) + (h1)) )
/* *******************************************************************
* Types definition
* ******************************************************************/
/* *******************************************************************
* Global variables definition
* ******************************************************************/
/*****************************************************************//**
*
* \brief Global interface to Gamebuino low-level libs.
*
*********************************************************************/
Gamebuino gb;
/* *******************************************************************
* Local variables definition
* ******************************************************************/
/* *******************************************************************
* Local prototypes declaration
* ******************************************************************/
/* *******************************************************************
* Functions definition
* ******************************************************************/
/*****************************************************************//**
*
* \brief Initializes the device and game parameters.
*
*********************************************************************/
void SystemInit(void)
{
/* Arduino initialization routine. */
init();
/* Initialize Gamebuino libs. */
gb.begin();
#ifdef USBCON
USBDevice.attach();
#endif /* USBCON */
}