Request: Get Brush Properties

Blitz3D Forums/Blitz3D Bug Reports/Request: Get Brush Properties

@jfk
It comes a little bit late, but try this:
Global hackbank1,hackbank2
hackbank1=createbank(4)
hackbank2=createbank(4)
Dim scan(16,4)

Function GetBrushAlpha#(brush)
 Local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+32
 RtlMoveMemory1(hackbank2,adr,4)
 return PeekFloat(hackbank2,0)
End Function

Function GetBrushShininess#(brush)
 Local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+28
 RtlMoveMemory1(hackbank2,adr,4)
 return PeekFloat(hackbank2,0)
End Function

Function GetBrushRED(brush)
 local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+16
 RtlMoveMemory1(hackbank2,adr,4)
 Return PeekFloat(hackbank2,0)*255
End Function

Function GetBrushGREEN(brush)
 Local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+20
 RtlMoveMemory1(hackbank2,adr,4)
 Return PeekFloat(hackbank2,0)*255
End Function

Function GetBrushBLUE(brush)
 local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+24
 RtlMoveMemory1(hackbank2,adr,4)
 Return PeekFloat(hackbank2,0)*255
End Function

Function GetBrushBLEND(brush)
 local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+4
 RtlMoveMemory1(hackbank2,adr,4)
 Return Peekbyte(hackbank2,0)
End Function

Function GetBrushFX(brush)
 local adr
 RtlMoveMemory1(hackbank1,brush,4)
 adr=PeekInt(hackbank1,0)+40
 RtlMoveMemory1(hackbank2,adr,4)
 Return Peekbyte(hackbank2,0)
End Function

Function GetTextureBlend(tex)
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 adr=PeekInt(hackbank1,0)+24
 RtlMoveMemory1(hackbank2,adr,4)
 Return Peekbyte(hackbank2,0)
End Function

Function GetTextureScaleX#(tex)
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 adr=PeekInt(hackbank1,0)+36
 RtlMoveMemory1(hackbank2,adr,4)
 Return (1.0/Peekfloat(hackbank2,0))
End Function

Function GetTextureScaleY#(tex)
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 adr=PeekInt(hackbank1,0)+40
 RtlMoveMemory1(hackbank2,adr,4)
 Return (1.0/Peekfloat(hackbank2,0))
End Function

Function GetTexturePosX#(tex)
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 adr=PeekInt(hackbank1,0)+44
 RtlMoveMemory1(hackbank2,adr,4)
 Return ((-1.0)*Peekfloat(hackbank2,0))
End Function

Function GetTexturePosY#(tex)
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 adr=PeekInt(hackbank1,0)+48
 RtlMoveMemory1(hackbank2,adr,4)
 Return ((-1.0)*Peekfloat(hackbank2,0))
End Function

Function GetTextureFlags(tex,mode=2)
; Mode=0 for Createtexture()
 ; Mode=1 for Loadtexture()
 ; Mode=2 for GetBrushTexture() does not work proper!
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 Select mode
  Case 0
   offset=140
  Case 1
   offset=228
  Case 2
   offset=196
  Default
   offset=196
 End select
 adr=PeekInt(hackbank1,0)+offset
 RtlMoveMemory1(hackbank2,adr,4)
 Return Peekshort(hackbank2,0)
End Function

Function GetTextureRotation#(tex)
 local adr
 RtlMoveMemory1(hackbank1,tex,4)
 adr=PeekInt(hackbank1,0)+52
 RtlMoveMemory1(hackbank2,adr,4)
 Return (360.0/(pi*2))*(Peekfloat(hackbank2,0))*(-1.0)
End Function

You need the following .decls
.lib "kernel32.dll"

RtlMoveMemory1%(Destination*,Source,Length) : "RtlMoveMemory" 

I´m sorry, that GetTextureFlags() does not work properly. I can´t find flags proper position inside the memory, when texture-handle was received with GetBrushTexture().
Any Ideas?

Please can you mail me tomspeeds memorylib.dll.
Can´t find a valid Link to download.

thanks Shodan

mail: heinz-helge@...