コード例 #1
0
void actors_draw(Actors * self) {
    for (int y = 0; y < self->h; y += 1) {
        for (int x = 0; x < self->w; x += 1) {
            Item * i = self->tilemap[x + self->w * y] .item;
            if (i) {
                item_draw_shadow(i);
            }
            LandArray * arr = self->tilemap[x + self->w * y] .actors;
            if (arr) {
                {LandArrayIterator __iter0__ = LandArrayIterator_first(arr) ; for (Actor * a = LandArrayIterator_item(arr, & __iter0__) ; LandArrayIterator_next(arr, & __iter0__) ; a = LandArrayIterator_item(arr, & __iter0__)) {
                    actor_draw_shadow(a);
                }
                }
            }
        }
    }
    for (int y = 0; y < self->h; y += 1) {
        for (int x = 0; x < self->w; x += 1) {
            Item * i = self->tilemap[x + self->w * y] .item;
            if (i) {
                item_draw(i);
            }
            LandArray * arr = self->tilemap[x + self->w * y] .actors;
            if (arr) {
                {LandArrayIterator __iter1__ = LandArrayIterator_first(arr) ; for (Actor * a = LandArrayIterator_item(arr, & __iter1__) ; LandArrayIterator_next(arr, & __iter1__) ; a = LandArrayIterator_item(arr, & __iter1__)) {
                    actor_draw(a);
                }
                }
            }
        }
    }
}
コード例 #2
0
ファイル: main.c プロジェクト: bsurmanski/GGJ2012
void draw(void)
{
    SDL_FillRect(scaled, 0, SDL_MapRGB(scaled->format, 0, 0, 0));
    if(title){
        upscaleCopy(scaled, titlesurf, 2);
    } else {
        SDL_FillRect(s, 0, SDL_MapRGB(s->format, 0, 0, 0));
        if (SDL_MUSTLOCK(s)) SDL_LockSurface(s);
        planet_draw(s);
        particle_draw(s);
        if (SDL_MUSTLOCK(s)) SDL_UnlockSurface(s);
        actor_draw(player, s);
        upscaleCopy(scaled, s, 2);
    }
}