Skip to content

Commit

Permalink
Print an error when second byte of "swap buffers" is not 0
Browse files Browse the repository at this point in the history
As discussed in #42
  • Loading branch information
Gama11 committed Jun 3, 2015
1 parent 542fd4f commit 3ad61e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
* logfiles are now saved in a `logfiles/` subdirectory
* more helpful "disconnected" overlay in live mode (displays server IP and port)
* major improvements to the behavior of windows with multi-monitor setups (among other things, dialogs are now displayed relative the the main window as opposed to always being on the primiary monitor)
* added a way to select players with the drawing API
* added a select players command to the drawing API: `| 3 | 0 | Agent/Team |`
* the swap buffers command now prints an error when the second byte does not equal 0 instead of ignoring it, making the behavior consistent with the rest of the drawing API
* added a black outline for the player numbers texts
* moved `config.txt` out of `resources/` into the root directory for easier access
* moved build scripts to the `scripts/` subdirectory
Expand Down
11 changes: 9 additions & 2 deletions src/rv/comm/drawing/commands/DrawOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ public class DrawOption extends Command {
public DrawOption(ByteBuffer buf, Viewer viewer) {
this.drawings = viewer.getDrawings();

// currently only one type of draw option (swap buffers)
int type = ByteUtil.uValue(buf.get());
setName = getString(buf);

switch (type) {
case SWAP_BUFFERS:
setName = getString(buf);
break;
default:
System.err.println("Unknown draw option : " + type);
setName = null;
}
}

@Override
Expand Down

0 comments on commit 3ad61e7

Please sign in to comment.