Exemplo n.º 1
0
        void IDrawable.draw(DoubleBufferedVMWareSVGAII canvas)
        {
            int x = (int)(Cosmos.System.MouseManager.X);
            int y = (int)(Cosmos.System.MouseManager.Y);

            if (x < 0)
            {
                x = 0;
            }
            if (y < 0)
            {
                y = 0;
            }
            if (x >= screenSizeX)
            {
                x = (int)screenSizeX - 1;
            }
            if (y >= screenSizeY)
            {
                y = (int)screenSizeY - 1;
            }

            if (!firstLoop)
            {
                RestoreSavedSublayer(canvas);
            }
            else
            {
                firstLoop = false;
            }
            this.CaptureCurrentSublayer(x, y, canvas);
            this.DrawCursorAt(x, y, canvas);
        }
Exemplo n.º 2
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);
                            }
                        }
                    }
                }
            }
        }
Exemplo 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]);
         }
     }
 }
Exemplo n.º 4
0
 private void CaptureCurrentSublayer(int x, int y, DoubleBufferedVMWareSVGAII canvas)
 {
     savedPosition[0] = x;
     savedPosition[1] = y;
     for (ushort h = 0; h < 19; h++)
     {
         for (ushort w = 0; w < 12; w++)
         {
             savedSubLayer[h * 12 + w] = canvas.DoubleBuffer_GetPixel((uint)(w + x), (uint)(h + y));
         }
     }
 }
Exemplo n.º 5
0
 public GUI()
 {
     this.canvas = new DoubleBufferedVMWareSVGAII();
     this.canvas.SetMode(ScreenWidth, ScreenHeight);
     for (int i = 0; i < this.lowerDrawableLayer.Count(); i++)
     {
         lowerDrawableLayer[i].init(this.canvas);
     }
     for (int i = 0; i < this.drawables.Count(); i++)
     {
         drawables[i].init(this.canvas);
     }
     for (int i = 0; i < this.topDrawableLayer.Count(); i++)
     {
         topDrawableLayer[i].init(this.canvas);
     }
 }
Exemplo n.º 6
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());
             }
         }
     }
 }
Exemplo n.º 7
0
 void IDrawable.draw(DoubleBufferedVMWareSVGAII canvas)
 {
     this.debugger.Send("Loooooop");
     canvas.DoubleBuffer_DrawFillRectangle(this.position[0], this.position[1], 100, 200, backgroundColor);
 }
Exemplo n.º 8
0
 void IDrawable.init(DoubleBufferedVMWareSVGAII canvas)
 {
 }
Exemplo n.º 9
0
 void IDrawable.draw(DoubleBufferedVMWareSVGAII canvas)
 {
     canvas.DoubleBuffer_DrawFillRectangle(0, (uint)(screenHeight - taskBarHeight), (uint)(screenWidth), taskBarHeight, color);
 }
Exemplo n.º 10
0
 void IDrawable.init(DoubleBufferedVMWareSVGAII canvas)
 {
     Cosmos.System.MouseManager.ScreenWidth  = screenSizeX;
     Cosmos.System.MouseManager.ScreenHeight = screenSizeY;
 }