예제 #1
0
 unsafe internal void Initialize()
 {
     if (initialized == false)
     {
         var pal = stackalloc byte[256 * 3]
         {
             0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0x00, 0xaa, 0xaa,
             0xaa, 0x00, 0x00, 0xaa, 0x00, 0xaa, 0xaa, 0x55, 0x00, 0xaa, 0xaa, 0xaa,
             0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, 0xff, 0x55, 0x55, 0xff, 0xff,
             0xff, 0x55, 0x55, 0xff, 0x55, 0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff,
             0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x20, 0x20, 0x20, 0x2c, 0x2c, 0x2c,
             0x38, 0x38, 0x38, 0x45, 0x45, 0x45, 0x51, 0x51, 0x51, 0x61, 0x61, 0x61,
             0x71, 0x71, 0x71, 0x82, 0x82, 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2, 0xa2,
             0xb6, 0xb6, 0xb6, 0xcb, 0xcb, 0xcb, 0xe3, 0xe3, 0xe3, 0xff, 0xff, 0xff,
             0x00, 0x00, 0xff, 0x41, 0x00, 0xff, 0x7d, 0x00, 0xff, 0xbe, 0x00, 0xff,
             0xff, 0x00, 0xff, 0xff, 0x00, 0xbe, 0xff, 0x00, 0x7d, 0xff, 0x00, 0x41,
             0xff, 0x00, 0x00, 0xff, 0x41, 0x00, 0xff, 0x7d, 0x00, 0xff, 0xbe, 0x00,
             0xff, 0xff, 0x00, 0xbe, 0xff, 0x00, 0x7d, 0xff, 0x00, 0x41, 0xff, 0x00,
             0x00, 0xff, 0x00, 0x00, 0xff, 0x41, 0x00, 0xff, 0x7d, 0x00, 0xff, 0xbe,
             0x00, 0xff, 0xff, 0x00, 0xbe, 0xff, 0x00, 0x7d, 0xff, 0x00, 0x41, 0xff,
             0x7d, 0x7d, 0xff, 0x9e, 0x7d, 0xff, 0xbe, 0x7d, 0xff, 0xdf, 0x7d, 0xff,
             0xff, 0x7d, 0xff, 0xff, 0x7d, 0xdf, 0xff, 0x7d, 0xbe, 0xff, 0x7d, 0x9e,
             0xff, 0x7d, 0x7d, 0xff, 0x9e, 0x7d, 0xff, 0xbe, 0x7d, 0xff, 0xdf, 0x7d,
             0xff, 0xff, 0x7d, 0xdf, 0xff, 0x7d, 0xbe, 0xff, 0x7d, 0x9e, 0xff, 0x7d,
             0x7d, 0xff, 0x7d, 0x7d, 0xff, 0x9e, 0x7d, 0xff, 0xbe, 0x7d, 0xff, 0xdf,
             0x7d, 0xff, 0xff, 0x7d, 0xdf, 0xff, 0x7d, 0xbe, 0xff, 0x7d, 0x9e, 0xff,
             0xb6, 0xb6, 0xff, 0xc7, 0xb6, 0xff, 0xdb, 0xb6, 0xff, 0xeb, 0xb6, 0xff,
             0xff, 0xb6, 0xff, 0xff, 0xb6, 0xeb, 0xff, 0xb6, 0xdb, 0xff, 0xb6, 0xc7,
             0xff, 0xb6, 0xb6, 0xff, 0xc7, 0xb6, 0xff, 0xdb, 0xb6, 0xff, 0xeb, 0xb6,
             0xff, 0xff, 0xb6, 0xeb, 0xff, 0xb6, 0xdb, 0xff, 0xb6, 0xc7, 0xff, 0xb6,
             0xb6, 0xdf, 0xb6, 0xb6, 0xff, 0xc7, 0xb6, 0xff, 0xdb, 0xb6, 0xff, 0xeb,
             0xb6, 0xff, 0xff, 0xb6, 0xeb, 0xff, 0xb6, 0xdb, 0xff, 0xb6, 0xc7, 0xff,
             0x00, 0x00, 0x71, 0x1c, 0x00, 0x71, 0x38, 0x00, 0x71, 0x55, 0x00, 0x71,
             0x71, 0x00, 0x71, 0x71, 0x00, 0x55, 0x71, 0x00, 0x38, 0x71, 0x00, 0x1c,
             0x71, 0x00, 0x00, 0x71, 0x1c, 0x00, 0x71, 0x38, 0x00, 0x71, 0x55, 0x00,
             0x71, 0x71, 0x00, 0x55, 0x71, 0x00, 0x38, 0x71, 0x00, 0x1c, 0x71, 0x00,
             0x00, 0x71, 0x00, 0x00, 0x71, 0x1c, 0x00, 0x71, 0x38, 0x00, 0x71, 0x55,
             0x00, 0x71, 0x71, 0x00, 0x55, 0x71, 0x00, 0x38, 0x71, 0x00, 0x1c, 0x71,
             0x38, 0x38, 0x71, 0x45, 0x38, 0x71, 0x55, 0x38, 0x71, 0x61, 0x38, 0x71,
             0x71, 0x38, 0x71, 0x71, 0x38, 0x61, 0x71, 0x38, 0x55, 0x71, 0x38, 0x45,
             0x71, 0x38, 0x38, 0x71, 0x45, 0x38, 0x71, 0x55, 0x38, 0x71, 0x61, 0x38,
             0x71, 0x71, 0x38, 0x61, 0x71, 0x38, 0x55, 0x71, 0x38, 0x45, 0x71, 0x38,
             0x38, 0x71, 0x38, 0x38, 0x71, 0x45, 0x38, 0x71, 0x55, 0x38, 0x71, 0x61,
             0x38, 0x71, 0x71, 0x38, 0x61, 0x71, 0x38, 0x55, 0x71, 0x38, 0x45, 0x71,
             0x51, 0x51, 0x71, 0x59, 0x51, 0x71, 0x61, 0x51, 0x71, 0x69, 0x51, 0x71,
             0x71, 0x51, 0x71, 0x71, 0x51, 0x69, 0x71, 0x51, 0x61, 0x71, 0x51, 0x59,
             0x71, 0x51, 0x51, 0x71, 0x59, 0x51, 0x71, 0x61, 0x51, 0x71, 0x69, 0x51,
             0x71, 0x71, 0x51, 0x69, 0x71, 0x51, 0x61, 0x71, 0x51, 0x59, 0x71, 0x51,
             0x51, 0x71, 0x51, 0x51, 0x71, 0x59, 0x51, 0x71, 0x61, 0x51, 0x71, 0x69,
             0x51, 0x71, 0x71, 0x51, 0x69, 0x71, 0x51, 0x61, 0x71, 0x51, 0x59, 0x71,
             0x00, 0x00, 0x41, 0x10, 0x00, 0x41, 0x20, 0x00, 0x41, 0x30, 0x00, 0x41,
             0x41, 0x00, 0x41, 0x41, 0x00, 0x30, 0x41, 0x00, 0x20, 0x41, 0x00, 0x10,
             0x41, 0x00, 0x00, 0x41, 0x10, 0x00, 0x41, 0x20, 0x00, 0x41, 0x30, 0x00,
             0x41, 0x41, 0x00, 0x30, 0x41, 0x00, 0x20, 0x41, 0x00, 0x10, 0x41, 0x00,
             0x00, 0x41, 0x00, 0x00, 0x41, 0x10, 0x00, 0x41, 0x20, 0x00, 0x41, 0x30,
             0x00, 0x41, 0x41, 0x00, 0x30, 0x41, 0x00, 0x20, 0x41, 0x00, 0x10, 0x41,
             0x20, 0x20, 0x41, 0x28, 0x20, 0x41, 0x30, 0x20, 0x41, 0x38, 0x20, 0x41,
             0x41, 0x20, 0x41, 0x41, 0x20, 0x38, 0x41, 0x20, 0x30, 0x41, 0x20, 0x28,
             0x41, 0x20, 0x20, 0x41, 0x28, 0x20, 0x41, 0x30, 0x20, 0x41, 0x38, 0x20,
             0x41, 0x41, 0x20, 0x38, 0x41, 0x20, 0x30, 0x41, 0x20, 0x28, 0x41, 0x20,
             0x20, 0x41, 0x20, 0x20, 0x41, 0x28, 0x20, 0x41, 0x30, 0x20, 0x41, 0x38,
             0x20, 0x41, 0x41, 0x20, 0x38, 0x41, 0x20, 0x30, 0x41, 0x20, 0x28, 0x41,
             0x2c, 0x2c, 0x41, 0x30, 0x2c, 0x41, 0x34, 0x2c, 0x41, 0x3c, 0x2c, 0x41,
             0x41, 0x2c, 0x41, 0x41, 0x2c, 0x3c, 0x41, 0x2c, 0x34, 0x41, 0x2c, 0x30,
             0x41, 0x2c, 0x2c, 0x41, 0x30, 0x2c, 0x41, 0x34, 0x2c, 0x41, 0x3c, 0x2c,
             0x41, 0x41, 0x2c, 0x3c, 0x41, 0x2c, 0x34, 0x41, 0x2c, 0x30, 0x41, 0x2c,
             0x2c, 0x41, 0x2c, 0x2c, 0x41, 0x30, 0x2c, 0x41, 0x34, 0x2c, 0x41, 0x3c,
             0x2c, 0x41, 0x41, 0x2c, 0x3c, 0x41, 0x2c, 0x34, 0x41, 0x2c, 0x30, 0x41,
             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
         };
         m_ColorData = new UnsafeArray <float4>(kMaxColors);
         for (var i = 0; i < kMaxColors; ++i)
         {
             m_ColorData[i] = new float4(pal[i * 3 + 2], pal[i * 3 + 1], pal[i * 3 + 0], 255) / 255.0f;
         }
         m_TextBuffer.Initialize();
         m_GraphBuffer.Initialize();
         m_LineBuffer.Initialize();
         m_LogBuffer                  = new LogBuffer(new int2(128, 4096));
         m_LogBuffer.m_Fg             = ColorIndex.Yellow;
         m_LogBuffer.m_Bg             = ColorIndex.Blue;
         m_TextBufferAllocations      = m_TextBuffer.AllocateAll();
         m_GraphBufferAllocations     = m_GraphBuffer.AllocateAll();
         m_GraphDataBufferAllocations = m_GraphBuffer.ReserveAllData();
         m_LineBufferAllocations      = m_LineBuffer.AllocateAll();
         initialized                  = true;
     }
 }