Code: Show/Hide local void PlayerAction(Player *p, int action, Arena *arena) { if (action == PA_ENTERGAME) { Region *test = md->FindRegionByName(arena,"testRegion"); Region *over = md->FindRegionByName(arena,"overlappingRegion"); int x = 0; int y = 0; if (test && over) { if (md->Contains(test,x,y)) { printf("point is in the test region.\n"); } else { printf("point is NOT in the test region\n"); } if (md->Contains(over,x,y)) { printf("point is in the overlapping region.\n"); } else { printf("point is NOT in the overlapping region\n"); } } else printf("one of our regions is null\n"); } } |
Quote: |
point is NOT in the test region
point is in the overlapping region. |
Quote: |
static inline unsigned char lookup_sparse(sparse_arr c_3, int x, int y)
{ sparse_chunk_2_t *c_2 = (*c_3)[(x>>5)&31][(y>>5)&31]; if (c_2) { sparse_chunk_1_t *c_1 = (*c_2)[(x>>3)&3][(y>>3)&3]; if (c_1) { return (*c_1)[(x>>0)&7][(y>>0)&7]; } else return 0x00; } else return 0x00; } |
Quote: |
point is NOT in the test region
point is in the overlapping region |