Skip to content

Commit

Permalink
fix: Altought it seems to have worked before, correctly propagate fea…
Browse files Browse the repository at this point in the history
…tures
  • Loading branch information
sbernauer committed Jun 10, 2024
1 parent 5e47e1b commit d236fd2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions breakwater-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ tokio.workspace = true

[features]
alpha = []
binary-commands = []
7 changes: 6 additions & 1 deletion breakwater-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ PX x y rrggbb: Color the pixel (x,y) with the given hexadecimal color rrggbb
{}
PX x y gg: Color the pixel (x,y) with the hexadecimal color gggggg. Basically this is the same as the other commands, but is a more efficient way of filling white, black or gray areas
PX x y: Get the color value of the pixel (x,y)
SIZE: Get the size of the drawing surface, e.g. `SIZE 1920 1080`
{}SIZE: Get the size of the drawing surface, e.g. `SIZE 1920 1080`
OFFSET x y: Apply offset (x,y) to all further pixel draws on this connection. This can e.g. be used to pre-calculate an image/animation and simply use the OFFSET command to move it around the screen without the need to re-calculate it
",
if cfg!(feature = "alpha") {
"PX x y rrggbbaa: Color the pixel (x,y) with the given hexadecimal color rrggbb and a transparency of aa, where ff means draw normally on top of the existing pixel and 00 means fully transparent (no change at all)"
} else {
"PX x y rrggbbaa: Color the pixel (x,y) with the given hexadecimal color rrggbb. The alpha part is discarded for performance reasons, as breakwater was compiled without the alpha feature"
},
if cfg!(feature = "binary-commands") {
"PBxxyyrgba: Binary version of the PX command. x and y are little-endian 16 bit coordinates, r, g, b and are a byte each. There is *no* newline after the command.\n"
} else {
""
}
).as_bytes();

Expand Down
1 change: 1 addition & 0 deletions breakwater-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ pixelbomber.workspace = true

[features]
alpha = []
binary-commands = []
6 changes: 4 additions & 2 deletions breakwater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ vncserver = { workspace = true, optional = true }
rstest.workspace = true

[features]
default = ["vnc"]
default = ["vnc", "binary-commands"]

vnc = ["dep:vncserver"]
alpha = []
alpha = ["breakwater-core/alpha", "breakwater-parser/alpha"]
binary-commands = ["breakwater-core/binary-commands", "breakwater-parser/binary-commands"]

0 comments on commit d236fd2

Please sign in to comment.