Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
sudo apt-mark hold grub-common grub-efi-amd64-bin shim-signed
sudo apt-get -qq update
sudo apt-get -y upgrade
sudo apt-get -y install build-essential libfreetype6-dev libgl1-mesa-dev libpng-dev qt5-qmake qtbase5-dev qtbase5-dev-tools qtchooser zlib1g-dev
sudo apt-get -y install build-essential libfreetype6-dev libgl1-mesa-dev libpng-dev libzstd-dev qt5-qmake qtbase5-dev qtbase5-dev-tools qtchooser zlib1g-dev
- name: Prepare Environment
run: |
echo "GIT_REVISION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
Expand Down Expand Up @@ -84,6 +84,7 @@ jobs:
mingw-w64-x86_64-libpng
mingw-w64-x86_64-qt5
mingw-w64-x86_64-zlib
mingw-w64-x86_64-zstd
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
Expand Down
9 changes: 7 additions & 2 deletions projects/msvc/libGLideNHQ.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\src;$(ProjectDir)..\..\src\inc;$(ProjectDir)..\..\src\osal;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsCpp</CompileAs>
<CompileAs>Default</CompileAs>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>UNICODE;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;OS_WINDOWS;__MSC__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>UNICODE;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;OS_WINDOWS;__MSC__;ZWRAP_USE_ZSTD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ObjectFileName>$(IntDir)</ObjectFileName>
</ClCompile>
Expand Down Expand Up @@ -142,6 +142,11 @@
<ClCompile Include="..\..\src\GLideNHQ\TxReSample.cpp" />
<ClCompile Include="..\..\src\GLideNHQ\TxTexCache.cpp" />
<ClCompile Include="..\..\src\GLideNHQ\TxUtil.cpp" />
<ClCompile Include="..\..\src\GLideNHQ\zstd\zstd_zlibwrapper.c" />
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzclose.c" />
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzlib.c" />
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzread.c" />
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzwrite.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
15 changes: 15 additions & 0 deletions projects/msvc/libGLideNHQ.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@
<ClCompile Include="..\..\src\GLideNHQ\TextureFilters.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNHQ\zstd\zstd_zlibwrapper.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzclose.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNHQ\zstd\gzwrite.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Source Files">
Expand Down
3 changes: 2 additions & 1 deletion projects/msvc/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": [
"libpng",
"zlib",
"freetype"
"freetype",
"zstd"
]
}
18 changes: 18 additions & 0 deletions src/GLideNHQ/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ set(GLideNHQ_SOURCES
TxUtil.cpp
)

list(APPEND GLideNHQ_SOURCES
zstd/zstd_zlibwrapper.c
zstd/gzclose.c
zstd/gzlib.c
zstd/gzread.c
zstd/gzwrite.c
)
add_definitions( -DZWRAP_USE_ZSTD )

if(MINGW OR PANDORA OR BCMHOST)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../osal )
else(MINGW OR PANDORA OR BCMHOST)
Expand Down Expand Up @@ -88,14 +97,17 @@ if( GLIDEN64_BUILD_TYPE STREQUAL "Debug")
if(MINGW OR BCMHOST OR APPLE OR USE_SYSTEM_LIBS)
FIND_PACKAGE( ZLIB REQUIRED )
FIND_PACKAGE( PNG REQUIRED )
FIND_PACKAGE( ZSTD REQUIRED )
target_link_libraries(GLideNHQd
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
zstd::libzstd_static
osald
)
elseif(ANDROID)
target_link_libraries(GLideNHQ PRIVATE
${ANDROID_LIB_PATH}/libs/${BUILD_VARIANT}/${ANDROID_ABI}/libpng.a
${ANDROID_LIB_PATH}/libs/${BUILD_VARIANT}/${ANDROID_ABI}/libzstd.a
z
dl
osal
Expand All @@ -104,6 +116,7 @@ if( GLIDEN64_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(GLideNHQd PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libzstd.a
dl
osald
)
Expand All @@ -120,19 +133,23 @@ else( GLIDEN64_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(GLideNHQ PRIVATE
/mnt/utmp/codeblocks/usr/lib/libpng.a
/mnt/utmp/codeblocks/usr/lib/libz.a
/mnt/utmp/codeblocks/usr/lib/libzstd.a
osal
)
elseif(BCMHOST OR MINGW OR APPLE OR USE_SYSTEM_LIBS)
FIND_PACKAGE( ZLIB REQUIRED )
FIND_PACKAGE( PNG REQUIRED )
FIND_PACKAGE( ZSTD REQUIRED )
target_link_libraries(GLideNHQ
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
zstd::libzstd_static
osal
)
elseif(ANDROID)
target_link_libraries(GLideNHQ PRIVATE
${ANDROID_LIB_PATH}/libs/${BUILD_VARIANT}/${ANDROID_ABI}/libpng.a
${ANDROID_LIB_PATH}/libs/${BUILD_VARIANT}/${ANDROID_ABI}/libzstd.a
z
dl
osal
Expand All @@ -141,6 +158,7 @@ else( GLIDEN64_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(GLideNHQ PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a
${CMAKE_CURRENT_SOURCE_DIR}/lib/libzstd.a
dl
osal
)
Expand Down
3 changes: 2 additions & 1 deletion src/GLideNHQ/TxCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

#include <fstream>
#include <unordered_map>
#include <zlib.h>
#include "zstd/zstd_zlibwrapper.h"

#include <memory.h>
#include <stdlib.h>
#include <assert.h>
Expand Down
1 change: 0 additions & 1 deletion src/GLideNHQ/TxHiResCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "TxDbg.h"
#include <osal_files.h>
#include <osal_keys.h>
#include <zlib.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
Expand Down
1 change: 0 additions & 1 deletion src/GLideNHQ/TxTexCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "TxTexCache.h"
#include "TxDbg.h"
#include <osal_files.h>
#include <zlib.h>

#define TEXCACHE_DUMP_ENABLED (FILE_TEXCACHE|DUMP_TEXCACHE)

Expand Down
1 change: 0 additions & 1 deletion src/GLideNHQ/TxUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <thread>
#include "TxUtil.h"
#include "TxDbg.h"
#include <zlib.h>
#include <assert.h>

#if defined (OS_WINDOWS)
Expand Down
67 changes: 42 additions & 25 deletions src/GLideNHQ/inc/zconf.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/

Expand Down Expand Up @@ -33,14 +33,21 @@
# ifndef Z_SOLO
# define compress z_compress
# define compress2 z_compress2
# define compress_z z_compress_z
# define compress2_z z_compress2_z
# define compressBound z_compressBound
# define compressBound_z z_compressBound_z
# endif
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define crc32_combine_gen z_crc32_combine_gen
# define crc32_combine_gen64 z_crc32_combine_gen64
# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateBound_z z_deflateBound_z
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateGetDictionary z_deflateGetDictionary
Expand All @@ -56,6 +63,7 @@
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflateUsed z_deflateUsed
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
# ifndef Z_SOLO
Expand Down Expand Up @@ -125,9 +133,12 @@
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# define inflate_fixed z_inflate_fixed
# ifndef Z_SOLO
# define uncompress z_uncompress
# define uncompress2 z_uncompress2
# define uncompress_z z_uncompress_z
# define uncompress2_z z_uncompress2_z
# endif
# define zError z_zError
# ifndef Z_SOLO
Expand Down Expand Up @@ -231,14 +242,20 @@
# endif
#endif

#if defined(ZLIB_CONST) && !defined(z_const)
# define z_const const
#else
# define z_const
#ifndef z_const
# ifdef ZLIB_CONST
# define z_const const
# else
# define z_const
# endif
#endif

#ifdef Z_SOLO
typedef unsigned long z_size_t;
# ifdef _WIN64
typedef unsigned long long z_size_t;
# else
typedef unsigned long z_size_t;
# endif
#else
# define z_longlong long long
# if defined(NO_SIZE_T)
Expand Down Expand Up @@ -293,14 +310,6 @@
# endif
#endif

#ifndef Z_ARG /* function prototypes for stdarg */
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
# else
# define Z_ARG(args) ()
# endif
#endif

/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
Expand Down Expand Up @@ -349,6 +358,9 @@
# ifdef FAR
# undef FAR
# endif
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
Expand Down Expand Up @@ -431,11 +443,11 @@ typedef uLong FAR uLongf;
typedef unsigned long z_crc_t;
#endif

#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
#if HAVE_UNISTD_H-0 /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif

#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
#if HAVE_STDARG_H-0 /* may be set to #if 1 by ./configure */
# define Z_HAVE_STDARG_H
#endif

Expand Down Expand Up @@ -467,11 +479,14 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE
#endif

#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# define Z_HAVE_UNISTD_H
#ifndef Z_HAVE_UNISTD_H
# if defined(__WATCOMC__) || defined(__GO32__) || \
(defined(_LARGEFILE64_SOURCE) && !defined(_WIN32))
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# if defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
Expand Down Expand Up @@ -501,17 +516,19 @@ typedef uLong FAR uLongf;
#endif

#ifndef z_off_t
# define z_off_t long
# define z_off_t long long
#endif

#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#elif defined(__MINGW32__)
# define z_off64_t long long
#elif defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
#elif defined(__GO32__)
# define z_off64_t offset_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
# endif
# define z_off64_t z_off_t
#endif

/* MVS linker does not support external names larger than 8 bytes */
Expand Down
Loading
Loading