mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 20:45:29 +00:00
Use sdl_blit instead of custom blitting function (blit_surface) in editor
This commit is contained in:
parent
00b2715460
commit
67348181f5
@ -172,12 +172,12 @@ void mouse_action::set_terrain_mouse_overlay(editor_display& disp, const t_trans
|
||||
// Blit left side
|
||||
image_fg = scale_surface(image_fg, new_size, new_size);
|
||||
SDL_Rect rcDestLeft = sdl::create_rect(offset, quarter_size, 0, 0);
|
||||
blit_surface ( image_fg, nullptr, image, &rcDestLeft );
|
||||
sdl_blit( image_fg, nullptr, image, &rcDestLeft );
|
||||
|
||||
// Blit right side
|
||||
image_bg = scale_surface(image_bg, new_size, new_size);
|
||||
SDL_Rect rcDestRight = sdl::create_rect(half_size, quarter_size, 0, 0);
|
||||
blit_surface ( image_bg, nullptr, image, &rcDestRight );
|
||||
sdl_blit( image_bg, nullptr, image, &rcDestRight );
|
||||
|
||||
//apply mask so the overlay is contained within the mouseover hex
|
||||
image = mask_surface(image, image::get_hexmask());
|
||||
@ -337,7 +337,7 @@ void mouse_action_paste::set_mouse_overlay(editor_display& disp)
|
||||
surface image = create_neutral_surface(72,72);
|
||||
|
||||
SDL_Rect r = sdl::create_rect(6, 6, 0, 0);
|
||||
blit_surface(image60, nullptr, image, &r);
|
||||
sdl_blit(image60, nullptr, image, &r);
|
||||
|
||||
Uint8 alpha = 196;
|
||||
int size = image->w;
|
||||
@ -455,7 +455,7 @@ void mouse_action_starting_position::set_mouse_overlay(editor_display& disp)
|
||||
surface image = create_neutral_surface(72,72);
|
||||
|
||||
SDL_Rect r = sdl::create_rect(6, 6, 0, 0);
|
||||
blit_surface(image60, nullptr, image, &r);
|
||||
sdl_blit(image60, nullptr, image, &r);
|
||||
|
||||
Uint8 alpha = 196;
|
||||
int size = image->w;
|
||||
|
@ -45,7 +45,7 @@ void mouse_action_village::set_mouse_overlay(editor_display& disp)
|
||||
surface image = create_neutral_surface(72,72);
|
||||
|
||||
SDL_Rect r = sdl::create_rect(6, 6, 0, 0);
|
||||
blit_surface(image60, nullptr, image, &r);
|
||||
sdl_blit(image60, nullptr, image, &r);
|
||||
|
||||
Uint8 alpha = 196;
|
||||
int size = image->w;
|
||||
|
@ -237,17 +237,16 @@ void tristate_button::draw_contents() {
|
||||
scalled_item.assign(scale_surface(itemImage_,
|
||||
36, 36));
|
||||
|
||||
// blit_surface want neutral surfaces
|
||||
surface nitem = make_neutral_surface(scalled_item);
|
||||
surface nbase = make_neutral_surface(base);
|
||||
|
||||
//TODO avoid magic numbers
|
||||
SDL_Rect r = sdl::create_rect(1, 1, 0, 0);
|
||||
blit_surface(nitem, nullptr, nbase, &r);
|
||||
sdl_blit(nitem, nullptr, nbase, &r);
|
||||
|
||||
if (!overlay.null()) {
|
||||
surface noverlay = make_neutral_surface(overlay);
|
||||
blit_surface(noverlay, nullptr, nbase, nullptr);
|
||||
sdl_blit(noverlay, nullptr, nbase, nullptr);
|
||||
}
|
||||
|
||||
// TODO for later reference
|
||||
|
Loading…
x
Reference in New Issue
Block a user