Changeset 26 for trunk/Classes/attack_prediction_display.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/attack_prediction_display.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/attack_prediction_display.cpp
r4 r26 107 107 defender_hp_distrib_width_, defender_hp_distrib_height_); 108 108 hp_distribs_height_ = std::max<int>(attacker_hp_distrib_height_, defender_hp_distrib_height_); 109 109 110 110 // Build the strings and compute the layout. 111 111 std::stringstream str; … … 269 269 270 270 // Unscathed probability. 271 left_strings.push_back(_("Chance of being unscathed")); 271 //left_strings.push_back(_("Chance of being unscathed")); 272 left_strings.push_back(_("Unhit chance")); 272 273 format_prob(str_buf, u_unscathed); 273 274 right_strings.push_back(str_buf); … … 348 349 surface& hp_distrib, int hp_distrib_width) 349 350 { 350 // KP: this screen is not used on iPhone... 351 /* 352 surface screen = disp_.get_screen_surface(); 351 //surface screen = disp_.get_screen_surface(); 353 352 int i; 354 353 … … 368 367 369 368 // Draw unit label. 370 font::draw_text_line(screen, clip_rect, font::SIZE_15, font::NORMAL_COLOUR, label, 371 clip_rect.x + x_off + (units_width_ - label_width) / 2, clip_rect.y + y_off, 0, TTF_STYLE_BOLD); 372 369 // font::draw_text_line(screen, clip_rect, font::SIZE_15, font::NORMAL_COLOUR, label, 370 // clip_rect.x + x_off + (units_width_ - label_width) / 2, clip_rect.y + y_off, 0, TTF_STYLE_BOLD); 371 372 font::draw_text(&video(), clip_rect, font::SIZE_15, font::NORMAL_COLOUR, label, 373 clip_rect.x + x_off + (units_width_ - label_width) / 2, clip_rect.y + y_off); 374 373 375 y_off += 24; 374 376 375 377 // Draw unit left and right strings except the last two (total damage and unscathed probability). 376 378 for(i = 0; i < static_cast<int>(left_strings.size()) - 2; i++) { 377 font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_strings[i], 378 clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 379 0, TTF_STYLE_NORMAL); 380 381 font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_strings[i], 382 clip_rect.x + x_off + left_strings_width + inter_column_gap_, 383 clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 0, TTF_STYLE_NORMAL); 379 //font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_strings[i], 380 // clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 381 // 0, TTF_STYLE_NORMAL); 382 font::draw_text(&video(), clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_strings[i], 383 clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i); 384 385 //font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_strings[i], 386 // clip_rect.x + x_off + left_strings_width + inter_column_gap_, 387 // clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 0, TTF_STYLE_NORMAL); 388 font::draw_text(&video(), clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_strings[i], 389 clip_rect.x + x_off + left_strings_width + inter_column_gap_, 390 clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i); 384 391 } 385 392 … … 392 399 const std::string& right_string = right_strings[right_strings.size() - 2 + i]; 393 400 394 font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_string, 395 clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 396 0, TTF_STYLE_NORMAL); 397 398 font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_string, 399 clip_rect.x + x_off + left_strings_width + inter_column_gap_, 400 clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 0, TTF_STYLE_NORMAL); 401 //font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_string, 402 // clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 403 // 0, TTF_STYLE_NORMAL); 404 font::draw_text(&video(), clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, left_string, 405 clip_rect.x + x_off, clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i); 406 407 //font::draw_text_line(screen, clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_string, 408 // clip_rect.x + x_off + left_strings_width + inter_column_gap_, 409 // clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i, 0, TTF_STYLE_NORMAL); 410 font::draw_text(&video(), clip_rect, font::SIZE_NORMAL, font::NORMAL_COLOUR, right_string, 411 clip_rect.x + x_off + left_strings_width + inter_column_gap_, 412 clip_rect.y + y_off + (font::SIZE_NORMAL + inter_line_gap_) * i); 413 401 414 } 402 415 … … 404 417 405 418 // Draw hitpoints distribution string. 406 font::draw_text( screen, clip_rect, font::SIZE_SMALL, font::NORMAL_COLOUR, hp_distrib_string_,419 font::draw_text(&video(), clip_rect, font::SIZE_SMALL, font::NORMAL_COLOUR, hp_distrib_string_, 407 420 clip_rect.x + x_off + (units_width_ - hp_distrib_string_width_) / 2, clip_rect.y + y_off); 408 421 … … 410 423 411 424 // Draw hitpoints distributions. 412 video().blit_surface(clip_rect.x + x_off + (units_width_ - hp_distrib_width) / 2, clip_rect.y + y_off, hp_distrib);413 */ 425 //video().blit_surface(clip_rect.x + x_off + (units_width_ - hp_distrib_width) / 2, clip_rect.y + y_off, hp_distrib); 426 blit_surface(clip_rect.x + x_off + (units_width_ - hp_distrib_width) / 2, clip_rect.y + y_off, hp_distrib); 414 427 } 415 428
Note: See TracChangeset
for help on using the changeset viewer.