Ejemplo n.º 1
0
        public static void _DrawACSIIString(this DoubleBufferedVMWareSVGAII vMWareSVGAII, string s, uint color, uint x, uint y)
        {
            string[] lines = s.Split('\n');
            for (int l = 0; l < lines.Length; l++)
            {
                for (int c = 0; c < lines[l].Length; c++)
                {
                    int offset = (Encoding.ASCII.GetBytes(lines[l][c].ToString())[0] & 0xFF) * 16;
                    ASC16FontMS.Seek(offset, SeekOrigin.Begin);
                    byte[] fontbuf = new byte[16];
                    ASC16FontMS.Read(fontbuf, 0, fontbuf.Length);

                    for (int i = 0; i < 16; i++)
                    {
                        for (int j = 0; j < 8; j++)
                        {
                            if ((fontbuf[i] & (0x80 >> j)) != 0)
                            {
                                vMWareSVGAII.DoubleBuffer_SetPixel((uint)((x + j) + (c * 8)), (uint)(y + i + (l * 16)), color);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void DrawCursorAt(int x, int y, DoubleBufferedVMWareSVGAII canvas)
 {
     for (ushort h = 0; h < 19; h++)
     {
         for (ushort w = 0; w < 12; w++)
         {
             if (cursor[h * 12 + w] == 1)
             {
                 canvas.DoubleBuffer_SetPixel((uint)(w + x), (uint)(h + y), (uint)Color.Black.ToArgb());
             }
             if (cursor[h * 12 + w] == 2)
             {
                 canvas.DoubleBuffer_SetPixel((uint)(w + x), (uint)(h + y), (uint)Color.White.ToArgb());
             }
         }
     }
 }
Ejemplo n.º 3
0
 private void RestoreSavedSublayer(DoubleBufferedVMWareSVGAII canvas)
 {
     for (ushort h = 0; h < 19; h++)
     {
         for (ushort w = 0; w < 12; w++)
         {
             canvas.DoubleBuffer_SetPixel((uint)(savedPosition[0] + w), (uint)(savedPosition[1] + h), savedSubLayer[h * 12 + w]);
         }
     }
 }