Compare commits

..

1 Commits
1.14 ... 64bits

Author SHA1 Message Date
nillerusr
898716f600 game/client: make font size proportional 2022-06-19 15:17:06 +03:00
538 changed files with 14589 additions and 18288 deletions

View File

@@ -1,77 +0,0 @@
name: Build
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
build-linux-i386:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build linux-i386
run: |
scripts/build-ubuntu-i386.sh
build-linux-amd64:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build linux-amd64
run: |
scripts/build-ubuntu-amd64.sh
build-android-armv7a:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build android-armv7a
run: |
scripts/build-android-armv7a.sh
build-windows-i386:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Build windows-i386
run: |
git submodule init && git submodule update
./waf.bat configure -T debug
./waf.bat build
build-dedicated-windows-i386:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Build dedicated windows-i386
run: |
git submodule init && git submodule update
./waf.bat configure -T debug -d
./waf.bat build
build-dedicated-linux-i386:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build dedicated linux-i386
run: |
scripts/build-ubuntu-i386.sh -d
build-dedicated-linux-amd64:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build dedicated linux-amd64
run: |
scripts/build-ubuntu-amd64.sh -d

View File

@@ -1,42 +0,0 @@
name: Tests
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
tests-linux-i386:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Run tests linux-i386
run: |
scripts/tests-ubuntu-i386.sh
tests-linux-amd64:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Run tests linux-amd64
run: |
scripts/tests-ubuntu-amd64.sh
tests-windows-i386:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Run tests windows-i386
run: |
git submodule init && git submodule update
./waf.bat configure -T release --tests --prefix=out/
./waf.bat install
cd out
$env:Path = "bin";
./unittest.exe

32
.gitignore vendored
View File

@@ -1,39 +1,11 @@
*.mak
*.mak.vpc_crc
*.vpc_crc
*.vpc.*
*.project
*obj_*
build/
.waf*
.lock-waf*
__pycache__
*.pyc
.vs/
Debug/
Debug_*/
Release/
Release_*/
*.tlog/
*.obj
*.pch
*.log
*.idb
*.pdb
*.rc
*.bin
*.vcxproj*
*.sln
*.dll*
*.exp
*.ilk
ValveETWProviderEvents.h
game/client/*/client.lib
game/server/*/server.lib
.DS_Store
build*/
.cache/
.ccache/
waf3*/
.vscode/
.depproj/
source-engine.sln
.DS_Store

3
.gitmodules vendored
View File

@@ -4,6 +4,3 @@
[submodule "ivp"]
path = ivp
url = https://github.com/nillerusr/source-physics
[submodule "lib"]
path = lib
url = https://github.com/nillerusr/source-engine-libs.git

View File

@@ -1,23 +1,36 @@
# source-engine
Welcome to source engine:)
Discord: https://discord.gg/hZRB7WMgGw
# Goals
* fixing bugs
* ~~NEON support~~
* DXVK support
* remove unnecessary dependencies
* Elbrus port
* ~~Arm(android) port~~
* improve performance
* ~~replace current buildsystem with waf~~
* rewrite achivement system( to work without steam )
* 64-bit support
# Current tasks
- [x] Windows build support for waf
- [x] NEON support
- [x] remove unnecessary dependencies
- [x] Arm(android) port
- [x] replace current buildsystem with waf
- [x] rewrite achivement system( to work without steam )
- [x] 64-bit support
- [x] VTF 7.5 support
- [x] PBR support
- [ ] improve performance
- [ ] fixing bugs
- [ ] dxvk-native support
- [ ] Elbrus port
- [ ] rewrite serverbrowser to work without steam
# How to Build?
Clone repo and change directory:
```
git clone https://github.com/nillerusr/source-engine --recursive --depth 1
cd source-engine
```
On Linux:
# [How to Build?](https://github.com/nillerusr/source-engine/wiki/How-to-build)
dependencies:
fontconfig, freetype2, OpenAL, SDL2, libbz2, libcurl, libjpeg, libpng, zlib
```
./waf configure -T debug
./waf build
```
On Linux for Android(**Note: only Android NDK r10e is supported**):
```
export ANDROID_NDK=/path/to/ndk
./waf configure -T debug --android=armeabi-v7a,4.9,21
./waf build
```
On Windows/MacOS:
**TODO(WAF is not configured for Windows/MacOS. Use VPC as temporary solution)**

View File

@@ -36,8 +36,8 @@
#define GLMPRINTF(args)
#endif
#if defined( OSX ) || defined( ANDROID )
ConVar rawinput_set_one_time( "rawinput_set_one_time", "0", FCVAR_ARCHIVE|FCVAR_HIDDEN, "");
#ifdef OSX
ConVar osx_rawinput_set_one_time( "osx_rawinput_set_one_time", "0", FCVAR_ARCHIVE|FCVAR_HIDDEN, "");
#endif
ConVar gl_blit_halfx( "gl_blit_halfx", "0" );
@@ -206,6 +206,8 @@ void *VoidFnPtrLookup_GlMgr(const char *fn, bool &okay, const bool bRequired, vo
{
retval = _glGetProcAddress(fn);
Msg("_glGetProcAddress(%s) = %x\n", fn, retval);
if( !retval && l_gles )
retval = dlsym( l_gles, fn );
}
@@ -1139,15 +1141,17 @@ void CSDLMgr::OnFrameRendered()
ConVarRef rawinput( "m_rawinput" );
#if defined( OSX ) || defined( ANDROID )
// We default raw input to on on Mac/Android and set it one time for all users since
#ifdef OSX
// We default raw input to on on Mac and set it one time for all users since
// it didn't used to be the default.
if ( !rawinput_set_one_time.GetBool() )
if ( !osx_rawinput_set_one_time.GetBool() )
{
rawinput_set_one_time.SetValue( 1 );
osx_rawinput_set_one_time.SetValue( 1 );
rawinput.SetValue( 1 );
}
#endif
m_bRawInput = !m_bCursorVisible && rawinput.IsValid() && rawinput.GetBool();
SDL_bool bWindowGrab = !m_bCursorVisible ? SDL_TRUE : SDL_FALSE;

View File

@@ -18,24 +18,13 @@ def build(bld):
source = [
'AppSystemGroup.cpp',
'../public/filesystem_init.cpp',
# 'vguimatsysapp.cpp' [$WIN32]
# 'winapp.cpp' [$WIN32]
'posixapp.cpp',# [$POSIX]
'sdlmgr.cpp'# [$SDL]
# 'glmrendererinfo_osx.mm' [$OSXALL]
]
if bld.env.SDL:
source += [
'sdlmgr.cpp'
]
if bld.env.DEST_OS == 'win32':
source += [
'vguimatsysapp.cpp',
'winapp.cpp'
]
else:
source += [
'posixapp.cpp',# [$POSIX]
]
includes = [
'.',
'../public',

View File

@@ -15,8 +15,6 @@ $Configuration
$AdditionalIncludeDirectories "$BASE;$SRCDIR\dx9sdk\include" [$WINDOWS]
$AdditionalIncludeDirectories "$BASE;$SRCDIR\x360xdk\include\win32\vs2005" [$WINDOWS]
$AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\stb"
$PreprocessorDefinitions "$BASE;NO_X360_XDK;" [!$X360]
}
}

View File

@@ -828,7 +828,7 @@ bool ConvertToATIxN( const uint8 *src, ImageFormat srcImageFormat,
uint8 *dst, ImageFormat dstImageFormat,
int width, int height, int srcStride, int dstStride )
{
#if 0
#if !defined( _X360 ) && !defined( POSIX )
// from rgb(a) to ATIxN
if( srcStride != 0 || dstStride != 0 )
@@ -877,7 +877,7 @@ bool ConvertToDXTLegacy( const uint8 *src, ImageFormat srcImageFormat,
uint8 *dst, ImageFormat dstImageFormat,
int width, int height, int srcStride, int dstStride )
{
#if 0
#if !defined( _X360 ) && !defined( POSIX )
// from rgb(a) to dxtN
if( srcStride != 0 || dstStride != 0 )
return false;

View File

@@ -784,50 +784,6 @@ bool ResampleRGB323232F( const ResampleInfo_t& info )
return true;
}
bool ResampleRGBA32323232F( const ResampleInfo_t& info )
{
// HDRFIXME: This is some lame shit right here. (We need to get NICE working, etc, etc.)
// Make sure everything is power of two.
Assert( ( info.m_nSrcWidth & ( info.m_nSrcWidth - 1 ) ) == 0 );
Assert( ( info.m_nSrcHeight & ( info.m_nSrcHeight - 1 ) ) == 0 );
Assert( ( info.m_nDestWidth & ( info.m_nDestWidth - 1 ) ) == 0 );
Assert( ( info.m_nDestHeight & ( info.m_nDestHeight - 1 ) ) == 0 );
// Make sure that we aren't upscaling the image. . .we don't support that very well.
Assert( info.m_nSrcWidth >= info.m_nDestWidth );
Assert( info.m_nSrcHeight >= info.m_nDestHeight );
int nSampleWidth = info.m_nSrcWidth / info.m_nDestWidth;
int nSampleHeight = info.m_nSrcHeight / info.m_nDestHeight;
float *pSrc = ( float * )info.m_pSrc;
float *pDst = ( float * )info.m_pDest;
for( int y = 0; y < info.m_nDestHeight; y++ )
{
for( int x = 0; x < info.m_nDestWidth; x++ )
{
float accum[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
for( int nSampleY = 0; nSampleY < nSampleHeight; nSampleY++ )
{
for( int nSampleX = 0; nSampleX < nSampleWidth; nSampleX++ )
{
accum[0] += pSrc[((x*nSampleWidth+nSampleX)+(y*nSampleHeight+nSampleY)*info.m_nSrcWidth)*4+0];
accum[1] += pSrc[((x*nSampleWidth+nSampleX)+(y*nSampleHeight+nSampleY)*info.m_nSrcWidth)*4+1];
accum[2] += pSrc[((x*nSampleWidth+nSampleX)+(y*nSampleHeight+nSampleY)*info.m_nSrcWidth)*4+2];
accum[3] += pSrc[((x*nSampleWidth+nSampleX)+(y*nSampleHeight+nSampleY)*info.m_nSrcWidth)*4+3];
}
}
for( int i = 0; i < 4; i++ )
{
accum[i] /= ( nSampleWidth * nSampleHeight );
pDst[(x+y*info.m_nDestWidth)*4+i] = accum[i];
}
}
}
return true;
}
//-----------------------------------------------------------------------------
// Generates mipmap levels
//-----------------------------------------------------------------------------

View File

@@ -21,6 +21,7 @@ def build(bld):
'float_bm.cpp',
'float_bm2.cpp',
'float_bm3.cpp',
#'float_bm4.cpp', [$WINDOWS]
'float_bm_bilateral_filter.cpp',
'float_cube.cpp',
'imageformat.cpp',
@@ -30,11 +31,6 @@ def build(bld):
'tgawriter.cpp',
'bitmap.cpp'
]
if bld.env.DEST_OS == 'win32':
source += [
'float_bm4.cpp'
]
includes = [
'.',
@@ -47,9 +43,6 @@ def build(bld):
defines = []
libs = []
#if bld.env.DEST_OS == 'win32':
# libs += ['NVTC', 'ATI_COMPRESS_MT_VC10']
bld.stlib(
source = source,

5
build.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
# example: ./build.sh everything togl
make MAKE_VERBOSE=1 NO_CHROOT=1 -f $1.mak $2 -j$(nproc --all)

View File

@@ -53,12 +53,12 @@ int CBlacklistedServerManager::LoadServersFromFile( const char *pszFilename, boo
{
const char *pszName = pData->GetString( "name" );
uint64 ullDate = pData->GetUint64( "date" );
uint32 ulDate = pData->GetInt( "date" );
if ( bResetTimes )
{
time_t today;
time( &today );
ullDate = (uint64)today;
ulDate = today;
}
const char *pszNetAddr = pData->GetString( "addr" );
@@ -68,7 +68,7 @@ int CBlacklistedServerManager::LoadServersFromFile( const char *pszFilename, boo
m_Blacklist[iIdx].m_nServerID = m_iNextServerID++;
V_strncpy( m_Blacklist[iIdx].m_szServerName, pszName, sizeof( m_Blacklist[iIdx].m_szServerName ) );
m_Blacklist[iIdx].m_ullTimeBlacklistedAt = ullDate;
m_Blacklist[iIdx].m_ulTimeBlacklistedAt = ulDate;
m_Blacklist[iIdx].m_NetAdr.SetFromString( pszNetAddr );
++count;
@@ -92,7 +92,7 @@ void CBlacklistedServerManager::SaveToFile( const char *pszFilename )
{
KeyValues *pSubKey = new KeyValues( "server" );
pSubKey->SetString( "name", m_Blacklist[i].m_szServerName );
pSubKey->SetUint64( "date", m_Blacklist[i].m_ullTimeBlacklistedAt );
pSubKey->SetInt( "date", m_Blacklist[i].m_ulTimeBlacklistedAt );
pSubKey->SetString( "addr", m_Blacklist[i].m_NetAdr.ToString() );
pKV->AddSubKey( pSubKey );
}
@@ -120,7 +120,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( gameserveritem_t &se
time_t today;
time( &today );
m_Blacklist[iIdx].m_ullTimeBlacklistedAt = (uint64)today;
m_Blacklist[iIdx].m_ulTimeBlacklistedAt = today;
m_Blacklist[iIdx].m_NetAdr = netAdr;
m_Blacklist[iIdx].m_nServerID = m_iNextServerID++;
@@ -145,7 +145,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa
time_t today;
time( &today );
m_Blacklist[iIdx].m_ullTimeBlacklistedAt = (uint64)today;
m_Blacklist[iIdx].m_ulTimeBlacklistedAt = today;
m_Blacklist[iIdx].m_NetAdr = netAdr;
m_Blacklist[iIdx].m_nServerID = m_iNextServerID++;
@@ -157,7 +157,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa
//-----------------------------------------------------------------------------
// Purpose: Add the given server to the blacklist. Return added server.
//-----------------------------------------------------------------------------
blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverName, const char *netAddressString, uint64 timestamp )
blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverName, const char *netAddressString, uint32 timestamp )
{
netadr_t netAdr( netAddressString );
@@ -168,7 +168,7 @@ blacklisted_server_t *CBlacklistedServerManager::AddServer( const char *serverNa
int iIdx = m_Blacklist.AddToTail();
V_strncpy( m_Blacklist[iIdx].m_szServerName, serverName, sizeof( m_Blacklist[iIdx].m_szServerName ) );
m_Blacklist[iIdx].m_ullTimeBlacklistedAt = timestamp;
m_Blacklist[iIdx].m_ulTimeBlacklistedAt = timestamp;
m_Blacklist[iIdx].m_NetAdr = netAdr;
m_Blacklist[iIdx].m_nServerID = m_iNextServerID++;

View File

@@ -23,7 +23,7 @@ struct blacklisted_server_t
{
int m_nServerID;
char m_szServerName[64];
uint64 m_ullTimeBlacklistedAt;
uint32 m_ulTimeBlacklistedAt;
netadr_t m_NetAdr;
};
@@ -40,7 +40,7 @@ public:
blacklisted_server_t *AddServer( gameserveritem_t &server );
blacklisted_server_t *AddServer( const char *serverName, uint32 serverIP, int serverPort );
blacklisted_server_t *AddServer( const char *serverName, const char *netAddressString, uint64 timestamp );
blacklisted_server_t *AddServer( const char *serverName, const char *netAddressString, uint32 timestamp );
void RemoveServer( int iServerID ); // remove server with matching 'server id' from list

View File

@@ -54,8 +54,6 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
extern IEngineReplay *g_pEngine;
#elif ENGINE_DLL
#include "EngineInterface.h"
#elif UTILS
// OwO
#else
#include "cdll_int.h"
extern IVEngineClient *engine;
@@ -63,23 +61,10 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
// use the JPEGLIB_USE_STDIO define so that we can read in jpeg's from outside the game directory tree.
#define JPEGLIB_USE_STDIO
#if ANDROID
#include "android/jpeglib/jpeglib.h"
#else
#include "jpeglib/jpeglib.h"
#endif
#undef JPEGLIB_USE_STDIO
#if HAVE_PNG
#if ANDROID
#include "libpng/png.h"
#else
#include <png.h>
#endif
#endif
#include <setjmp.h>
@@ -108,8 +93,6 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
#if HAVE_JPEG
struct ValveJpegErrorHandler_t
{
// The default manager
@@ -146,12 +129,12 @@ static void ValveJpegErrorHandler( j_common_ptr cinfo )
// Bail
longjmp( pError->m_ErrorContext, 1 );
}
#endif
// convert the JPEG file given to a TGA file at the given output path.
ConversionErrorType ImgUtl_ConvertJPEGToTGA( const char *jpegpath, const char *tgaPath, bool bRequirePowerOfTwo )
{
#if !defined( _X360 ) && HAVE_JPEG
#if !defined( _X360 )
//
// !FIXME! This really probably should use ImgUtl_ReadJPEGAsRGBA, to avoid duplicated code.
@@ -502,7 +485,7 @@ unsigned char * ImgUtl_ReadTGAAsRGBA(const char *tgaPath, int &width, int &heigh
unsigned char *ImgUtl_ReadJPEGAsRGBA( const char *jpegPath, int &width, int &height, ConversionErrorType &errcode )
{
#if !defined( _X360 ) && HAVE_JPEG
#if !defined( _X360 )
struct jpeg_decompress_struct jpegInfo;
struct ValveJpegErrorHandler_t jerr;
JSAMPROW row_pointer[1];
@@ -653,7 +636,6 @@ unsigned char *ImgUtl_ReadJPEGAsRGBA( const char *jpegPath, int &width, int &hei
#endif
}
#if HAVE_PNG
static void ReadPNGData( png_structp png_ptr, png_bytep outBytes, png_size_t byteCountToRead )
{
@@ -672,37 +654,19 @@ static void ReadPNGData( png_structp png_ptr, png_bytep outBytes, png_size_t byt
// Read the bytes
pBuf->Get( outBytes, byteCountToRead );
}
#endif
unsigned char *ImgUtl_ReadPNGAsRGBA( const char *pngPath, int &width, int &height, ConversionErrorType &errcode )
{
#if !defined( _X360 ) && HAVE_PNG
#if !defined( _X360 )
// Just load the whole file into a memory buffer
CUtlBuffer bufFileContents;
#if UTILS
static char buf[8192];
FILE *readfile = fopen(pngPath, "rb");
if( !readfile )
{
errcode = CE_CANT_OPEN_SOURCE_FILE;
return NULL;
}
size_t size;
while( ( size = fread(buf, 1, sizeof(buf), readfile ) ) > 0 )
bufFileContents.Put( buf, size );
// Load it
return ImgUtl_ReadPNGAsRGBAFromBuffer( bufFileContents, width, height, errcode );
#else
if ( !g_pFullFileSystem->ReadFile( pngPath, NULL, bufFileContents ) )
{
errcode = CE_CANT_OPEN_SOURCE_FILE;
return NULL;
}
#endif
// Load it
return ImgUtl_ReadPNGAsRGBAFromBuffer( bufFileContents, width, height, errcode );
@@ -715,7 +679,7 @@ unsigned char *ImgUtl_ReadPNGAsRGBA( const char *pngPath, int &width, int &heigh
unsigned char *ImgUtl_ReadPNGAsRGBAFromBuffer( CUtlBuffer &buffer, int &width, int &height, ConversionErrorType &errcode )
{
#if !defined( _X360 ) && HAVE_PNG
#if !defined( _X360 )
png_const_bytep pngData = (png_const_bytep)buffer.Base();
if (png_sig_cmp( pngData, 0, 8))
@@ -1506,7 +1470,7 @@ ConversionErrorType ImgUtl_ConvertTGAToVTF(const char *tgaPath, int nMaxWidth/*=
inbuf.SeekPut( CUtlBuffer::SEEK_HEAD, nBytesRead );
// load vtex_dll.dll and get the interface to it.
CSysModule *vtexmod = Sys_LoadModule("vtex_dll" DLL_EXT_STRING);
CSysModule *vtexmod = Sys_LoadModule("vtex_dll");
if (vtexmod == NULL)
{
Msg( "Failed to open TGA conversion module vtex_dll: %s\n", tgaPath);
@@ -1555,17 +1519,6 @@ static void DoCopyFile( const char *source, const char *destination )
::COM_CopyFile( source, destination );
#elif REPLAY_DLL
g_pEngine->CopyFile( source, destination );
#elif UTILS
static char buf[16384];
FILE *readfile = fopen(source, "rb");
FILE *writefile = fopen(destination, "wb");
size_t size = 0;
while( (size = fread(buf, sizeof(buf), 1, readfile)) != 0 )
fwrite(buf, size, 1, writefile);
fclose(readfile);
fclose(writefile);
#else
engine->CopyLocalFile( source, destination );
#endif
@@ -1756,12 +1709,12 @@ ConversionErrorType ImgUtl_ConvertToVTFAndDumpVMT( const char *pInPath, const ch
Q_strncpy(finalPath, com_gamedir, sizeof(finalPath));
#elif REPLAY_DLL
Q_strncpy(finalPath, g_pEngine->GetGameDir(), sizeof(finalPath));
#elif !UTILS
#else
Q_strncpy(finalPath, engine->GetGameDirectory(), sizeof(finalPath));
#endif
Q_strncat(finalPath, szOutDir, sizeof(finalPath), COPY_ALL_CHARACTERS);
Q_strncat(finalPath, vtfFilename, sizeof(finalPath), COPY_ALL_CHARACTERS);
c = finalPath + strlen(finalPath);
while ((c > finalPath) && (*(c-1) != '.'))
{
@@ -1873,7 +1826,6 @@ ConversionErrorType ImgUtl_WriteGenericVMT( const char *vtfPath, const char *pMa
return CE_SUCCESS;
}
#if HAVE_PNG
static void WritePNGData( png_structp png_ptr, png_bytep inBytes, png_size_t byteCountToWrite )
{
@@ -1975,13 +1927,11 @@ fail:
return CE_SOURCE_FILE_FORMAT_NOT_SUPPORTED;
#endif
}
#endif
//-----------------------------------------------------------------------------
// Purpose: Initialize destination --- called by jpeg_start_compress
// before any data is actually written.
//-----------------------------------------------------------------------------
#if HAVE_JPEG
METHODDEF(void) init_destination (j_compress_ptr cinfo)
{
JPEGDestinationManager_t *dest = ( JPEGDestinationManager_t *) cinfo->dest;
@@ -2062,14 +2012,12 @@ GLOBAL(void) jpeg_UtlBuffer_dest (j_compress_ptr cinfo, CUtlBuffer *pBuffer )
dest->pub.term_destination = term_destination;
dest->pBuffer = pBuffer;
}
#endif
//-----------------------------------------------------------------------------
// Purpose: Write three channel RGB data to a JPEG file
//-----------------------------------------------------------------------------
bool ImgUtl_WriteRGBToJPEG( unsigned char *pSrcBuf, unsigned int nSrcWidth, unsigned int nSrcHeight, const char *lpszFilename )
{
#if HAVE_JPEG
CUtlBuffer dstBuf;
JSAMPROW row_pointer[1]; // pointer to JSAMPLE row[s]
@@ -2119,16 +2067,13 @@ bool ImgUtl_WriteRGBToJPEG( unsigned char *pSrcBuf, unsigned int nSrcWidth, unsi
// Cleanup
jpeg_destroy_compress(&cinfo);
return CE_SUCCESS;
#else
return CE_SOURCE_FILE_FORMAT_NOT_SUPPORTED;
#endif
}
ConversionErrorType ImgUtl_WriteRGBAAsJPEGToBuffer( const unsigned char *pRGBAData, int nWidth, int nHeight, CUtlBuffer &bufOutData, int nStride )
{
#if !defined( _X360 ) && HAVE_JPEG
#if !defined( _X360 )
JSAMPROW row_pointer[1]; // pointer to JSAMPLE row[s]
int row_stride; // physical row width in image buffer
@@ -2269,7 +2214,6 @@ ConversionErrorType ImgUtl_SaveBitmapToBuffer( CUtlBuffer &fileData, const Bitma
ConversionErrorType ImgUtl_LoadPNGBitmapFromBuffer( CUtlBuffer &fileData, Bitmap_t &bitmap )
{
#if HAVE_PNG
bitmap.Clear();
ConversionErrorType nErrorCode;
int width, height;
@@ -2282,14 +2226,10 @@ ConversionErrorType ImgUtl_LoadPNGBitmapFromBuffer( CUtlBuffer &fileData, Bitmap
// Install the buffer into the bitmap, and transfer ownership
bitmap.SetBuffer( width, height, IMAGE_FORMAT_RGBA8888, buffer, true, width*4 );
return CE_SUCCESS;
#else
return CE_SOURCE_FILE_FORMAT_NOT_SUPPORTED;
#endif
}
ConversionErrorType ImgUtl_SavePNGBitmapToBuffer( CUtlBuffer &fileData, const Bitmap_t &bitmap )
{
#if HAVE_PNG
if ( !bitmap.IsValid() )
{
Assert( bitmap.IsValid() );
@@ -2312,9 +2252,6 @@ ConversionErrorType ImgUtl_SavePNGBitmapToBuffer( CUtlBuffer &fileData, const Bi
bitmap.Stride()
);
return result;
#else
return CE_SOURCE_FILE_FORMAT_NOT_SUPPORTED;
#endif
}
ConversionErrorType ImgUtl_ResizeBitmap( Bitmap_t &destBitmap, int nWidth, int nHeight, const Bitmap_t *pImgSource )

5
createallprojects Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
pushd `dirname $0`
devtools/bin/vpc /f /hl2 +everything /mksln everything
popd

1
createallprojects.bat Normal file
View File

@@ -0,0 +1 @@
devtools\bin\vpc.exe /2013 +everything /mksln everything.sln

View File

@@ -181,9 +181,10 @@ private:
DataCacheItem_t *m_pFirst;
int m_iThread;
};
typedef CThreadLocal<FrameLock_t *> CThreadFrameLock;
CDataCacheLRU & m_LRU;
CTHREADLOCAL(FrameLock_t*) m_ThreadFrameLock;
CThreadFrameLock m_ThreadFrameLock;
DataCacheStatus_t m_status;
DataCacheLimits_t m_limits;
IDataCacheClient * m_pClient;
@@ -380,4 +381,4 @@ inline void CDataCacheSection::NoteUnlock( int size )
//-----------------------------------------------------------------------------
#endif // DATACACHE_H
#endif // DATACACHE_H

View File

@@ -5,7 +5,7 @@
//-----------------------------------------------------------------------------
$macro SRCDIR ".."
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
$Macro OUTBINDIR "$LIBPUBLIC"
$include "$SRCDIR\vpc_scripts\source_dll_base.vpc"

View File

@@ -20,8 +20,7 @@ def build(bld):
'mdlcache.cpp',
'../public/studio.cpp',
'../public/studio_virtualmodel.cpp',
'../common/studiobyteswap.cpp',
'../public/tier0/memoverride.cpp'
'../common/studiobyteswap.cpp'
]
includes = [

View File

@@ -5,7 +5,7 @@
//-----------------------------------------------------------------------------
$Macro SRCDIR ".."
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
$Macro OUTBINDIR "$LIBPUBLIC"
$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
$include "$SRCDIR\vpc_scripts\source_cryptlib_include.vpc"
@@ -142,7 +142,6 @@ $Project "Dedicated"
$Lib tier2
$Lib tier3
$Lib vgui_controls [$WIN32]
$Lib vpklib
$LibExternal "$SRCDIR/thirdparty/libedit-3.1/src/.libs/libedit" [$LINUXALL]
$ImpLibExternal steam_api
$ImpLib SDL2 [$SDL]

View File

@@ -24,8 +24,11 @@ def build(bld):
'../common/SteamAppStartup.cpp',
'sys_common.cpp',
'sys_ded.cpp',
#'sys_windows.cpp', [$WINDOWS]
'sys_linux.cpp', # [$POSIX]
'console/conproc.cpp',
'console/textconsole.cpp',
'console/TextConsoleUnix.cpp', # [$POSIX]
'../filesystem/filetracker.cpp',
'../filesystem/basefilesystem.cpp',
'../filesystem/packfile.cpp',
@@ -33,20 +36,9 @@ def build(bld):
'../filesystem/filesystem_stdio.cpp',
'../filesystem/QueuedLoader.cpp',
'../public/zip_utils.cpp',
'../public/tier0/memoverride.cpp'
'../filesystem/linux_support.cpp' # [$POSIX]
]
if bld.env.DEST_OS == 'win32':
source += [
'sys_windows.cpp'
]
else:
source += [
'sys_linux.cpp', # [$POSIX]
'console/TextConsoleUnix.cpp', # [$POSIX]
'../filesystem/linux_support.cpp' # [$POSIX]
]
includes = [
'.',
'../public',

Binary file not shown.

3
dx9sdk/lib/DxErr8.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3e3a0893326c705d44a13d9263681df9b50a3112f37c45488f5e4919f3b3d26e
size 1083572

3
dx9sdk/lib/DxErr9.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0dcf72695c4dc029768d2d8fadb5d61d56dcf896bb9683dc936f8a046c608495
size 3901404

3
dx9sdk/lib/XInput.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef5622f062ea151ea49aee29903562b819bd65c90b052877c127ebcd428895dd
size 3436

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
dx9sdk/lib/amstrmid.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11049ebe22f538fd6ca0d6231012c01bf7b867ee181c976fdeba2a666926ae24
size 272820

3
dx9sdk/lib/d3d8.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5f410143bdc4fd43a2de62f03837aae135009952c08a1dfef19dcf2d898e75f7
size 2466

3
dx9sdk/lib/d3d9.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:461a9baf9d7a3e6ce4b04ef7814296c0fcad36ec77deb7566b361cbdabf6e3d7
size 4988

3
dx9sdk/lib/d3dx.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a7302d67797790fa68dd8c42308621e90971dc71179c702574208b3e56b351f
size 614522

3
dx9sdk/lib/d3dx8.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0d5bd10baa80550e2a063e16867723f2fa6a7269a4afef86517a46293958849d
size 2151212

3
dx9sdk/lib/d3dx8d.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2b4f081d23b65686c5d0821eb3fb5f3aaf08972f9539a9ce589499700c227c74
size 53414

3
dx9sdk/lib/d3dx8dt.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eddac0b46ac664863136e9c3aa85fa5276e029b8972433fdf1cc40dcc3aefe8f
size 2467156

3
dx9sdk/lib/d3dx9.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b1cd009d5e5ed15080c4d7ad0245a273242da07e0747921e80ac3ccf9bc0fc2
size 87600

3
dx9sdk/lib/d3dx9d.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f97e80701a1ed7a4d13bc3315a76512ff9abe7dff595d4dd50c323aaf5147185
size 82790

3
dx9sdk/lib/d3dx9dt.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fd431d9ec65c3d3fd401b89aba77d83551e06ef80dcb725fdc89b8d78e90cf79
size 6980296

3
dx9sdk/lib/d3dxd.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2fa2491ea3fc524799b6a66e23b2f10c5f6ac028f1f53f37d53361978ebc9cce
size 565570

3
dx9sdk/lib/d3dxof.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6e02101d54f570d2bbb985292f4c6f0db105b067d32e865991a698faa78a34e6
size 1722

3
dx9sdk/lib/ddraw.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6e9e94271645a16f5dee111cf380eaea1dd03bafcfab676d4198cfd7900de036
size 4540

3
dx9sdk/lib/dinput.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6cefbeaf8688ea42259a055f84feec0410a666be6ddfdcc745c2661edeb123da
size 17790

3
dx9sdk/lib/dinput8.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:277158fb325b22fd10680779e73b7dec1b2f577c7129ac25f632168325bd4f5e
size 284368

3
dx9sdk/lib/dmoguids.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3fdecc54f091efe3f1888879e0f166c753a86984fb5624f96244f7abb45a3bb7
size 18408

3
dx9sdk/lib/dplayx.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0ec0bb6a248ddb690ef60d05a8f04003005a1c231e6e4fa42b1b013cca2900aa
size 3142

3
dx9sdk/lib/dsetup.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ca00eae1ab791a5fd790d5ff88637e0c1572d9e0c2ce519bebf6152555b9004b
size 5998

3
dx9sdk/lib/dsound.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:14cfc17975a4fa6e4d556f54e428feddfaf18bed92de0d88ff5cec056b12a232
size 4038

3
dx9sdk/lib/dxguid.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2980caa0e1508434f235e508774cd04ba10c7307ac1ac6cd9882c27af3d5a905
size 896294

3
dx9sdk/lib/dxtrans.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df37172800688fb7e3f5fdfdb74356dd1b3cf96f832f0853216e5cc77d5eefcf
size 3700

3
dx9sdk/lib/encapi.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7e413d10865eb1e926025377cd5f32e4ff43edb24a26ebe3a5c91816575a4991
size 1522

3
dx9sdk/lib/ksproxy.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ec6a36a095d3407c714c400c7b2af4ef99045e259bfa26159a4c54a3da6f55f
size 3054

3
dx9sdk/lib/ksuser.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:83637cc3955db5f8603629d2030208f5aeaa0d6d236e31c29d315f64bd25e13a
size 196016

3
dx9sdk/lib/msdmo.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6df9d8ce8bff23e0f9dcf5d53e863742c8d349dcc599962f05d2846689eb9431
size 4620

3
dx9sdk/lib/quartz.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a794047f31bd85d9672ee9abcadc4dc78d7a13a02727ed1e6ae9f7a31b810919
size 2370

3
dx9sdk/lib/strmiids.lib Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11049ebe22f538fd6ca0d6231012c01bf7b867ee181c976fdeba2a666926ae24
size 272820

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More