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); } } } } } }
void scene_render_game(Uint32 delta) { background_draw(3, delta); world_draw(delta); player_draw(delta); enemy_draw(); item_draw(); bullet_draw(); player_life_draw(); world_life_draw(); }
static void game_draw_items(struct s_rend *rend, const struct s_vary *vary, const float *bill_M, float t) { int hi; int type = ITEM_NONE; int value = 0; sol_color_mtrl(rend, 1); { for (hi = 0; hi < vary->hc; hi++) { struct v_item *hp = &vary->hv[hi]; /* Skip picked up items. */ if (hp->t == ITEM_NONE) continue; /* Lazily update color. */ if (hp->t != type || hp->n != value) { float c[4]; item_color(hp, c); glColor4f(c[0], c[1], c[2], c[3]); type = hp->t; value = hp->n; } /* Draw model. */ glPushMatrix(); { glTranslatef(hp->p[0], hp->p[1], hp->p[2]); item_draw(rend, hp, bill_M, t); } glPopMatrix(); } } glColor4f(1.0f, 1.0f, 1.0f, 1.0f); sol_color_mtrl(rend, 0); }
void HUD_draw(struct icmmGame* game, float dt) { item_draw(game->player->items->elem, dt); //glColor3f(1.0f, 0.0f, 0.0f, 1.0f); }