Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary cleanup of mapview_common #1169

Merged
merged 22 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/include/mapview_g.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void dirty_rect(int canvas_x, int canvas_y, int pixel_width,
int pixel_height);
void dirty_all(void);
void flush_dirty(void);
void gui_flush(void);

void update_map_canvas_scrollbars(void);

Expand Down
9 changes: 1 addition & 8 deletions client/mapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,21 +528,14 @@ void flush_dirty()
} else {
for (int i = 0; i < num_dirty_rects; i++) {
mapview->repaint(dirty_rects[i].x() * mapview->scale(),
dirty_rects[i].y() * mapview->scale(),
dirty_rects[i].y() * mapview->scale(),
dirty_rects[i].width() * mapview->scale(),
dirty_rects[i].height() * mapview->scale());
}
}
num_dirty_rects = 0;
}

/**
Do any necessary synchronization to make sure the screen is up-to-date.
The canvas should have already been flushed to screen via flush_dirty -
all this function does is make sure the hardware has caught up.
*/
void gui_flush(void) { queen()->mapview_wdg->update(); }

/**
Update (refresh) the locations of the mapview scrollbars (if it uses
them).
Expand Down
5 changes: 0 additions & 5 deletions client/mapview_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ void set_mapview_origin(float gui_x0, float gui_y0)
base_set_mapview_origin(start_x + diff_x * (mytime / timing_sec),
start_y + diff_y * (mytime / timing_sec));
flush_dirty();
gui_flush();
frames++;
} while (currtime < timing_sec);

Expand Down Expand Up @@ -1122,7 +1121,6 @@ void put_nuke_mushroom_pixmaps(struct tile *ptile)
dirty_rect(canvas_x, canvas_y, mysprite->width(), mysprite->height());

flush_dirty();
gui_flush();

fc_usleep(1000000);

Expand Down Expand Up @@ -1650,7 +1648,6 @@ void decrease_unit_hp_smooth(struct unit *punit0, int hp0,
}

unqueue_mapview_updates(true);
gui_flush();
lmoureaux marked this conversation as resolved.
Show resolved Hide resolved
anim_delay(gui_options.smooth_combat_step_msec);
}

Expand Down Expand Up @@ -1683,7 +1680,6 @@ void decrease_unit_hp_smooth(struct unit *punit0, int hp0,
tileset_tile_height(tileset));

flush_dirty();
gui_flush();
anim_delay(gui_options.smooth_combat_step_msec);
}
}
Expand Down Expand Up @@ -1769,7 +1765,6 @@ void move_unit_map_canvas(struct unit *punit, struct tile *src_tile, int dx,

// Flush.
flush_dirty();
gui_flush();

// Restore the backup. It won't take effect until the next flush.
p.begin(mapview.store);
Expand Down