Compare commits

..

152 Commits

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
nillerusr
3f5ebfbde3 game(client): fix back button in touch 2022-09-19 17:54:09 +03:00
nillerusr
4ace9f8030 game(client): fix touch drawing problems again, fix some fonts on android 2022-09-18 19:54:29 +03:00
nillerusr
9c4ace30c3 game(client): fix touch drawing problems 2022-09-18 18:47:19 +03:00
nillerusr
a7611c481e game(client): fix atlas generation for touch 2022-09-17 21:00:50 +03:00
nillerusr
d2f789853d vtex(android): fix build 2022-09-17 18:41:25 +03:00
nillerusr
5e9ce905f7 tier1(android): add error message for library loading from mod apk 2022-09-17 18:27:50 +03:00
nillerusr
2dca8fd6c7 launcher_main: automatically set LD_LIBRARY_PATH on launch 2022-09-17 18:26:41 +03:00
nillerusr
54f174d262 modify original vtex and add png support for it 2022-09-17 18:25:20 +03:00
nillerusr
3daa537791 game(client): fix touch drawing again bruh 2022-09-17 16:42:45 +03:00
nillerusr
5a28ccec8c game(client): fix touch drawing 2022-09-17 15:57:17 +03:00
nillerusr
b1a3eafbe6 android: fix crashhandler 2022-09-17 03:01:26 +03:00
nillerusr
8a7e28d38d game(client): fix touch editor 2022-09-16 19:00:32 +03:00
nillerusr
f07ba797c5 game(client): optimize touch drawing 2022-09-16 02:41:03 +03:00
nillerusr
bf860c87c6 update lib submodule 2022-09-13 00:43:52 +03:00
nillerusr
5912845f29 engine: fix audio language setting 2022-09-10 03:30:28 +03:00
nillerusr
09924b7998 game(android): add custom chat 2022-09-08 21:23:06 +03:00
nillerusr
93c71cb74a togles: fix alpha test on some GPUs( fixes #119 ) 2022-09-08 20:41:35 +03:00
nillerusr
efc1fc2a9b add -fvisibility=hidden for gcc 2022-09-05 19:33:23 +03:00
nillerusr
3e19d26a72 add additional logging information 2022-09-05 12:54:41 +03:00
nillerusr
f11087b83a game(hl1): fix bigmomma decal 2022-09-05 01:17:02 +03:00
nillerusr
4c49154dc0 togles: fix GL_QCOM_alpha_test extension detection 2022-09-03 02:52:33 +03:00
nillerusr
c91e68975b game(hl1): fix SetBoneController 2022-09-03 02:51:56 +03:00
nillerusr
216bbf1baa game(hl1): fix gibbing 2022-08-31 18:23:22 +03:00
nillerusr
fafc3554a5 game(hl1): fix UTIL_DropToFloor 2022-08-31 18:22:56 +03:00
nillerusr
1fe1d7b419 use threaded bone setup by default 2022-08-31 18:19:52 +03:00
nillerusr
32c57a8a49 game(hl1): fix stupid mp5 recoil 2022-08-23 18:17:31 +03:00
nillerusr
2cb00530c7 game(hl1): fix use after scope 2022-08-23 17:33:12 +03:00
nillerusr
e11a21ea19 public: fix misalignment in Studio_AnimPosition 2022-08-23 17:32:37 +03:00
nillerusr
3dbe2cdd32 hl1: make pushable rotatable 2022-08-23 03:21:46 +03:00
nillerusr
faca1ab142 game(hl1): fix apache,can bbox, fix DROP_TO_FLOOR, fix barnacle 2022-08-21 02:56:36 +03:00
nillerusr
3b153bc9c3 fix day of defeat build 2022-08-21 02:12:18 +03:00
nillerusr
1f0ae521d6 Merge pull request #112 from SanyaSho/fixes
Fixes (x2)
2022-08-20 00:05:05 +03:00
SanyaSho
c41148b9dd game: disable text on buttons by default 2022-08-19 23:43:31 +03:00
nillerusr
40c4f2b96f Update ivp submodule 2022-08-19 23:31:05 +03:00
nillerusr
a16123e4be fixed some unitialized variables 2022-08-19 23:27:37 +03:00
nillerusr
0a66367243 tslist: add asserts for tests 2022-08-19 23:21:37 +03:00
nillerusr
c909de8faf use HAVE_* macros for dependencies 2022-08-19 23:19:53 +03:00
SanyaSho
53ed9e3bd8 Revert "game: fixes some player's origin displacements for fire events, impulses commands etc... (ValveSoftware/source-sdk-2013#442)"
This reverts commit 2e969d3890.
2022-08-19 23:00:06 +03:00
nillerusr
0d48bf354a unittests: add tslist tests to tier1test 2022-08-17 14:28:41 +03:00
nillerusr
dd1dc186f9 unittests: fix utlstringtest for windows 2022-08-17 13:46:41 +03:00
nillerusr
c0cbc669bc scripts: fix tests 2022-08-17 13:39:51 +03:00
nillerusr
45d33c6b97 tier1: fix commandbuffer unitialized boolean 2022-08-17 13:35:55 +03:00
nillerusr
8b6ad0d342 workflows: add tests.yml 2022-08-17 12:54:11 +03:00
nillerusr
9aa0ecab6a add wscripts for unittests 2022-08-17 11:12:27 +03:00
nillerusr
08e3444409 Delete needless unittests again 2022-08-17 11:03:31 +03:00
SanyaSho
c0472cccbf game: fix camera glitch with FOV 110 2022-08-17 02:45:02 +03:00
SanyaSho
9a03faec58 game: fix satchel/tripmine damage and damage radius cvars (hrgve/hl2dm-bugfix@d2aa89fc0f) 2022-08-16 18:41:34 +03:00
SanyaSho
8a366537e7 game: fix death icon in hl2mp (hrgve/hl2dm-bugfix@6f7337d3f2) 2022-08-16 18:28:28 +03:00
SanyaSho
27339449c0 game: rpg missle fixes (hrgve/hl2dm-bugfix@36de43ebc1) 2022-08-16 18:24:49 +03:00
SanyaSho
69b377495b game: update hud_flashlight.cpp (::yoba_Ukraine::) (ValveSoftware/source-sdk-2013#275) 2022-08-16 17:54:53 +03:00
SanyaSho
4838d9ee3f game: changed delay parameter for ent_fire (ValveSoftware/source-sdk-2013#300) 2022-08-16 17:50:12 +03:00
SanyaSho
42b528dec3 game: fixed a format string vulnerability in CDebugOverlay::Paint (ValveSoftware/source-sdk-2013#372) 2022-08-16 17:39:41 +03:00
SanyaSho
387d15521a game: fix typo in logical expression (ValveSoftware/source-sdk-2013#502) 2022-08-16 17:24:18 +03:00
SanyaSho
a0d8a59d58 game: touch customization and small update 2022-08-16 17:21:59 +03:00
SanyaSho
148035ce31 game: fixed npc_manhack not notifying npc_template_maker/npc_maker when thrown and destroyed with gravity gun. (ValveSoftware/source-sdk-2013#362) 2022-08-16 17:21:59 +03:00
SanyaSho
21c54015a2 game: fixed infinite recursion by using incorrect key on value conversation. (ValveSoftware/source-sdk-2013#380) 2022-08-16 17:21:59 +03:00
SanyaSho
2e969d3890 game: fixes some player's origin displacements for fire events, impulses commands etc... (ValveSoftware/source-sdk-2013#442) 2022-08-16 17:21:59 +03:00
SanyaSho
81c354ee0d game: use gpGlobals->interval_per_tick instead of DEFAULT_TICK_INTERVAL (ValveSoftware/source-sdk-2013#515) 2022-08-16 17:05:58 +03:00
SanyaSho
047b3e3150 game: fix hl2mp slam (ValveSoftware/source-sdk-2013#532) 2022-08-16 17:04:26 +03:00
SanyaSho
68483bd0f6 game: fix linux soundscapes (ValveSoftware/source-sdk-2013#448) 2022-08-16 17:03:33 +03:00
nillerusr
d8f5cdfd3c Delete needless unittests 2022-08-16 15:08:46 +03:00
nillerusr
8ab4c90f54 update thirdparty submodule 2022-08-16 00:13:11 +03:00
nillerusr
872243be56 waifulib: fix configure with clang 2022-08-15 22:37:56 +03:00
nillerusr
c68b7af554 launcher(android): fix build problem 2022-08-15 22:35:36 +03:00
nillerusr
38fcc71c6e launcher(android): add crashhandler 2022-08-15 22:14:09 +03:00
nillerusr
41414854db launcher: move android.cpp -> android/main.cpp 2022-08-15 21:28:05 +03:00
LegendGuard
a87918565a Add PBR support (#91)
* Add PBR support
* Fix physics props turning black
2022-08-10 17:41:01 +03:00
nillerusr
08073ae622 again boring misalignment fixes 2022-08-09 21:24:27 +03:00
nillerusr
c5607661f0 vgui_surfacelib(android): use fonts with chinese/japanese/korean support( fixes #104 ) 2022-08-05 22:40:06 +03:00
nillerusr
e852953d9d Merge pull request #100 from SanyaSho/ent-create-crash-fix
small fixes
2022-08-04 19:10:52 +03:00
SanyaSho
448b353844 game: grenade trail fix 2022-08-04 17:01:54 +03:00
SanyaSho
b525e49d6f game: fix 357 crosshair in hl2mp 2022-08-04 16:58:02 +03:00
SanyaSho
31c5944b5e game: fix rpg laser sprite precache in hl2mp 2022-08-04 16:54:21 +03:00
SanyaSho
d958e12dbd game: set MAX_FOV value to 110 2022-08-04 16:48:47 +03:00
SanyaSho
6c42a04f8a game: fix env_sun sprite disappearing when you look at it 2022-08-04 16:47:14 +03:00
SanyaSho
38209fe326 fix game: don`t rotate viewmodels in zoom 2022-08-04 16:42:23 +03:00
SanyaSho
e8ffb402de game: quantum crouch fix 2022-08-04 16:30:30 +03:00
SanyaSho
e6901ffadf game: fix acid damage white flash bug 2022-08-04 16:29:21 +03:00
SanyaSho
ccf0357a51 game: restore dropship ability to shoot with rotsting gun 2022-08-04 16:27:21 +03:00
SanyaSho
d628a7ae80 game: restore combine elite soldiers ability to use alt-fire of SMG1 2022-08-04 16:17:51 +03:00
SanyaSho
5caf8adbd7 game: don`t rotate viewmodels in zoom 2022-08-04 15:53:29 +03:00
SanyaSho
e0db3b1a40 game: beta houndeye painsound fix 2022-08-04 15:36:04 +03:00
SanyaSho
e8f26b4401 game: fix NPC blink 2022-08-04 11:42:52 +03:00
SanyaSho
9779491774 game: fix previous commit 2022-08-04 00:48:42 +03:00
SanyaSho
29080d7649 game: apply https://developer.valvesoftware.com/wiki/Weapon_Respawn_Fix patch 2022-08-04 00:33:51 +03:00
SanyaSho
3b475331f2 gameui: don`t show FOVValueLabel if fov_desired cvar is not exists 2022-08-03 20:27:22 +03:00
SanyaSho
4ae9719b74 game: restore combine ability to play pain sounds 2022-08-03 17:34:05 +03:00
SanyaSho
0f7d9d029f game: fix ent_create crash if entity model is NULL 2022-08-03 17:19:43 +03:00
nillerusr
a9c5da7d69 materialsystem: unlock mat_picmip cvar again 2022-08-03 16:30:27 +03:00
SanyaSho
48aa042ee1 Fov cvar fix (#98)
* game: set fov_desired cvar max value to 110
* scripts: waifulib: change '4.9,9' to '4.9,21' in configure example
2022-08-03 16:22:17 +03:00
nillerusr
50ff9922a6 togles: use sampler objects by default 2022-08-03 16:21:23 +03:00
nillerusr
1aa326b7f2 appframework: use rawinput for android by default 2022-08-02 10:45:21 +03:00
nillerusr
79e83bb97f tier0: fix cpu freq on some arm cpu's 2022-08-01 04:30:44 +03:00
nillerusr
8200eda3ec Merge pull request #95 from nillerusr/dedicated-build-fix
fix dedicated build
2022-08-01 01:41:56 +03:00
524 changed files with 19723 additions and 13713 deletions

View File

@@ -1,12 +1,6 @@
name: Build tests
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

50
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Tests
on: [push, pull_request]
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
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

5
.gitignore vendored
View File

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

View File

@@ -1,22 +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
- [ ] 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

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

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

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

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

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

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

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

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