Fix CA2263
This commit is contained in:
committed by
Pavel Penev
parent
332ab244a7
commit
e2296ad2d1
@@ -30,7 +30,7 @@ namespace OpenRA.Platforms.Default
|
||||
if (surface == IntPtr.Zero)
|
||||
throw new InvalidDataException($"Failed to create surface: {SDL.SDL_GetError()}");
|
||||
|
||||
var sur = (SDL.SDL_Surface)Marshal.PtrToStructure(surface, typeof(SDL.SDL_Surface));
|
||||
var sur = Marshal.PtrToStructure<SDL.SDL_Surface>(surface);
|
||||
Marshal.Copy(data, 0, sur.pixels, data.Length);
|
||||
|
||||
// This call very occasionally fails on Windows, but often works when retried.
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Platforms.Default
|
||||
sealed class VertexBuffer<T> : ThreadAffine, IDisposable, IVertexBuffer<T>
|
||||
where T : struct
|
||||
{
|
||||
static readonly int VertexSize = Marshal.SizeOf(typeof(T));
|
||||
static readonly int VertexSize = Marshal.SizeOf<T>();
|
||||
uint buffer;
|
||||
bool disposed;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user