Ignore:
Timestamp:
2010-05-28 07:39:52 (2 years ago)
Author:
kpoole
Message:

Episode 5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Classes/attack_prediction_display.cpp

    r4 r26  
    107107                       defender_hp_distrib_width_, defender_hp_distrib_height_); 
    108108    hp_distribs_height_ = std::max<int>(attacker_hp_distrib_height_, defender_hp_distrib_height_); 
    109  
     109     
    110110    // Build the strings and compute the layout. 
    111111    std::stringstream str; 
     
    269269 
    270270    // 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")); 
    272273    format_prob(str_buf, u_unscathed); 
    273274    right_strings.push_back(str_buf); 
     
    348349                                       surface& hp_distrib, int hp_distrib_width) 
    349350{ 
    350     // KP: this screen is not used on iPhone... 
    351 /*   
    352     surface screen = disp_.get_screen_surface(); 
     351    //surface screen = disp_.get_screen_surface(); 
    353352    int i; 
    354353 
     
    368367 
    369368    // 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     
    373375    y_off += 24; 
    374376 
    375377    // Draw unit left and right strings except the last two (total damage and unscathed probability). 
    376378    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); 
    384391    } 
    385392 
     
    392399        const std::string& right_string = right_strings[right_strings.size() - 2 + i]; 
    393400 
    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                         
    401414    } 
    402415 
     
    404417 
    405418    // 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_, 
    407420                    clip_rect.x + x_off + (units_width_ - hp_distrib_string_width_) / 2, clip_rect.y + y_off); 
    408421 
     
    410423 
    411424    // 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); 
    414427} 
    415428 
Note: See TracChangeset for help on using the changeset viewer.