~sladen/openbve/openbve2

« back to all changes in this revision

Viewing changes to OpenBveApi/Texture.cs

  • Committer: Paul Sladen
  • Author(s): Michelle Boucquemont
  • Date: 2010-03-17 04:04:44 UTC
  • Revision ID: git-v1:c9050dde4c55fe2b9c257080653cee1a07c91303
import openbve2.zip (2010-03-14)

You will find a settings.cfg file where you can configure a series of
options and also which route or object to load. The options are
explained briefly via the comments in the settings.cfg file itself.
Select any route or object you want, but mind the following limitations:

* Background images and fog are not yet supported. Only a background
  color will be shown.
* Animated objects are not yet supported. This includes signals. These
  objects are not shown at all.
* Glow is not yet supported. All objects using glow will always show at
  full intensity instead of fading in.
* The legacy visibility system (where objects are disposed of as soon as
  the CSV/RW block the object was placed in has been passed by the camera)
  is not yet supported, only the new 2D grid is.

In-game, you can use the arrow, the WASD and the PageUp and PageDown keys to move and rotate around. Hold down the shift, control or alt key for faster movement. There is no way for you to jump to specific "track positions" as the new program does not have something like them internally. Also, you cannot jump to stations in any way at the moment. The initial position of the camera is the first stop point, though.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
                /// <summary>Represents a texture format.</summary>
9
9
                public struct TextureFormat {
10
10
                        // members
11
 
                        /// <summary>The width.</summary>
 
11
                        /// <summary>The positive width of the texture.</summary>
12
12
                        public int Width;
13
 
                        /// <summary>The height.</summary>
 
13
                        /// <summary>The positive height of the texture.</summary>
14
14
                        public int Height;
15
15
                        /// <summary>The number of bits per channel. Allowed values are 8 or 16.</summary>
16
16
                        public int BitsPerChannel;
17
17
                        // constructors
18
18
                        /// <summary>Creates a new instance of this structure.</summary>
19
 
                        /// <param name="width">The width.</param>
20
 
                        /// <param name="height">The height.</param>
 
19
                        /// <param name="width">The positive width of the texture.</param>
 
20
                        /// <param name="height">The positive height of the texture.</param>
21
21
                        /// <param name="bitsPerChannel">The number of bits per channel. Allowed values are 8 or 16.</param>
 
22
                        /// <exception cref="System.ArgumentException">Raised when any of the submitted arguments are invalid.</exception>
22
23
                        public TextureFormat(int width, int height, int bitsPerChannel) {
23
 
                                this.Width = width;
24
 
                                this.Height = height;
25
 
                                this.BitsPerChannel = bitsPerChannel;
 
24
                                if (width <= 0 | height <= 0 | bitsPerChannel != 8 & bitsPerChannel != 16) {
 
25
                                        throw new ArgumentException();
 
26
                                } else {
 
27
                                        this.Width = width;
 
28
                                        this.Height = height;
 
29
                                        this.BitsPerChannel = bitsPerChannel;
 
30
                                }
26
31
                        }
27
32
                }
28
33
                
57
62
                // texture clip region
58
63
                /// <summary>Represents a region of a texture to be extracted by a texture load operation.</summary>
59
64
                public class TextureClipRegion {
 
65
                        // members
60
66
                        /// <summary>The x-coordinate of the left margin of the region to be extracted, in pixels.</summary>
61
67
                        /// <remarks>The coordinate is zero-based.</remarks>
62
68
                        public int Left;
67
73
                        public int Width;
68
74
                        /// <summary>The height of the region to be extracted in pixels.</summary>
69
75
                        public int Height;
 
76
                        // static functions
 
77
                        /// <summary>Checks two texture clip regions for equality.</summary>
 
78
                        /// <param name="a">The first texture clip region.</param>
 
79
                        /// <param name="b">The second texture clip region.</param>
 
80
                        /// <returns>A boolean indicating whether the two texture clip regions are equal.</returns>
 
81
                        public static bool Equals(TextureClipRegion a, TextureClipRegion b) {
 
82
                                if (a == null & b == null) {
 
83
                                        return true;
 
84
                                } else if (a == null | b == null) {
 
85
                                        return false;
 
86
                                } else {
 
87
                                        return a.Left == b.Left & a.Top == b.Top & a.Width == b.Width & a.Height == b.Height;
 
88
                                }
 
89
                        }
70
90
                }
71
 
 
72
91
                
73
92
                // texture parameters
74
93
                /// <summary>Represents options for the texture loading process.</summary>
88
107
                        /// <param name="horizontalWrapMode">The horizontal wrap mode for this texture.</param>
89
108
                        /// <param name="verticalWrapMode">The vertical wrap mode for this texture.</param>
90
109
                        /// <param name="clipRegion">The region of the texture to be extracted, or a null reference for the entire texture.</param>
91
 
                        /// <remarks>If more than one transparent color is specified, you must ensure that they are in canonical order. Use the static method GetCanonicalOrder of the TextureLoadOptions structure to ensure this order.</remarks>
92
110
                        public TextureParameters(Color.TransparentColor transparentColor, TextureWrapMode horizontalWrapMode, TextureWrapMode verticalWrapMode, TextureClipRegion clipRegion) {
93
111
                                this.TransparentColor = transparentColor;
94
112
                                this.HorizontalWrapMode = horizontalWrapMode;
133
151
                        public override int GetHashCode() {
134
152
                                return base.GetHashCode();
135
153
                        }
 
154
                        // read-only fields
 
155
                        /// <summary>Represents texture parameters without transparent color nor clip regions, and with the texture wrap mode set to ClampToEdge.</summary>
 
156
                        public static readonly TextureParameters ClampToEdge = new TextureParameters(Color.TransparentColor.Empty, TextureWrapMode.ClampToEdge, TextureWrapMode.ClampToEdge, null);
 
157
                        /// <summary>Represents texture parameters without transparent color nor clip regions, and with the texture wrap mode set to Repeat.</summary>
 
158
                        public static readonly TextureParameters Repeat = new TextureParameters(Color.TransparentColor.Empty, TextureWrapMode.Repeat, TextureWrapMode.Repeat, null);
136
159
                }
137
160
                
138
161
                // texture handle
139
162
                /// <summary>Represents a handle to a texture as obtained from the host application.</summary>
140
 
                public struct TextureHandle {
141
 
                        // members
142
 
                        /// <summary>Data by which the host application can identify the texture this handle points to, or a null reference.</summary>
143
 
                        public object TextureData;
144
 
                        // constructors
145
 
                        /// <summary>Creates a new instance of this structure.</summary>
146
 
                        /// <param name="textureData">Data by which the host application can identify the texture this handle points to, or a null reference.</param>
147
 
                        public TextureHandle(object textureData) {
148
 
                                this.TextureData = textureData;
149
 
                        }
150
 
                        // read-only fields
151
 
                        /// <summary>Represents a handle that has not been allocated by the host application.</summary>
152
 
                        public static readonly TextureHandle Null = new TextureHandle(null);
153
 
                }
 
163
                public abstract class TextureHandle { }
154
164
                
155
165
        }
156
166
}
 
 
b'\\ No newline at end of file'