void az_draw_bad_jungle_chomper( const az_baddie_t *baddie, float frozen, az_clock_t clock) { assert(baddie->kind == AZ_BAD_JUNGLE_CHOMPER); const float flare = baddie->armor_flare; const az_color_t center_color = az_color3f(0.75f - 0.75f * frozen, 1.0f - 0.5f * flare, frozen); const az_color_t side_color = az_color3f(0.15f + 0.4f * flare, 0.3f - 0.3f * flare, 0.4f * frozen); draw_stalk(baddie, 3, true, 1.0, false, center_color, side_color); draw_base(baddie, center_color, side_color, 0); draw_core(baddie, flare, frozen); draw_pincers(baddie, true, center_color, side_color); }
void az_draw_bad_fire_chomper( const az_baddie_t *baddie, float frozen, az_clock_t clock) { assert(baddie->kind == AZ_BAD_FIRE_CHOMPER); const float flare = baddie->armor_flare; const az_color_t center_color = az_color3f(0.8f - 0.7f * frozen, 0.3f + 0.2f * flare + 0.5f * frozen, 0.1f - 0.1f * flare + 0.9f * frozen); const az_color_t side_color = az_color3f(0.4f - 0.4f * frozen, 0.2f + 0.2f * flare + 0.4f * frozen, 0.1f - 0.1f * flare + 0.6f * frozen); draw_stalk(baddie, 3, false, 0.5, false, center_color, side_color); draw_base(baddie, center_color, side_color, 0); draw_core(baddie, flare, frozen); draw_pincers(baddie, true, center_color, side_color); }
void az_draw_bad_aquatic_chomper( const az_baddie_t *baddie, float frozen, az_clock_t clock) { assert(baddie->kind == AZ_BAD_AQUATIC_CHOMPER); const float flare = baddie->armor_flare; const az_color_t center_color = az_color3f(0.4f + 0.5f * flare, 0.3f - 0.2f * flare + 0.5f * frozen, 0.8f - 0.5f * flare); const az_color_t side_color = az_color3f(0.1f + 0.3f * flare, 0.2f - 0.2f * flare + 0.3f * frozen, 0.35f); draw_stalk(baddie, 3, false, 0.5, false, center_color, side_color); draw_base(baddie, center_color, side_color, 0); draw_core(baddie, flare, frozen); draw_pincers(baddie, false, center_color, side_color); }
static gboolean draw(GtkWidget* widget, cairo_t* cr, gpointer data) { /* TODO dibujar solo lo que ha cambiado */ /* Si es que es nulo no nos sirve */ if(!the_layout) return FALSE; /* Se cambia el numero de la pasada en la que vamos */ draw_count++; /* Set color for background */ cairo_set_source_rgb(cr, 27.0/255.0, 27.0/255.0, 47.0/255.0); /* Fill in the background color*/ cairo_paint(cr); /* Siempre se deben dibujar las celdas */ for(int i = 0; i < the_layout -> zone_count; i++) { draw_cell_border(cr, the_layout -> zones[i]); } for(int i = 0; i < the_layout -> core_count; i++) { draw_cell_border(cr, the_layout -> cores[i]); } /* Esto se debe dibujar siempre */ for(int i = 0; i < the_layout -> core_count; i++) { draw_core(cr, the_layout -> cores[i]); } /* Si se quiere dibujar el lado oculto del problema */ if(draw_inner) { for(int i = 0; i < the_layout -> zone_count; i++) { /* Necesariamente se van a dibujar los nodos */ draw_cell_nodes(cr, the_layout -> zones[i]); draw_raw_links(cr, the_layout -> zones[i]); } for(int i = 0; i < the_layout -> core_count; i++) { draw_raw_links(cr, the_layout -> cores[i]); } } /* Si se quiere dibujar el lado lindo del problema */ else { for(int i = 0; i < the_layout -> zone_count; i++) { draw_fancy_links(cr, the_layout -> zones[i]); } for(int i = 0; i < the_layout -> core_count; i++) { draw_fancy_links(cr, the_layout -> cores[i]); } } return TRUE; }