From baa489a863712d930831b41040bf607f2857857d Mon Sep 17 00:00:00 2001 From: Benn Snyder Date: Wed, 10 Jul 2013 21:57:54 -0400 Subject: [PATCH] as3-bom: Support uncompressed depth Signed-off-by: Benn Snyder --- wrappers/actionscript/server/as3-server.c | 30 ++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/wrappers/actionscript/server/as3-server.c b/wrappers/actionscript/server/as3-server.c index 8b79103d..ac5b476e 100755 --- a/wrappers/actionscript/server/as3-server.c +++ b/wrappers/actionscript/server/as3-server.c @@ -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) {