Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/Cursors/Symbols/minus.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/Cursors/Symbols/plus.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/Cursors/fb.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/Cursors/fc.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/Cursors/fgl.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/Cursors/fgr.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/Cursors/fk.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/Cursors/fm.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/Cursors/fr.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/Cursors/fw.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/Cursors/fy.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/Cursors/g1.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/Cursors/g2.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/Cursors/g3.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/Cursors/hc1.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/Cursors/hc2.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/Cursors/hc3.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/Cursors/hc4.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/Cursors/hc5.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/Cursors/nb.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/Cursors/nc.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/Cursors/ng.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/Cursors/nk.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/Cursors/nm.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/Cursors/nr.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/Cursors/ny.png
1 change: 1 addition & 0 deletions assets/Languages/en-US.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ DEBUG_WIREFRAME = Activates or deactivates wireframe mode
DEBUG_NORMALS = Shows or hides vertex normals
DEBUG_BRAKE = Shows or hides brake system debug output
DEBUG_ATS = Shows or hides plugin debug output
DEBUG_TOUCH_MODE = Shows or hides the touch range
ROUTE_INFORMATION = Shows or hides the route information window
SHOW_EVENTS = Shows or hides event markers (For developers)

Expand Down
26 changes: 26 additions & 0 deletions licenses/Cursors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2019, F81 tec200
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ $(DEBUG_DIR)/$(OPEN_BVE_FILE) $(RELEASE_DIR)/$(OPEN_BVE_FILE): $(OPEN_BVE_ROOT)/
$(OPEN_BVE_ROOT)/Properties/AssemblyInfo.cs \
/reference:$(OUTPUT_DIR)/OpenTK.dll /reference:$(OPEN_BVE_API_OUT) /reference:$(ASSIMP_OUT) /reference:$(FORMATS_MSTS_OUT) /reference:$(FORMATS_DIRECTX_OUT) \
/reference:$(OUTPUT_DIR)/CSScriptLibrary.dll /reference:$(OUTPUT_DIR)/NUniversalCharDet.dll /reference:$(OUTPUT_DIR)/SharpCompress.dll /reference:$(OUTPUT_DIR)/PIEHid32Net.dll \
/reference:System.Core.dll /reference:System.dll \
/reference:System.Xml.Linq.dll /reference:System.Core.dll /reference:System.dll \
/win32icon:$(ICON) $(addprefix /resource:, $(OPEN_BVE_RESOURCE))
@echo $(COLOR_GREEN)Adding LBA Flag to executable $(COLOR_CYAN)$(OPEN_BVE_OUT)$(COLOR_END)
@mono $(LBAHEADER_OUT) ${OPEN_BVE_OUT} > /dev/null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ internal void Initialize(int StateIndex, bool Overlay, bool Show)
/// <param name="Show"></param>
/// <param name="TimeElapsed">The time elapsed since this object was last updated</param>
/// <param name="EnableDamping">Whether damping is to be applied for this call</param>
internal void Update(bool IsPartOfTrain, TrainManager.Train Train, int CarIndex, int SectionIndex, double TrackPosition, Vector3 Position, Vector3 Direction, Vector3 Up, Vector3 Side, bool Overlay, bool UpdateFunctions, bool Show, double TimeElapsed, bool EnableDamping)
/// <param name="IsTouch">Whether Animated Object belonging to TouchElement class.</param>
internal void Update(bool IsPartOfTrain, TrainManager.Train Train, int CarIndex, int SectionIndex, double TrackPosition, Vector3 Position, Vector3 Direction, Vector3 Up, Vector3 Side, bool Overlay, bool UpdateFunctions, bool Show, double TimeElapsed, bool EnableDamping, bool IsTouch = false)
{
int s = CurrentState;
int i = ObjectIndex;
Expand Down Expand Up @@ -787,21 +788,25 @@ internal void Update(bool IsPartOfTrain, TrainManager.Train Train, int CarIndex,
}
}
// visibility changed
if (Show)
// TouchElement is handled by another function.
if (!IsTouch)
{
if (Overlay)
if (Show)
{
Renderer.ShowObject(i, ObjectType.Overlay);
if (Overlay)
{
Renderer.ShowObject(i, ObjectType.Overlay);
}
else
{
Renderer.ShowObject(i, ObjectType.Dynamic);
}
}
else
{
Renderer.ShowObject(i, ObjectType.Dynamic);
Renderer.HideObject(i);
}
}
else
{
Renderer.HideObject(i);
}
}
}

Expand Down
47 changes: 27 additions & 20 deletions source/OpenBVE/Graphics/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ internal static void RenderScene(double TimeElapsed)
/// <summary> Stores the last bound OpenGL texture</summary>
internal static OpenGlTexture LastBoundTexture = null;

private static void RenderFace(ref ObjectFace Face, double CameraX, double CameraY, double CameraZ)
private static void RenderFace(ref ObjectFace Face, double CameraX, double CameraY, double CameraZ, bool IsDebugTouchMode = false)
{
if (CullEnabled)
{
Expand All @@ -503,9 +503,9 @@ private static void RenderFace(ref ObjectFace Face, double CameraX, double Camer
}
}
int r = (int)ObjectManager.Objects[Face.ObjectIndex].Mesh.Faces[Face.FaceIndex].Material;
RenderFace(ref ObjectManager.Objects[Face.ObjectIndex].Mesh.Materials[r], ObjectManager.Objects[Face.ObjectIndex].Mesh.Vertices, Face.Wrap, ref ObjectManager.Objects[Face.ObjectIndex].Mesh.Faces[Face.FaceIndex], CameraX, CameraY, CameraZ);
RenderFace(ref ObjectManager.Objects[Face.ObjectIndex].Mesh.Materials[r], ObjectManager.Objects[Face.ObjectIndex].Mesh.Vertices, Face.Wrap, ref ObjectManager.Objects[Face.ObjectIndex].Mesh.Faces[Face.FaceIndex], CameraX, CameraY, CameraZ, IsDebugTouchMode);
}
private static void RenderFace(ref MeshMaterial Material, VertexTemplate[] Vertices, OpenGlTextureWrapMode wrap, ref MeshFace Face, double CameraX, double CameraY, double CameraZ)
private static void RenderFace(ref MeshMaterial Material, VertexTemplate[] Vertices, OpenGlTextureWrapMode wrap, ref MeshFace Face, double CameraX, double CameraY, double CameraZ, bool IsDebugTouchMode = false)
{
// texture
if (Material.DaytimeTexture != null)
Expand Down Expand Up @@ -582,23 +582,30 @@ private static void RenderFace(ref MeshMaterial Material, VertexTemplate[] Verti
}
// render daytime polygon
int FaceType = Face.Flags & MeshFace.FaceTypeMask;
switch (FaceType)
{
case MeshFace.FaceTypeTriangles:
GL.Begin(PrimitiveType.Triangles);
break;
case MeshFace.FaceTypeTriangleStrip:
GL.Begin(PrimitiveType.TriangleStrip);
break;
case MeshFace.FaceTypeQuads:
GL.Begin(PrimitiveType.Quads);
break;
case MeshFace.FaceTypeQuadStrip:
GL.Begin(PrimitiveType.QuadStrip);
break;
default:
GL.Begin(PrimitiveType.Polygon);
break;
if (!IsDebugTouchMode)
{
switch (FaceType)
{
case MeshFace.FaceTypeTriangles:
GL.Begin(PrimitiveType.Triangles);
break;
case MeshFace.FaceTypeTriangleStrip:
GL.Begin(PrimitiveType.TriangleStrip);
break;
case MeshFace.FaceTypeQuads:
GL.Begin(PrimitiveType.Quads);
break;
case MeshFace.FaceTypeQuadStrip:
GL.Begin(PrimitiveType.QuadStrip);
break;
default:
GL.Begin(PrimitiveType.Polygon);
break;
}
}
else
{
GL.Begin(PrimitiveType.LineLoop);
}
if (Material.GlowAttenuationData != 0)
{
Expand Down
1 change: 1 addition & 0 deletions source/OpenBVE/Graphics/Renderer/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ internal static void Reset()
DynamicAlpha = new ObjectList();
OverlayOpaque = new ObjectList();
OverlayAlpha = new ObjectList();
Touch = new ObjectList();
OptionLighting = true;
OptionAmbientColor = new Color24(160, 160, 160);
OptionDiffuseColor = new Color24(160, 160, 160);
Expand Down
3 changes: 3 additions & 0 deletions source/OpenBVE/Graphics/Renderer/Objects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ internal static void HideObject(int ObjectIndex)
case ObjectListType.OverlayAlpha:
list = OverlayAlpha;
break;
case ObjectListType.Touch:
list = Touch;
break;
default:
throw new InvalidOperationException();
}
Expand Down
4 changes: 3 additions & 1 deletion source/OpenBVE/Graphics/Renderer/Structures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ private enum ObjectListType : byte
/// <summary>The face is fully opaque and originates from an object that is part of the cab.</summary>
OverlayOpaque = 4,
/// <summary>The face is partly transparent and originates from an object that is part of the cab.</summary>
OverlayAlpha = 5
OverlayAlpha = 5,
/// <summary>The face is touch element and originates from an object that is part of the cab.</summary>
Touch = 6
}

private struct ObjectListReference
Expand Down
Loading