Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
leezer3 committed Dec 21, 2020
2 parents 762a783 + 89bf9ff commit d84708c
Show file tree
Hide file tree
Showing 36 changed files with 1,276 additions and 37 deletions.
Binary file added assets/Compatibility/Windscreen/Day/drop1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Day/drop2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Day/drop3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Day/drop4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Night/drop1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Night/drop2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Night/drop3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Compatibility/Windscreen/Night/drop4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# The final YAML runs PR trigger builds

pr:
- master

### Test on latest Windows and .Net version

jobs:
- job: WindowsBuild
displayName: 'Build on Windows (sln)'
pool:
vmImage: 'windows-latest'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

### Build and upload via makefile on OS-X
### This uses Mono 6.8.0 as the default version isn't high enough on this image
### As we're 32-bit only at present 10.15+ is no good to us

- job: AppleMakeBuild
displayName: 'Build on Apple OS-X (makefile)'
pool:
vmImage: 'macos-10.14'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1
### Default Mono version isn't high enough on this OS-X image so kick to the latest
- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_8_0
- script: make publish

### Linux makefile build
### This runs on the latest Mono version installed

- job: LinuxMakeBuild
displayName: 'Build on Linux (makefile)'
pool:
vmImage: 'ubuntu-16.04'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1
- script: make publish
84 changes: 84 additions & 0 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This YAML runs the stable release upload builds
trigger:
- tag

### Test on latest Windows and .Net version

jobs:
- job: WindowsBuild
displayName: 'Build on Windows (sln)'
pool:
vmImage: 'windows-latest'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

### Build and upload via makefile on OS-X
### This uses Mono 6.8.0 as the default version isn't high enough on this image
### As we're 32-bit only at present 10.15+ is no good to us

- job: AppleMakeBuild
displayName: 'Build on Apple OS-X (makefile)'
pool:
vmImage: 'macos-10.14'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1
### Default Mono version isn't high enough on this OS-X image so kick to the latest
- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_8_0
- script: make publish
- task: CopyFilesOverSSH@0
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
sshEndpoint: 'BuildServer'
sourceFolder: $(Pipeline.Workspace)/s/
contents: /*.dmg
targetFolder: '/var/www/vps.bvecornwall.co.uk/public/OpenBVE/Stable/'
overwrite: true
readyTimeout: 90000

### Linux makefile build
### This runs on the latest Mono version installed

- job: LinuxMakeBuild
displayName: 'Build on Linux (makefile)'
pool:
vmImage: 'ubuntu-16.04'

variables:
solution: 'OpenBVE.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1
- script: make publish
- task: CopyFilesOverSSH@0
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
sshEndpoint: 'BuildServer'
sourceFolder: $(Pipeline.Workspace)/s/
contents: /*.zip
targetFolder: '/var/www/vps.bvecornwall.co.uk/public/OpenBVE/Stable/'
overwrite: true
readyTimeout: 90000
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ $(DEBIAN_BUILD_RESULT): all-release
ifeq (, $(PROGRAM_VERSION))
@echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
@mv debianbuild.deb OpenBVE-$$(date '+%F').deb
@mv installers/debian.deb OpenBVE-$$(date '+%F').deb
else
@echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
@echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
@mv debianbuild.deb OpenBVE-$(PROGRAM_VERSION).deb
@mv installers/debian.deb OpenBVE-$(PROGRAM_VERSION).deb
endif
15 changes: 15 additions & 0 deletions source/ObjectViewer/FunctionScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,21 @@ internal static void ExecuteFunctionScript(FunctionScript Function, TrainManager
Function.Stack[s] = Math.Sqrt(dx * dx + dy * dy + dz * dz);
s++;
} break;
case Instructions.CameraXDistance:
{
Function.Stack[s] = Program.Renderer.Camera.AbsolutePosition.X - Position.X;
s++;
} break;
case Instructions.CameraYDistance:
{
Function.Stack[s] = Program.Renderer.Camera.AbsolutePosition.Y - Position.Y;
s++;
} break;
case Instructions.CameraZDistance:
{
Function.Stack[s] = Program.Renderer.Camera.AbsolutePosition.Z - Position.Z;
s++;
} break;
case Instructions.CameraView:
//Returns whether the camera is in interior or exterior mode
if (Program.Renderer.Camera.CurrentMode == CameraViewMode.Interior)
Expand Down
2 changes: 1 addition & 1 deletion source/OpenBVE/Audio/Sounds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal partial class Sounds : SoundsBase
/// <returns>The sound source.</returns>
internal void PlayCarSound(CarSound sound, double pitch, double volume, AbstractCar car, bool looped)
{
if (sound.Buffer == null)
if (sound?.Buffer == null)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,21 @@ internal static void ExecuteFunctionScript(FunctionScript Function, TrainManager
Function.Stack[s] = Math.Sqrt(dx * dx + dy * dy + dz * dz);
s++;
} break;
case Instructions.CameraXDistance:
{
Function.Stack[s] = Program.Renderer.Camera.AbsolutePosition.X - Position.X;
s++;
} break;
case Instructions.CameraYDistance:
{
Function.Stack[s] = Program.Renderer.Camera.AbsolutePosition.Y - Position.Y;
s++;
} break;
case Instructions.CameraZDistance:
{
Function.Stack[s] = Program.Renderer.Camera.AbsolutePosition.Z - Position.Z;
s++;
} break;
case Instructions.CameraView:
//Returns whether the camera is in interior or exterior mode
if (Program.Renderer.Camera.CurrentMode == CameraViewMode.Interior || Program.Renderer.Camera.CurrentMode == CameraViewMode.InteriorLookAhead)
Expand Down Expand Up @@ -1347,6 +1362,27 @@ internal static void ExecuteFunctionScript(FunctionScript Function, TrainManager
Function.Stack[s] = 0;
}
s++; break;
case Instructions.RainDrop:
if (Train == null || !Train.IsPlayerTrain) {
Function.Stack[s - 1] = 0.0;
} else {
int n = (int)Math.Round(Function.Stack[s - 1]);
if (n >= 0 & n < Train.Cars[Train.DriverCar].Windscreen.RainDrops.Length) {
Function.Stack[s - 1] = Train.Cars[Train.DriverCar].Windscreen.RainDrops[n].Visible ? 1.0 : 0.0;
} else {
Function.Stack[s - 1] = 0.0;
}
} break;
case Instructions.WiperPosition:
if (Train == null || !Train.IsPlayerTrain)
{
Function.Stack[s] = 0.0; //Not part of player train, so irrelevant
}
else
{
Function.Stack[s] = Train.Cars[Train.DriverCar].Windscreen.Wipers.CurrentPosition;
}
s++; break;
// default
default:
throw new System.InvalidOperationException("The unknown instruction " + Function.InstructionSet[i].ToString() + " was encountered in ExecuteFunctionScript.");
Expand Down
5 changes: 5 additions & 0 deletions source/OpenBVE/OpenBve.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@
<Compile Include="Simulation\TrainManager\Train\Train.RequestStop.cs" />
<Compile Include="Simulation\TrainManager\Train\Train.Specs.cs" />
<Compile Include="Simulation\TrainManager\Train\Train.Station.cs" />
<Compile Include="Simulation\TrainManager\Train\Windscreen\Raindrop.cs" />
<Compile Include="Simulation\TrainManager\Train\Windscreen\Windscreen.cs" />
<Compile Include="Simulation\TrainManager\Train\Windscreen\Wiper.cs" />
<Compile Include="Simulation\TrainManager\Train\Windscreen\WiperPosition.cs" />
<Compile Include="Simulation\TrainManager\Train\Windscreen\WiperSpeed.cs" />
<Compile Include="System\Cursor.cs" />
<Compile Include="System\Functions\Bve5Shared.cs" />
<Compile Include="System\Functions\CrashHandler.cs" />
Expand Down
Loading

0 comments on commit d84708c

Please sign in to comment.