fixed bug where very large dialogs could crash the game
This commit is contained in:
parent
f6a871e909
commit
7a85a6f35b
2 changed files with 4 additions and 6 deletions
|
@ -432,15 +432,14 @@ void turn_info::left_click(const SDL_MouseButtonEvent& event)
|
|||
stats.range : lang_range;
|
||||
|
||||
std::stringstream att;
|
||||
att << "&" << stats.attack_icon << "," << attack_name << " (" << attack_type
|
||||
<< ") " << stats.damage_defender_takes << "-"
|
||||
att << "&" << stats.attack_icon << "," << attack_name
|
||||
<< " " << stats.damage_defender_takes << "-"
|
||||
<< stats.nattacks << " " << range << " "
|
||||
<< stats.chance_to_hit_defender
|
||||
<< "%";
|
||||
|
||||
att << "," << string_table["versus"] << ",";
|
||||
att << defend_name << " (" << defend_type
|
||||
<< ") " << stats.damage_attacker_takes << "-"
|
||||
att << defend_name << " " << stats.damage_attacker_takes << "-"
|
||||
<< stats.ndefends << " "
|
||||
<< stats.chance_to_hit_attacker
|
||||
<< "%,&" << stats.defend_icon;
|
||||
|
|
|
@ -351,8 +351,7 @@ void menu::draw_item(int item)
|
|||
const std::string image_name(str.begin()+1,str.end());
|
||||
SDL_Surface* const img = image::get_image(image_name,image::UNSCALED);
|
||||
if(img != NULL && xpos+img->w < display_->x() && rect.y+img->h < display_->y()) {
|
||||
SDL_Rect dest = {xpos,rect.y,img->w,img->h};
|
||||
SDL_BlitSurface(img,NULL,display_->video().getSurface(),&dest);
|
||||
display_->blit_surface(xpos,rect.y,img);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue