mirror of
https://github.com/celisej567/source-engine.git
synced 2025-12-31 21:48:22 +03:00
Compare commits
139 Commits
dedicated-
...
1.15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ca36e7b43 | ||
|
|
44fef251c5 | ||
|
|
be3d0e301f | ||
|
|
c44ae6211c | ||
|
|
4f4e74273a | ||
|
|
892fc662e4 | ||
|
|
9bca259e0f | ||
|
|
8c0f758a57 | ||
|
|
26184742eb | ||
|
|
729ac111af | ||
|
|
20f5783225 | ||
|
|
d2b202836d | ||
|
|
2fb712af66 | ||
|
|
53bd92f7a8 | ||
|
|
807eaae850 | ||
|
|
a1c4e27718 | ||
|
|
ad5790eee6 | ||
|
|
c2cdd880bf | ||
|
|
d8580d59d2 | ||
|
|
54d76a1131 | ||
|
|
1f3b4583da | ||
|
|
cb0e405e0f | ||
|
|
006f82528e | ||
|
|
80c9ef37d7 | ||
|
|
dde72b675b | ||
|
|
de873d3fc3 | ||
|
|
db3062c60b | ||
|
|
8fbc002a37 | ||
|
|
e368f3e9a6 | ||
|
|
ba90de20d9 | ||
|
|
3a7d4319d6 | ||
|
|
b9a21f26ba | ||
|
|
cf44c39aaf | ||
|
|
2f15ebbfb8 | ||
|
|
bca0ae8c59 | ||
|
|
a68d5d8633 | ||
|
|
091b49e29c | ||
|
|
e5eaf0fa9e | ||
|
|
653e08bce4 | ||
|
|
d4e0a8108b | ||
|
|
5c5d990c87 | ||
|
|
5ab75bf9ef | ||
|
|
7a26688494 | ||
|
|
a269b89168 | ||
|
|
5af39f3d0d | ||
|
|
3f5ebfbde3 | ||
|
|
4ace9f8030 | ||
|
|
9c4ace30c3 | ||
|
|
a7611c481e | ||
|
|
d2f789853d | ||
|
|
5e9ce905f7 | ||
|
|
2dca8fd6c7 | ||
|
|
54f174d262 | ||
|
|
3daa537791 | ||
|
|
5a28ccec8c | ||
|
|
b1a3eafbe6 | ||
|
|
8a7e28d38d | ||
|
|
f07ba797c5 | ||
|
|
bf860c87c6 | ||
|
|
5912845f29 | ||
|
|
09924b7998 | ||
|
|
93c71cb74a | ||
|
|
efc1fc2a9b | ||
|
|
3e19d26a72 | ||
|
|
f11087b83a | ||
|
|
4c49154dc0 | ||
|
|
c91e68975b | ||
|
|
216bbf1baa | ||
|
|
fafc3554a5 | ||
|
|
1fe1d7b419 | ||
|
|
32c57a8a49 | ||
|
|
2cb00530c7 | ||
|
|
e11a21ea19 | ||
|
|
3dbe2cdd32 | ||
|
|
faca1ab142 | ||
|
|
3b153bc9c3 | ||
|
|
1f0ae521d6 | ||
|
|
c41148b9dd | ||
|
|
40c4f2b96f | ||
|
|
a16123e4be | ||
|
|
0a66367243 | ||
|
|
c909de8faf | ||
|
|
53ed9e3bd8 | ||
|
|
0d48bf354a | ||
|
|
dd1dc186f9 | ||
|
|
c0cbc669bc | ||
|
|
45d33c6b97 | ||
|
|
8b6ad0d342 | ||
|
|
9aa0ecab6a | ||
|
|
08e3444409 | ||
|
|
c0472cccbf | ||
|
|
9a03faec58 | ||
|
|
8a366537e7 | ||
|
|
27339449c0 | ||
|
|
69b377495b | ||
|
|
4838d9ee3f | ||
|
|
42b528dec3 | ||
|
|
387d15521a | ||
|
|
a0d8a59d58 | ||
|
|
148035ce31 | ||
|
|
21c54015a2 | ||
|
|
2e969d3890 | ||
|
|
81c354ee0d | ||
|
|
047b3e3150 | ||
|
|
68483bd0f6 | ||
|
|
d8f5cdfd3c | ||
|
|
8ab4c90f54 | ||
|
|
872243be56 | ||
|
|
c68b7af554 | ||
|
|
38fcc71c6e | ||
|
|
41414854db | ||
|
|
a87918565a | ||
|
|
08073ae622 | ||
|
|
c5607661f0 | ||
|
|
e852953d9d | ||
|
|
448b353844 | ||
|
|
b525e49d6f | ||
|
|
31c5944b5e | ||
|
|
d958e12dbd | ||
|
|
6c42a04f8a | ||
|
|
38209fe326 | ||
|
|
e8ffb402de | ||
|
|
e6901ffadf | ||
|
|
ccf0357a51 | ||
|
|
d628a7ae80 | ||
|
|
5caf8adbd7 | ||
|
|
e0db3b1a40 | ||
|
|
e8f26b4401 | ||
|
|
9779491774 | ||
|
|
29080d7649 | ||
|
|
3b475331f2 | ||
|
|
4ae9719b74 | ||
|
|
0f7d9d029f | ||
|
|
a9c5da7d69 | ||
|
|
48aa042ee1 | ||
|
|
50ff9922a6 | ||
|
|
1aa326b7f2 | ||
|
|
79e83bb97f | ||
|
|
8200eda3ec |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Build tests
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
42
.github/workflows/tests.yml
vendored
Normal file
42
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
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
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -31,10 +31,11 @@ game/client/*/client.lib
|
||||
game/server/*/server.lib
|
||||
.DS_Store
|
||||
build*/
|
||||
android/
|
||||
.cache/
|
||||
.ccache/
|
||||
waf3*/
|
||||
.vscode/
|
||||
.depproj/
|
||||
source-engine.sln
|
||||
source-engine.sln
|
||||
hl2/
|
||||
|
||||
|
||||
61
README.md
61
README.md
@@ -1,22 +1,49 @@
|
||||
# source-engine
|
||||
Welcome to source engine:)
|
||||
# Source Engine
|
||||
[](https://github.com/nillerusr/source-engine/actions/workflows/build.yml) [](https://github.com/nillerusr/source-engine/actions/workflows/tests.yml)
|
||||
Discord: [](https://discord.gg/hZRB7WMgGw)
|
||||
|
||||
|
||||
Discord: https://discord.gg/hZRB7WMgGw
|
||||
Information from [wikipedia](https://wikipedia.org/wiki/Source_(game_engine)):
|
||||
|
||||
Source is a 3D game engine developed by Valve.
|
||||
It debuted as the successor to GoldSrc with Half-Life: Source in June 2004,
|
||||
followed by Counter-Strike: Source and Half-Life 2 later that year.
|
||||
Source does not have a concise version numbering scheme; instead, it was released in incremental versions
|
||||
|
||||
Source code is based on TF2 2018 leak. Don't use it for commercial purposes.
|
||||
|
||||
This project is using waf buildsystem. If you have waf-related questions look https://waf.io/book
|
||||
|
||||
# Features:
|
||||
- Android, OSX, FreeBSD, Windows support
|
||||
- Arm support( except windows )
|
||||
- 64bit support
|
||||
- Modern toolchains support
|
||||
- Fixed many undefined behaviours
|
||||
- Touch support( even on windows/linux/osx )
|
||||
- VTF 7.5 support
|
||||
- PBR support
|
||||
- bsp v19-v21 support( bsp v21 support is partial, portal 2 and csgo maps works fine )
|
||||
- mdl v46-49 support
|
||||
- Removed useless/unnecessary dependencies
|
||||
- Achivement system working without steam
|
||||
- Fixed many bugs
|
||||
|
||||
# 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
|
||||
- [ ] improve performance
|
||||
- [ ] fixing bugs
|
||||
- [ ] dxvk-native support
|
||||
- [ ] Elbrus port
|
||||
- [ ] rewrite serverbrowser to work without steam
|
||||
- Rewrite materialsystem for OpenGL render
|
||||
- dxvk-native support
|
||||
- Elbrus port
|
||||
- Bink audio support( for video_bink )
|
||||
- Rewrite serverbrowser to work without steam
|
||||
|
||||
# How to Build?
|
||||
- [Windows](https://github.com/nillerusr/source-engine/wiki/How-to-build#on-windows)
|
||||
- [Linux](https://github.com/nillerusr/source-engine/wiki/How-to-build#on-linux)
|
||||
- [For Android under Linux](https://github.com/nillerusr/source-engine/wiki/How-to-build#on-linux-for-android)
|
||||
|
||||
# [How to Build?](https://github.com/nillerusr/source-engine/wiki/How-to-build)
|
||||
# Support me
|
||||
BTC: `bc1qnjq92jj9uqjtafcx2zvnwd48q89hgtd6w8a6na`
|
||||
|
||||
ETH: `0x5d0D561146Ed758D266E59B56e85Af0b03ABAF46`
|
||||
|
||||
XMR: `48iXvX61MU24m5VGc77rXQYKmoww3dZh6hn7mEwDaLVTfGhyBKq2teoPpeBq6xvqj4itsGh6EzNTzBty6ZDDevApCFNpsJ`
|
||||
|
||||
@@ -28,14 +28,6 @@
|
||||
#include "tier3/tier3.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CVguiMatSysApp::CVguiMatSysApp()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Create all singleton systems
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -631,8 +631,8 @@ void GLMDisplayInfo::Dump( int which )
|
||||
{
|
||||
SDLAPP_FUNC;
|
||||
|
||||
GLMPRINTF(("\n #%d: GLMDisplayInfo @ %08x, pixwidth=%d pixheight=%d",
|
||||
which, (int)this, m_info.m_displayPixelWidth, m_info.m_displayPixelHeight ));
|
||||
GLMPRINTF(("\n #%d: GLMDisplayInfo @ %p, pixwidth=%d pixheight=%d",
|
||||
which, this, m_info.m_displayPixelWidth, m_info.m_displayPixelHeight ));
|
||||
|
||||
FOR_EACH_VEC( *m_modes, i )
|
||||
{
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
#define GLMPRINTF(args)
|
||||
#endif
|
||||
|
||||
#ifdef OSX
|
||||
ConVar osx_rawinput_set_one_time( "osx_rawinput_set_one_time", "0", FCVAR_ARCHIVE|FCVAR_HIDDEN, "");
|
||||
#if defined( OSX ) || defined( ANDROID )
|
||||
ConVar rawinput_set_one_time( "rawinput_set_one_time", "0", FCVAR_ARCHIVE|FCVAR_HIDDEN, "");
|
||||
#endif
|
||||
|
||||
ConVar gl_blit_halfx( "gl_blit_halfx", "0" );
|
||||
@@ -206,8 +206,6 @@ 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 );
|
||||
}
|
||||
@@ -272,7 +270,7 @@ public:
|
||||
|
||||
// Get the next N events. The function returns the number of events that were filled into your array.
|
||||
virtual int GetEvents( CCocoaEvent *pEvents, int nMaxEventsToReturn, bool debugEvents = false );
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(PLATFORM_BSD)
|
||||
virtual int PeekAndRemoveKeyboardEvents( bool *pbEsc, bool *pbReturn, bool *pbSpace, bool debugEvent = false );
|
||||
#endif
|
||||
|
||||
@@ -1006,7 +1004,7 @@ int CSDLMgr::GetEvents( CCocoaEvent *pEvents, int nMaxEventsToReturn, bool debug
|
||||
return nToWrite;
|
||||
}
|
||||
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(PLATFORM_BSD)
|
||||
|
||||
int CSDLMgr::PeekAndRemoveKeyboardEvents( bool *pbEsc, bool *pbReturn, bool *pbSpace, bool debugEvent )
|
||||
{
|
||||
@@ -1141,17 +1139,15 @@ void CSDLMgr::OnFrameRendered()
|
||||
|
||||
ConVarRef rawinput( "m_rawinput" );
|
||||
|
||||
|
||||
#ifdef OSX
|
||||
// We default raw input to on on Mac and set it one time for all users since
|
||||
#if defined( OSX ) || defined( ANDROID )
|
||||
// We default raw input to on on Mac/Android and set it one time for all users since
|
||||
// it didn't used to be the default.
|
||||
if ( !osx_rawinput_set_one_time.GetBool() )
|
||||
if ( !rawinput_set_one_time.GetBool() )
|
||||
{
|
||||
osx_rawinput_set_one_time.SetValue( 1 );
|
||||
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;
|
||||
|
||||
@@ -18,13 +18,17 @@ def build(bld):
|
||||
source = [
|
||||
'AppSystemGroup.cpp',
|
||||
'../public/filesystem_init.cpp',
|
||||
# 'glmrendererinfo_osx.mm' [$OSXALL]
|
||||
]
|
||||
|
||||
if bld.env.SDL:
|
||||
source += [
|
||||
'sdlmgr.cpp'
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS == 'darwin':
|
||||
source += [
|
||||
'glmrendererinfo_osx.mm'
|
||||
]
|
||||
|
||||
if bld.env.DEST_OS == 'win32':
|
||||
source += [
|
||||
@@ -47,6 +51,9 @@ def build(bld):
|
||||
|
||||
libs = []
|
||||
|
||||
if bld.env.DEST_OS == 'darwin':
|
||||
libs += ['FOUNDATION', 'APPKIT', 'IOKIT']
|
||||
|
||||
bld.stlib(
|
||||
source = source,
|
||||
target = PROJECT_NAME,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <sys/cdefs.h>
|
||||
#elif defined(OSX)
|
||||
#elif defined(OSX) || defined(PLATFORM_BSD)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
@@ -54,6 +54,8 @@ 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;
|
||||
@@ -61,10 +63,23 @@ 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 || WIN32
|
||||
#include "libpng/png.h"
|
||||
#else
|
||||
#include <png.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
@@ -93,6 +108,8 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
#if HAVE_JPEG
|
||||
|
||||
struct ValveJpegErrorHandler_t
|
||||
{
|
||||
// The default manager
|
||||
@@ -129,12 +146,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 )
|
||||
#if !defined( _X360 ) && HAVE_JPEG
|
||||
|
||||
//
|
||||
// !FIXME! This really probably should use ImgUtl_ReadJPEGAsRGBA, to avoid duplicated code.
|
||||
@@ -485,7 +502,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 )
|
||||
#if !defined( _X360 ) && HAVE_JPEG
|
||||
struct jpeg_decompress_struct jpegInfo;
|
||||
struct ValveJpegErrorHandler_t jerr;
|
||||
JSAMPROW row_pointer[1];
|
||||
@@ -636,6 +653,7 @@ 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 )
|
||||
{
|
||||
|
||||
@@ -654,19 +672,37 @@ 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 )
|
||||
#if !defined( _X360 ) && HAVE_PNG
|
||||
|
||||
// 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 );
|
||||
@@ -679,7 +715,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 )
|
||||
#if !defined( _X360 ) && HAVE_PNG
|
||||
|
||||
png_const_bytep pngData = (png_const_bytep)buffer.Base();
|
||||
if (png_sig_cmp( pngData, 0, 8))
|
||||
@@ -1470,7 +1506,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");
|
||||
CSysModule *vtexmod = Sys_LoadModule("vtex_dll" DLL_EXT_STRING);
|
||||
if (vtexmod == NULL)
|
||||
{
|
||||
Msg( "Failed to open TGA conversion module vtex_dll: %s\n", tgaPath);
|
||||
@@ -1519,6 +1555,17 @@ 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
|
||||
@@ -1709,12 +1756,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));
|
||||
#else
|
||||
#elif !UTILS
|
||||
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) != '.'))
|
||||
{
|
||||
@@ -1826,6 +1873,7 @@ 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 )
|
||||
{
|
||||
|
||||
@@ -1927,11 +1975,13 @@ 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;
|
||||
@@ -2012,12 +2062,14 @@ 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]
|
||||
@@ -2067,13 +2119,16 @@ 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 )
|
||||
#if !defined( _X360 ) && HAVE_JPEG
|
||||
|
||||
JSAMPROW row_pointer[1]; // pointer to JSAMPLE row[s]
|
||||
int row_stride; // physical row width in image buffer
|
||||
@@ -2214,6 +2269,7 @@ 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;
|
||||
@@ -2226,10 +2282,14 @@ 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() );
|
||||
@@ -2252,6 +2312,9 @@ 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 )
|
||||
|
||||
@@ -420,7 +420,7 @@ FORCE_INLINE uint32_t _mm_crc32_u8(uint32_t, uint8_t);
|
||||
|
||||
// Older gcc does not define vld1q_u8_x4 type
|
||||
#if defined(__GNUC__) && !defined(__clang__) && \
|
||||
((__GNUC__ <= 10 && defined(__arm__)) || \
|
||||
(defined(__arm__) || \
|
||||
(__GNUC__ == 10 && __GNUC_MINOR__ < 3 && defined(__aarch64__)) || \
|
||||
(__GNUC__ <= 9 && defined(__aarch64__)))
|
||||
FORCE_INLINE uint8x16x4_t _sse2neon_vld1q_u8_x4(const uint8_t *p)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "filesystem.h"
|
||||
#include "vguifont.h"
|
||||
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
#ifdef POSIX
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
typedef void *(*FontDataHelper)( const char *pchFontName, int &size, const char *fontFileName );
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
IFileSystem *FileSystem() { return m_pFileSystem; }
|
||||
IMaterialSystem *MaterialSystem() { return m_pMaterialSystem; }
|
||||
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
#ifdef POSIX
|
||||
FT_Library GetFontLibraryHandle() { return library; }
|
||||
void SetFontDataHelper( FontDataHelper helper ) { m_pFontDataHelper = helper; }
|
||||
#endif
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
CUtlVector<CFontAmalgam> m_FontAmalgams;
|
||||
CUtlVector<font_t *> m_Win32Fonts;
|
||||
|
||||
#if defined(LINUX) || defined(OSX)
|
||||
#ifdef POSIX
|
||||
FT_Library library;
|
||||
FontDataHelper m_pFontDataHelper;
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@ struct newChar_t
|
||||
#ifdef WIN32
|
||||
#include "Win32Font.h"
|
||||
typedef CWin32Font font_t;
|
||||
#elif defined(LINUX) || defined(OSX)
|
||||
#elif defined(POSIX)
|
||||
#include "linuxfont.h"
|
||||
typedef CLinuxFont font_t;
|
||||
#else
|
||||
@@ -31,4 +31,4 @@ typedef CLinuxFont font_t;
|
||||
#endif
|
||||
|
||||
|
||||
#endif //VGUIFONT_H
|
||||
#endif //VGUIFONT_H
|
||||
|
||||
@@ -1680,6 +1680,36 @@ bool CMDLCache::BuildHardwareData( MDLHandle_t handle, studiodata_t *pStudioData
|
||||
|
||||
Assert( GetVertexData( handle ) );
|
||||
|
||||
if( pStudioHdr->version == 49 )
|
||||
{
|
||||
for( int i = 0; i < pVtxHdr->numBodyParts; i++)
|
||||
{
|
||||
OptimizedModel::BodyPartHeader_t *pBodyPartHdr = pVtxHdr->pBodyPart(i);
|
||||
|
||||
for( int j = 0; j < pBodyPartHdr->numModels; j++ )
|
||||
{
|
||||
OptimizedModel::ModelHeader_t *pModelHdr = pBodyPartHdr->pModel(j);
|
||||
|
||||
for( int k = 0; k < pModelHdr->numLODs; k++)
|
||||
{
|
||||
OptimizedModel::ModelLODHeader_t *pModelLODHdr = pModelHdr->pLOD(k);
|
||||
|
||||
for( int l = 0; l < pModelLODHdr->numMeshes; l++ )
|
||||
{
|
||||
OptimizedModel::MeshHeader_t *pMeshHdr = pModelLODHdr->pMesh(l);
|
||||
pMeshHdr->flags |= OptimizedModel::MESH_IS_MDL49;
|
||||
|
||||
for( int m = 0; m < pMeshHdr->numStripGroups; m++ )
|
||||
{
|
||||
OptimizedModel::StripGroupHeader_t *pStripGroupHdr = pMeshHdr->pStripGroup(m);
|
||||
pStripGroupHdr->flags |= OptimizedModel::STRIPGROUP_IS_MDL49;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BeginLock();
|
||||
bool bLoaded = g_pStudioRender->LoadModel( pStudioHdr, pVtxHdr, &pStudioData->m_HardwareData );
|
||||
EndLock();
|
||||
|
||||
@@ -377,7 +377,7 @@ private:
|
||||
{
|
||||
DmObjectId_t m_id;
|
||||
DmElementReference_t m_ref;
|
||||
ElementIdHandlePair_t() {}
|
||||
ElementIdHandlePair_t() = default;
|
||||
explicit ElementIdHandlePair_t( const DmObjectId_t &id ) : m_ref()
|
||||
{
|
||||
CopyUniqueId( id, &m_id );
|
||||
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
{
|
||||
DmObjectId_t m_oldId;
|
||||
DmObjectId_t m_newId;
|
||||
DmIdPair_t() {}
|
||||
DmIdPair_t() = default;
|
||||
DmIdPair_t( const DmObjectId_t &id )
|
||||
{
|
||||
CopyUniqueId( id, &m_oldId );
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
#include <stdlib.h>
|
||||
#include "interface.h"
|
||||
#include <string.h>
|
||||
#ifdef OSX
|
||||
#include <malloc/malloc.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include "tier1/strtools.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "tier0/dbg.h"
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef OSX
|
||||
#include <malloc/malloc.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
@@ -206,11 +206,11 @@ int main( int argc, char *argv[] )
|
||||
void *tier0 = dlopen( "libtier0" DLL_EXT_STRING, RTLD_NOW );
|
||||
void *vstdlib = dlopen( "libvstdlib" DLL_EXT_STRING, RTLD_NOW );
|
||||
|
||||
const char *pBinaryName = "dedicated" DLL_EXT_STRING;
|
||||
const char *pBinaryName = "bin/dedicated" DLL_EXT_STRING;
|
||||
|
||||
void *dedicated = dlopen( pBinaryName, RTLD_NOW );
|
||||
if ( !dedicated )
|
||||
dedicated = dlopen( "libdedicated" DLL_EXT_STRING, RTLD_NOW );
|
||||
dedicated = dlopen( "bin/libdedicated" DLL_EXT_STRING, RTLD_NOW );
|
||||
|
||||
if ( !dedicated )
|
||||
{
|
||||
|
||||
@@ -231,7 +231,7 @@ enum
|
||||
class CDmxElementDictionary
|
||||
{
|
||||
public:
|
||||
CDmxElementDictionary();
|
||||
CDmxElementDictionary() = default;
|
||||
|
||||
DmxElementDictHandle_t InsertElement( CDmxElement *pElement );
|
||||
CDmxElement *GetElement( DmxElementDictHandle_t handle );
|
||||
@@ -287,15 +287,6 @@ private:
|
||||
AttributeList_t m_ArrayAttributes;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CDmxElementDictionary::CDmxElementDictionary()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Clears the dictionary
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef struct D3DXFLOAT16
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXFLOAT16() {};
|
||||
D3DXFLOAT16() = default;
|
||||
D3DXFLOAT16( FLOAT );
|
||||
D3DXFLOAT16( CONST D3DXFLOAT16& );
|
||||
|
||||
@@ -88,7 +88,7 @@ typedef struct D3DXVECTOR2
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXVECTOR2() {};
|
||||
D3DXVECTOR2() = default;
|
||||
D3DXVECTOR2( CONST FLOAT * );
|
||||
D3DXVECTOR2( CONST D3DXFLOAT16 * );
|
||||
D3DXVECTOR2( FLOAT x, FLOAT y );
|
||||
@@ -134,7 +134,7 @@ typedef struct D3DXVECTOR2_16F
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXVECTOR2_16F() {};
|
||||
D3DXVECTOR2_16F() = default;
|
||||
D3DXVECTOR2_16F( CONST FLOAT * );
|
||||
D3DXVECTOR2_16F( CONST D3DXFLOAT16 * );
|
||||
D3DXVECTOR2_16F( CONST D3DXFLOAT16 &x, CONST D3DXFLOAT16 &y );
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
typedef struct D3DXVECTOR3 : public D3DVECTOR
|
||||
{
|
||||
public:
|
||||
D3DXVECTOR3() {};
|
||||
D3DXVECTOR3() = default;
|
||||
D3DXVECTOR3( CONST FLOAT * );
|
||||
D3DXVECTOR3( CONST D3DVECTOR& );
|
||||
D3DXVECTOR3( CONST D3DXFLOAT16 * );
|
||||
@@ -208,7 +208,7 @@ typedef struct D3DXVECTOR3_16F
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXVECTOR3_16F() {};
|
||||
D3DXVECTOR3_16F() = default;
|
||||
D3DXVECTOR3_16F( CONST FLOAT * );
|
||||
D3DXVECTOR3_16F( CONST D3DVECTOR& );
|
||||
D3DXVECTOR3_16F( CONST D3DXFLOAT16 * );
|
||||
@@ -237,7 +237,7 @@ typedef struct D3DXVECTOR4
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXVECTOR4() {};
|
||||
D3DXVECTOR4() = default;
|
||||
D3DXVECTOR4( CONST FLOAT* );
|
||||
D3DXVECTOR4( CONST D3DXFLOAT16* );
|
||||
D3DXVECTOR4( CONST D3DVECTOR& xyz, FLOAT w );
|
||||
@@ -281,7 +281,7 @@ typedef struct D3DXVECTOR4_16F
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXVECTOR4_16F() {};
|
||||
D3DXVECTOR4_16F() = default;
|
||||
D3DXVECTOR4_16F( CONST FLOAT * );
|
||||
D3DXVECTOR4_16F( CONST D3DXFLOAT16* );
|
||||
D3DXVECTOR4_16F( CONST D3DXVECTOR3_16F& xyz, CONST D3DXFLOAT16& w );
|
||||
@@ -426,7 +426,7 @@ typedef struct D3DXQUATERNION
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXQUATERNION() {}
|
||||
D3DXQUATERNION() = default;
|
||||
D3DXQUATERNION( CONST FLOAT * );
|
||||
D3DXQUATERNION( CONST D3DXFLOAT16 * );
|
||||
D3DXQUATERNION( FLOAT x, FLOAT y, FLOAT z, FLOAT w );
|
||||
@@ -472,7 +472,7 @@ typedef struct D3DXPLANE
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXPLANE() {}
|
||||
D3DXPLANE() = default;
|
||||
D3DXPLANE( CONST FLOAT* );
|
||||
D3DXPLANE( CONST D3DXFLOAT16* );
|
||||
D3DXPLANE( FLOAT a, FLOAT b, FLOAT c, FLOAT d );
|
||||
@@ -513,7 +513,7 @@ typedef struct D3DXCOLOR
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
public:
|
||||
D3DXCOLOR() {}
|
||||
D3DXCOLOR() = default;
|
||||
D3DXCOLOR( DWORD argb );
|
||||
D3DXCOLOR( CONST FLOAT * );
|
||||
D3DXCOLOR( CONST D3DXFLOAT16 * );
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $Workfile: $
|
||||
// $Date: $
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include "audio_pch.h"
|
||||
@@ -62,5 +62,5 @@
|
||||
#include "xbox/xbox_win32stubs.h"
|
||||
#include <xhv2.h>
|
||||
#elif POSIX
|
||||
#include "audio/private/posix_stubs.h"
|
||||
#include "audio/posix_stubs.h"
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "eax.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "video//ivideoservices.h"
|
||||
#include "../../sys_dll.h"
|
||||
#include "sys_dll.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -9,8 +9,8 @@
|
||||
#if !DEDICATED
|
||||
|
||||
#include "tier0/dynfunction.h"
|
||||
#include "video//ivideoservices.h"
|
||||
#include "../../sys_dll.h"
|
||||
#include "video/ivideoservices.h"
|
||||
#include "sys_dll.h"
|
||||
|
||||
// prevent some conflicts in SDL headers...
|
||||
#undef M_PI
|
||||
@@ -13,28 +13,28 @@
|
||||
#include "con_nprint.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "vox_private.h"
|
||||
#include "../../traceinit.h"
|
||||
#include "../../cmd.h"
|
||||
#include "traceinit.h"
|
||||
#include "cmd.h"
|
||||
#include "toolframework/itoolframework.h"
|
||||
#include "vstdlib/random.h"
|
||||
#include "vstdlib/jobthread.h"
|
||||
#include "vaudio/ivaudio.h"
|
||||
#include "../../client.h"
|
||||
#include "../../cl_main.h"
|
||||
#include "client.h"
|
||||
#include "cl_main.h"
|
||||
#include "utldict.h"
|
||||
#include "mempool.h"
|
||||
#include "../../enginetrace.h" // for traceline
|
||||
#include "../../public/bspflags.h" // for traceline
|
||||
#include "../../public/gametrace.h" // for traceline
|
||||
#include "enginetrace.h" // for traceline
|
||||
#include "bspflags.h" // for traceline
|
||||
#include "gametrace.h" // for traceline
|
||||
#include "vphysics_interface.h" // for surface props
|
||||
#include "../../ispatialpartitioninternal.h" // for entity enumerator
|
||||
#include "../../debugoverlay.h"
|
||||
#include "ispatialpartitioninternal.h" // for entity enumerator
|
||||
#include "debugoverlay.h"
|
||||
#include "icliententity.h"
|
||||
#include "../../cmodel_engine.h"
|
||||
#include "../../staticpropmgr.h"
|
||||
#include "../../server.h"
|
||||
#include "cmodel_engine.h"
|
||||
#include "staticpropmgr.h"
|
||||
#include "server.h"
|
||||
#include "edict.h"
|
||||
#include "../../pure_server.h"
|
||||
#include "pure_server.h"
|
||||
#include "filesystem/IQueuedLoader.h"
|
||||
#include "voice.h"
|
||||
#if defined( _X360 )
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "snd_mix_buf.h"
|
||||
|
||||
#include "iprediction.h"
|
||||
#include "../../common.h" // for parsing routines
|
||||
#include "common.h" // for parsing routines
|
||||
#include "vstdlib/random.h"
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -7,10 +7,10 @@
|
||||
#include "audio_pch.h"
|
||||
|
||||
#include "mouthinfo.h"
|
||||
#include "../../cl_main.h"
|
||||
#include "cl_main.h"
|
||||
#include "icliententitylist.h"
|
||||
#include "icliententity.h"
|
||||
#include "../../sys_dll.h"
|
||||
#include "sys_dll.h"
|
||||
#include "video/ivideoservices.h"
|
||||
#include "engine/IEngineSound.h"
|
||||
|
||||
@@ -123,15 +123,13 @@ void CAudioMixerWaveADPCM::DecompressBlockMono( short *pOut, const char *pIn, in
|
||||
int co2 = m_pCoefficients[pred].iCoef2;
|
||||
|
||||
// read initial delta
|
||||
int delta = *((short *)pIn);
|
||||
pIn += 2;
|
||||
short data[3];
|
||||
memcpy( data, pIn, sizeof(data) );
|
||||
pIn += sizeof(data);
|
||||
|
||||
// read initial samples for prediction
|
||||
int samp1 = *((short *)pIn);
|
||||
pIn += 2;
|
||||
|
||||
int samp2 = *((short *)pIn);
|
||||
pIn += 2;
|
||||
int delta = data[0];
|
||||
int samp1 = data[1];
|
||||
int samp2 = data[2];
|
||||
|
||||
// write out the initial samples (stored in reverse order)
|
||||
*pOut++ = (short)samp2;
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "snd_mp3_source.h"
|
||||
#include "utlsymbol.h"
|
||||
#include "checksum_crc.h"
|
||||
#include "../../host.h"
|
||||
#include "host.h"
|
||||
#include "xwvfile.h"
|
||||
#include "filesystem/IQueuedLoader.h"
|
||||
#include "tier1/lzmaDecoder.h"
|
||||
@@ -107,7 +107,6 @@ IAudioDevice *IAudioDevice::AutoDetectInit( bool waveOnly )
|
||||
#elif defined( USE_SDL )
|
||||
DevMsg( "Trying SDL Audio Interface\n" );
|
||||
pDevice = Audio_CreateSDLAudioDevice();
|
||||
|
||||
#ifdef NEVER
|
||||
// Jul 2012. mikesart. E-mail exchange with Ryan Gordon after figuring out that
|
||||
// Audio_CreatePulseAudioDevice() wasn't working on Ubuntu 12.04 (lots of stuttering).
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "ivoicerecord.h"
|
||||
#include "ivoicecodec.h"
|
||||
#include "filesystem.h"
|
||||
#include "../../filesystem_engine.h"
|
||||
#include "filesystem_engine.h"
|
||||
#include "tier1/utlbuffer.h"
|
||||
#if defined( _X360 )
|
||||
#include "xauddefs.h"
|
||||
@@ -7,6 +7,7 @@
|
||||
//=============================================================================//
|
||||
// This module implements the voice record and compression functions
|
||||
|
||||
#if HAVE_OPENAL
|
||||
//#include "audio_pch.h"
|
||||
//#include "voice.h"
|
||||
#include "tier0/platform.h"
|
||||
@@ -207,3 +208,5 @@ IVoiceRecord* CreateVoiceRecord_OpenAL(int sampleRate)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "engine/IEngineSound.h"
|
||||
#include "utlsymbol.h"
|
||||
#include "utldict.h"
|
||||
#include "../../MapReslistGenerator.h"
|
||||
#include "MapReslistGenerator.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -20,6 +20,11 @@
|
||||
#include <copyfile.h>
|
||||
#import <mach/mach_host.h>
|
||||
#import <sys/sysctl.h>
|
||||
#elif defined(PLATFORM_BSD)
|
||||
# include <sys/sysctl.h>
|
||||
# include <sys/types.h>
|
||||
# include <fcntl.h>
|
||||
# define HW_MEMSIZE HW_PHYSMEM
|
||||
#elif defined(LINUX)
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -105,7 +110,7 @@
|
||||
#define BUG_REPOSITORY_URL "\\\\fileserver\\bugs"
|
||||
#elif defined(OSX)
|
||||
#define BUG_REPOSITORY_URL "/Volumes/bugs"
|
||||
#elif defined(LINUX)
|
||||
#elif defined(LINUX) || defined(PLATFORM_BSD)
|
||||
#define BUG_REPOSITORY_URL "\\\\fileserver\\bugs"
|
||||
#else
|
||||
//#error
|
||||
@@ -139,7 +144,7 @@ unsigned long GetRam()
|
||||
MEMORYSTATUS stat;
|
||||
GlobalMemoryStatus( &stat );
|
||||
return (stat.dwTotalPhys / (1024 * 1024));
|
||||
#elif defined(OSX)
|
||||
#elif defined(OSX) || defined(PLATFORM_BSD)
|
||||
int mib[2] = { CTL_HW, HW_MEMSIZE };
|
||||
u_int namelen = sizeof(mib) / sizeof(mib[0]);
|
||||
uint64_t memsize;
|
||||
@@ -340,6 +345,12 @@ void DisplaySystemVersion( char *osversion, int maxlen )
|
||||
|
||||
fclose( fpKernelVer );
|
||||
}
|
||||
#elif PLATFORM_BSD
|
||||
#ifdef __FreeBSD__
|
||||
osversion = (char *)"FreeBSD";
|
||||
#else
|
||||
osversion = (char *)"*BSD";
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2246,7 +2257,7 @@ void NonFileSystem_CreatePath (const char *path)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LINUX
|
||||
#if defined(LINUX) || defined(PLATFORM_BSD)
|
||||
#define COPYFILE_ALL 0
|
||||
#define BSIZE 65535
|
||||
int copyfile( const char *local, const char *remote, void *ignored, int ignoredFlags )
|
||||
|
||||
@@ -71,13 +71,16 @@ void CBenchmarkResults::StartBenchmark( const CCommand &args )
|
||||
SetResultsFilename( pszFilename );
|
||||
|
||||
// set any necessary settings
|
||||
host_framerate.SetValue( (float)(1.0f / host_state.interval_per_tick) );
|
||||
//host_framerate.SetValue( (float)(1.0f / host_state.interval_per_tick) );
|
||||
|
||||
// get the current frame and time
|
||||
m_iStartFrame = host_framecount;
|
||||
m_flStartTime = realtime;
|
||||
|
||||
m_flNextSecondTime = realtime + 1.0f;
|
||||
m_iNextSecondFrame = host_framecount;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: writes out results to file
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -86,7 +89,7 @@ void CBenchmarkResults::StopBenchmark()
|
||||
m_bIsTestRunning = false;
|
||||
|
||||
// reset
|
||||
host_framerate.SetValue( 0 );
|
||||
//host_framerate.SetValue( 0 );
|
||||
|
||||
// print out some stats
|
||||
int numticks = host_framecount - m_iStartFrame;
|
||||
@@ -103,12 +106,23 @@ void CBenchmarkResults::StopBenchmark()
|
||||
kv->SetFloat( "framerate", framerate );
|
||||
kv->SetInt( "build", build_number() );
|
||||
|
||||
CUtlString str;
|
||||
for( int i = 0; i < m_FPSInfo.Count(); i++ )
|
||||
{
|
||||
str += m_FPSInfo[i];
|
||||
if( i != m_FPSInfo.Count()-1 )
|
||||
str += ',';
|
||||
}
|
||||
kv->SetString( "framerates", str );
|
||||
|
||||
// get material system info
|
||||
GetMaterialSystemConfigForBenchmarkUpload( kv );
|
||||
|
||||
// save
|
||||
kv->SaveToFile( g_pFileSystem, szFilename, "MOD" );
|
||||
kv->deleteThis();
|
||||
|
||||
m_FPSInfo.Purge();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -152,6 +166,20 @@ void CBenchmarkResults::Upload()
|
||||
#endif
|
||||
}
|
||||
|
||||
void CBenchmarkResults::Frame()
|
||||
{
|
||||
if( !m_bIsTestRunning )
|
||||
return;
|
||||
|
||||
if( m_flNextSecondTime <= realtime )
|
||||
{
|
||||
m_FPSInfo.AddToTail( host_framecount-m_iNextSecondFrame );
|
||||
m_flNextSecondTime += 1.0f;
|
||||
m_iNextSecondFrame = host_framecount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CON_COMMAND_F( bench_start, "Starts gathering of info. Arguments: filename to write results into", FCVAR_CHEAT )
|
||||
{
|
||||
GetBenchResultsMgr()->StartBenchmark( args );
|
||||
|
||||
@@ -34,13 +34,19 @@ public:
|
||||
void StopBenchmark();
|
||||
void SetResultsFilename( const char *pFilename );
|
||||
void Upload();
|
||||
void Frame();
|
||||
|
||||
private:
|
||||
bool m_bIsTestRunning;
|
||||
char m_szFilename[256];
|
||||
|
||||
int m_flStartTime;
|
||||
float m_flStartTime;
|
||||
int m_iStartFrame;
|
||||
|
||||
float m_flNextSecondTime;
|
||||
int m_iNextSecondFrame;
|
||||
|
||||
CUtlVector<int> m_FPSInfo;
|
||||
};
|
||||
|
||||
inline CBenchmarkResults *GetBenchResultsMgr()
|
||||
|
||||
@@ -637,10 +637,6 @@ void CDemoRecorder::StartupDemoFile( void )
|
||||
g_ClientDLL->OnDemoRecordStart( m_szDemoBaseName );
|
||||
}
|
||||
|
||||
CDemoRecorder::CDemoRecorder()
|
||||
{
|
||||
}
|
||||
|
||||
CDemoRecorder::~CDemoRecorder()
|
||||
{
|
||||
CloseDemoFile();
|
||||
|
||||
@@ -123,7 +123,7 @@ class CDemoRecorder : public IDemoRecorder
|
||||
{
|
||||
public:
|
||||
~CDemoRecorder();
|
||||
CDemoRecorder();
|
||||
CDemoRecorder() = default;
|
||||
|
||||
CDemoFile *GetDemoFile( void );
|
||||
int GetRecordingTick( void );
|
||||
|
||||
@@ -2738,6 +2738,7 @@ static ConCommand startupmenu( "startupmenu", &CL_CheckToDisplayStartupMenus, "O
|
||||
ConVar cl_language( "cl_language", "english", FCVAR_USERINFO, "Language (from HKCU\\Software\\Valve\\Steam\\Language)" );
|
||||
void CL_InitLanguageCvar()
|
||||
{
|
||||
Msg("CL_InitLanguageCvar\n");
|
||||
if ( Steam3Client().SteamApps() )
|
||||
{
|
||||
cl_language.SetValue( Steam3Client().SteamApps()->GetCurrentGameLanguage() );
|
||||
@@ -2747,15 +2748,22 @@ void CL_InitLanguageCvar()
|
||||
char *szLang = getenv("LANG");
|
||||
|
||||
if ( CommandLine()->CheckParm( "-language" ) )
|
||||
{
|
||||
cl_language.SetValue( CommandLine()->ParmValue( "-language", "english") );
|
||||
return;
|
||||
}
|
||||
else if( szLang )
|
||||
{
|
||||
ELanguage lang = PchLanguageICUCodeToELanguage(szLang, k_Lang_English);
|
||||
const char *szShortLang = GetLanguageShortName(lang);
|
||||
cl_language.SetValue( szShortLang );
|
||||
if( Q_strncmp(szShortLang, "none", 4) != 0 )
|
||||
{
|
||||
cl_language.SetValue( szShortLang );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
cl_language.SetValue( "english" );
|
||||
|
||||
cl_language.SetValue( "english" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user