Browse Source

Cleanups.

Mark Sibly 9 years ago
parent
commit
f15554a511
2 changed files with 4 additions and 2 deletions
  1. 1 1
      modules/mojo/graphics/canvas.monkey2
  2. 3 1
      modules/mojo/graphics/texture.monkey2

+ 1 - 1
modules/mojo/graphics/canvas.monkey2

@@ -460,7 +460,7 @@ Class Canvas
 	End
 	End
 	
 	
 	#rem monkeydoc Draws a triangle.
 	#rem monkeydoc Draws a triangle.
-	#end
+	#End
 	Method DrawTriangle( v0:Vec2f,v1:Vec2f,v2:Vec2f )
 	Method DrawTriangle( v0:Vec2f,v1:Vec2f,v2:Vec2f )
 		AddDrawOp( _materials[3],3,1 )
 		AddDrawOp( _materials[3],3,1 )
 		AddVertex( v0.x,v0.y,.5,0 )
 		AddVertex( v0.x,v0.y,.5,0 )

+ 3 - 1
modules/mojo/graphics/texture.monkey2

@@ -159,6 +159,7 @@ Class Texture
 			glPushTexture2d( _glTexture )
 			glPushTexture2d( _glTexture )
 		
 		
 		Else
 		Else
+		
 			glGenTextures( 1,Varptr _glTexture )
 			glGenTextures( 1,Varptr _glTexture )
 
 
 			glPushTexture2d( _glTexture )
 			glPushTexture2d( _glTexture )
@@ -229,6 +230,7 @@ Class Texture
 		Endif
 		Endif
 		
 		
 		If _mipsDirty
 		If _mipsDirty
+		
 			If _flags & TextureFlags.Mipmap glGenerateMipmap( GL_TEXTURE_2D )
 			If _flags & TextureFlags.Mipmap glGenerateMipmap( GL_TEXTURE_2D )
 			_mipsDirty=False
 			_mipsDirty=False
 		End
 		End
@@ -273,7 +275,7 @@ Class Texture
 			glReadPixels( r.X,r.Y,r.Width,r.Height,GL_RGBA,GL_UNSIGNED_BYTE,_managed.PixelPtr( r.X,r.Y ) )
 			glReadPixels( r.X,r.Y,r.Width,r.Height,GL_RGBA,GL_UNSIGNED_BYTE,_managed.PixelPtr( r.X,r.Y ) )
 		Endif
 		Endif
 		
 		
-		_mipsDirty=True
+		If _flags & TextureFlags.Mipmap _mipsDirty=True
 	End
 	End
 	
 	
 	Private
 	Private