Skip to content

Commit 08c48d6

Browse files
Merge branch 'master' into mapbase
2 parents aa52c5d + 2998568 commit 08c48d6

File tree

240 files changed

+4719
-6696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+4719
-6696
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
name: Build
22

3-
on:
4-
push:
5-
branches:
6-
- "*"
7-
pull_request:
8-
branches:
9-
- "*"
3+
on: [push, pull_request]
104

115
jobs:
126
build-linux-i386:
13-
runs-on: ubuntu-18.04
7+
runs-on: ubuntu-latest
148

159
steps:
1610
- uses: actions/checkout@v2
@@ -19,7 +13,7 @@ jobs:
1913
scripts/build-ubuntu-i386.sh
2014
2115
build-linux-amd64:
22-
runs-on: ubuntu-18.04
16+
runs-on: ubuntu-20.04
2317

2418
steps:
2519
- uses: actions/checkout@v2
@@ -28,7 +22,7 @@ jobs:
2822
scripts/build-ubuntu-amd64.sh
2923
3024
build-android-armv7a:
31-
runs-on: ubuntu-18.04
25+
runs-on: ubuntu-20.04
3226

3327
steps:
3428
- uses: actions/checkout@v2
@@ -42,6 +36,17 @@ jobs:
4236
steps:
4337
- uses: actions/checkout@v2
4438
- name: Build windows-i386
39+
run: |
40+
git submodule init && git submodule update
41+
./waf.bat configure -T debug --32bits
42+
./waf.bat build
43+
44+
build-windows-amd64:
45+
runs-on: windows-2019
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
- name: Build windows-amd64
4550
run: |
4651
git submodule init && git submodule update
4752
./waf.bat configure -T debug
@@ -58,8 +63,19 @@ jobs:
5863
./waf.bat configure -T debug -d
5964
./waf.bat build
6065
66+
build-dedicated-windows-amd64:
67+
runs-on: windows-2019
68+
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Build dedicated windows-amd64
72+
run: |
73+
git submodule init && git submodule update
74+
./waf.bat configure -T debug -d
75+
./waf.bat build
76+
6177
build-dedicated-linux-i386:
62-
runs-on: ubuntu-18.04
78+
runs-on: ubuntu-20.04
6379

6480
steps:
6581
- uses: actions/checkout@v2
@@ -68,10 +84,28 @@ jobs:
6884
scripts/build-ubuntu-i386.sh -d
6985
7086
build-dedicated-linux-amd64:
71-
runs-on: ubuntu-18.04
87+
runs-on: ubuntu-20.04
7288

7389
steps:
7490
- uses: actions/checkout@v2
7591
- name: Build dedicated linux-amd64
7692
run: |
7793
scripts/build-ubuntu-amd64.sh -d
94+
95+
build-macos-amd64:
96+
runs-on: macos-latest
97+
98+
steps:
99+
- uses: actions/checkout@v2
100+
- name: Build macos-amd64
101+
run: |
102+
scripts/build-macos-amd64.sh
103+
104+
build-dedicated-macos-amd64:
105+
runs-on: macos-latest
106+
107+
steps:
108+
- uses: actions/checkout@v2
109+
- name: Build dedicated macos-amd64
110+
run: |
111+
scripts/build-macos-amd64.sh -d

.github/workflows/tests.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
name: Tests
22

3-
on:
4-
push:
5-
branches:
6-
- "*"
7-
pull_request:
8-
branches:
9-
- "*"
3+
on: [push, pull_request]
104

115
jobs:
126
tests-linux-i386:
13-
runs-on: ubuntu-18.04
7+
runs-on: ubuntu-20.04
148

159
steps:
1610
- uses: actions/checkout@v2
@@ -19,20 +13,43 @@ jobs:
1913
scripts/tests-ubuntu-i386.sh
2014
2115
tests-linux-amd64:
22-
runs-on: ubuntu-18.04
16+
runs-on: ubuntu-20.04
2317

2418
steps:
2519
- uses: actions/checkout@v2
2620
- name: Run tests linux-amd64
2721
run: |
2822
scripts/tests-ubuntu-amd64.sh
2923
24+
tests-macos-amd64:
25+
runs-on: macos-latest
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Run tests macos-amd64
30+
run: |
31+
scripts/tests-macos-amd64.sh
32+
3033
tests-windows-i386:
3134
runs-on: windows-2019
3235

3336
steps:
3437
- uses: actions/checkout@v2
3538
- name: Run tests windows-i386
39+
run: |
40+
git submodule init && git submodule update
41+
./waf.bat configure -T release --tests --prefix=out/ --32bits
42+
./waf.bat install
43+
cd out
44+
$env:Path = "bin";
45+
./unittest.exe
46+
47+
tests-windows-amd64:
48+
runs-on: windows-2019
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
- name: Run tests windows-amd64
3653
run: |
3754
git submodule init && git submodule update
3855
./waf.bat configure -T release --tests --prefix=out/

.vscode/tasks.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Configure Waf for Debug 32-bit",
6+
"type": "shell",
7+
"command": "./waf configure -T debug --prefix=build/out/",
8+
"problemMatcher": [],
9+
"windows": {
10+
"command": "./waf.bat configure -T debug --prefix=build/out/"
11+
},
12+
"osx": {
13+
"command": "python3 waf configure -T debug --prefix=build/out/"
14+
}
15+
},
16+
{
17+
"label": "Configure Waf for Debug 64-bit",
18+
"type": "shell",
19+
"command": "./waf configure -T debug --64bits --prefix=build/out/",
20+
"problemMatcher": [],
21+
"windows": {
22+
"command": "./waf.bat configure -T debug --64bits --prefix=build/out/"
23+
},
24+
"osx": {
25+
"command": "python3 waf configure -T debug --64bits --prefix=build/out/"
26+
}
27+
},
28+
{
29+
"label": "Configure Waf for Debug on Android (NDK r10e)",
30+
"type": "shell",
31+
"command": "./waf configure -T debug --android=armeabi-v7a-hard,4.9,21",
32+
"problemMatcher": [],
33+
"windows": {
34+
"command": "./waf.bat configure -T debug --android=armeabi-v7a-hard,4.9,21"
35+
},
36+
"osx": {
37+
"command": "python3 waf configure -T debug --android=armeabi-v7a-hard,4.9,21"
38+
}
39+
},
40+
{
41+
"label": "Build",
42+
"type": "shell",
43+
"command": "./waf install",
44+
"problemMatcher": {
45+
"base": "$gcc",
46+
"fileLocation": ["relative", "${workspaceFolder}/build"]
47+
},
48+
"group": {
49+
"kind": "build",
50+
"isDefault": true
51+
},
52+
"windows": {
53+
"command": "./waf.bat install",
54+
"problemMatcher": {
55+
"base": "$msCompile",
56+
"fileLocation": ["relative", "${workspaceFolder}/build"]
57+
}
58+
},
59+
"osx": {
60+
"command": "python3 waf install"
61+
}
62+
}
63+
]
64+
}

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Source code is based on TF2 2018 leak. Don't use it for commercial purposes.
1515
This project is using waf buildsystem. If you have waf-related questions look https://waf.io/book
1616

1717
# Features:
18-
- Android, OSX, FreeBSD, Windows support
18+
- Android, OSX, FreeBSD, Windows, Linux( glibc, musl ) support
1919
- Arm support( except windows )
2020
- 64bit support
2121
- Modern toolchains support
@@ -28,18 +28,17 @@ This project is using waf buildsystem. If you have waf-related questions look ht
2828
- Removed useless/unnecessary dependencies
2929
- Achivement system working without steam
3030
- Fixed many bugs
31+
- Serverbrowser works without steam
3132

3233
# Current tasks
3334
- Rewrite materialsystem for OpenGL render
3435
- dxvk-native support
3536
- Elbrus port
3637
- Bink audio support( for video_bink )
37-
- Rewrite serverbrowser to work without steam
3838

3939
# How to Build?
40-
- [Windows](https://github.com/nillerusr/source-engine/wiki/How-to-build#on-windows)
41-
- [Linux](https://github.com/nillerusr/source-engine/wiki/How-to-build#on-linux)
42-
- [For Android under Linux](https://github.com/nillerusr/source-engine/wiki/How-to-build#on-linux-for-android)
40+
- [Building instructions(EN)](https://github.com/nillerusr/source-engine/wiki/Source-Engine-(EN))
41+
- [Building instructions(RU)](https://github.com/nillerusr/source-engine/wiki/Source-Engine-(RU))
4342

4443
# Support me
4544
BTC: `bc1qnjq92jj9uqjtafcx2zvnwd48q89hgtd6w8a6na`

appframework/posixapp.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
#include "filesystem_init.h"
1515
#include "tier1/convar.h"
1616
#include "vstdlib/cvar.h"
17+
18+
#ifndef DEDICATED
1719
#include "togl/rendermechanism.h"
20+
#endif
1821

1922
// NOTE: This has to be the last file included! (turned off below, since this is included like a header)
2023
#include "tier0/memdbgon.h"

appframework/sdlmgr.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ class CSDLMgr : public ILauncherMgr
404404
int m_MouseButtonDownX;
405405
int m_MouseButtonDownY;
406406

407+
bool m_bResetVsync;
408+
int m_nFramesToSkip;
409+
407410
double m_flPrevGLSwapWindowTime;
408411
};
409412

@@ -584,6 +587,9 @@ InitReturnVal_t CSDLMgr::Init()
584587
m_nWarpDelta = 0;
585588
m_bRawInput = false;
586589

590+
m_nFramesToSkip = 0;
591+
m_bResetVsync = false;
592+
587593
m_flPrevGLSwapWindowTime = 0.0f;
588594

589595
memset(m_pixelFormatAttribs, '\0', sizeof (m_pixelFormatAttribs));
@@ -1431,7 +1437,20 @@ void CSDLMgr::ShowPixels( CShowPixelsParams *params )
14311437

14321438
m_flPrevGLSwapWindowTime = tm.GetDurationInProgress().GetMillisecondsF();
14331439

1434-
1440+
#ifdef ANDROID
1441+
// ADRENO GPU MOMENT, SKIP 5 FRAMES
1442+
if( m_bResetVsync )
1443+
{
1444+
if( m_nFramesToSkip <= 0 )
1445+
{
1446+
SDL_GL_SetSwapInterval(swapInterval);
1447+
m_bResetVsync = false;
1448+
}
1449+
else
1450+
m_nFramesToSkip--;
1451+
}
1452+
#endif
1453+
14351454
CheckGLError( __LINE__ );
14361455
}
14371456
#endif // DX_TO_GL_ABSTRACTION
@@ -1887,6 +1906,7 @@ void CSDLMgr::PumpWindowsMessageLoop()
18871906
}
18881907
case SDL_WINDOWEVENT_FOCUS_GAINED:
18891908
{
1909+
m_bResetVsync = true; m_nFramesToSkip = 3;
18901910
m_bHasFocus = true;
18911911
SDL_ShowCursor( m_bCursorVisible ? 1 : 0 );
18921912
CCocoaEvent theEvent;
@@ -2224,7 +2244,7 @@ GLMDisplayDB *CSDLMgr::GetDisplayDB( void )
22242244
}
22252245

22262246
#ifndef OSX
2227-
# include "glmdisplaydb_linuxwin.inl"
2247+
#include "glmdisplaydb_linuxwin.inl"
22282248
#endif
22292249

22302250

appframework/wscript

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ def build(bld):
2424
source += [
2525
'sdlmgr.cpp'
2626
]
27-
28-
if bld.env.DEST_OS == 'darwin':
29-
source += [
30-
'glmrendererinfo_osx.mm'
31-
]
27+
28+
if bld.env.DEST_OS == 'darwin' and bld.env.GL:
29+
source += ['glmrendererinfo_osx.mm']
30+
3231

3332
if bld.env.DEST_OS == 'win32':
3433
source += [

bitmap/ImageByteSwap.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,7 @@ namespace ImageLoader
8888

8989
Assert( IsFormatValidForConversion( imageFormat ) );
9090

91-
#if !defined( DX_TO_GL_ABSTRACTION ) && !defined( NO_X360_XDK )
92-
if ( IsPC() )
93-
{
94-
// running as a win32 tool, data is in expected order
95-
// for conversion code
96-
return;
97-
}
98-
91+
#ifdef _X360
9992
// running on 360 and converting, input data must be x86 order
10093
// swap to ensure conversion code gets valid data
10194
XGENDIANTYPE xEndian;
@@ -137,7 +130,7 @@ namespace ImageLoader
137130
{
138131
Assert( IsFormatValidForConversion( imageFormat ) );
139132

140-
#if !defined( DX_TO_GL_ABSTRACTION ) && !defined( NO_X360_XDK )
133+
#ifdef _X360
141134
// It would have been nice to use the 360 D3DFORMAT bit encodings, but the codes
142135
// are different for win32, and this routine is used by a win32 library to
143136
// manipulate 360 data, so there can be no reliance on D3DFORMAT bits
@@ -201,7 +194,7 @@ namespace ImageLoader
201194
{
202195
Assert( IsFormatValidForConversion( imageFormat ) );
203196

204-
#if !defined( DX_TO_GL_ABSTRACTION ) && !defined( NO_X360_XDK )
197+
#ifdef _X360
205198
XGENDIANTYPE xEndian;
206199
switch ( imageFormat )
207200
{
@@ -256,5 +249,4 @@ namespace ImageLoader
256249
}
257250
#endif
258251
}
259-
260252
}

0 commit comments

Comments
 (0)