-
Notifications
You must be signed in to change notification settings - Fork 34
Texture implementations of GetPixel, GetPixels, SetPixel and SetPixels, plus helpers. #35
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
base: master
Are you sure you want to change the base?
Conversation
… of Texture.SetPixels and Texture.GetPixels and Texture.Apply(bool). Added helper methods Texture.GetMipmapSize(miplevel), Texture.GetMipmapWidth(miplevel) and Texture.GetMipmapHeight(miplevel).
… into account to prevent crashing on indexes above or below texture dimensions.
…an index in-texture pixels beyond (0, 0) is using GetData/SetData with Rectangle.
Conflicts: Framework/PressPlay.FFWD/Texture.cs Unstable: Framework/PressPlay.FFWD/Texture.cs and Framework/PressPlay.FFWD/Texture2D.cs have duplicated code.
…ble. Also, changed Xna.Framework.Color[] operations to byte[].
|
I have synced my fork to the latest version of FFWD and fixed the conflicts in Texture. One more test to verify things work. To fully check it, set "Generate Mipmaps" to True in the XNA texture's properties. |
|
I am getting a "the 'optional parameter' cannot be used it is not part of the 3.0 c# language specification" error. On Texture2D.cs Total of 7 places...lines 67, 82, 127, 147, 166, 177 and 188. Anytime something like: Apparently xbox and windows phone only use .NET 3.0, I am trying the suggestion linked below...just deleting the "= 0" This occurs when debugging the FFWD.Unity.Tests XNA project. |
|
i'll add this note to Elideb's fork...not sure if I was testing what you guys wanted tested...however I did notice the "optional parameter" still in the Texture2D.cs so it is worth noting. Just going through and deleting the "=0" made the error go away, not sure if it still functions as desired however. Materials and textures still seem to make it onto their meshes :-) |
…th explicit no mipmap methods calling to mipmap capable ones.
|
I've learnt the lesson and created WP7 and X360 versions of my test project. I've tested the last commit and it works on WP7. However, calling GetPixel and SetPixel each frame for each pixel in a 64x64 texture takes 6 seconds per frame in the WP7 emulator. Only calling SetPixels each frame does much better (16 ticks), which is to be expected. |
|
Awesome, I will test soon...hopefully whilst working on integrating Terrain, any thoughts here: |
|
After clearing out the UnityTests project and known errors...I compiled your XNA, the errors that were there are gone, now there is a bunch of warnings 14 or so. And 3 errors: Warnings: |
|
@maconbot I've integrated Fehaar's latest changes, which fix the compilation and dependencies of the tests. |
This fixes issue #27.
Testing code for different cases: