Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
is_on_screen.inc.c
Go to the documentation of this file.
1/* Whether the rectangle (x, y, w, h) is in the view of the map's layer */
2s32 isOnScreen(s32 x, s32 y, s32 w, s32 h) {
3 RECT rect;
4 struct Layer *layer = GFX.funcs.getLayer(FIELD_LAYER_MAP);
5
6 layer->getViewRect(layer, &rect);
7 if (x + w < rect.x) {
8 return 0;
9 }
10 if (rect.x + rect.w < x) {
11 return 0;
12 }
13 if (y + h < rect.y) {
14 return 0;
15 }
16 return rect.y + rect.h >= y;
17}
signed int s32
Definition common.h:11
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
#define FIELD_LAYER_MAP
the map, its objects and characters, and the menus
Definition field_map.h:20
s32 isOnScreen(s32 x, s32 y, s32 w, s32 h)
Whether the rectangle (x, y, w, h) is in the view of the map's layer.
struct Layer *(* getLayer)(s32 id)
Definition gfx.h:28
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* getViewRect)()
Definition gfx.h:151