-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Power of two exception #47
Comments
The power of two exception happens to a texture that is applied to 3D model. The texture must be
I changed the code so that it will read only 1024x1024 or 512x512 |
Thanks. I resized my sprtie sheet and ended up with the same error. So means theres something else causing the exception error besides the sprite sheet. |
If the size of the sprite sheet is around 1024x1024 try hard coding the condition so that it will respond to only that size of texture. |
There is also another problem that you could have overlooked. The position of the texture files in your XNA project must be the same way as it is in Unity. |
The exception occurs due to a missing null reference check. If there is no texture it fails, so there should be a check for that. I have some new code for it done, but it is mixed up with some other stuff that is not done yet - so it hasn't been posted. Hopefully I can get back to FFWD soon and finish up those parts. |
I am getting exception but am unsure what exactly I will need to do to get rid of the exception. Here is the exception:
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=PressPlay.FFWD
StackTrace:
at PressPlay.FFWD.Texture.CheckPowerOfTwoSize() in C:\Users\dwc2987@msn.com\FFWD-Templates\FFWD\Framework\PressPlay.FFWD\Texture.cs:line 96
at PressPlay.FFWD.Texture.DoLoadAsset(AssetHelper assetHelper) in C:\Users\dwc2987@msn.com\FFWD-Templates\FFWD\Framework\PressPlay.FFWD\Texture.cs:line 78
at PressPlay.FFWD.Asset.LoadAsset(AssetHelper assetHelper) in C:\Users\dwc2987@msn.com\FFWD-Templates\FFWD\Framework\PressPlay.FFWD\Asset.cs:line 28
at PressPlay.FFWD.Application.LoadSceneAssets() in C:\Users\dwc2987@msn.com\FFWD-Templates\FFWD\Framework\PressPlay.FFWD\Application.cs:line 496
at PressPlay.FFWD.Application.Update(GameTime gameTime) in C:\Users\dwc2987@msn.com\FFWD-Templates\FFWD\Framework\PressPlay.FFWD\Application.cs:line 228
at Microsoft.Xna.Framework.Game.Update(GameTime gameTime)
at FFWD.Unity.Tests.Game1.Update(GameTime gameTime) in C:\Users\dwc2987@msn.com\Documents\New folder\XNA\Test\Game1.cs:line 85
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Microsoft.Xna.Framework.Game.Run()
at FFWD.Unity.Tests.Program.Main(String[] args) in C:\Users\dwc2987@msn.com\Documents\New folder\XNA\Test\Program.cs:line 15
InnerException:
The text was updated successfully, but these errors were encountered: