java 方法引用无效_InvalidProgramException:调用方法时无效的IL代码
我收到此運行時錯誤: InvalidProgramException: Invalid IL code . 我正在使用unity 5.3.1f1 . 該項目是編輯器擴展 . 代碼的簡化版本是:
public unsafe class PPAGraph
{
PaddedImage downSampleImage;
int downSampleRate;
internal void Calculate(PaddedImage sourceImage)
{
sourceImage.DownSample(downSampleImage, downSampleRate);
}
此行發生此錯誤 .
InvalidProgramException:Assets.UPlus.TerrEngine.PaddedImage中的IL代碼無效:DownSample(Assets.UPlus.TerrEngine.PaddedImage,int):IL_00a9:stloc.s 15 Assets.UPlus.TerrEngine.PPAGraph.Calculate(Assets.UPlus.TerrEngine . PaddedImage sourceImage,Boolean isRidge,Boolean sketch,Int32 plength,Int32 part)(在Assets / UPlus / TerrEngine / Engine / PPA / PPAGraph.cs:1311)Assets.UPlus.Utils.TerraGodContext.CalcSketchPpa(Assets.UPlus.TerrEngine.PaddedImage sketchImg,Int32 sketchDownSampleRate)(在Assets / UPlus / TerrEngine / UnityEngine / TerraGodContext.cs:70)EditorExtensions.Editor.TerrainGodMainPanel.CreatePanel()(在Assets / UPlus / TerrEngine / Engine / Editor / TerrainGODMainPanel.cs:45)EditorExtensions . Editor.TerrainGODWindow.OnGUI()(在Assets / UPlus / TerrEngine / Engine / Editor / TerrainGODWindow.cs:39)System.Reflection.MonoMethod.Invoke(System.Object obj,BindingFlags invokeAttr,System.Reflection.Binder binder,System . Object []參數,System.Globalization.CultureInfo文化)(在/ Users / buil duser / buildslave /單運行時和 - classlibs /建造/ MCS /類/ corlib /的System.Reflection / MonoMethod.cs:222)
DownSample方法是:
public void DownSample(PaddedImage downSampImg, int downsampleRate)
{
int dsW = downSampImg.Width;
int dsH = downSampImg.Height;
float* dsPix = downSampImg.Pixels,padDSPix=downSampImg.PaddedPixels;
int pad = Padding;
int twoPad = pad + pad;
float* rowMyPix = PaddedPixels;
rowMyPix += pad*PaddedWidth + pad;
float* myPix;
int yStep = downsampleRate * PaddedWidth;
int dsPad = downSampImg.Padding;
int twoDSPad = dsPad + dsPad;
padDSPix += downSampImg.PaddedWidth*dsPad + dsPad;
if (downSampImg.PixelsPtr != IntPtr.Zero)
{
for (int y = 0; y < dsH; y++)
{
myPix = rowMyPix;
for (int x = 0; x < dsW; x++)
{
*padDSPix++ = *dsPix++ = *myPix;
myPix += downsampleRate;
}
padDSPix += twoDSPad;
rowMyPix += yStep;
}
}
else
{
for (int y = 0; y < dsH; y++)
{
myPix = rowMyPix;
for (int x = 0; x < dsW; x++)
{
*padDSPix++ = *dsPix++ = *myPix;
myPix += downsampleRate;
}
padDSPix += twoDSPad;
rowMyPix += yStep;
}
}
}
總結
以上是生活随笔為你收集整理的java 方法引用无效_InvalidProgramException:调用方法时无效的IL代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dos怎么删除文件 如何在DOS中删除文
- 下一篇: 超级玛丽地图java_我的世界超级玛丽地