Minor fixes related to jpeg/png libs -> stb changes

This commit is contained in:
SRSaunders 2024-06-22 18:08:30 -04:00
parent 2478622e7c
commit 5ce9a3b1a6
3 changed files with 3 additions and 4 deletions

View file

@ -281,12 +281,11 @@ if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
endif()
# SRS - search for system zlib only if we have not already searched via system libpng
if(USE_SYSTEM_ZLIB)
find_package(ZLIB)
endif()
if (USE_SYSTEM_ZLIB AND ZLIB_FOUND)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
else()

View file

@ -894,7 +894,7 @@ static int stbi_write_hdr_core( stbi__write_context* s, int x, int y, int comp,
#ifdef __STDC_LIB_EXT1__
len = sprintf_s( buffer, sizeof( buffer ), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x );
#else
len = sprintf( buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x );
len = snprintf( buffer, sizeof( buffer ), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x );
#endif
s->func( s->context, buffer, len );

View file

@ -847,7 +847,7 @@ bool R_ReadPixelsRGB8( nvrhi::IDevice* device, CommonRenderPasses* pPasses, nvrh
// SRS - Save screen shots to fs_savepath on macOS (i.e. don't save into an app bundle's basepath)
#if defined(__APPLE__)
R_WritePNG( fullname, static_cast<byte*>( pData ), 4, desc.width, desc.height, true, "fs_savepath" );
R_WritePNG( fullname, static_cast<byte*>( pData ), 4, desc.width, desc.height, "fs_savepath" );
#else
R_WritePNG( fullname, static_cast<byte*>( pData ), 4, desc.width, desc.height, "fs_basepath" );
#endif