Skip to content

Commit 2828144

Browse files
Merge remote-tracking branch 'upstream/master' into 2024-10-18-bui
2 parents 674271e + 5a82df2 commit 2828144

18 files changed

+189
-39
lines changed

MSBuild/Robust.Engine.Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<Project>
22
<!-- This file automatically reset by Tools/version.py -->
3-
<PropertyGroup><Version>236.1.0</Version></PropertyGroup>
3+
<PropertyGroup><Version>237.1.0</Version></PropertyGroup>
44
</Project>

RELEASE-NOTES.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,53 @@ END TEMPLATE-->
3939

4040
### New features
4141

42-
* The game server's `/update` endpoint now supports passing more information on why an update is available.
43-
* This information is accessible via `IWatchdogApi.RestartRequested`.
44-
* Information can be specified by passing a JSON object with a `Reason` code and `Message` field.
42+
*None yet*
4543

4644
### Bugfixes
4745

4846
*None yet*
4947

5048
### Other
5149

52-
* Made `WatchdogApi` and some members of `IWatchdogApi` private. These symbols should never have been accessed by content.
50+
*None yet*
5351

5452
### Internal
5553

5654
*None yet*
5755

5856

57+
## 237.1.0
58+
59+
### New features
60+
61+
* csi's auto import-system can now handle generic types.
62+
* csi's reflection helpers (like `fld()`) handle private members up the inheritance chain.
63+
64+
### Bugfixes
65+
66+
* Fix `UniqueIndexHkm<,>` and, by extension, entity data storage memory leaking.
67+
* Fix bugs related to UIScale on `OSWindow`s.
68+
69+
70+
## 237.0.0
71+
72+
### Breaking changes
73+
74+
* `IClydeWindow.Size` is now settable, allowing window sizes to be changed after creation.
75+
76+
### New features
77+
78+
* The game server's `/update` endpoint now supports passing more information on why an update is available.
79+
* This information is accessible via `IWatchdogApi.RestartRequested`.
80+
* Information can be specified by passing a JSON object with a `Reason` code and `Message` field.
81+
* Added an "Erase" button to the tile spawn menu.
82+
* Added `OSWindow.Create()`, which allows OS windows to be created & initialised without immediately opening/showing them.
83+
84+
### Other
85+
86+
* Made `WatchdogApi` and some members of `IWatchdogApi` private. These symbols should never have been accessed by content.
87+
88+
5989
## 236.1.0
6090

6191
### New features

Robust.Client/Graphics/Clyde/Clyde.Events.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ private void SendCloseWindow(WindowReg windowReg, WindowRequestClosedEventArgs e
109109

110110
private void SendWindowResized(WindowReg reg, Vector2i oldSize)
111111
{
112+
if (!reg.IsVisible) // Only send this for open windows
113+
return;
114+
112115
var loaded = RtToLoaded(reg.RenderTarget);
113116
loaded.Size = reg.FramebufferSize;
114117

Robust.Client/Graphics/Clyde/Clyde.Windowing.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ public IClydeWindow CreateWindow(WindowCreateParameters parameters)
343343
if (isMain)
344344
_mainWindow = reg;
345345

346+
reg.IsVisible = parameters.Visible;
347+
346348
_windows.Add(reg);
347349
_windowHandles.Add(reg.Handle);
348350

@@ -444,6 +446,12 @@ public void SetCursor(ICursor? cursor)
444446
_windowing!.CursorSet(_mainWindow!, cursor);
445447
}
446448

449+
private void SetWindowSize(WindowReg reg, Vector2i size)
450+
{
451+
DebugTools.AssertNotNull(_windowing);
452+
453+
_windowing!.WindowSetSize(reg, size);
454+
}
447455

448456
private void SetWindowVisible(WindowReg reg, bool visible)
449457
{
@@ -533,7 +541,11 @@ public void Dispose()
533541
_clyde.DoDestroyWindow(Reg);
534542
}
535543

536-
public Vector2i Size => Reg.FramebufferSize;
544+
public Vector2i Size
545+
{
546+
get => Reg.FramebufferSize;
547+
set => _clyde.SetWindowSize(Reg, value);
548+
}
537549

538550
public IRenderTarget RenderTarget => Reg.RenderTarget;
539551

Robust.Client/Graphics/Clyde/ClydeHeadless.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ public DummyWindow(IRenderTarget renderTarget)
517517
RenderTarget = renderTarget;
518518
}
519519

520-
public Vector2i Size { get; } = default;
520+
public Vector2i Size { get; set; } = default;
521521
public bool IsDisposed { get; private set; }
522522
public WindowId Id { get; set; }
523523
public IRenderTarget RenderTarget { get; }

Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Threading;
44
using System.Threading.Channels;
@@ -176,6 +176,7 @@ private void BlitSecondaryWindows()
176176
window.BlitDoneEvent!.Reset();
177177
window.BlitStartEvent!.Set();
178178
window.BlitDoneEvent.Wait();
179+
window.UnlockBeforeSwap = Clyde._cfg.GetCVar(CVars.DisplayThreadUnlockBeforeSwap);
179180
}
180181
}
181182
else
@@ -212,8 +213,15 @@ private void BlitThreadDoSecondaryWindowBlit(WindowData window)
212213
GL.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
213214
Clyde.CheckGlError();
214215

215-
window.BlitDoneEvent?.Set();
216+
if (window.UnlockBeforeSwap)
217+
{
218+
window.BlitDoneEvent?.Set();
219+
}
216220
Clyde._windowing!.WindowSwapBuffers(window.Reg);
221+
if (!window.UnlockBeforeSwap)
222+
{
223+
window.BlitDoneEvent?.Set();
224+
}
217225
}
218226

219227
private unsafe void BlitThreadInit(WindowData reg)
@@ -336,6 +344,7 @@ private sealed class WindowData
336344
public Thread? BlitThread;
337345
public ManualResetEventSlim? BlitStartEvent;
338346
public ManualResetEventSlim? BlitDoneEvent;
347+
public bool UnlockBeforeSwap;
339348
}
340349
}
341350
}

Robust.Client/Graphics/Clyde/Windowing/Glfw.WindowThread.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ private void ProcessGlfwCmd(CmdBase cmdb)
8585
WinThreadWinSetMonitor(cmd);
8686
break;
8787

88+
case CmdWinSetSize cmd:
89+
WinThreadWinSetSize(cmd);
90+
break;
91+
8892
case CmdWinSetVisible cmd:
8993
WinThreadWinSetVisible(cmd);
9094
break;
@@ -234,6 +238,11 @@ private sealed record CmdWinSetFullscreen(
234238
nint Window
235239
) : CmdBase;
236240

241+
private sealed record CmdWinSetSize(
242+
nint Window,
243+
int W, int H
244+
) : CmdBase;
245+
237246
private sealed record CmdWinSetVisible(
238247
nint Window,
239248
bool Visible

Robust.Client/Graphics/Clyde/Windowing/Glfw.Windows.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ private void WinThreadWinSetMonitor(CmdWinSetMonitor cmd)
8484
);
8585
}
8686

87+
public void WindowSetSize(WindowReg window, Vector2i size)
88+
{
89+
var reg = (GlfwWindowReg) window;
90+
91+
SendCmd(new CmdWinSetSize((nint) reg.GlfwWindow, size.X, size.Y));
92+
}
93+
8794
public void WindowSetVisible(WindowReg window, bool visible)
8895
{
8996
var reg = (GlfwWindowReg) window;
@@ -92,6 +99,13 @@ public void WindowSetVisible(WindowReg window, bool visible)
9299
SendCmd(new CmdWinSetVisible((nint) reg.GlfwWindow, visible));
93100
}
94101

102+
private void WinThreadWinSetSize(CmdWinSetSize cmd)
103+
{
104+
var win = (Window*) cmd.Window;
105+
106+
GLFW.SetWindowSize(win, cmd.W, cmd.H);
107+
}
108+
95109
private void WinThreadWinSetVisible(CmdWinSetVisible cmd)
96110
{
97111
var win = (Window*) cmd.Window;

Robust.Client/Graphics/Clyde/Windowing/IWindowingImpl.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private interface IWindowingImpl
3939
void WindowDestroy(WindowReg reg);
4040
void WindowSetTitle(WindowReg window, string title);
4141
void WindowSetMonitor(WindowReg window, IClydeMonitor monitor);
42+
void WindowSetSize(WindowReg window, Vector2i size);
4243
void WindowSetVisible(WindowReg window, bool visible);
4344
void WindowRequestAttention(WindowReg window);
4445
void WindowSwapBuffers(WindowReg window);

Robust.Client/Graphics/Clyde/Windowing/Sdl2.WindowThread.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ private void ProcessSdl2Cmd(CmdBase cmdb)
9393
WinThreadWinRequestAttention(cmd);
9494
break;
9595

96+
case CmdWinSetSize cmd:
97+
WinThreadWinSetSize(cmd);
98+
break;
99+
96100
case CmdWinSetVisible cmd:
97101
WinThreadWinSetVisible(cmd);
98102
break;
@@ -246,6 +250,11 @@ private sealed record CmdWinRequestAttention(
246250
nint Window
247251
) : CmdBase;
248252

253+
private sealed record CmdWinSetSize(
254+
nint Window,
255+
int W, int H
256+
) : CmdBase;
257+
249258
private sealed record CmdWinSetVisible(
250259
nint Window,
251260
bool Visible

0 commit comments

Comments
 (0)