-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fixed issue #2010 and #1966 #2016
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
@mgbot test |
Test FAILed. |
@@ -1,4 +1,7 @@ | |||
#define DIRECTX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't define DIRECTX in a source file. These are declared in the project properties. This is causing non-DirectX platforms to fail to build.
Also, why does it need "using System.IO"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added DIRECTX define as a dirty hack to force my debugger to recognize conditional parts when the file was open in different solution. I forgot to remove it.
The System.IO is used by Seek() method (specifically SeekOrigin enum).
@mgbot test |
Test PASSed. |
After figuring out that Texture2D.GetData doesn't return the correct color values for WP8, W8 (always returns R=0,G=0,B=0,A=0) I found this fork and tried it in my app. Unfortunately, I still have the same issues. The correct color value is not returned. Here is how I use it (see the ContainsPointForArbitrary method (last one in the file)): https://github.com/brainchest/CraftworkGames/blob/master/Source/CraftworkGames.Gui/Controls/Shape.cs Using MonoGame for WindowsGL it works perfectly (even without this fix here). Do I need to prepare something on WP8, W8 side in order to get this working? |
@brainchest Your problem should be fixed now. @KonajuGames I hope it is OK that I included this fix in this push request. |
I just implemented OpenGL version of Texture3D.GetData(), but I can't find how to test it. Also could somebody point me to some information how to do testing on Android? |
@kfazi Thanks. This fixed the issue :) |
@kfazi can you update this PR? There have been some other changes merged that affect the same files. |
Conflicts: Test/MonoGame.Tests.Windows.csproj Test/MonoGame.Tests.XNA.csproj
@KonajuGames Is this PR ok to be merged? I have few other fixes ready that depend on this one. |
It looks good to me. |
Can I get data from the dxt1 sprite in the same way? |
@mgbot test |
@Knight219 GetData will return the compressed DXT1 data if the texture is compressed as DXT1. |
Ok. Can I decompress DXT1 data after I get it with GetData method? |
If you write the DXT decompression, sure. |
What about a standard method for this? |
There are no plans to provide decompression routines for the many different |
Thanks |
Test PASSed. |
Finally. Good work. |
When I use getdata method for dxt1 texture I have AccessViolationException. Exception throws because method trying to read count of rows and elementsinrow for not compressed texture. |
var databox = d3dContext.MapSubresource(stagingTex, 0, SharpDX.Direct3D11.MapMode.Read, SharpDX.Direct3D11.MapFlags.None, out stream); | ||
|
||
// Some drivers may add pitch to rows. | ||
// We need to copy each row separatly and skip trailing zeros. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change GetData doesn't work correctly on Windows Phone 8 anymore. @kfazi @tomspilman do you have an idea how this can be fixed (without reverting)?
Textures with even widths have four small squares on the top. Textures with uneven widths have four small squares on the top, where the first one is greyish, second is blue, third is green and the fourth red.
Added GetData methods to Texture3D for Windows (SharpDX).
Implementations for other platforms are not provided.
While adding GetData to Texture3D I found out that implementation of the same method in Texture2D doesn't support row pitches. This is now fixed.