Skip to content

Commit

Permalink
as3-bom: Support uncompressed depth
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <[email protected]>
  • Loading branch information
piedar committed Jul 11, 2013
1 parent 89ccc40 commit baa489a
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions wrappers/actionscript/server/as3-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,29 @@ void sendDepth(){
depth = tmp_depth;
}

for (i=0; i< depth_mode.width * depth_mode.height; i++) {
buf_depth[4 * i + 0] = 0x00;
buf_depth[4 * i + 1] = 0x00;
buf_depth[4 * i + 2] = 0x00;
buf_depth[4 * i + 3] = 0xFF;
for (i=0; i< depth_mode.width * depth_mode.height; i++) {
if(_depth_compression != 0) {
buf_depth[3 * i + 0] = 0x00;
buf_depth[3 * i + 1] = 0x00;
buf_depth[3 * i + 2] = 0x00;
} else {
buf_depth[4 * i + 0] = 0x00;
buf_depth[4 * i + 1] = 0x00;
buf_depth[4 * i + 2] = 0x00;
buf_depth[4 * i + 3] = 0xFF;
}
if(depth[i] < _max_depth && depth[i] > _min_depth){
unsigned char l = 0xFF - ((depth[i] - _min_depth) & 0xFF);
buf_depth[4 * i + 0] = l;
buf_depth[4 * i + 1] = l;
buf_depth[4 * i + 2] = l;
buf_depth[4 * i + 3] = 0xFF;
if(_depth_compression != 0) {
buf_depth[3 * i + 0] = l;
buf_depth[3 * i + 1] = l;
buf_depth[3 * i + 2] = l;
} else {
buf_depth[4 * i + 0] = l;
buf_depth[4 * i + 1] = l;
buf_depth[4 * i + 2] = l;
buf_depth[4 * i + 3] = 0xFF;
}
}
}
if(_depth_compression != 0) {
Expand Down

0 comments on commit baa489a

Please sign in to comment.