From 9be0130f2dbd5adccca5724adc1776856f275001 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 26 Aug 2019 12:28:37 +0100 Subject: [PATCH] Show image limit in show_limits console command (#9935) --- src/openrct2/drawing/Drawing.h | 2 ++ src/openrct2/drawing/Image.cpp | 10 ++++++++++ src/openrct2/interface/InteractiveConsole.cpp | 1 + 3 files changed, 13 insertions(+) diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 33f743187c..8d3b5ae6f7 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -310,6 +310,8 @@ bool is_csg_loaded(); uint32_t gfx_object_allocate_images(const rct_g1_element* images, uint32_t count); void gfx_object_free_images(uint32_t baseImageId, uint32_t count); void gfx_object_check_all_images_freed(); +size_t ImageListGetUsedCount(); +size_t ImageListGetMaximum(); void FASTCALL gfx_bmp_sprite_to_buffer( const uint8_t* palette_pointer, uint8_t* source_pointer, uint8_t* dest_pointer, const rct_g1_element* source_image, rct_drawpixelinfo* dest_dpi, int32_t height, int32_t width, int32_t image_type); diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index ee374e6ad5..a6a5e4ce89 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -241,3 +241,13 @@ void gfx_object_check_all_images_freed() #endif } } + +size_t ImageListGetUsedCount() +{ + return _allocatedImageCount; +} + +size_t ImageListGetMaximum() +{ + return MAX_IMAGES; +} diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index e0eb6293a0..d167a80a99 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1253,6 +1253,7 @@ static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] cons console.WriteFormatLine("Banners: %d/%zu", bannerCount, MAX_BANNERS); console.WriteFormatLine("Rides: %d/%d", rideCount, MAX_RIDES); console.WriteFormatLine("Staff: %d/%d", staffCount, STAFF_MAX_COUNT); + console.WriteFormatLine("Images: %zu/%zu", ImageListGetUsedCount(), ImageListGetMaximum()); return 0; }