Browse Source

Cleanups galore!

Mark Sibly 8 years ago
parent
commit
d7aa8b3d25

+ 13 - 3
modules/mojo/graphics/canvas.monkey2

@@ -64,6 +64,7 @@ Class Canvas
 		PointSize=0
 		PointSize=0
 		LineWidth=0
 		LineWidth=0
 		LineSmoothing=False
 		LineSmoothing=False
+		TextureFilteringEnabled=true
 		
 		
 		ClearMatrix()
 		ClearMatrix()
 	End
 	End
@@ -173,10 +174,19 @@ Class Canvas
 	#end	
 	#end	
 	Property TextureFilteringEnabled:Bool()
 	Property TextureFilteringEnabled:Bool()
 		
 		
-		Return True
+		Return Not _device.RetroMode
 		
 		
 	Setter( enabled:Bool )
 	Setter( enabled:Bool )
-	
+		DebugAssert( Not _lighting,"Canvas.TextureFilteringEnabled property cannot be modified while lighting" )
+		If _lighting Return
+		
+		Local rmode:=Not enabled
+		
+		If rmode=_device.RetroMode Return
+		
+		Flush()
+
+		_device.RetroMode=rmode
 	End	
 	End	
 	
 	
 	#rem monkeydoc The current point size for use with DrawPoint.
 	#rem monkeydoc The current point size for use with DrawPoint.
@@ -1243,6 +1253,7 @@ Class Canvas
 	Field _scissor:Recti
 	Field _scissor:Recti
 	Field _ambientLight:Color
 	Field _ambientLight:Color
 	
 	
+	Field _retroMode:Bool
 	Field _blendMode:BlendMode
 	Field _blendMode:BlendMode
 	Field _font:Font
 	Field _font:Font
 	Field _alpha:Float
 	Field _alpha:Float
@@ -1464,7 +1475,6 @@ Class Canvas
 			_uniforms.SetVec2f( "ViewportClip",_rviewportClip )
 			_uniforms.SetVec2f( "ViewportClip",_rviewportClip )
 			
 			
 			_device.Viewport=_rviewport
 			_device.Viewport=_rviewport
-		
 		Endif
 		Endif
 		
 		
 		If _dirty & Dirty.Scissor
 		If _dirty & Dirty.Scissor

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

@@ -141,7 +141,7 @@ Class FreeTypeFont Extends Font
 			tx+=gw+1
 			tx+=gw+1
 		Next
 		Next
 		
 		
-		gpage.image=New Image( pixmap,Null,_shader )
+		gpage.image=New Image( pixmap,TextureFlags.Filter|TextureFlags.Mipmap,_shader )
 		gpage.glyphs=glyphs
 		gpage.glyphs=glyphs
 		
 		
 		pixmap.Discard()
 		pixmap.Discard()

+ 14 - 0
modules/mojo/graphics/glutil.monkey2

@@ -11,6 +11,20 @@ Public
 #end
 #end
 Global glGraphicsSeq:Int=1
 Global glGraphicsSeq:Int=1
 
 
+#rem monkeydoc @hidden
+#end
+Global glRetroMode:Bool=False
+
+#rem monkeydoc @hidden
+#end
+Global glRetroSeq:Int=1
+
+#rem monkeydoc @hidden
+#end
+Function glInvalidateGraphics()
+	glGraphicsSeq+=1
+End
+
 #rem monkeydoc @hidden
 #rem monkeydoc @hidden
 #end
 #end
 Function glCheck()
 Function glCheck()

+ 42 - 24
modules/mojo/graphics/graphicsdevice.monkey2

@@ -186,6 +186,17 @@ Class GraphicsDevice
 		_dirty2|=Dirty.CullMode
 		_dirty2|=Dirty.CullMode
 	End
 	End
 
 
+	Property RetroMode:Bool()
+		
+		Return _retroMode
+	
+	Setter( retroMode:Bool )
+		
+		_retroMode=retroMode
+		
+		_dirty2|=Dirty.RetroMode
+	End
+	
 	Property VertexBuffer:VertexBuffer()
 	Property VertexBuffer:VertexBuffer()
 	
 	
 		Return _vertexBuffer
 		Return _vertexBuffer
@@ -255,12 +266,8 @@ Class GraphicsDevice
 
 
 	Method Clear( color:Color,depth:Float=1 )',clearColor:Bool=True,clearDepth:Bool=True )
 	Method Clear( color:Color,depth:Float=1 )',clearColor:Bool=True,clearDepth:Bool=True )
 		
 		
-		glCheck()
-	
 		Validate()
 		Validate()
 		
 		
-		glCheck()
-		
 		If Not _scissorTest glEnable( GL_SCISSOR_TEST )
 		If Not _scissorTest glEnable( GL_SCISSOR_TEST )
 		
 		
 		Local mask:GLbitfield
 		Local mask:GLbitfield
@@ -286,11 +293,7 @@ Class GraphicsDevice
 	
 	
 	Method Render( order:Int,count:Int,offset:Int=0 )
 	Method Render( order:Int,count:Int,offset:Int=0 )
 		
 		
-		glCheck()
-	
 		Validate2()
 		Validate2()
-		
-		glCheck()
 	
 	
 		Local n:=order*count
 		Local n:=order*count
 	
 	
@@ -311,12 +314,8 @@ Class GraphicsDevice
 
 
 	Method RenderIndexed( order:Int,count:Int,offset:Int=0 )
 	Method RenderIndexed( order:Int,count:Int,offset:Int=0 )
 		
 		
-		glCheck()
-		
 		Validate2()
 		Validate2()
 		
 		
-		glCheck()
-		
 		Local n:=order*count
 		Local n:=order*count
 		
 		
 		Local gltype:GLenum,pitch:Int
 		Local gltype:GLenum,pitch:Int
@@ -370,11 +369,12 @@ Class GraphicsDevice
 		DepthFunc=			$0100
 		DepthFunc=			$0100
 		BlendMode=			$0200
 		BlendMode=			$0200
 		CullMode=			$0400
 		CullMode=			$0400
-		VertexBuffer=		$0800
-		IndexBuffer=		$1000
-		Shader=				$2000
+		RetroMode=			$0800
+		VertexBuffer=		$1000
+		IndexBuffer=		$2000
+		Shader=				$4000
 		'
 		'
-		All=				$ffff
+		All=				$7fff
 		'
 		'
 	End
 	End
 	
 	
@@ -393,6 +393,7 @@ Class GraphicsDevice
 	Field _depthFunc:DepthFunc
 	Field _depthFunc:DepthFunc
 	Field _blendMode:BlendMode
 	Field _blendMode:BlendMode
 	Field _cullMode:CullMode
 	Field _cullMode:CullMode
+	Field _retroMode:Bool
 	Field _vertexBuffer:VertexBuffer
 	Field _vertexBuffer:VertexBuffer
 	Field _indexBuffer:IndexBuffer
 	Field _indexBuffer:IndexBuffer
 	Field _ublocks:=New UniformBlock[4]
 	Field _ublocks:=New UniformBlock[4]
@@ -414,30 +415,32 @@ Class GraphicsDevice
 	End
 	End
 	
 	
 	Function InitGL()
 	Function InitGL()
-	
+
 		glCheck()
 		glCheck()
-		
+			
 		InitGLexts()
 		InitGLexts()
 		
 		
 		glGetIntegerv( GL_FRAMEBUFFER_BINDING,Varptr _defaultFbo )
 		glGetIntegerv( GL_FRAMEBUFFER_BINDING,Varptr _defaultFbo )
 		
 		
 		If GL_draw_buffer glGetIntegerv( GL_DRAW_BUFFER,Varptr _defaultDrawBuf )
 		If GL_draw_buffer glGetIntegerv( GL_DRAW_BUFFER,Varptr _defaultDrawBuf )
 		If GL_read_buffer glGetIntegerv( GL_READ_BUFFER,Varptr _defaultReadBuf )
 		If GL_read_buffer glGetIntegerv( GL_READ_BUFFER,Varptr _defaultReadBuf )
-		
+			
 		glCheck()
 		glCheck()
 	End
 	End
 	
 	
 	Method FlushTarget()
 	Method FlushTarget()
 		If Not _modified Return
 		If Not _modified Return
 		_modified=False
 		_modified=False
-		If _rtarget
+		If _rtarget And _rtarget.NumColorTextures
 			Validate()
 			Validate()
-'			_rtarget.Modified( _viewport & _scissor )
+			_rtarget.GetColorTexture(0).Modified( _viewport & _scissor )
 		Endif
 		Endif
 	End
 	End
 	
 	
 	Method Validate()
 	Method Validate()
 
 
+		glCheck()
+
 		If _glSeq<>glGraphicsSeq
 		If _glSeq<>glGraphicsSeq
 			_glSeq=glGraphicsSeq
 			_glSeq=glGraphicsSeq
 			_current=Null
 			_current=Null
@@ -486,11 +489,11 @@ Class GraphicsDevice
 			If _scissorTest glEnable( GL_SCISSOR_TEST ) Else glDisable( GL_SCISSOR_TEST )
 			If _scissorTest glEnable( GL_SCISSOR_TEST ) Else glDisable( GL_SCISSOR_TEST )
 			
 			
 			If _rtarget
 			If _rtarget
-				glScissor( scissor.X,scissor.Y,scissor.Width,scissor.Height )
+				glScissor( scissor.X,scissor.Y,Max( scissor.Width,0 ),Max( scissor.Height,0 ) )
 			Else
 			Else
-				glScissor( scissor.X,_rtargetSize.y-scissor.Bottom,scissor.Width,scissor.Height )
+				glScissor( scissor.X,_rtargetSize.y-scissor.Bottom,Max( scissor.Width,0 ),Max( scissor.Height,0 ) )
 			Endif
 			Endif
-		
+			
 		Endif
 		Endif
 		
 		
 		If _dirty & Dirty.ColorMask
 		If _dirty & Dirty.ColorMask
@@ -510,6 +513,8 @@ Class GraphicsDevice
 			
 			
 		Endif
 		Endif
 		
 		
+		glCheck()
+		
 		_dirty=Null
 		_dirty=Null
 	End
 	End
 	
 	
@@ -517,6 +522,8 @@ Class GraphicsDevice
 		
 		
 		Validate()
 		Validate()
 		
 		
+		glCheck()
+		
 		If _dirty2 & Dirty.DepthFunc
 		If _dirty2 & Dirty.DepthFunc
 			
 			
 			If _depthFunc=DepthFunc.Always
 			If _depthFunc=DepthFunc.Always
@@ -583,6 +590,15 @@ Class GraphicsDevice
 		
 		
 		Endif
 		Endif
 		
 		
+		If _dirty2 & Dirty.RetroMode
+			
+			If _retroMode<>glRetroMode
+				glRetroMode=_retroMode
+				glRetroSeq+=1
+			Endif
+		
+		Endif
+		
 		If _dirty2 & Dirty.VertexBuffer
 		If _dirty2 & Dirty.VertexBuffer
 		
 		
 			 _vertexBuffer.Bind()
 			 _vertexBuffer.Bind()
@@ -604,6 +620,8 @@ Class GraphicsDevice
 
 
 		_shader.ValidateUniforms( _rpass,_ublocks )
 		_shader.ValidateUniforms( _rpass,_ublocks )
 		
 		
+		glCheck()
+		
 		_dirty2=Null
 		_dirty2=Null
 	End
 	End
 	
 	

+ 24 - 6
modules/mojo/graphics/image.monkey2

@@ -52,7 +52,9 @@ Class Image Extends Resource
 	@param width,height Image size.
 	@param width,height Image size.
 	
 	
 	#end	
 	#end	
-	Method New( pixmap:Pixmap,textureFlags:TextureFlags=TextureFlags.Filter|TextureFlags.Mipmap,shader:Shader=Null )
+	Method New( pixmap:Pixmap,textureFlags:TextureFlags=Null,shader:Shader=Null )
+		
+		textureFlags=MakeTextureFlags( textureFlags )
 	
 	
 		Local texture:=New Texture( pixmap,textureFlags )
 		Local texture:=New Texture( pixmap,textureFlags )
 		
 		
@@ -61,9 +63,16 @@ Class Image Extends Resource
 		AddDependancy( texture )
 		AddDependancy( texture )
 	End
 	End
 
 
-	Method New( width:Int,height:Int,textureFlags:TextureFlags=TextureFlags.Filter|TextureFlags.Mipmap,shader:Shader=Null )
+	Method New( width:Int,height:Int,textureFlags:TextureFlags=null,shader:Shader=Null )
+		
+		Self.New( width,height,PixelFormat.RGBA8,textureFlags,shader )
+	End
+
+	Method New( width:Int,height:Int,format:PixelFormat,textureFlags:TextureFlags=Null,shader:Shader=Null )
+		
+		textureFlags=MakeTextureFlags( textureFlags )
 	
 	
-		Local texture:=New Texture( width,height,PixelFormat.RGBA8,textureFlags )
+		Local texture:=New Texture( width,height,format,textureFlags )
 		
 		
 		Init( texture,shader )
 		Init( texture,shader )
 		
 		
@@ -133,7 +142,7 @@ Class Image Extends Resource
 	
 	
 		SetTexture( 0,texture )
 		SetTexture( 0,texture )
 	End
 	End
-
+	
 	#rem monkeydoc The image's texture rect.
 	#rem monkeydoc The image's texture rect.
 	
 	
 	Describes the rect the image occupies within its primary texture.
 	Describes the rect the image occupies within its primary texture.
@@ -319,14 +328,14 @@ Class Image Extends Resource
 	
 	
 	#rem monkeydoc Loads an image from file.
 	#rem monkeydoc Loads an image from file.
 	#end
 	#end
-	Function Load:Image( path:String,shader:Shader=Null,textureFlags:TextureFlags=Null )
+	Function Load:Image( path:String,shader:Shader=Null )
 		
 		
 		Local pixmap:=Pixmap.Load( path,Null,True )
 		Local pixmap:=Pixmap.Load( path,Null,True )
 		If Not pixmap Return Null
 		If Not pixmap Return Null
 
 
 		If Not shader shader=mojo.graphics.Shader.GetShader( "sprite" )
 		If Not shader shader=mojo.graphics.Shader.GetShader( "sprite" )
 		
 		
-		Local image:=New Image( pixmap,textureFlags,shader )
+		Local image:=New Image( pixmap,Null,shader )
 			
 			
 		image.OnDiscarded+=Lambda()
 		image.OnDiscarded+=Lambda()
 			pixmap.Discard()
 			pixmap.Discard()
@@ -510,6 +519,15 @@ Class Image Extends Resource
 		_texCoords.max.y=Float(_rect.max.y)/_textures[0].Height
 		_texCoords.max.y=Float(_rect.max.y)/_textures[0].Height
 	End
 	End
 	
 	
+	Method MakeTextureFlags:TextureFlags( textureFlags:TextureFlags )
+		
+		textureFlags|=TextureFlags.Filter
+		
+		If Not (textureFlags & TextureFlags.Dynamic) textureFlags|=textureFlags.Mipmap
+		
+		Return textureFlags
+	End
+	
 End
 End
 
 
 Class ResourceManager Extension
 Class ResourceManager Extension

+ 16 - 1
modules/mojo/graphics/rendertarget.monkey2

@@ -16,11 +16,26 @@ Class RenderTarget Extends Resource
 		Next
 		Next
 	End
 	End
 	
 	
+	Property NumColorTextures:Int()
+		Return _colorTextures.Length
+	End
+	
+	Property HasDepthTexture:Bool()
+		Return _depthTexture
+	End
+	
 	Property Size:Vec2i()
 	Property Size:Vec2i()
-		
 		Return _colorTextures ? _colorTextures[0].Size Else _depthTexture.Size
 		Return _colorTextures ? _colorTextures[0].Size Else _depthTexture.Size
 	End
 	End
 	
 	
+	Method GetColorTexture:Texture( index:Int )
+		Return index>=0 And index<_colorTextures.Length ? _colorTextures[index] Else Null
+	End
+	
+	Method GetDepthTexture:Texture()
+		Return _depthTexture
+	End
+	
 	'***** INTERNAL *****
 	'***** INTERNAL *****
 	
 	
 	Method CheckStatus()
 	Method CheckStatus()

+ 17 - 7
modules/mojo/graphics/shader.monkey2

@@ -48,6 +48,7 @@ Class GLProgram
 	Field _uniforms:=New GLUniform[4][]
 	Field _uniforms:=New GLUniform[4][]
 	Field _textures:=New GLUniform[4][]
 	Field _textures:=New GLUniform[4][]
 	Field _ublockSeqs:=New Int[4]
 	Field _ublockSeqs:=New Int[4]
+	Field _glRetroSeq:Int
 
 
 	Method New( glprogram:GLuint )
 	Method New( glprogram:GLuint )
 
 
@@ -98,7 +99,16 @@ Class GLProgram
 		Return _glprogram
 		Return _glprogram
 	End
 	End
 
 
-	Method ValidateUniforms( ublocks:UniformBlock[] )',textureFilter:TextureFilter )
+	Method ValidateUniforms( ublocks:UniformBlock[] )
+		
+		#rem
+		If _glRetroSeq<>glRetroSeq
+			For Local i:=0 Until _ublockSeqs.Length
+				_ublockSeqs[i]=0
+			Next
+			_glRetroSeq=glRetroSeq
+		Endif
+		#end
 
 
 		For Local i:=0 Until 4
 		For Local i:=0 Until 4
 
 
@@ -151,12 +161,12 @@ Class GLProgram
 			For Local u:=Eachin _textures[i]
 			For Local u:=Eachin _textures[i]
 				
 				
 				Local tex:=ublocks[i].GetTexture( u.uniformId )
 				Local tex:=ublocks[i].GetTexture( u.uniformId )
-				If tex
-					tex.Bind( u.texunit )',textureFilter )
-				Else
+				If Not tex
 					Print( "Can't bind shader texture uniform '"+u.name+"' - no texture!" )
 					Print( "Can't bind shader texture uniform '"+u.name+"' - no texture!" )
+					Continue
 				Endif
 				Endif
 				
 				
+				tex.Bind( u.texunit )
 			Next
 			Next
 		
 		
 		Next
 		Next
@@ -218,8 +228,8 @@ Class Shader
 	#end
 	#end
 	Method Bind( renderPass:Int )
 	Method Bind( renderPass:Int )
 	
 	
-		If _seq<>glGraphicsSeq
-			_seq=glGraphicsSeq
+		If _glSeq<>glGraphicsSeq
+			_glSeq=glGraphicsSeq
 			Rebuild()
 			Rebuild()
 		Endif
 		Endif
 	
 	
@@ -264,7 +274,7 @@ Class Shader
 	Field _rpasses:Int[]
 	Field _rpasses:Int[]
 	Field _rpassMask:Int
 	Field _rpassMask:Int
 	Field _programs:=New GLProgram[8]
 	Field _programs:=New GLProgram[8]
-	Field _seq:Int
+	Field _glSeq:Int
 	
 	
 	Method EnumPasses()
 	Method EnumPasses()
 
 

+ 1 - 1
modules/mojo/graphics/shaders/light.glsl

@@ -66,7 +66,7 @@ void main(){
 	
 	
 	float ndotl=max( dot( normal,lvec ),0.0 );
 	float ndotl=max( dot( normal,lvec ),0.0 );
 	
 	
-	vec4 tcolor=texture2D( m_ImageTexture0,texCoord0 ) * v_Color;
+	vec4 tcolor=texture2D( m_ImageTexture0,v_TexCoord0 ) * v_Color;
 
 
 	vec4 diffuse=texture2D( r_GBuffer0,v_GBufferCoords ) * tcolor * ndotl;
 	vec4 diffuse=texture2D( r_GBuffer0,v_GBufferCoords ) * tcolor * ndotl;
 	
 	

+ 3 - 3
modules/mojo/graphics/shaders/shadow.glsl

@@ -3,13 +3,13 @@
 
 
 //@vertex
 //@vertex
 
 
-attribute vec4 mx2_Vertex;
+uniform mat4 r_ModelViewProjectionMatrix;
 
 
-uniform mat4 mx2_ModelViewProjectionMatrix;
+attribute vec4 a_Position;
 
 
 void main(){
 void main(){
 
 
-	gl_Position=mx2_ModelViewProjectionMatrix * mx2_Vertex;
+	gl_Position=r_ModelViewProjectionMatrix * a_Position;
 }
 }
 
 
 //@fragment
 //@fragment

+ 29 - 11
modules/mojo/graphics/texture.monkey2

@@ -69,23 +69,20 @@ Public
 
 
 #end
 #end
 Enum TextureFlags
 Enum TextureFlags
-	WrapS=			$0001			'wrap works, but hidden for now...
+	None=			$0000
+	WrapS=			$0001
 	WrapT=			$0002
 	WrapT=			$0002
 	Filter=			$0004
 	Filter=			$0004
 	Mipmap=			$0008
 	Mipmap=			$0008
-	Dynamic=		$0010
-	Cubemap=		$0020
 	
 	
+	Dynamic=		$00100
+	Cubemap=		$00200
+
 	Skybox=			Filter|Mipmap|Cubemap
 	Skybox=			Filter|Mipmap|Cubemap
 	ColorTarget=	Filter|Dynamic
 	ColorTarget=	Filter|Dynamic
 	DepthTarget=	Dynamic
 	DepthTarget=	Dynamic
 End
 End
 
 
-Enum TextureFilter
-	Filter=			$0001
-	Mipmap=			$0002
-End
-
 #rem monkeydoc @hidden
 #rem monkeydoc @hidden
 #end
 #end
 Class Texture Extends Resource
 Class Texture Extends Resource
@@ -179,6 +176,14 @@ Class Texture Extends Resource
 	Property Flags:TextureFlags()
 	Property Flags:TextureFlags()
 		
 		
 		Return _flags
 		Return _flags
+	
+	Setter( flags:TextureFlags )
+		
+		Local mask:=TextureFlags.WrapS|TextureFlags.WrapT|TextureFlags.Filter|TextureFlags.Mipmap
+		
+		_flags=(_flags & ~mask) | (Flags & mask)
+		
+		_dirty|=Dirty.TexParams
 	End
 	End
 	
 	
 	Method PastePixmap( pixmap:Pixmap,x:Int,y:Int )
 	Method PastePixmap( pixmap:Pixmap,x:Int,y:Int )
@@ -304,7 +309,14 @@ Class Texture Extends Resource
 	#end
 	#end
 	Method ValidateGLTexture:GLuint()
 	Method ValidateGLTexture:GLuint()
 		
 		
-		If _glSeq=glGraphicsSeq And Not _dirty Or _discarded Return _glTexture
+		If _discarded Return 0
+		
+		If _retroMode<>glRetroMode
+			_dirty|=Dirty.TexParams
+			_retroMode=glRetroMode
+		Endif
+		
+		If _glSeq=glGraphicsSeq And Not _dirty Return _glTexture
 		
 		
 		glCheck()
 		glCheck()
 		
 		
@@ -330,7 +342,10 @@ Class Texture Extends Resource
 				glTexParameteri( _glTarget,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE )
 				glTexParameteri( _glTarget,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE )
 			Endif
 			Endif
 			
 			
-			If _flags & TextureFlags.Mipmap
+			If _retroMode
+				glTexParameteri( _glTarget,GL_TEXTURE_MAG_FILTER,GL_NEAREST )
+				glTexParameteri( _glTarget,GL_TEXTURE_MIN_FILTER,GL_NEAREST )
+			Else If _flags & TextureFlags.Mipmap
 				If _flags & TextureFlags.Filter
 				If _flags & TextureFlags.Filter
 					glTexParameteri( _glTarget,GL_TEXTURE_MAG_FILTER,GL_LINEAR )
 					glTexParameteri( _glTarget,GL_TEXTURE_MAG_FILTER,GL_LINEAR )
 					glTexParameteri( _glTarget,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR )
 					glTexParameteri( _glTarget,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR )
@@ -384,12 +399,14 @@ Class Texture Extends Resource
 			If _flags & TextureFlags.Mipmap glGenerateMipmap( _glTarget )
 			If _flags & TextureFlags.Mipmap glGenerateMipmap( _glTarget )
 				
 				
 			glCheck()
 			glCheck()
-		
+
 		End
 		End
 		
 		
 		_dirty=Null
 		_dirty=Null
 		
 		
 		glPopTexture()
 		glPopTexture()
+		
+		glCheck()
 
 
 		Return _glTexture
 		Return _glTexture
 	End
 	End
@@ -429,6 +446,7 @@ Class Texture Extends Resource
 	Field _flags:TextureFlags
 	Field _flags:TextureFlags
 	Field _managed:Pixmap
 	Field _managed:Pixmap
 	Field _discarded:Bool
 	Field _discarded:Bool
+	Field _retroMode:Bool
 	
 	
 	Field _dirty:Dirty
 	Field _dirty:Dirty