Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ********* FreeBASIC *********
- Sub DrawRect(X as Short, Y as Short, iWid as Short, iHei as Short, ConColor as uByte, ConChar as uByte)
- Dim as uShort CharBlock = (ConColor SHL 8) OR ConChar
- var RectPart = (X + (Y * iWidth))
- var RectY = 0
- while RectY <> iHei
- For RectX as Integer = 0 to iWid-1
- pNewScreen[RectPart+RectX] = CharBlock
- Next RectX
- RectPart += iWidth: RectY += 1
- wend
- End Sub
- ********* C# port *********
- public static void DrawRect(short X, short Y, short Wid, short Hei, byte ConColor, byte ConChar)
- {
- ushort CharBlock = (ushort)(ConChar | (ConColor << 8));
- int RectPart = (X + (Y * Width));
- int RectY = 0;
- while (RectY != Hei)
- {
- for (int RectX = 0; RectX < Wid; RectX++)
- {
- pNewScreen[RectPart + RectX] = CharBlock;
- }
- RectPart += Width;
- RectY += 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement