Project

General

Profile

Revision 138

input checkers

View differences:

sprite.c
44 44
void sprite_draw(const sprite_t *p){
45 45
    for (int i = 0; i < p->w; i++) {
46 46
        for (int j = 0; j < p->h; j++) {
47
            set_pixel(p->x + i, p->y + j, p->map[i + j * p->w]);
47
            if (p->x + i < get_XRes() && p->y + j < get_YRes()) {
48
                set_pixel(p->x + i, p->y + j, p->map[i + j * p->w]);
49
            }
48 50
        }
49 51
    }
50 52
}

Also available in: Unified diff