… | |
… | |
255 | if (faces_sent[facenum]) |
255 | if (faces_sent[facenum]) |
256 | return; |
256 | return; |
257 | |
257 | |
258 | faces_sent[facenum] = true; |
258 | faces_sent[facenum] = true; |
259 | |
259 | |
|
|
260 | // if for some reason we let a client without face caching connect, |
|
|
261 | // we better support that decision here and implement it. |
260 | if (!facecache) |
262 | if (!facecache) |
261 | { |
|
|
262 | send_drawinfo ( |
|
|
263 | "*** Please enable image/face caching in preferences or use a client that supports it.\n", |
|
|
264 | NDI_RED |
|
|
265 | ); |
|
|
266 | return send_image (facenum); |
263 | return send_image (facenum); |
|
|
264 | |
|
|
265 | if (fxix) |
|
|
266 | { |
|
|
267 | fxface.push_back (facenum); |
|
|
268 | return; |
267 | } |
269 | } |
268 | |
270 | |
269 | packet sl; |
271 | packet sl; |
270 | |
272 | |
271 | if (force_face0) |
273 | if (force_face0) |
… | |
… | |
291 | |
293 | |
292 | send_packet (sl); |
294 | send_packet (sl); |
293 | } |
295 | } |
294 | } |
296 | } |
295 | |
297 | |
|
|
298 | void client::flush_fx () |
|
|
299 | { |
|
|
300 | while (!fxface.empty ()) |
|
|
301 | { |
|
|
302 | packet sl ("fx"); |
|
|
303 | |
|
|
304 | do |
|
|
305 | { |
|
|
306 | faceidx facenum = fxface.back (); fxface.pop_back (); |
|
|
307 | |
|
|
308 | const facedata *d = face_data (facenum, faceset); |
|
|
309 | |
|
|
310 | if (d) |
|
|
311 | { |
|
|
312 | sl << ber32 (facenum) |
|
|
313 | << data8 (d->chksum, CHKSUM_SIZE); |
|
|
314 | |
|
|
315 | faceinfo *f = face_info (facenum); |
|
|
316 | if (f->smooth && EMI_smooth) |
|
|
317 | sl << ber32 (f->smooth); |
|
|
318 | } |
|
|
319 | } |
|
|
320 | while (!fxface.empty () && sl.room () > CHKSUM_SIZE + 8 + 8); |
|
|
321 | |
|
|
322 | send_packet (sl); |
|
|
323 | } |
|
|
324 | } |
|
|
325 | |
296 | void |
326 | void |
297 | client::send_image (faceidx facenum) |
327 | client::send_image (faceidx facenum) |
298 | { |
328 | { |
299 | // never send face 0. ever. it does not exist. |
329 | // never send face 0. ever. it does not exist. |
300 | if (!facenum) |
330 | if (!facenum) |
… | |
… | |
307 | LOG (llevError, "client::send_image (%d) out of bounds??\n", facenum); |
337 | LOG (llevError, "client::send_image (%d) out of bounds??\n", facenum); |
308 | return; |
338 | return; |
309 | } |
339 | } |
310 | |
340 | |
311 | faces_sent[facenum] = true; |
341 | faces_sent[facenum] = true; |
|
|
342 | |
|
|
343 | if (force_image_newmap) |
|
|
344 | force_newmap = true; |
312 | |
345 | |
313 | packet sl; |
346 | packet sl; |
314 | |
347 | |
315 | sl << (image2 ? "image2 " : "image ") |
348 | sl << (image2 ? "image2 " : "image ") |
316 | << uint32 (facenum); |
349 | << uint32 (facenum); |