mirror of
https://github.com/risingPhil/PokeMe64.git
synced 2026-04-18 13:07:28 -05:00
It doesn't look like much, but it's functional ;-) It can inject distribution pokémon into gen 1 and gen 2 original cartridges and inject the GS ball in Pokémon Crystal. That's it. But that was the minimal feature set I had in mind for the project. In the Readme.md you can find the ideas I have for expanding the project. But the first priority is the UI, because it really looks bad right now. (as I was mostly focused on building blocks and transfer pak functionality. Not on making it looks good)
63 lines
2.2 KiB
C
Executable File
63 lines
2.2 KiB
C
Executable File
#ifndef _SPRITE_H
|
|
#define _SPRITE_H
|
|
|
|
#include "core/common.h"
|
|
|
|
typedef struct sprite_s sprite_t;
|
|
|
|
|
|
/**
|
|
* The render mode of the sprite. We have NORMAL and NINESLICE
|
|
* NINESLICE is used to render and stretch a 9sliced image similar to 9slice images
|
|
* are/were used on the web. (for things like rounded corners or otherwise custom boxes)
|
|
*/
|
|
enum class SpriteRenderMode
|
|
{
|
|
NORMAL = 0,
|
|
NINESLICE
|
|
};
|
|
|
|
typedef struct SpriteRenderSettings
|
|
{
|
|
/*
|
|
* Indicates the render mode of the sprite
|
|
*
|
|
* If you use NINESLICE, you MUST specify a 9 slice rectangle in the srcRect field.
|
|
* Please refer to the comments there for more info.
|
|
*/
|
|
SpriteRenderMode renderMode;
|
|
|
|
/**
|
|
* Either a source region within the sprite that needs to be rendered if the SpriteRenderMode is set to NORMAL
|
|
* or a 9slice rectangle if the SpriteRenderMode is set to NINESLICE
|
|
*
|
|
* A 9slice rectangle is special because it is usually used to specify a box-like image with
|
|
* special corners/edges using an extremely small image.
|
|
*
|
|
* One typical use case for this is when you want to draw rounded corners.
|
|
*
|
|
* To specify a 9slice image, the x, y, width and height properties of srcRect have a different meaning:
|
|
* x -> the width of each corner on the left size of the image
|
|
* y -> the height of each corner on the left size of the image
|
|
* width -> the width of each corner on the right size of the image
|
|
* height -> the height of each corner on the right size of the image
|
|
*
|
|
* Our RDPQGraphics class will use these values to stretch a 9slice image according to the
|
|
* destination rectangle specified in RDPQGraphics::drawSprite().
|
|
* The corners will never get stretched, but the edges and middle portion will
|
|
*
|
|
* Note: because of the properties of a 9slice image, the image doesn't really need to be any bigger
|
|
* than the widths and heights of all corners combined + 1 pixel in each direction.
|
|
*
|
|
* For example: if my corners are all 6x6 pixels, then it suffices to create an image that is 13x13 pixels
|
|
* to render the box element.
|
|
*/
|
|
Rectangle srcRect;
|
|
|
|
/**
|
|
* @brief Rotation angle in radians
|
|
*/
|
|
float rotationAngle;
|
|
} SpriteRenderSettings;
|
|
|
|
#endif |