What's wrong with MiniB3D Brushes??

BlitzMax Forums/MiniB3D Module/What's wrong with MiniB3D Brushes??

Hujiklo(Posted 2010) [#1]
Why are Minib3d brushes behaving randomly? There is no control over them whilst applying them to different meshes.

If I want to change multiple surface brush colours - (even if I only use two) only one of them will have any effect and even then it applies itself to everything that just had a brushcolor() change!!

I'm wasting hours exhausting myself trying to work around this but to no avail.

It has to be something in the MiniB3d code but I haven't a clue or the knowledge to tamper with it.




Select True


		Case b.event_stage = 0 ' Set alpha targets
		     
	
			If b.side = 0 ' ONLY IF TILES ARE FACING AWAY
		
				Local i:Int
		
				Local brush:TBrush
				brush = CreateBrush(255, 0, 0) ' get ready to set tiles to new colour
		
		 
				b.alpha = 0.3
			
				For i:Int = 1 To CountSurfaces(TMesh(b.front))
					PaintSurface GetSurface(TMesh(b.front), i), brush
				Next

				For i:Int = 1 To CountSurfaces(TMesh(b.back))
					PaintSurface GetSurface(TMesh(b.back), i), brush
				Next
			
			
			
				b.front.RotateEntity(0, 180, 0)
				b.front.ShowEntity()
				b.front.EntityAlpha(b.alpha)
			
				b.centre.HideEntity() ' HIDE BACKS
				b.back.EntityAlpha(b.alpha)
			
				brush.FreeBrush()
			
			Else ' ALREADY FACING
		
				Local i:Int
				Local brush2:TBrush
				brush2 = CreateBrush(255, 255, 255) ' get ready to set tiles back to normal colour
		
			
				b.alpha = 0.999 ' BUG FIX for solid facing tiles to render
			
			
				For i:Int = 1 To CountSurfaces(TMesh(b.front))
					PaintSurface GetSurface(TMesh(b.front), i), brush2
				Next

				For i:Int = 1 To CountSurfaces(TMesh(b.back))
					PaintSurface GetSurface(TMesh(b.back), i), brush2
				Next
			
				
				b.front.EntityAlpha(b.alpha)
			
				Print " BRUSH ASSIGNED but will not show"
			
				brush2.FreeBrush()
            
			
			EndIf
		
		
		
		
			b.event_stage = 1
		
		 
	
		Case b.event_stage = 1
	
	
	
	
	
	
	
	
	
	
	End Select