Compare commits

..

58 Commits
1.14 ... win64

Author SHA1 Message Date
HappyDOGE
c69afba381 Merge branch 'master' into win64 2023-01-23 19:16:19 +03:00
HappyDOGE
bfb5b44d38 win64: misc pointer truncation fixes 2023-01-16 11:56:05 +03:00
Er2
f735e7a036 Fix HTML MOTD (#174) 2023-01-14 20:47:16 +03:00
nillerusr
a15db00bc0 materialsystem: threaded optimizations, fix mat_queue_mode on some android devices 2023-01-14 15:53:33 +03:00
nillerusr
3458c36d5a datacache: enable async mode(was disabled in TF2 branch, lol?) 2023-01-13 01:51:19 +03:00
nillerusr
3d43e9fe3a togles: optimize PBO usage 2023-01-12 20:48:13 +03:00
exstrim401
e26b40d889 Basic Steam Dick support (#166)
Without gamepadui library
2023-01-08 15:38:24 +03:00
nillerusr
f63849bb34 vtf: fix cubemap loading for vtf versions less than 7.5 2023-01-02 16:39:44 +03:00
nillerusr
7ca36e7b43 launcher(android): fix crashhandler initialization 2022-12-31 19:14:30 +03:00
LegendGuard
44fef251c5 Add forgotten VTF 7.5 support (#160)
VTF 7.5 support was added some time ago, the issue #83 was solved. 
This is important for making artists, mappers and modelers know.
2022-12-29 17:31:44 +03:00
nillerusr
be3d0e301f Update README.md 2022-12-19 00:37:13 +03:00
nillerusr
c44ae6211c restore MAXSTUDIOBONES value 2022-12-18 20:24:28 +03:00
nillerusr
4f4e74273a sse2neon: typo fix 2022-12-17 19:55:22 +03:00
nillerusr
892fc662e4 sse2neon: fix armhf build( fixes #157 ) 2022-12-17 18:27:04 +03:00
nillerusr
bc909e9f96 windows(amd64): fix EHANDLE size( fixes saverestore ) 2022-12-17 12:21:22 +03:00
nillerusr
ff2211f0ad windows: fix(workaround) illegal instruction in release build 2022-12-17 10:14:49 +03:00
nillerusr
af8c358ce9 windows: fix dedicated build 2022-12-16 19:47:53 +03:00
nillerusr
8404418202 windows: add workflows for amd64 target architecture 2022-12-16 19:23:23 +03:00
nillerusr
eff77f0a0a windows: fix 64bit build( #149 ) 2022-12-16 19:20:56 +03:00
exstrim401
9bca259e0f Make net_usesocketsforloopback 1 by default (#153)
Fixes connection to localhost server on macOS
2022-12-05 19:23:43 +03:00
nillerusr
8c0f758a57 bsp: change MAX_MAP_DISPINFO value to 4096 2022-12-02 21:45:33 +03:00
nillerusr
26184742eb update ivp submodule 2022-11-30 16:00:03 +03:00
nillerusr
729ac111af engine: add bsp v21 support, add StaticPropLump_t v7-v11 support 2022-11-30 15:58:19 +03:00
nillerusr
20f5783225 vtf: fix cubemap loading 2022-11-30 14:07:51 +03:00
nillerusr
d2b202836d add MDL version 49 support 2022-11-29 18:49:29 +03:00
exstrim401
2fb712af66 Fix macOS build (#146)
* Fix macOS build
* Fix *BSD build
* Add missing *BSD include
2022-11-27 16:48:27 +03:00
Er2
53bd92f7a8 BSD: Add support (#140)
* BSD: Add support

* BSD: other fixes

There is still a bug when vgui haven't got text, maybe because of resources.

Also there is bug where when trying to start new game caption names shows wrong.

* BSD: Debugging

* BSD: modify preprocessor and fix windows

* BSD: Remove debugging and fix labels in gameui

* BSD: Remove disabling some DX9 commands

* BSD: Remove -g flag
2022-11-24 22:04:29 +03:00
exstrim401
807eaae850 Pretend macOS to be Linux in KeyValues (#145)
Workaround for FL_Load_Glyph error
2022-11-24 20:29:11 +03:00
exstrim401
a1c4e27718 Don't use objcopy for macOS build (#143)
* Don't use objcopy for macOS build

* Add -x option to strip on macOS
Without -x strip results in error for dylib
2022-11-21 21:18:35 +03:00
exstrim401
ad5790eee6 Don't use -march=native on macOS 2022-11-20 21:04:32 +03:00
nillerusr
c2cdd880bf Merge pull request #142 from exstrim401/macos
macOS build support
2022-11-20 20:35:30 +03:00
exstrim401
d8580d59d2 Fix CreateThreadPool 2022-11-20 19:32:30 +02:00
exstrim401
54d76a1131 Move mm_hook to separate file 2022-11-20 16:47:32 +02:00
exstrim401
1f3b4583da macOS build support 2022-11-20 15:00:44 +02:00
nillerusr
cb0e405e0f Merge pull request #133 from SanyaSho/master
string vulnerabilities
2022-11-20 11:41:02 +03:00
nillerusr
006f82528e Merge pull request #135 from nillerusr/optimization
Optimization branch
2022-11-20 11:39:37 +03:00
nillerusr
80c9ef37d7 Add cflags/ldflags, SDL version to engine.log 2022-11-16 13:58:09 +03:00
nillerusr
dde72b675b update ivp submodule 2022-11-16 13:51:28 +03:00
nillerusr
de873d3fc3 engine: upgrade benchmark 2022-11-16 13:51:03 +03:00
nillerusr
db3062c60b WIP: fix some memaccess-class warnings 2022-11-16 13:28:39 +03:00
nillerusr
8fbc002a37 Replace empty constructors with default constructors #88 2022-11-05 14:23:05 +03:00
SanyaSho
e368f3e9a6 game: fix string vulnerabilities 2022-11-04 01:28:39 +00:00
nillerusr
ba90de20d9 game/server: fix particle transition from trigger_vphysics_motion 2022-10-31 19:59:10 +03:00
nillerusr
3a7d4319d6 utils/vtex: fix windows build ( fixes #125 ) 2022-10-24 03:59:43 +03:00
nillerusr
b9a21f26ba game/client(android): view optimization 2022-10-17 00:01:23 +03:00
nillerusr
cf44c39aaf video: add initial implementation for video_bink 2022-10-13 17:55:10 +03:00
nillerusr
2f15ebbfb8 wscript: add videoservices 2022-10-13 17:47:27 +03:00
nillerusr
bca0ae8c59 engine/audio: fix build 2022-10-12 05:31:18 +03:00
nillerusr
a68d5d8633 engine: move engine/audio/public to public/ directory 2022-10-12 03:34:30 +03:00
nillerusr
091b49e29c togl/togles: fix PBO usage 2022-10-08 22:15:17 +03:00
nillerusr
e5eaf0fa9e tier1: rewrite Sys_LoadModule 2022-10-08 22:14:26 +03:00
nillerusr
653e08bce4 game(client): make touch more transparent in cutscenes 2022-10-06 00:24:18 +03:00
nillerusr
d4e0a8108b game(client): fix particles problems on 64bit systems 2022-10-04 05:43:22 +03:00
nillerusr
5c5d990c87 game(client): fix touch drawing problems 2022-10-04 05:42:38 +03:00
nillerusr
5ab75bf9ef togl/togles: fpermissive fixes 2022-10-02 01:03:52 +03:00
nillerusr
7a26688494 togl/togles: use PBO for DYNAMIC textures 2022-10-02 00:58:57 +03:00
nillerusr
a269b89168 game(client): fix crash on linux/window in touch, fix memory leak in touch 2022-09-22 22:37:30 +03:00
nillerusr
5af39f3d0d fix windows build 2022-09-20 18:17:55 +03:00
343 changed files with 4985 additions and 3399 deletions

View File

@@ -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

View File

@@ -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
View File

@@ -37,3 +37,5 @@ waf3*/
.vscode/
.depproj/
source-engine.sln
hl2/

View File

@@ -1,23 +1,49 @@
# source-engine
Welcome to source engine:)
# Source Engine
[![GitHub Actions Status](https://github.com/nillerusr/source-engine/actions/workflows/build.yml/badge.svg)](https://github.com/nillerusr/source-engine/actions/workflows/build.yml) [![GitHub Actions Status](https://github.com/nillerusr/source-engine/actions/workflows/tests.yml/badge.svg)](https://github.com/nillerusr/source-engine/actions/workflows/tests.yml)
Discord: [![Discord Server](https://img.shields.io/discord/672055862608658432.svg)](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`

View File

@@ -28,14 +28,6 @@
#include "tier3/tier3.h"
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
CVguiMatSysApp::CVguiMatSysApp()
{
}
//-----------------------------------------------------------------------------
// Create all singleton systems
//-----------------------------------------------------------------------------

View File

@@ -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 )
{

View File

@@ -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 )
{

View File

@@ -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,

View File

@@ -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>

View File

@@ -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>

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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();

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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"

View File

@@ -470,7 +470,7 @@ bool CDedicatedSteamApplication::Create( )
//-----------------------------------------------------------------------------
int main(int argc, char **argv)
{
#ifndef POSIX
#if !defined( POSIX ) && !defined( PLATFORM_64BITS )
_asm
{
fninit

View File

@@ -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>

View File

@@ -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 )
{

View File

@@ -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
//-----------------------------------------------------------------------------

View File

@@ -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 * );

View File

@@ -1,10 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#include "audio_pch.h"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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 )

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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).

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 )

View File

@@ -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 );

View File

@@ -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()

View File

@@ -637,10 +637,6 @@ void CDemoRecorder::StartupDemoFile( void )
g_ClientDLL->OnDemoRecordStart( m_szDemoBaseName );
}
CDemoRecorder::CDemoRecorder()
{
}
CDemoRecorder::~CDemoRecorder()
{
CloseDemoFile();

View File

@@ -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