From 7e83df55311ce763c51f3a577a68940b02a1cdb6 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 5 Jan 2019 17:41:55 +0100 Subject: [PATCH] Show libTIFF version in statistics --- src/help.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/help.c b/src/help.c index c087b94a..e8f6bbf3 100644 --- a/src/help.c +++ b/src/help.c @@ -68,6 +68,9 @@ screen.h:58: error: conflicting types for 'SetPalette' #ifndef __no_pnglib__ #include #endif +#ifndef __no_tifflib__ +#include +#endif #ifndef NORECOIL #include "recoil.h" #endif @@ -792,9 +795,9 @@ void Button_Stats(int btn) #if defined(USE_SDL) || defined(USE_SDL2) // 2 lines more -#define WIN_HEIGHT 190 +#define WIN_HEIGHT 190+8 #else -#define WIN_HEIGHT 174 +#define WIN_HEIGHT 174+8 #endif Open_window(310,WIN_HEIGHT,"Statistics"); @@ -816,6 +819,7 @@ void Button_Stats(int btn) #if defined(USE_SDL2) SDL_version sdlver; SDL_GetVersion(&sdlver); // linked version : only available with SDL2 + GFX2_Log(GFX2_DEBUG, "SDL_GetRevision(): %s\n", SDL_GetRevision()); snprintf(buffer,20,"%d.%d.%d.%s", sdlver.major, sdlver.minor, sdlver.patch, SDL_GetRevision()); #else const SDL_version * sdlver = SDL_Linked_Version(); @@ -856,6 +860,26 @@ void Button_Stats(int btn) Print_in_window(146,y,"not linked",STATS_DATA_COLOR,MC_Black); #else Print_in_window(146,y,png_libpng_ver,STATS_DATA_COLOR,MC_Black); +#endif + y+=8; + Print_in_window(10,y,"libtiff:",STATS_TITLE_COLOR,MC_Black); +#ifdef __no_tifflib__ + Print_in_window(146,y,"not linked",STATS_DATA_COLOR,MC_Black); +#else + { + unsigned int i; + const char * tiff_version = TIFFGetVersion(); + + GFX2_Log(GFX2_DEBUG, "'%s'\n", tiff_version); + for (i = 0; i < sizeof(buffer) - 1; i++) + { + if (tiff_version[i] < ' ') + break; + buffer[i] = tiff_version[i]; + } + buffer[i] = '\0'; + Print_in_window(146-8*8,y,buffer,STATS_DATA_COLOR,MC_Black); + } #endif #ifndef NORECOIL y+=8;