mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 09:06:23 +02:00
Add ScreenInfo render command for desktop size synchronization
This commit is contained in:
@@ -26,6 +26,7 @@ public sealed class CanvasRenderSource : IRenderSource
|
||||
private static Point lastPointerPosition = new(-1, -1);
|
||||
|
||||
private static Point cursorPosition;
|
||||
private static int screenWidth, screenHeight;
|
||||
|
||||
private static readonly Lock renderLock = new();
|
||||
|
||||
@@ -62,6 +63,12 @@ public sealed class CanvasRenderSource : IRenderSource
|
||||
isPositionDirty = true;
|
||||
break;
|
||||
|
||||
case RenderCommandType.ScreenInfo:
|
||||
screenWidth = Get(command.Properties, "Width", 640);
|
||||
screenHeight = Get(command.Properties, "Height", 480);
|
||||
isPositionDirty = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (windowCanvases.ContainsKey(command.WindowId))
|
||||
{
|
||||
|
||||
@@ -95,6 +95,11 @@ public class RenderCommand
|
||||
WriteInt16(s, Position.X);
|
||||
WriteInt16(s, Position.Y);
|
||||
break;
|
||||
|
||||
case RenderCommandType.ScreenInfo:
|
||||
WriteUInt16(s, GetProp("Width", 0));
|
||||
WriteUInt16(s, GetProp("Height", 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +168,11 @@ public class RenderCommand
|
||||
case RenderCommandType.SetCursor:
|
||||
pos = new Point(ReadInt16(data, ref offset), ReadInt16(data, ref offset));
|
||||
break;
|
||||
|
||||
case RenderCommandType.ScreenInfo:
|
||||
props["Width"] = ReadUInt16(data, ref offset);
|
||||
props["Height"] = ReadUInt16(data, ref offset);
|
||||
break;
|
||||
}
|
||||
|
||||
return new RenderCommand
|
||||
|
||||
@@ -17,4 +17,6 @@ public enum RenderCommandType : byte
|
||||
RemovePrimitives = 0x20,
|
||||
|
||||
SetCursor = 0x30,
|
||||
|
||||
ScreenInfo = 0xF0,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user