-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into OpenDream-854
- Loading branch information
Showing
41 changed files
with
681 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Content.Tests/DMProject/Tests/Statements/Switch/weird_when_clause.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
//Issue OD#996, kinda: https://github.com/OpenDreamProject/OpenDream/issues/996 | ||
|
||
/proc/RunTest() | ||
var/x = 5 | ||
switch(x) | ||
if(1) | ||
CRASH("Strange branch chosen in switch statement") | ||
if(4) | ||
CRASH("Strange branch chosen in switch statement") | ||
else if(x == 3) | ||
CRASH("Parser failed to understand 'else if' in switch block") | ||
else | ||
return | ||
CRASH("Parser failed to understand 'else if' in switch block") |
16 changes: 16 additions & 0 deletions
16
Content.Tests/DMProject/Tests/Statements/Switch/weird_when_clause_pragma.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//COMPILE ERROR | ||
//test to make sure SuspiciousSwitchCase is working | ||
|
||
#pragma SuspiciousSwitchCase error | ||
|
||
/proc/RunTest() | ||
var/x = 5 | ||
switch(x) | ||
if(1) | ||
return | ||
if(4) | ||
return | ||
else if(x == 3) | ||
return | ||
else | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using DMCompiler.Bytecode; | ||
using NUnit.Framework; | ||
|
||
namespace Content.Tests; | ||
|
||
[TestFixture] | ||
public sealed class RuntimeTests { | ||
/// <summary> | ||
/// Validates that the opcodes in DreamProcOpcode are all unique, such that none resolve to the same byte. | ||
/// </summary> | ||
[Test] | ||
public void EnsureOpcodesUnique() { | ||
Assert.That(Enum.GetValues<DreamProcOpcode>(), Is.Unique); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@echo off | ||
if not exist bin\Debug\net7.0\DMStandard mkdir bin\Debug\net7.0\DMStandard | ||
xcopy DMStandard bin\Debug\net7.0\DMStandard /y /s /e | ||
if not exist bin\Release\net7.0\DMStandard mkdir bin\Release\net7.0\DMStandard | ||
xcopy DMStandard bin\Release\net7.0\DMStandard /y /s /e | ||
if not exist bin\Debug\net8.0\DMStandard mkdir bin\Debug\net8.0\DMStandard | ||
xcopy DMStandard bin\Debug\net8.0\DMStandard /y /s /e | ||
if not exist bin\Release\net8.0\DMStandard mkdir bin\Release\net8.0\DMStandard | ||
xcopy DMStandard bin\Release\net8.0\DMStandard /y /s /e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Audio; | ||
using Robust.Shared.Audio.Components; | ||
|
||
namespace OpenDreamClient.Audio; | ||
|
||
public sealed class DreamSoundChannel : IDisposable { | ||
public IClydeAudioSource Source { get; } | ||
|
||
public DreamSoundChannel(IClydeAudioSource source) { | ||
Source = source; | ||
} | ||
public sealed class DreamSoundChannel(AudioSystem audioSystem, (EntityUid Entity, AudioComponent Component) source) { | ||
public readonly (EntityUid Entity, AudioComponent Component) Source = source; | ||
|
||
public void Stop() { | ||
Source.StopPlaying(); | ||
} | ||
|
||
public void Dispose() { | ||
Stop(); | ||
Source.Dispose(); | ||
audioSystem.Stop(Source.Entity, Source.Component); | ||
} | ||
} |
Oops, something went wrong.