GoaLitiuM's changes to fix msvc2015's cmake support.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5594 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2019-12-17 17:41:12 +00:00
parent b4de288ca7
commit d16c6646b7
15 changed files with 119 additions and 91 deletions

View file

@ -69,6 +69,12 @@ ENDIF()
SET(FTE_BUILD_CONFIG ${CMAKE_HOME_DIRECTORY}/engine/common/config_fteqw.h CACHE FILEPATH "Which build config file to use to control supported features.") SET(FTE_BUILD_CONFIG ${CMAKE_HOME_DIRECTORY}/engine/common/config_fteqw.h CACHE FILEPATH "Which build config file to use to control supported features.")
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};CONFIG_FILE_NAME=${FTE_BUILD_CONFIG}) SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};CONFIG_FILE_NAME=${FTE_BUILD_CONFIG})
IF(NOT WIN32)
SET(SYS_LIBS ${SYS_LIBS} m)
ELSE()
SET(SYS_LIBS ${SYS_LIBS})
ENDIF()
FIND_PACKAGE(ZLIB) FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND) IF(ZLIB_FOUND)
SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};ZLIB_STATIC) SET(FTE_LIB_DEFINES ${FTE_LIB_DEFINES};ZLIB_STATIC)
@ -181,7 +187,7 @@ IF(${ANDROID})
# INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} ) # INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} )
SET(FTE_DEFINES ${FTE_DEFINES};ANDROID;VKQUAKE;MULTITHREAD) SET(FTE_DEFINES ${FTE_DEFINES};ANDROID;VKQUAKE;MULTITHREAD)
SET(FTE_LIBS ${FTE_LIBS} android log EGL m ${CMAKE_DL_LIBS}) SET(FTE_LIBS ${FTE_LIBS} android log EGL ${SYS_LIBS} ${CMAKE_DL_LIBS})
SET(FTE_ARCH_FILES SET(FTE_ARCH_FILES
engine/client/sys_droid.c engine/client/sys_droid.c
engine/common/sys_linux_threads.c engine/common/sys_linux_threads.c
@ -262,7 +268,7 @@ ELSEIF(${UNIX}) #linux(ish)
ENDIF() ENDIF()
SET(FTE_DEFINES ${FTE_DEFINES};DYNAMIC_SDL;MULTITHREAD) SET(FTE_DEFINES ${FTE_DEFINES};DYNAMIC_SDL;MULTITHREAD)
SET(FTE_LIBS ${FTE_LIBS} m ${CMAKE_DL_LIBS} pthread ${SDL2_LIBRARIES}) SET(FTE_LIBS ${FTE_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} pthread ${SDL2_LIBRARIES})
SET(FTE_ARCH_FILES SET(FTE_ARCH_FILES
engine/client/sys_linux.c engine/client/sys_linux.c
engine/common/sys_linux_threads.c engine/common/sys_linux_threads.c
@ -317,7 +323,7 @@ ELSEIF(${UNIX}) #linux(ish)
engine/common/net_ssl_gnutls.c engine/common/net_ssl_gnutls.c
# engine/common/net_ssl_openssl.c # engine/common/net_ssl_openssl.c
) )
SET(FTESV_LIBS ${FTESV_LIBS} m ${CMAKE_DL_LIBS} pthread) SET(FTESV_LIBS ${FTESV_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} pthread)
# SET(FTE_DEFINES ${FTE_DEFINES};HAVE_OPENSSL) # SET(FTE_DEFINES ${FTE_DEFINES};HAVE_OPENSSL)
# SET(FTESV_DEFINES ${FTESV_DEFINES};HAVE_OPENSSL) # SET(FTESV_DEFINES ${FTESV_DEFINES};HAVE_OPENSSL)
@ -336,7 +342,7 @@ ELSEIF(1) #SDL
#SDL2.0.7 supports vulkan, so lets use it. #SDL2.0.7 supports vulkan, so lets use it.
SET(FTE_DEFINES ${FTE_DEFINES};FTE_SDL) SET(FTE_DEFINES ${FTE_DEFINES};FTE_SDL)
SET(FTE_LIBS ${FTE_LIBS} m ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES}) SET(FTE_LIBS ${FTE_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES})
SET(FTE_ARCH_FILES SET(FTE_ARCH_FILES
engine/client/sys_sdl.c engine/client/sys_sdl.c
engine/client/snd_al.c engine/client/snd_al.c
@ -347,7 +353,7 @@ ELSEIF(1) #SDL
) )
SET(FTESV_DEFINES FTE_SDL) SET(FTESV_DEFINES FTE_SDL)
SET(FTESV_LIBS ${FTESV_LIBS} m ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES}) SET(FTESV_LIBS ${FTESV_LIBS} ${SYS_LIBS} ${CMAKE_DL_LIBS} ${SDL2_LIBRARIES})
IF(WIN32) IF(WIN32)
SET(FTE_LIBS ${FTE_LIBS} wsock32 gdi32 ole32) SET(FTE_LIBS ${FTE_LIBS} wsock32 gdi32 ole32)
@ -740,7 +746,7 @@ ELSE()
SET_TARGET_PROPERTIES(bullet PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(bullet PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(bullet PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(bullet PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(bullet PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(bullet PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(bullet m ${BULLET_LIBRARIES}) TARGET_LINK_LIBRARIES(bullet ${SYS_LIBS} ${BULLET_LIBRARIES})
SET(INSTALLTARGS ${INSTALLTARGS} bullet) SET(INSTALLTARGS ${INSTALLTARGS} bullet)
ENDIF() ENDIF()
ENDIF() ENDIF()
@ -781,7 +787,6 @@ ELSE()
SET_TARGET_PROPERTIES(iqmtool PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}") SET_TARGET_PROPERTIES(iqmtool PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}")
SET(INSTALLTARGS ${INSTALLTARGS} iqmtool) SET(INSTALLTARGS ${INSTALLTARGS} iqmtool)
IF(NOT WIN32)
ADD_EXECUTABLE(imgtool ADD_EXECUTABLE(imgtool
engine/client/image.c engine/client/image.c
imgtool.c imgtool.c
@ -789,7 +794,6 @@ ELSE()
SET_TARGET_PROPERTIES(imgtool PROPERTIES COMPILE_DEFINITIONS "IMGTOOL;${FTE_LIB_DEFINES};${FTE_DEFINES};${FTE_REVISON}") SET_TARGET_PROPERTIES(imgtool PROPERTIES COMPILE_DEFINITIONS "IMGTOOL;${FTE_LIB_DEFINES};${FTE_DEFINES};${FTE_REVISON}")
TARGET_LINK_LIBRARIES(imgtool ${FTE_LIBS} ) TARGET_LINK_LIBRARIES(imgtool ${FTE_LIBS} )
SET(INSTALLTARGS ${INSTALLTARGS} imgtool) SET(INSTALLTARGS ${INSTALLTARGS} imgtool)
ENDIF()
ADD_EXECUTABLE(qtv ADD_EXECUTABLE(qtv
fteqtv/netchan.c fteqtv/netchan.c
@ -811,9 +815,9 @@ ELSE()
) )
SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}") SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON}")
IF(WIN32) IF(WIN32)
TARGET_LINK_LIBRARIES(qtv ws2_32 winmm) TARGET_LINK_LIBRARIES(qtv ws2_32 winmm ${SYS_LIBS})
ELSE() ELSE()
TARGET_LINK_LIBRARIES(qtv m) TARGET_LINK_LIBRARIES(qtv ${SYS_LIBS})
ENDIF() ENDIF()
SET(INSTALLTARGS ${INSTALLTARGS} qtv) SET(INSTALLTARGS ${INSTALLTARGS} qtv)
@ -862,7 +866,7 @@ ELSE()
engine/qclib/qcd_main.c engine/qclib/qcd_main.c
) )
SET_TARGET_PROPERTIES(fteqcc PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES};${FTE_REVISON}") SET_TARGET_PROPERTIES(fteqcc PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES};${FTE_REVISON}")
TARGET_LINK_LIBRARIES(fteqcc ${FTEQCC_LIBS} m) TARGET_LINK_LIBRARIES(fteqcc ${FTEQCC_LIBS} ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} fteqcc) SET(INSTALLTARGS ${INSTALLTARGS} fteqcc)
IF(${WIN32}) IF(${WIN32})
@ -934,7 +938,7 @@ ADD_LIBRARY(qi MODULE
SET_TARGET_PROPERTIES(qi PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(qi PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(qi PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(qi PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(qi PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(qi PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(qi m) TARGET_LINK_LIBRARIES(qi ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} qi) SET(INSTALLTARGS ${INSTALLTARGS} qi)
#ODE Physics library plugin #ODE Physics library plugin
@ -950,7 +954,7 @@ IF (LIBODE_INCLUDE_DIR)
SET_TARGET_PROPERTIES(ode PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;ODE_STATIC") SET_TARGET_PROPERTIES(ode PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;ODE_STATIC")
SET_TARGET_PROPERTIES(ode PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(ode PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(ode PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(ode PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(ode m ${LIBODE_LIBRARY}) TARGET_LINK_LIBRARIES(ode ${SYS_LIBS} ${LIBODE_LIBRARY})
SET(INSTALLTARGS ${INSTALLTARGS} ode) SET(INSTALLTARGS ${INSTALLTARGS} ode)
ENDIF() ENDIF()
@ -965,7 +969,7 @@ ADD_LIBRARY(ezhud MODULE
SET_TARGET_PROPERTIES(ezhud PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(ezhud PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(ezhud PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(ezhud PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(ezhud PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(ezhud PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(ezhud m) TARGET_LINK_LIBRARIES(ezhud ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} ezhud) SET(INSTALLTARGS ${INSTALLTARGS} ezhud)
#NameMaker string generation plugin #NameMaker string generation plugin
@ -976,7 +980,7 @@ ADD_LIBRARY(namemaker MODULE
SET_TARGET_PROPERTIES(namemaker PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(namemaker PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(namemaker PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(namemaker PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(namemaker PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(namemaker PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(namemaker m) TARGET_LINK_LIBRARIES(namemaker ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} namemaker) SET(INSTALLTARGS ${INSTALLTARGS} namemaker)
#Terrain Generation plugin #Terrain Generation plugin
@ -987,7 +991,7 @@ ADD_LIBRARY(terrorgen MODULE
SET_TARGET_PROPERTIES(terrorgen PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(terrorgen PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(terrorgen PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(terrorgen PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(terrorgen PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(terrorgen PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(terrorgen m) TARGET_LINK_LIBRARIES(terrorgen ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} terrorgen) SET(INSTALLTARGS ${INSTALLTARGS} terrorgen)
#IRC client plugin #IRC client plugin
@ -998,7 +1002,7 @@ ADD_LIBRARY(irc MODULE
SET_TARGET_PROPERTIES(irc PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_REVISON};${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(irc PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_REVISON};${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(irc PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(irc PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(irc PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(irc PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(irc m) TARGET_LINK_LIBRARIES(irc ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} irc) SET(INSTALLTARGS ${INSTALLTARGS} irc)
#model formats plugin #model formats plugin
@ -1011,7 +1015,7 @@ ADD_LIBRARY(models MODULE
SET_TARGET_PROPERTIES(models PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(models PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(models PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(models PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(models PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(models PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(models m) TARGET_LINK_LIBRARIES(models ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} models) SET(INSTALLTARGS ${INSTALLTARGS} models)
IF(0) IF(0)
@ -1027,7 +1031,7 @@ IF(0)
SET_TARGET_PROPERTIES(x11sv PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(x11sv PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(x11sv PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(x11sv PROPERTIES PREFIX "fteplug_")
SET_TARGET_PROPERTIES(x11sv PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(x11sv PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(x11sv m) TARGET_LINK_LIBRARIES(x11sv ${SYS_LIBS})
SET(INSTALLTARGS ${INSTALLTARGS} x11sv) SET(INSTALLTARGS ${INSTALLTARGS} x11sv)
ENDIF() ENDIF()
@ -1050,7 +1054,7 @@ IF((AVFORMAT_INCLUDE_DIR) AND (AVSWSCALE_INCLUDE_DIR))
) )
TARGET_INCLUDE_DIRECTORIES(ffmpeg PUBLIC ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${AVSWSCALE_INCLUDE_DIR}) TARGET_INCLUDE_DIRECTORIES(ffmpeg PUBLIC ${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${AVSWSCALE_INCLUDE_DIR})
SET_TARGET_PROPERTIES(ffmpeg PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(ffmpeg PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
TARGET_LINK_LIBRARIES(ffmpeg m ${AVFORMAT_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${AVSWSCALE_LIBRARY}) TARGET_LINK_LIBRARIES(ffmpeg ${SYS_LIBS} ${AVFORMAT_LIBRARY} ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${AVSWSCALE_LIBRARY})
SET_TARGET_PROPERTIES(ffmpeg PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}") SET_TARGET_PROPERTIES(ffmpeg PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
SET_TARGET_PROPERTIES(ffmpeg PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(ffmpeg PROPERTIES PREFIX "fteplug_")
SET(INSTALLTARGS ${INSTALLTARGS} ffmpeg) SET(INSTALLTARGS ${INSTALLTARGS} ffmpeg)
@ -1076,7 +1080,7 @@ IF(NOT ANDROID)
SET_TARGET_PROPERTIES(xmpp PROPERTIES LINK_FLAGS "-Wl,--no-undefined") SET_TARGET_PROPERTIES(xmpp PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
IF(${WIN32}) IF(${WIN32})
ELSE() ELSE()
TARGET_LINK_LIBRARIES(xmpp m resolv) TARGET_LINK_LIBRARIES(xmpp ${SYS_LIBS} resolv)
ENDIF() ENDIF()
SET(INSTALLTARGS ${INSTALLTARGS} xmpp) SET(INSTALLTARGS ${INSTALLTARGS} xmpp)
ENDIF() ENDIF()

View file

@ -433,7 +433,9 @@ typedef struct botlib_export_s
} botlib_export_t; } botlib_export_t;
//linking of bot library //linking of bot library
#ifndef EXTERNALBOTLIB
botlib_export_t *QDECL GetBotLibAPI( int apiVersion, botlib_import_t *import ); botlib_export_t *QDECL GetBotLibAPI( int apiVersion, botlib_import_t *import );
#endif
/* Library variables: /* Library variables:

View file

@ -3870,15 +3870,15 @@ nextchan:
} }
struct xcf_heirachy_s struct xcf_heirachy_s
{ {
uint32_t width; quint32_t width;
uint32_t height; quint32_t height;
uint32_t bpp; quint32_t bpp;
qbyte *data; qbyte *data;
}; };
static struct xcf_heirachy_s XCF_ReadHeirachy(struct xcf_s *f) static struct xcf_heirachy_s XCF_ReadHeirachy(struct xcf_s *f)
{ {
struct xcf_heirachy_s ctx; struct xcf_heirachy_s ctx;
uint32_t x, y, lw, lh; quint32_t x, y, lw, lh;
qofs_t ofs, tofs; qofs_t ofs, tofs;
if (!f->offset) if (!f->offset)
{ {
@ -3927,8 +3927,8 @@ static struct xcf_heirachy_s XCF_ReadChannel(struct xcf_s *f)
{ {
struct xcf_heirachy_s h; struct xcf_heirachy_s h;
char name[1024]; char name[1024];
uint32_t width = XCF_Read32(f); quint32_t width = XCF_Read32(f);
uint32_t height = XCF_Read32(f); quint32_t height = XCF_Read32(f);
unsigned int proptype, propsize; unsigned int proptype, propsize;
XCF_ReadString(f, name, sizeof(name)); XCF_ReadString(f, name, sizeof(name));
for(;;) for(;;)
@ -3991,11 +3991,11 @@ static qboolean XCF_CombineLayer(struct xcf_s *f)
unsigned int proptype, propsize; unsigned int proptype, propsize;
size_t width, height, type, heirachyoffset, layermaskoffset; size_t width, height, type, heirachyoffset, layermaskoffset;
char name[1024]; char name[1024];
uint32_t applylayermask = false; quint32_t applylayermask = false;
int32_t blendmode = 0; qint32_t blendmode = 0;
qboolean unsupported = false; qboolean unsupported = false;
uint32_t x,y, ofsx=0,ofsy=0; quint32_t x,y, ofsx=0,ofsy=0;
uint32_t visible = true; quint32_t visible = true;
float opacity = 1; float opacity = 1;
width = XCF_Read32(f); width = XCF_Read32(f);
height = XCF_Read32(f); height = XCF_Read32(f);
@ -9943,7 +9943,7 @@ static void Image_Decode_ASTC_HDR_HF_Block(qbyte *fte_restrict in, pixel64_t *ft
/*static unsigned int RGB16F_to_E5BGR9(unsigned short Cr, unsigned short Cg, unsigned short Cb) /*static unsigned int RGB16F_to_E5BGR9(unsigned short Cr, unsigned short Cg, unsigned short Cb)
{ {
int Re,Ge,Be, Rex,Gex,Bex, Xm, Xe; int Re,Ge,Be, Rex,Gex,Bex, Xm, Xe;
uint32_t rshift, gshift, bshift, expo; quint32_t rshift, gshift, bshift, expo;
int Rm, Gm, Bm; int Rm, Gm, Bm;
if( Cr > 0x7c00 ) Cr = 0; else if( Cr == 0x7c00 ) Cr = 0x7bff; if( Cr > 0x7c00 ) Cr = 0; else if( Cr == 0x7c00 ) Cr = 0x7bff;

View file

@ -254,13 +254,15 @@ extern "C" {
#ifdef _WIN32 #ifdef _WIN32
#if (_MSC_VER >= 1400) #if (_MSC_VER >= 1900)
//with MSVC 8, use MS extensions // MSVC 14 has standardized snprintf functions, hurrah!
#elif (_MSC_VER >= 1400)
//with MSVC 8, use MS extensions. return values are still wrong.
#define snprintf linuxlike_snprintf_vc8 #define snprintf linuxlike_snprintf_vc8
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...) LIKEPRINTF(3); int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...) LIKEPRINTF(3);
#define vsnprintf(a, b, c, d) vsnprintf_s(a, b, _TRUNCATE, c, d) #define vsnprintf(a, b, c, d) vsnprintf_s(a, b, _TRUNCATE, c, d)
#else #else
//msvc crap //msvc crap. return values are wrong but at least we can null terminate it safely.
#define snprintf linuxlike_snprintf #define snprintf linuxlike_snprintf
int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3); int VARGS linuxlike_snprintf(char *buffer, int size, const char *format, ...) LIKEPRINTF(3);
#define vsnprintf linuxlike_vsnprintf #define vsnprintf linuxlike_vsnprintf
@ -272,6 +274,13 @@ extern "C" {
//but mingw has some defines elsewhere and makes gcc moan //but mingw has some defines elsewhere and makes gcc moan
#define _vsnprintf unsafe_vsnprintf #define _vsnprintf unsafe_vsnprintf
#define _snprintf unsafe_snprintf #define _snprintf unsafe_snprintf
#ifndef strcasecmp
#define strcasecmp _stricmp
#endif
#ifndef strncasecmp
#define strncasecmp _strnicmp
#endif
#endif #endif
#endif #endif

View file

@ -1528,7 +1528,6 @@ void Sys_Init (void)
{ {
// LARGE_INTEGER PerformanceFreq; // LARGE_INTEGER PerformanceFreq;
// unsigned int lowpart, highpart; // unsigned int lowpart, highpart;
OSVERSIONINFO vinfo;
Sys_QueryDesktopParameters(); Sys_QueryDesktopParameters();
@ -1594,11 +1593,15 @@ void Sys_Init (void)
// NT gets 18ms resolution // NT gets 18ms resolution
timeBeginPeriod( 1 ); timeBeginPeriod( 1 );
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
#if _MSC_VER >= 1600 //msvc2010 runtime does not work on 9x any more. get rid of the deprecation warnings in later versions. #if _MSC_VER >= 1600 //msvc2010 runtime does not work on 9x any more. get rid of the deprecation warnings in later versions.
WinNT = true; WinNT = true;
qwinvermaj = 6; //Hack: assume 6.2 (aka win8). this will block 16bit colour depths.
qwinvermin = 2;
#else #else
{
OSVERSIONINFO vinfo;
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
if (!GetVersionEx (&vinfo)) if (!GetVersionEx (&vinfo))
Sys_Error ("Couldn't get OS info"); Sys_Error ("Couldn't get OS info");
@ -1612,10 +1615,11 @@ void Sys_Init (void)
WinNT = true; WinNT = true;
else else
WinNT = false; WinNT = false;
#endif
qwinvermaj = vinfo.dwMajorVersion; qwinvermaj = vinfo.dwMajorVersion;
qwinvermin = vinfo.dwMinorVersion; qwinvermin = vinfo.dwMinorVersion;
}
#endif
} }

View file

@ -4923,6 +4923,11 @@ static void COM_Version_f (void)
else if (_MSC_VER == 1400) { Con_Printf("Visual C++ 2005, version 8.0\n"); } else if (_MSC_VER == 1400) { Con_Printf("Visual C++ 2005, version 8.0\n"); }
else if (_MSC_VER == 1500) { Con_Printf("Visual C++ 2008, version 9.0\n"); } else if (_MSC_VER == 1500) { Con_Printf("Visual C++ 2008, version 9.0\n"); }
else if (_MSC_VER == 1600) { Con_Printf("Visual C++ 2010, version 10.0\n"); } else if (_MSC_VER == 1600) { Con_Printf("Visual C++ 2010, version 10.0\n"); }
else if (_MSC_VER == 1700) { Con_Printf("Visual C++ 2012, version 11.0\n"); }
else if (_MSC_VER == 1800) { Con_Printf("Visual C++ 2013, version 12.0\n"); }
else if (_MSC_VER == 1900) { Con_Printf("Visual C++ 2015, version 14.0\n"); }
else if (_MSC_VER >= 1910 && _MSC_VER < 1920) { Con_Printf("Visual C++ 2017, version 14.1x\n"); }
else if (_MSC_VER >= 1920 && _MSC_VER < 1930) { Con_Printf("Visual C++ 2019, version 14.2x\n"); }
else else
{ {
#ifdef _MSC_BUILD #ifdef _MSC_BUILD

View file

@ -95,7 +95,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#if _MSC_VER >= 1310 #if _MSC_VER >= 1900
// MSVC 14 supports these
#elif _MSC_VER >= 1310
#define strtoull _strtoui64 #define strtoull _strtoui64
#define strtoll _strtoi64 #define strtoll _strtoi64
#else #else

View file

@ -329,7 +329,7 @@ qboolean D3D11_LoadTextureMips(image_t *tex, const struct pendingtextureinfo *mi
} }
else else
{ {
subresdesc = alloca(tdesc.ArraySize*mips->mipcount); subresdesc = alloca(tdesc.ArraySize*mips->mipcount*sizeof(*subresdesc));
for (layer = 0; layer < tdesc.ArraySize; layer++) for (layer = 0; layer < tdesc.ArraySize; layer++)
{ {
for (i = 0; i < mips->mipcount; i++) for (i = 0; i < mips->mipcount; i++)

View file

@ -226,7 +226,7 @@ extern QCC_opcode_t pr_opcodes[]; // sized by initialization
#ifdef _MSC_VER #if defined(_MSC_VER) && _MSC_VER < 1900
#define Q_vsnprintf _vsnprintf #define Q_vsnprintf _vsnprintf
#else #else
#define Q_vsnprintf vsnprintf #define Q_vsnprintf vsnprintf

View file

@ -25,31 +25,27 @@
#endif #endif
#ifdef __MINGW32_VERSION #ifdef __MINGW32_VERSION
#define MINGW #define MINGW
#endif #endif
#define progfuncs qccprogfuncs #define progfuncs qccprogfuncs
extern progfuncs_t *qccprogfuncs; extern progfuncs_t *qccprogfuncs;
#ifndef _WIN32 #if defined(_MSC_VER) && _MSC_VER < 1900
#define stricmp strcasecmp #define strtoull _strtoui64
#define strnicmp strncasecmp #ifndef PRIxPTR
#endif #define PRIxPTR "Ix"
#endif
#ifdef _MSC_VER //ffs
#define strtoull _strtoui64
#ifndef PRIxPTR
#define PRIxPTR "Ix"
#endif
#else #else
#ifndef PRIxPTR #include <inttypes.h>
#define PRIxPTR "Ix" #ifndef PRIxPTR
#endif #define PRIxPTR "p"
#endif
#endif #endif
#ifndef STRINGIFY #ifndef STRINGIFY
#define STRINGIFY2(s) #s #define STRINGIFY2(s) #s
#define STRINGIFY(s) STRINGIFY2(s) #define STRINGIFY(s) STRINGIFY2(s)
#endif #endif
void *qccHunkAlloc(size_t mem); void *qccHunkAlloc(size_t mem);

View file

@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h> #include <stdio.h>
/*work around fucked MSVC functions. we use our own for these*/ /*work around fucked MSVC functions. we use our own for these*/
#if _MSC_VER >= 1300 #if _MSC_VER >= 1300 && _MSC_VER < 1900
#include <string.h> #include <string.h>
#ifndef _CRT_SECURE_NO_WARNINGS #ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
@ -70,8 +70,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
#include <ws2tcpip.h> #include <ws2tcpip.h>
#else #else
#define IPPROTO_IPV6 #define IPPROTO_IPV6 41
#ifndef EAI_NONAME
#define EAI_NONAME 8 #define EAI_NONAME 8
#endif
struct ip6_scope_id struct ip6_scope_id
{ {
union union

View file

@ -374,6 +374,7 @@ static enum uploadfmt ImgTool_ASTCToLDR(uploadfmt_t fmt)
return fmt; return fmt;
} }
#ifdef _WIN32 #ifdef _WIN32
#include <io.h>
#include <fcntl.h> #include <fcntl.h>
static void FS_MakeTempName(char *out, size_t outsize, char *prefix, char *suffix) static void FS_MakeTempName(char *out, size_t outsize, char *prefix, char *suffix)
{ {
@ -1040,6 +1041,7 @@ static void FileList_Add(struct filelist_s *list, char *fname)
#ifdef _WIN32 #ifdef _WIN32
static void ImgTool_TreeScan(struct filelist_s *list, const char *basepath, const char *subpath) static void ImgTool_TreeScan(struct filelist_s *list, const char *basepath, const char *subpath)
{ {
(void)FileList_Add;
Con_Printf("ImgTool_TreeScan not implemented on windows.\n"); Con_Printf("ImgTool_TreeScan not implemented on windows.\n");
} }
#else #else

View file

@ -33,8 +33,6 @@ extern pluginputfuncs_t *inputfuncs;
#define Q_atoi atoi #define Q_atoi atoi
#define strlcpy Q_strlcpy #define strlcpy Q_strlcpy
#define strlcat Q_strlcat #define strlcat Q_strlcat
#undef snprintf
#define snprintf Q_snprintf
#undef mpic_t #undef mpic_t
#define mpic_t void #define mpic_t void

View file

@ -104,7 +104,7 @@ char *Plug_Info_ValueForKey (const char *s, const char *key, char *out, size_t o
return oout; return oout;
} }
#if defined(_MSC_VER) && _MSC_VER < 2015 #if defined(_MSC_VER) && _MSC_VER < 1900
int Q_vsnprintf(char *buffer, size_t maxlen, const char *format, va_list argptr) int Q_vsnprintf(char *buffer, size_t maxlen, const char *format, va_list argptr)
{ {
int r = _vsnprintf (buffer, maxlen-1, format, argptr); int r = _vsnprintf (buffer, maxlen-1, format, argptr);
@ -174,7 +174,7 @@ int QDECL linuxlike_vsnprintf(char *buffer, int size, const char *format, va_lis
return ret; return ret;
} }
#else #elif (_MSC_VER < 1900)
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...) int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format, ...)
{ {
int ret; int ret;

View file

@ -35,6 +35,10 @@
# define strcasecmp stricmp # define strcasecmp stricmp
# define strncasecmp strnicmp # define strncasecmp strnicmp
# endif # endif
# if defined(_MSC_VER) && _MSC_VER >= 1900
# define Q_vsnprintf vsnprintf
# define Q_snprintf snprintf
# endif
#else #else
# define stricmp strcasecmp # define stricmp strcasecmp
# define strnicmp strncasecmp # define strnicmp strncasecmp