Skip to content

Commit bb77846

Browse files
authored
Merge branch 'Facepunch:master' into nodeeditor-valueeditor-additions
2 parents f0ef0b5 + fa4e017 commit bb77846

File tree

119 files changed

+4439
-998
lines changed

Some content is hidden

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

119 files changed

+4439
-998
lines changed

.github/workflows/pull_request.yml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request
1+
name: PR Triage
22
on:
33
pull_request_target:
44
types: [ labeled ]
@@ -8,10 +8,56 @@ jobs:
88
runs-on: ubuntu-latest
99
if: github.event.label.name == 'triaged'
1010
steps:
11+
- name: Ensure PR checks passed
12+
uses: actions/github-script@v7
13+
with:
14+
github-token: ${{ secrets.GITHUB_TOKEN }}
15+
script: |
16+
const requiredChecks = ['Tests', 'Formatting'];
17+
18+
const pr = context.payload.pull_request;
19+
if (!pr) {
20+
throw new Error('No pull request found in event payload.');
21+
}
22+
23+
const { data } = await github.rest.checks.listForRef({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
ref: pr.head.sha,
27+
per_page: 100
28+
});
29+
30+
const checkRuns = data.check_runs ?? [];
31+
for (const requiredCheck of requiredChecks) {
32+
const match = checkRuns.find(run => (run.name ?? '') === requiredCheck);
33+
34+
if (!match || match.conclusion !== 'success') {
35+
const status = match ? (match.conclusion ?? match.status ?? 'unknown') : 'missing';
36+
core.warning(`Required check '${requiredCheck}' did not pass (${status}). Removing triaged label.`);
37+
38+
await github.rest.issues.removeLabel({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
issue_number: pr.number,
42+
name: 'triaged'
43+
});
44+
45+
throw new Error('Cannot triage until required checks succeed.');
46+
}
47+
}
48+
1149
- name: Repository Dispatch
12-
uses: peter-evans/repository-dispatch@v4
50+
uses: actions/github-script@v7
51+
env:
52+
DISPATCH_CONTEXT: ${{ toJson(github) }}
1353
with:
14-
token: ${{ secrets.SBOXBOT_TOKEN }}
15-
repository: Facepunch/sbox
16-
event-type: pr-triaged
17-
client-payload: '{"github": ${{ toJson(github) }}}'
54+
github-token: ${{ secrets.SBOXBOT_TOKEN }}
55+
script: |
56+
const clientPayload = JSON.parse(process.env.DISPATCH_CONTEXT);
57+
58+
await github.rest.repos.createDispatchEvent({
59+
owner: 'Facepunch',
60+
repo: 'sbox',
61+
event_type: 'pr-triaged',
62+
client_payload: { github: clientPayload }
63+
});

.github/workflows/pull_request_checks.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request Checks
1+
name: Tests
22

33
on:
44
pull_request:
@@ -15,18 +15,15 @@ jobs:
1515
uses: actions/checkout@v4
1616
with:
1717
clean: true
18-
fetch-depth: 1
18+
fetch-depth: 0
1919
persist-credentials: false
2020
- name: Setup .NET
2121
uses: actions/setup-dotnet@v5
2222
with:
2323
dotnet-version: '10.0.x'
2424

25-
- name: Format
26-
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- format --verify
27-
28-
- name: Bootstrap
29-
run: .\Bootstrap.bat
25+
- name: Build
26+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- build --config Developer
3027

3128
- name: Test
3229
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- test
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Formatting
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
format:
12+
runs-on: [ windows-latest ]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
clean: true
18+
fetch-depth: 1
19+
persist-credentials: false
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v5
23+
with:
24+
dotnet-version: '10.0.x'
25+
26+
- name: Format
27+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- format --verify

engine/Definitions/common/Physics/IPhysicsJoint.def

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,43 @@ native class IPhysicsJoint as NativeEngine.IPhysicsJoint
7979
float Motor_GetAngularDampingRatio();
8080
float Motor_GetMaxSpringForce();
8181
float Motor_GetMaxSpringTorque();
82+
83+
void Wheel_EnableSuspension( bool flag );
84+
bool Wheel_IsSuspensionEnabled();
85+
void Wheel_SetSuspensionHertz( float hertz );
86+
float Wheel_GetSuspensionHertz();
87+
void Wheel_SetSuspensionDampingRatio( float dampingRatio );
88+
float Wheel_GetSuspensionDampingRatio();
89+
void Wheel_EnableSuspensionLimit( bool flag );
90+
bool Wheel_IsSuspensionLimitEnabled();
91+
float Wheel_GetLowerSuspensionLimit();
92+
float Wheel_GetUpperSuspensionLimit();
93+
void Wheel_SetSuspensionLimits( float lower, float upper );
94+
void Wheel_EnableSpinMotor( bool flag );
95+
bool Wheel_IsSpinMotorEnabled();
96+
void Wheel_SetSpinMotorSpeed( float speed );
97+
float Wheel_GetSpinMotorSpeed();
98+
void Wheel_SetMaxSpinTorque( float torque );
99+
float Wheel_GetMaxSpinTorque();
100+
void Wheel_EnableSteering( bool flag );
101+
bool Wheel_IsSteeringEnabled();
102+
void Wheel_SetSteeringHertz( float hertz );
103+
float Wheel_GetSteeringHertz();
104+
void Wheel_SetSteeringDampingRatio( float dampingRatio );
105+
float Wheel_GetSteeringDampingRatio();
106+
void Wheel_SetMaxSteeringTorque( float torque );
107+
float Wheel_GetMaxSteeringTorque();
108+
void Wheel_EnableSteeringLimit( bool flag );
109+
bool Wheel_IsSteeringLimitEnabled();
110+
float Wheel_GetLowerSteeringLimit();
111+
float Wheel_GetUpperSteeringLimit();
112+
void Wheel_SetSteeringLimits( float lowerRadians, float upperRadians );
113+
void Wheel_SetTargetSteeringAngle( float radians );
114+
float Wheel_GetTargetSteeringAngle();
115+
float Wheel_GetSpinSpeed();
116+
float Wheel_GetSpinTorque();
117+
float Wheel_GetSteeringAngle();
118+
float Wheel_GetSteeringTorque();
82119
}
83120

84121
managed static class Sandbox.Physics.PhysicsEngine

engine/Definitions/common/Physics/IPhysicsWorld.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ native class IPhysicsWorld
4343
IPhysicsJoint AddPrismaticJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4444
IPhysicsJoint AddSphericalJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4545
IPhysicsJoint AddMotorJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
46+
IPhysicsJoint AddWheelJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4647

4748
//
4849
// Sets the collision rules using a json serialized Sandbox.Internal.CollisionRules

engine/Definitions/common/Render/renderdevice.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ native accessor g_pRenderDevice
6969

7070
bool IsTextureRenderTarget( ITexture texture );
7171

72+
bool IsRayTracingSupported();
73+
7274
inline RenderBufferHandle_t CreateGPUBuffer( RenderBufferType_t nType, BufferDesc_t desc, RenderBufferFlags_t usage, string pDebugName )
7375
{
7476
desc.m_pDebugName = pDebugName;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "scenesystem/iscenesystem.h"
2+
3+
native class IRayTraceSceneWorld as NativeEngine.IRayTraceSceneWorld
4+
{
5+
void BeginBuild();
6+
void AddSceneWorldToBuild( ISceneWorld pWorld, IRenderContext pRenderContext );
7+
bool EndBuild( IRenderContext pRenderContext, CRenderAttributes attrs );
8+
9+
inline bool BuildTLASForWorld( ISceneWorld pWorld, CRenderAttributes attrs )
10+
{
11+
CRenderContextPtr pRenderContext( g_pRenderDevice, "sceneinfo_gpu" );
12+
13+
this->BeginBuild();
14+
this->AddSceneWorldToBuild( pWorld, pRenderContext );
15+
this->EndBuild( pRenderContext, attrs );
16+
17+
return true;
18+
}
19+
}

engine/Definitions/common/SceneSystem/g_pSceneSystem.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,8 @@ native accessor g_pSceneSystem as NativeEngine.CSceneSystem
160160
void RenderTiledLightCulling( IRenderContext pCtx, ISceneView pView, RenderViewport viewport );
161161

162162
void BindTransformSlot( IRenderContext pCtx, int nVBSlot, int nTransformSlotIndex );
163+
164+
// Ray Tracing
165+
IRayTraceSceneWorld CreateRayTraceWorld( string pWorldDebugName, int nMaxRayTypes );
166+
void DestroyRayTraceWorld( IRayTraceSceneWorld pRayTraceSceneWorld );
163167
}

engine/Definitions/engine/Render/RenderTools.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ native static class RenderTools as NativeEngine.RenderTools
1717
//
1818
void Compute( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, int tx, int ty, int tz );
1919
void ComputeIndirect( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, RenderBufferHandle_t hIndirectBuffer, uint nIndirectBufferOffset );
20+
void TraceRays( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, uint tx, uint ty, uint tz );
21+
void TraceRaysIndirect( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, RenderBufferHandle_t hIndirectBuffer, uint nIndirectBufferOffset );
2022
void SetDynamicConstantBufferData( CRenderAttributes attributes, StringToken nTokenID, IRenderContext renderContext, void* data, int dataSize );
2123

2224
void CopyTexture( IRenderContext renderContext, ITexture sourceTexture, ITexture destTexture, Rect_t pSrcRect, int nDestX, int nDestY, uint nSrcMipSlice, uint nSrcArraySlice, uint nDstMipSlice, uint nDstArraySlice );

engine/Definitions/tools/widgetutil.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ native static class WidgetUtil Native.WidgetUtil
2525
// Text measuring tools
2626
//
2727
Vector4 MeasureText( QRect rect, int flags, string text );
28+
QString ElidedText( string text, int width, int mode, int flags );
2829

2930

3031
static void ConstrainToScreen( QWidget widget );

0 commit comments

Comments
 (0)