Exemple #1
0
 public AtomicLong(byte* ptr)
 {
     if (((long) ptr & 7) != 0)
     {
         throw new ArgumentException("The address should be aligned to 8 byte boundary");
     }
     _ptr = (long*) ptr;
 }
Exemple #2
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     ((SpatialIndex)GCHandledObjects.GCHandleToObject(instance)).AddAreaTriggerBuildingsInRangeOf((Entity)GCHandledObjects.GCHandleToObject(*args), *(int *)(args + 1), *(int *)(args + 2));
     return(-1L);
 }
 public unsafe static long $Invoke0(long instance, long *args)
 {
     ((ProjectorForceReloadHelper)GCHandledObjects.GCHandleToObject(instance)).Destroy();
     return(-1L);
 }
Exemple #4
0
 public unsafe partial void GetInternalformat([Flow(FlowDirection.In)] TextureTarget target, [Flow(FlowDirection.In)] InternalFormat internalformat, [Flow(FlowDirection.In)] InternalFormatPName pname, [Flow(FlowDirection.In)] uint count, [Count(Parameter = "count"), Flow(FlowDirection.Out)] long * @params);
 public unsafe static long $Invoke17(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).UseUpgradeImage(*(int *)args)));
 }
 public unsafe static long $Invoke15(long instance, long *args)
 {
     ((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).ShowIconUpgradeCelebrationScreen();
     return(-1L);
 }
 public unsafe static long $Invoke13(long instance, long *args)
 {
     ((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).SaveIconProgress();
     return(-1L);
 }
        /// <summary>
        /// Disposes the object and frees resources for the Garbage Collector.
        /// </summary>
        /// <param name="disposing">If true, the object gets disposed.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (this.isDisposed)
            {
                return;
            }

            if (disposing)
            {
                // Dispose of any managed resources here.
                this.UnlockBitmap();
            }

            // Call the appropriate methods to clean up
            // unmanaged resources here.
            if (this.normalSumHandle.IsAllocated)
            {
                this.normalSumHandle.Free();
                this.normalSum = null;
            }

            if (this.squaredSumHandle.IsAllocated)
            {
                this.squaredSumHandle.Free();
                this.squaredSum = null;
            }

            if (this.tiltedSumHandle.IsAllocated)
            {
                this.tiltedSumHandle.Free();
                this.tiltedSum = null;
            }

            // Note disposing is done.
            this.isDisposed = true;
        }
 public unsafe static long $Invoke9(long instance, long *args)
 {
     ((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).OnGetProfilePicture((Texture2D)GCHandledObjects.GCHandleToObject(*args), GCHandledObjects.GCHandleToObject(args[1]));
     return(-1L);
 }
 public unsafe static long $Invoke8(long instance, long *args)
 {
     ((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).InitView();
     return(-1L);
 }
 public unsafe static long $Invoke7(long instance, long *args)
 {
     ((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).InitPlanetStats(Marshal.PtrToStringUni(*(IntPtr *)args));
     return(-1L);
 }
 public unsafe static long $Invoke6(long instance, long *args)
 {
     ((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).InitIcons(Marshal.PtrToStringUni(*(IntPtr *)args), (FactionType)(*(int *)(args + 1)), *(int *)(args + 2));
     return(-1L);
 }
 public unsafe static long $Invoke3(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).GetPlayerElementPrefix((SocialTabs)(*(int *)args))));
 }
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).CanPlayerBeInvitedToJoinSquad()));
 }
 /// <summary>
 /// ���
 /// </summary>
 public void Clear()
 {
     if (null == m_OffsetPointer) return;
     m_OffsetPointer = null;
     m_OffsetSize = 0;
     m_OffsetBase = 0;
     m_LimitStart = 0;
     m_LimitSize = 0;
     m_Pos = 0;
 }
        /// <summary>
        ///   Releases unmanaged and - optionally - managed resources
        /// </summary>
        /// 
        /// <param name="disposing"><c>true</c> to release both managed 
        /// and unmanaged resources; <c>false</c> to release only unmanaged
        /// resources.</param>
        /// 
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // free managed resources
                // (i.e. IDisposable objects)
            }

            // free native resources
            if (nSumHandle.IsAllocated)
            {
                nSumHandle.Free();
                nSum = null;
            }
            if (sSumHandle.IsAllocated)
            {
                sSumHandle.Free();
                sSum = null;
            }
            if (tSumHandle.IsAllocated)
            {
                tSumHandle.Free();
                tSum = null;
            }
        }
 public unsafe static long $Invoke10(long instance, long *args)
 {
     ((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).OnInviteToSquadClicked((UXButton)GCHandledObjects.GCHandleToObject(*args));
     return(-1L);
 }
Exemple #18
0
 public unsafe int *PointerCast(long *p)
 {
     return((int *)p);
 }
 public unsafe static long $Invoke11(long instance, long *args)
 {
     ((LeaderboardRowPlayerView)GCHandledObjects.GCHandleToObject(instance)).OnInviteToSquadComplete(*(sbyte *)args != 0, GCHandledObjects.GCHandleToObject(args[1]));
     return(-1L);
 }
 public unsafe static long $Invoke14(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).ShouldShowIconUpgradeCelebration()));
 }
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetCurrentPlayerDisplayNextLevel()));
 }
 public unsafe static long $Invoke16(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).SortAscending((IconUpgradeVO)GCHandledObjects.GCHandleToObject(*args), (IconUpgradeVO)GCHandledObjects.GCHandleToObject(args[1]))));
 }
 public unsafe static long $Invoke3(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetCurrentPlayerVictoryRating()));
 }
Exemple #24
0
 public unsafe partial void GetInternalformat([Flow(FlowDirection.In)] ARB target, [Flow(FlowDirection.In)] ARB internalformat, [Flow(FlowDirection.In)] ARB pname, [Flow(FlowDirection.In)] uint count, [Count(Parameter = "count"), Flow(FlowDirection.Out)] long * @params);
 public unsafe static long $Invoke4(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetIcon((FactionType)(*(int *)args), *(int *)(args + 1))));
 }
Exemple #26
0
 private static extern unsafe bool GetFileSizeEx
 (
     IntPtr hFile,               // handle to file
     long *lpFileSize            // a pointer to a large integer that will be set to the file size
 );
 public unsafe static long $Invoke5(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetIcon(Marshal.PtrToStringUni(*(IntPtr *)args), *(int *)(args + 1))));
 }
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((ProjectorForceReloadHelper)GCHandledObjects.GCHandleToObject(instance)).OnEvent((EventId)(*(int *)args), GCHandledObjects.GCHandleToObject(args[1]))));
 }
 public unsafe static long $Invoke6(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetIconPostfixFromRating(*(int *)args)));
 }
		/// <summary>
		/// Creates a new CudaRegisteredHostMemory_long from an existing IntPtr. IntPtr must be page size aligned (4KBytes)!
		/// </summary>
		/// <param name="hostPointer">must be page size aligned (4KBytes)</param>
		/// <param name="size">In elements</param>
		public CudaRegisteredHostMemory_long(IntPtr hostPointer, SizeT size)
		{
			_intPtr = hostPointer;
			_size = size;
			_typeSize = (SizeT)Marshal.SizeOf(typeof(long));
			_ptr = (long*)_intPtr;
		}
 public unsafe static long $Invoke7(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetSortedFactionIconData()));
 }
        /// <summary>
        ///   Constructs a new Integral image of the given size.
        /// </summary>
        /// 
        protected IntegralImage2(int width, int height, bool computeTilted)
        {
            this.width = width;
            this.height = height;

            this.nWidth = width + 1;
            this.nHeight = height + 1;

            this.tWidth = width + 2;
            this.tHeight = height + 2;

            this.nSumImage = new long[nHeight, nWidth];
            this.nSumHandle = GCHandle.Alloc(nSumImage, GCHandleType.Pinned);
            this.nSum = (long*)nSumHandle.AddrOfPinnedObject().ToPointer();

            this.sSumImage = new long[nHeight, nWidth];
            this.sSumHandle = GCHandle.Alloc(sSumImage, GCHandleType.Pinned);
            this.sSum = (long*)sSumHandle.AddrOfPinnedObject().ToPointer();

            if (computeTilted)
            {
                this.tSumImage = new long[tHeight, tWidth];
                this.tSumHandle = GCHandle.Alloc(tSumImage, GCHandleType.Pinned);
                this.tSum = (long*)tSumHandle.AddrOfPinnedObject().ToPointer();
            }
        }
 public unsafe static long $Invoke9(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).GetTotalVictoryRatingToNextLevel()));
 }
 public unsafe static long $Invoke10(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).OnEvent((EventId)(*(int *)args), GCHandledObjects.GCHandleToObject(args[1]))));
 }
 public unsafe static long $Invoke11(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(((FactionIconUpgradeController)GCHandledObjects.GCHandleToObject(instance)).RatingToDisplayLevel(*(int *)args)));
 }
        /// <summary>
        /// Locks the bitmap into system memory.
        /// </summary>
        private void LockBitmap()
        {
            Rectangle bounds = new Rectangle(Point.Empty, this.bitmap.Size);

            // Figure out the number of bytes in a row. This is rounded up to be a multiple
            // of 4 bytes, since a scan line in an image must always be a multiple of 4 bytes
            // in length.
            this.pixelSize = Image.GetPixelFormatSize(this.bitmap.PixelFormat) / 8;
            this.bytesInARow = bounds.Width * this.pixelSize;
            if (this.bytesInARow % 4 != 0)
            {
                this.bytesInARow = 4 * ((this.bytesInARow / 4) + 1);
            }

            // Lock the bitmap
            this.bitmapData = this.bitmap.LockBits(bounds, ImageLockMode.ReadWrite, this.bitmap.PixelFormat);

            // Set the value to the first scan line
            this.pixelBase = (byte*)this.bitmapData.Scan0.ToPointer();

            if (this.computeIntegrals)
            {
                // Allocate values for integral image calculation.
                this.normalWidth = this.width + 1;
                int normalHeight = this.height + 1;

                this.tiltedWidth = this.width + 2;
                int tiltedHeight = this.height + 2;

                this.normalSumImage = new long[normalHeight, this.normalWidth];
                this.normalSumHandle = GCHandle.Alloc(this.normalSumImage, GCHandleType.Pinned);
                this.normalSum = (long*)this.normalSumHandle.AddrOfPinnedObject().ToPointer();

                this.squaredSumImage = new long[normalHeight, this.normalWidth];
                this.squaredSumHandle = GCHandle.Alloc(this.squaredSumImage, GCHandleType.Pinned);
                this.squaredSum = (long*)this.squaredSumHandle.AddrOfPinnedObject().ToPointer();

                if (this.computeTilted)
                {
                    this.tiltedSumImage = new long[tiltedHeight, this.tiltedWidth];
                    this.tiltedSumHandle = GCHandle.Alloc(this.tiltedSumImage, GCHandleType.Pinned);
                    this.tiltedSum = (long*)this.tiltedSumHandle.AddrOfPinnedObject().ToPointer();
                }

                this.CalculateIntegrals();
            }
        }
Exemple #37
0
 public unsafe int PointerSubtraction2(long *p, short *q)
 {
     return((int)((byte *)p - (byte *)q));
 }