static void convert_row( unsigned char *out_buf, const DCELL *raster, int ncols, int is_fp, int bytes, int swap_flag, double null_val) { unsigned char *ptr = out_buf; int i; for (i = 0; i < ncols; i++) { DCELL x = Rast_is_d_null_value(&raster[i]) ? null_val : raster[i]; convert_cell(ptr, x, is_fp, bytes, swap_flag); ptr += bytes; } }
static void print_deplacement_expulse(t_player *player, t_player *expulsed) { char buf[32]; int cell; if (expulsed->x == player->x && expulsed->y == player->y) cell = 0; else if (expulsed->x == player->x) cell = expulsed->y == (player->y + 1) % g_zappy->height ? 5 : 1; else cell = expulsed->x == (player->x + 1) % g_zappy->width ? 7 : 3; cell = convert_cell(expulsed, cell); snprintf(buf, sizeof(buf), "deplacement: %d\n", cell); send_message(expulsed, buf); graphic_auto_ppo(expulsed); }