This WIP patch prefixes all functions declared in simgraph.h with "simgraph_" and groups similar functions together.
This is mostly for consistency, but also to make it immediately obvious where a function is defined (for example
vs.
).
The patch is too large to attach here, but is availble here (https://github.com/aburch/simutrans/compare/aburch:master...ceeac:simgraph.diff).
To make reviewing and discussing these changes easier, I made a table containing all old and new function names. Let me know what you think. :)
| Group | New name | Old name | Remarks |
| | | |
| General | simgraph_init | simgraph_init | Now returns bool to signal success/failure |
| simgraph_exit | simgraph_exit | |
| simgraph_is_display_init | is_display_init | |
| simgraph_resize | simgraph_resize | |
| simgraph_get_display_width | display_get_width | |
| simgraph_get_display_height | display_get_height | |
| simgraph_set_display_height | display_set_height | |
| simgraph_set_display_actualwidth | display_set_actual_width | |
| simgraph_zoom_in | zoom_factor_up | |
| simgraph_zoom_out | zoom_factor_down | |
| simgraph_get_tile_raster_width | get_tile_raster_width | |
| simgraph_get_current_tile_raster_width | get_current_tile_raster_width | |
| simgraph_get_base_tile_raster_width | get_base_tile_raster_width | |
| simgraph_set_base_raster_width | display_set_base_raster_width | |
| simgraph_take_screenshot | display_snapshot | |
| simgraph_flush_buffer | display_flush_buffer | |
| simgraph_set_show_pointer | display_show_pointer | Now takes a parameter of type bool |
| simgraph_set_pointer_image | display_set_pointer | Only used with USE_SOFTPOINTER |
| simgraph_set_show_load_pointer | display_show_load_pointer | Now takes a parameter of type bool |
| | | |
| Text | simgraph_load_font | display_load_font | |
| simgraph_get_char_width | display_get_char_width | |
| simgraph_font_has_character | has_character | |
| simgraph_get_next_char | get_next_char | |
| simgraph_get_prev_char | get_prev_char | |
| simgraph_get_next_char_with_metrics | get_next_char_with_metrics | |
| simgraph_get_prev_char_with_metrics | get_prev_char_with_metrics | |
| simgraph_get_widest_char | display_get_char_max_width | |
| simgraph_get_text_fit | display_fit_proportional | |
| simgraph_get_text_width | proportional_string_width | |
| simgraph_calc_multiline_text_size | display_calc_proportional_multiline_string_len_width | Now returns scr_size |
| simgraph_draw_text_rgb | display_proportional_rgb | |
| simgraph_draw_text_clip_rgb | display_proportional_clip_rgb | |
| simgraph_draw_multiline_text_rgb | display_multiline_text_rgb | |
| simgraph_draw_text_ellipsis_rgb | display_proportional_ellipsis_rgb | |
| simgraph_draw_textbox3d_clip_rgb | display_ddd_proportional_clip | |
| simgraph_draw_text_outlined_rgb | display_outline_proportional_rgb | |
| simgraph_draw_text_shadowed_rgb | display_shadow_proportional_rgb | |
| | | |
| Colors | simgraph_color_idx_to_rgb | color_idx_to_rgb | |
| simgraph_color_rgb_to_idx | color_rgb_to_idx | |
| simgraph_get_color_rgb | get_color_rgb | |
| simgraph_env_t_rgb_to_system_colors | env_t_rgb_to_system_colors | |
| simgraph_set_player_color_scheme | display_set_player_color_scheme | |
| simgraph_set_daynight_lights | n/a | new function; replaces direct access of display_day_lights & display_night_lights; COLOUR_DEPTH != 0 only |
| simgraph_update_day_night_shift | display_day_night_shift | COLOUR_DEPTH != 0 only |
| | | |
| Clip | simgraph_add_poly_clip | add_poly_clip | |
| simgraph_clear_all_poly_clip | clear_all_poly_clip | |
| simgraph_activate_ribi_clip | activate_ribi_clip | |
| simgraph_set_clip_wh | display_set_clip_wh | |
| simgraph_get_clip_wh | display_get_clip_wh | |
| simgraph_push_clip_wh | display_push_clip_wh | |
| simgraph_swap_clip_wh | display_swap_clip_wh | |
| simgraph_pop_clip_wh | display_pop_clip_wh | |
| | | |
| Images | simgraph_get_image_count | get_image_count | |
| simgraph_register_image | register_image | |
| simgraph_free_all_images_above | display_free_all_images_above | |
| simgraph_get_base_image_offset | display_get_base_image_offset | |
| simgraph_get_image_offset | display_get_image_offset | |
| simgraph_fit_img_to_width | display_fit_img_to_width | |
| | | |
| Dirty | simgraph_mark_img_dirty | display_mark_img_dirty | |
| simgraph_mark_rect_dirty_wc | mark_rect_dirty_wc | |
| simgraph_mark_rect_dirty_clip | mark_rect_dirty_clip | |
| simgraph_mark_screen_dirty | mark_screen_dirty | |
| | | |
| Drawing | simgraph_draw_scroll_band | display_scroll_band | |
| simgraph_draw_img_aligned | display_img_aligned | |
| simgraph_draw_img_aux | display_img_aux | |
| simgraph_draw_rezoomed_img_blend | display_rezoomed_img_blend | |
| simgraph_draw_img_blend | display_img_blend | |
| simgraph_draw_rezoomed_img_alpha | display_rezoomed_img_alpha | |
| simgraph_draw_img_alpha | display_img_alpha | |
| simgraph_draw_color_img | display_color_img | |
| simgraph_draw_base_img | display_base_img | |
| simgraph_draw_img_stretch | display_img_stretch | |
| simgraph_draw_img_stretch_blend | display_img_stretch_blend | |
| simgraph_draw_base_img_blend | display_base_img_blend | |
| simgraph_draw_base_img_alpha | display_base_img_alpha | |
| simgraph_draw_box3d_rgb | display_ddd_box_rgb | |
| simgraph_draw_box3d_clip_rgb | display_ddd_box_clip_rgb | |
| simgraph_draw_line_solid_rgb | display_direct_line_rgb | |
| simgraph_draw_line_dotted_rgb | display_direct_line_dotted_rgb | |
| simgraph_draw_circle_rgb | display_circle_rgb | |
| simgraph_draw_filled_circle_rgb | display_filled_circle_rgb | |
| simgraph_draw_bezier_rgb | draw_bezier_rgb | |
| simgraph_set_display_procs | display_set_image_proc | |
| simgraph_blend_colors | display_blend_colors | |
| simgraph_blend_wh_rgb | display_blend_wh_rgb | |
| simgraph_draw_fillbox_wh_rgb | display_fillbox_wh_rgb | |
| simgraph_draw_fillbox_wh_clip_rgb | display_fillbox_wh_clip_rgb | |
| simgraph_draw_vline_wh_clip_rgb | display_vline_wh_clip_rgb | |
| simgraph_draw_array_wh | display_array_wh | |