Skip to content

Commit

Permalink
Fixed OUYA to support DXT formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomspilman committed Apr 12, 2013
1 parent 7707c94 commit 10ebf36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MonoGame.Framework/Content/ContentReaders/Texture2DReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected internal override Texture2D Read(ContentReader reader, Texture2D exist
case SurfaceFormat.Dxt5:
convertedFormat = SurfaceFormat.RgbaPvrtc4Bpp;
break;
#elif ANDROID || PSM
#elif (ANDROID && !OUYA) || PSM
case SurfaceFormat.Dxt1:
case SurfaceFormat.Dxt3:
case SurfaceFormat.Dxt5:
Expand Down Expand Up @@ -142,7 +142,7 @@ protected internal override Texture2D Read(ContentReader reader, Texture2D exist
//Convert the image data if required
switch (surfaceFormat)
{
#if ANDROID || PSM
#if (ANDROID && !OUYA) || PSM
//no Dxt in OpenGL ES
case SurfaceFormat.Dxt1:
levelData = DxtUtil.DecompressDxt1(levelData, levelWidth, levelHeight);
Expand Down
16 changes: 16 additions & 0 deletions MonoGame.Framework/Graphics/GraphicsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,22 @@ internal static void GetGLFormat (this SurfaceFormat format,
break;
#endif

#if OUYA
case SurfaceFormat.Dxt1:
glInternalFormat = (PixelInternalFormat)0x83F1;
glFormat = (PixelFormat)All.CompressedTextureFormats;
break;
case SurfaceFormat.Dxt3:
glInternalFormat = (PixelInternalFormat)0x83F2;
glFormat = (PixelFormat)All.CompressedTextureFormats;
break;
case SurfaceFormat.Dxt5:
glInternalFormat = (PixelInternalFormat)0x83F3;
glFormat = (PixelFormat)All.CompressedTextureFormats;
break;
#endif


#if IOS || ANDROID
case SurfaceFormat.RgbPvrtc2Bpp:
glInternalFormat = PixelInternalFormat.CompressedRgbPvrtc2Bppv1Img;
Expand Down

0 comments on commit 10ebf36

Please sign in to comment.