1- using System ;
21using System . Drawing ;
3- using System . Runtime . InteropServices ;
42using ReClassNET . Controls ;
53using ReClassNET . UI ;
64
75namespace ReClassNET . Nodes
86{
97 public class Matrix3x3Node : BaseMatrixNode
108 {
11- [ StructLayout ( LayoutKind . Explicit ) ]
12- private readonly struct Matrix3x3Data
13- {
14- [ FieldOffset ( 0 ) ]
15- public readonly float _11 ;
16- [ FieldOffset ( 4 ) ]
17- public readonly float _12 ;
18- [ FieldOffset ( 8 ) ]
19- public readonly float _13 ;
20- [ FieldOffset ( 12 ) ]
21- public readonly float _21 ;
22- [ FieldOffset ( 16 ) ]
23- public readonly float _22 ;
24- [ FieldOffset ( 20 ) ]
25- public readonly float _23 ;
26- [ FieldOffset ( 24 ) ]
27- public readonly float _31 ;
28- [ FieldOffset ( 28 ) ]
29- public readonly float _32 ;
30- [ FieldOffset ( 32 ) ]
31- public readonly float _33 ;
32- }
33-
349 public override int ValueTypeSize => sizeof ( float ) ;
3510
3611 public override int MemorySize => 9 * ValueTypeSize ;
@@ -43,43 +18,7 @@ public override void GetUserInterfaceInfo(out string name, out Image icon)
4318
4419 public override Size Draw ( DrawContext context , int x2 , int y2 )
4520 {
46- return DrawMatrixType ( context , x2 , y2 , "Matrix (3x3)" , ( int defaultX , ref int maxX , ref int y ) =>
47- {
48- var value = context . Memory . ReadObject < Matrix3x3Data > ( Offset ) ;
49-
50- y += context . Font . Height ;
51- var x = defaultX ;
52- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "|" ) ;
53- x = AddText ( context , x , y , context . Settings . ValueColor , 0 , $ "{ value . _11 , 14 : 0.000} ") ;
54- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "," ) ;
55- x = AddText ( context , x , y , context . Settings . ValueColor , 1 , $ "{ value . _12 , 14 : 0.000} ") ;
56- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "," ) ;
57- x = AddText ( context , x , y , context . Settings . ValueColor , 2 , $ "{ value . _13 , 14 : 0.000} ") ;
58- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "|" ) ;
59- maxX = Math . Max ( x , maxX ) ;
60-
61- y += context . Font . Height ;
62- x = defaultX ;
63- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "|" ) ;
64- x = AddText ( context , x , y , context . Settings . ValueColor , 3 , $ "{ value . _21 , 14 : 0.000} ") ;
65- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "," ) ;
66- x = AddText ( context , x , y , context . Settings . ValueColor , 4 , $ "{ value . _22 , 14 : 0.000} ") ;
67- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "," ) ;
68- x = AddText ( context , x , y , context . Settings . ValueColor , 5 , $ "{ value . _23 , 14 : 0.000} ") ;
69- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "|" ) ;
70- maxX = Math . Max ( x , maxX ) ;
71-
72- y += context . Font . Height ;
73- x = defaultX ;
74- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "|" ) ;
75- x = AddText ( context , x , y , context . Settings . ValueColor , 6 , $ "{ value . _31 , 14 : 0.000} ") ;
76- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "," ) ;
77- x = AddText ( context , x , y , context . Settings . ValueColor , 7 , $ "{ value . _32 , 14 : 0.000} ") ;
78- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "," ) ;
79- x = AddText ( context , x , y , context . Settings . ValueColor , 8 , $ "{ value . _33 , 14 : 0.000} ") ;
80- x = AddText ( context , x , y , context . Settings . NameColor , HotSpot . NoneId , "|" ) ;
81- maxX = Math . Max ( x , maxX ) ;
82- } ) ;
21+ return DrawMatrixType ( context , x2 , y2 , "Matrix (3x3)" , 3 , 3 ) ;
8322 }
8423
8524 protected override int CalculateValuesHeight ( DrawContext context )
0 commit comments