define {Int,Float}Rect in terms of offset and extent
This commit is contained in:
parent
eea6aa094c
commit
874da52127
3 changed files with 38 additions and 8 deletions
|
@ -72,6 +72,10 @@ enum {
|
|||
GAMEOVER_SCORE_DELAY = 60,
|
||||
};
|
||||
|
||||
#define VIEWPORT_OFFSET { VIEWPORT_X, VIEWPORT_Y }
|
||||
#define VIEWPORT_SIZE { VIEWPORT_W, VIEWPORT_H }
|
||||
#define VIEWPORT_RECT { VIEWPORT_X, VIEWPORT_Y, VIEWPORT_W, VIEWPORT_H }
|
||||
|
||||
typedef enum GameoverType {
|
||||
GAMEOVER_NONE,
|
||||
GAMEOVER_DEFEAT = 1,
|
||||
|
|
|
@ -11,18 +11,42 @@
|
|||
|
||||
#include "taisei.h"
|
||||
|
||||
typedef struct FloatOffset {
|
||||
float x, y;
|
||||
} FloatOffset;
|
||||
|
||||
typedef struct FloatExtent {
|
||||
float w, h;
|
||||
} FloatExtent;
|
||||
|
||||
typedef struct FloatRect {
|
||||
float x;
|
||||
float y;
|
||||
float w;
|
||||
float h;
|
||||
union {
|
||||
FloatOffset offset;
|
||||
struct { float x, y; };
|
||||
};
|
||||
union {
|
||||
FloatExtent extent;
|
||||
struct { float w, h; };
|
||||
};
|
||||
} FloatRect;
|
||||
|
||||
typedef struct IntOffset {
|
||||
int x, y;
|
||||
} IntOffset;
|
||||
|
||||
typedef struct IntExtent {
|
||||
int w, h;
|
||||
} IntExtent;
|
||||
|
||||
typedef struct IntRect {
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
union {
|
||||
IntOffset offset;
|
||||
struct { int x, y; };
|
||||
};
|
||||
union {
|
||||
IntExtent extent;
|
||||
struct { int w, h; };
|
||||
};
|
||||
} IntRect;
|
||||
|
||||
typedef struct Ellipse {
|
||||
|
|
|
@ -28,6 +28,8 @@ enum {
|
|||
SCREEN_H = 600,
|
||||
};
|
||||
|
||||
#define SCREEN_SIZE { SCREEN_W, SCREEN_H }
|
||||
|
||||
typedef struct VideoMode {
|
||||
int width;
|
||||
int height;
|
||||
|
|
Loading…
Reference in a new issue