Ejemplo n.º 1
0
void SpellView::Display(bool full_redraw)
{
 if(full_redraw || update_display)
   {
    screen->fill(bg_color, area.x, area.y + NEWMAGIC_BMP_H, area.w, area.h - NEWMAGIC_BMP_H);

    screen->blit(area.x, area.y, background->get_data(), 8,  NEWMAGIC_BMP_W, NEWMAGIC_BMP_H, NEWMAGIC_BMP_W, true);
   }

 display_level_text();
 display_spell_list_text();

 DisplayChildren(full_redraw);
#if 1 // FIXME: This shouldn't need to be in the loop
 update_buttons(); // It doesn't seem to hurt speed though
 screen->update(area.x, area.y, area.w, area.h);
#else
 if(full_redraw || update_display)
   {
    update_display = false;
    screen->update(area.x, area.y, area.w, area.h);
   }
#endif
 return;
}
Ejemplo n.º 2
0
void ActorView::Display(bool full_redraw)
{

 if(portrait_data != NULL && (full_redraw || update_display || Game::get_game()->is_original_plus_full_map()))
  {
   update_display = false;
   if(MD)
   {
     fill_md_background(area);
     screen->blit(area.x+1,area.y+16,portrait_data,8,portrait->get_portrait_width(),portrait->get_portrait_height(),portrait->get_portrait_width(), true);
   }
   else
   {
     screen->fill(bg_color, area.x, area.y, area.w, area.h);
     screen->blit(area.x,area.y+8,portrait_data,8,portrait->get_portrait_width(),portrait->get_portrait_height(),portrait->get_portrait_width(), false);
   }
   display_name();
   display_actor_stats();
   DisplayChildren(); //draw buttons
   screen->update(area.x, area.y, area.w, area.h);
  }

 if(show_cursor && cursor_tile != NULL)
  {
   screen->blit(cursor_pos.px, cursor_pos.py, (unsigned char *)cursor_tile->data,
                8, 16, 16, 16, true, NULL);
   screen->update(cursor_pos.px, cursor_pos.py, 16, 16);
  }

}
Ejemplo n.º 3
0
void SignViewGump::Display(bool full_redraw)
{
 SDL_Rect dst;
 dst = area;
 SDL_BlitSurface(bg_image, NULL, surface, &dst);

 DisplayChildren(full_redraw);

 //font->TextOut(screen->get_sdl_surface(), area.x + 29, area.y + 6, "This is a test sign");

 font->drawString(screen, sign_text, strlen(sign_text), area.x + (area.w - font->getStringWidth(sign_text)) / 2, area.y + (area.h - 19) / 2, 0, 0);
 update_display = false;
 screen->update(area.x, area.y, area.w, area.h);


 return;
}
Ejemplo n.º 4
0
void ContainerViewGump::Display(bool full_redraw)
{
 //display_level_text();
 //display_spell_list_text();
 SDL_Rect dst;
 dst = area;
 SDL_BlitSurface(bg_image, NULL, surface, &dst);

 DisplayChildren(full_redraw);

 if(actor)
 {
	 font->drawString(screen, actor->get_name(), area.x + 18, area.y + 2, 15, 15);
	 display_inventory_weight();
 }
 update_display = false;
 screen->update(area.x, area.y, area.w, area.h);

 return;
}
Ejemplo n.º 5
0
/* Show the widget  */
void GUI_ScrollBar::Display(bool full_redraw)
{
 SDL_Rect framerect;
 // SDL_Rect src, dst;

 if(slider_y > 0)
   {
    framerect.x = area.x;
    framerect.y = area.y + button_height;
    framerect.w = SCROLLBAR_WIDTH;
    framerect.h = slider_y;
    SDL_FillRect(surface, &framerect, track_base_c);

    // Draw Border
    framerect.x = area.x;
    framerect.y = area.y + button_height;
    framerect.w = SCROLLBAR_WIDTH;
    framerect.h = 1;
    SDL_FillRect(surface, &framerect, track_border_c);

    framerect.x = area.x;
    framerect.y = area.y + button_height;
    framerect.w = 1;
    framerect.h = slider_y;
    SDL_FillRect(surface, &framerect, track_border_c);

    framerect.x = area.x + SCROLLBAR_WIDTH - 1;
    framerect.y = area.y + button_height;
    framerect.w = 1;
    framerect.h = slider_y;
    SDL_FillRect(surface, &framerect, track_border_c);

   }

 DisplaySlider();

 if(slider_y + slider_length < track_length)
   {
    framerect.x = area.x;
    framerect.y = area.y + button_height + slider_y + slider_length;
    framerect.w = SCROLLBAR_WIDTH;
    framerect.h = track_length - (slider_y + slider_length);
    SDL_FillRect(surface, &framerect, track_base_c);

    // Draw Border
    framerect.x = area.x;
    framerect.y = area.y + area.h - button_height - 1;
    framerect.w = SCROLLBAR_WIDTH;
    framerect.h = 1;
    SDL_FillRect(surface, &framerect, track_border_c);

    framerect.x = area.x;
    framerect.y = area.y + button_height + slider_y + slider_length;
    framerect.w = 1;
    framerect.h = track_length - slider_y - slider_length;
    SDL_FillRect(surface, &framerect, track_border_c);

    framerect.x = area.x + SCROLLBAR_WIDTH - 1;
    framerect.y = area.y + button_height + slider_y + slider_length;
    framerect.w = 1;
    framerect.h = track_length - slider_y - slider_length;
    SDL_FillRect(surface, &framerect, track_border_c);

   }

 DisplayChildren();

 screen->update(area.x,area.y,area.w,area.h);

 return;
}