Skip to content

Commit

Permalink
Port callers
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytheway committed Apr 28, 2020
1 parent 720ad83 commit becc280
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1647,8 +1647,9 @@ static bool mx_portal_in( map &m, const tripoint &abs_sub )
m.add_field( portal_location, fd_fatigue, 3 );

std::set<point> ignited;
place_fumarole( m, x1, y1, x2, y2, ignited );
place_fumarole( m, x1 + x_extra, y1 + y_extra, x2 + x_extra, y2 + y_extra, ignited );
place_fumarole( m, point( x1, y1 ), point( x2, y2 ), ignited );
place_fumarole( m, point( x1 + x_extra, y1 + y_extra ), point( x2 + x_extra, y2 + y_extra ),
ignited );

for( auto &i : ignited ) {
// Don't need to do anything to tiles that already have lava on them
Expand Down
4 changes: 2 additions & 2 deletions src/pixel_minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void pixel_minimap::flush_cache_updates()

if( pixel_size.x == 1 && pixel_size.y == 1 ) {
SetRenderDrawColor( renderer, tile_color.r, tile_color.g, tile_color.b, tile_color.a );
RenderDrawPoint( renderer, tile_pos.x, tile_pos.y );
RenderDrawPoint( renderer, tile_pos );
} else {
const SDL_Rect rect = SDL_Rect{ tile_pos.x, tile_pos.y, pixel_size.x, pixel_size.y };
render_fill_rect( renderer, rect, tile_color.r, tile_color.g, tile_color.b );
Expand Down Expand Up @@ -551,7 +551,7 @@ void pixel_minimap::draw_beacon( const SDL_Rect &rect, const SDL_Color &color )
const int divisor = 2 * ( std::abs( y ) == rect.h - std::abs( x ) ? 1 : 0 ) + 1;

SetRenderDrawColor( renderer, color.r / divisor, color.g / divisor, color.b / divisor, 0xFF );
RenderDrawPoint( renderer, rect.x + x, rect.y + y );
RenderDrawPoint( renderer, point( rect.x + x, rect.y + y ) );
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ static void invalidate_framebuffer_proportion( cata_cursesport::WINDOW *win )
const int mapfont_y2 = std::min( termpixel_y2 / map_font->fontheight, oversized_height - 1 );
const int mapfont_width = mapfont_x2 - mapfont_x + 1;
const int mapfont_height = mapfont_y2 - mapfont_y + 1;
invalidate_framebuffer( oversized_framebuffer, mapfont_x, mapfont_y, mapfont_width,
invalidate_framebuffer( oversized_framebuffer, point( mapfont_x, mapfont_y ), mapfont_width,
mapfont_height );
}

Expand All @@ -1082,7 +1082,8 @@ static void invalidate_framebuffer_proportion( cata_cursesport::WINDOW *win )
oversized_height - 1 );
const int overmapfont_width = overmapfont_x2 - overmapfont_x + 1;
const int overmapfont_height = overmapfont_y2 - overmapfont_y + 1;
invalidate_framebuffer( oversized_framebuffer, overmapfont_x, overmapfont_y, overmapfont_width,
invalidate_framebuffer( oversized_framebuffer, point( overmapfont_x, overmapfont_y ),
overmapfont_width,
overmapfont_height );
}
}
Expand Down Expand Up @@ -1196,7 +1197,7 @@ void cata_cursesport::curses_drawwindow( const catacurses::window &w )
x_offset = width;
}

invalidate_framebuffer( terminal_framebuffer, win->pos.x, win->pos.y,
invalidate_framebuffer( terminal_framebuffer, win->pos,
TERRAIN_WINDOW_TERM_WIDTH, TERRAIN_WINDOW_TERM_HEIGHT );

update = true;
Expand Down Expand Up @@ -1235,7 +1236,7 @@ void cata_cursesport::curses_drawwindow( const catacurses::window &w )
// The offset must not use the global font, but the map font
int offsetx = win->pos.x * map_font->fontwidth;
int offsety = win->pos.y * map_font->fontheight;
update = map_font->draw_window( w, offsetx, offsety );
update = map_font->draw_window( w, point( offsetx, offsety ) );
} else if( g && w == g->w_blackspace ) {
// fill-in black space window skips draw code
// so as not to confuse framebuffer any more than necessary
Expand Down Expand Up @@ -1273,7 +1274,7 @@ bool Font::draw_window( const catacurses::window &w )
cata_cursesport::WINDOW *const win = w.get<cata_cursesport::WINDOW>();
// Use global font sizes here to make this independent of the
// font used for this window.
return draw_window( w, win->pos.x * ::fontwidth, win->pos.y * ::fontheight );
return draw_window( w, point( win->pos.x * ::fontwidth, win->pos.y * ::fontheight ) );
}

bool Font::draw_window( const catacurses::window &w, const int offsetx, const int offsety )
Expand Down

0 comments on commit becc280

Please sign in to comment.