mirror of
https://github.com/celisej567/source-engine.git
synced 2026-01-02 01:48:16 +03:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c69afba381 | ||
|
|
bfb5b44d38 | ||
|
|
f735e7a036 | ||
|
|
a15db00bc0 | ||
|
|
3458c36d5a | ||
|
|
3d43e9fe3a | ||
|
|
e26b40d889 | ||
|
|
f63849bb34 | ||
|
|
7ca36e7b43 | ||
|
|
44fef251c5 | ||
|
|
be3d0e301f | ||
|
|
c44ae6211c | ||
|
|
4f4e74273a | ||
|
|
892fc662e4 | ||
|
|
bc909e9f96 | ||
|
|
ff2211f0ad | ||
|
|
af8c358ce9 | ||
|
|
8404418202 | ||
|
|
eff77f0a0a | ||
|
|
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 |
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
@@ -1,12 +1,6 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build-linux-i386:
|
||||
@@ -47,6 +41,17 @@ jobs:
|
||||
./waf.bat configure -T debug
|
||||
./waf.bat build
|
||||
|
||||
build-windows-amd64:
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build windows-amd64
|
||||
run: |
|
||||
git submodule init && git submodule update
|
||||
./waf.bat configure -T debug -8
|
||||
./waf.bat build
|
||||
|
||||
build-dedicated-windows-i386:
|
||||
runs-on: windows-2019
|
||||
|
||||
@@ -58,6 +63,17 @@ jobs:
|
||||
./waf.bat configure -T debug -d
|
||||
./waf.bat build
|
||||
|
||||
build-dedicated-windows-amd64:
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build dedicated windows-amd64
|
||||
run: |
|
||||
git submodule init && git submodule update
|
||||
./waf.bat configure -T debug -d -8
|
||||
./waf.bat build
|
||||
|
||||
build-dedicated-linux-i386:
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
|
||||
22
.github/workflows/tests.yml
vendored
22
.github/workflows/tests.yml
vendored
@@ -1,12 +1,6 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
tests-linux-i386:
|
||||
@@ -40,3 +34,17 @@ jobs:
|
||||
cd out
|
||||
$env:Path = "bin";
|
||||
./unittest.exe
|
||||
|
||||
tests-windows-amd64:
|
||||
runs-on: windows-2019
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run tests windows-amd64
|
||||
run: |
|
||||
git submodule init && git submodule update
|
||||
./waf.bat configure -T release --tests --prefix=out/ -8
|
||||
./waf.bat install
|
||||
cd out
|
||||
$env:Path = "bin";
|
||||
./unittest.exe
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -37,3 +37,5 @@ waf3*/
|
||||
.vscode/
|
||||
.depproj/
|
||||
source-engine.sln
|
||||
hl2/
|
||||
|
||||
|
||||
62
README.md
62
README.md
@@ -1,23 +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
|
||||
- [x] PBR 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 )
|
||||
{
|
||||
|
||||
@@ -270,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
|
||||
|
||||
@@ -1004,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 )
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -73,7 +73,7 @@ extern void longjmp( jmp_buf, int ) __attribute__((noreturn));
|
||||
|
||||
#if HAVE_PNG
|
||||
|
||||
#if ANDROID
|
||||
#if ANDROID || WIN32
|
||||
#include "libpng/png.h"
|
||||
#else
|
||||
#include <png.h>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace {
|
||||
#if defined( _X360 )
|
||||
#define AsyncMdlCache() 0 // Explicitly OFF for 360 (incompatible)
|
||||
#else
|
||||
#define AsyncMdlCache() 0
|
||||
#define AsyncMdlCache() 1
|
||||
#endif
|
||||
|
||||
#define ERROR_MODEL "models/error.mdl"
|
||||
@@ -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"
|
||||
|
||||
@@ -470,7 +470,7 @@ bool CDedicatedSteamApplication::Create( )
|
||||
//-----------------------------------------------------------------------------
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifndef POSIX
|
||||
#if !defined( POSIX ) && !defined( PLATFORM_64BITS )
|
||||
_asm
|
||||
{
|
||||
fninit
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
@@ -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 );
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user