… | |
… | |
254 | |
254 | |
255 | packet sl; |
255 | packet sl; |
256 | |
256 | |
257 | if (facecache && !forced) |
257 | if (facecache && !forced) |
258 | { |
258 | { |
259 | if (faces_sent[facenum] & NS_FACESENT_FACE) |
259 | if (faces_sent[facenum]) |
260 | return; |
260 | return; |
261 | |
261 | |
262 | faces_sent[facenum] |= NS_FACESENT_FACE; |
262 | faces_sent[facenum] = true; |
|
|
263 | |
|
|
264 | faceinfo *f = face_info (facenum); |
|
|
265 | if (f->smooth && EMI_smooth) |
|
|
266 | { |
|
|
267 | send_face (f->smooth); |
|
|
268 | |
|
|
269 | packet sl ("smooth"); |
|
|
270 | |
|
|
271 | sl << uint16 (facenum) |
|
|
272 | << uint16 (f->smooth); |
|
|
273 | |
|
|
274 | send_packet (sl); |
|
|
275 | } |
263 | |
276 | |
264 | if (force_face0) |
277 | if (force_face0) |
265 | sl << "face " << uint16 (facenum); |
278 | sl << "face " << uint16 (facenum); |
266 | else if (image2) |
279 | else if (image2) |
267 | sl << "face2 " << uint16 (facenum) << uint8 (0) << uint32 (force_bad_checksum ? gcfclient_checksum (d) : 0); |
280 | sl << "face2 " << uint16 (facenum) << uint8 (0) << uint32 (force_bad_checksum ? gcfclient_checksum (d) : 0); |
… | |
… | |
303 | send_face (anim.faces [i]); |
316 | send_face (anim.faces [i]); |
304 | } |
317 | } |
305 | } |
318 | } |
306 | |
319 | |
307 | /** |
320 | /** |
308 | * A lot like the old AskSmooth (in fact, now called by AskSmooth). |
|
|
309 | * Basically, it makes no sense to wait for the client to request a |
|
|
310 | * a piece of data from us that we know the client wants. So |
|
|
311 | * if we know the client wants it, might as well push it to the |
|
|
312 | * client. |
|
|
313 | */ |
|
|
314 | void |
|
|
315 | client::send_smooth (faceidx face) |
|
|
316 | { |
|
|
317 | faceinfo *f = face_info (face); |
|
|
318 | |
|
|
319 | if (!f) |
|
|
320 | return; |
|
|
321 | |
|
|
322 | if (faces_sent[face] & NS_FACESENT_SMOOTH) |
|
|
323 | return; |
|
|
324 | |
|
|
325 | faces_sent[face] |= NS_FACESENT_SMOOTH; |
|
|
326 | |
|
|
327 | /* If we can't find a face, return and set it so we won't try to send this |
|
|
328 | * again. |
|
|
329 | */ |
|
|
330 | if (!f->smooth) |
|
|
331 | { |
|
|
332 | LOG (llevError, "could not findsmooth for %d.\n", face); |
|
|
333 | return; |
|
|
334 | } |
|
|
335 | |
|
|
336 | send_face (f->smooth); |
|
|
337 | |
|
|
338 | packet sl ("smooth"); |
|
|
339 | |
|
|
340 | sl << uint16 (face) |
|
|
341 | << uint16 (f->smooth); |
|
|
342 | |
|
|
343 | send_packet (sl); |
|
|
344 | } |
|
|
345 | |
|
|
346 | /** |
|
|
347 | * Need to send an animation sequence to the client. |
321 | * Need to send an animation sequence to the client. |
348 | * We will send appropriate face commands to the client if we haven't |
322 | * We will send appropriate face commands to the client if we haven't |
349 | * sent them the face yet (this can become quite costly in terms of |
323 | * sent them the face yet (this can become quite costly in terms of |
350 | * how much we are sending - on the other hand, this should only happen |
324 | * how much we are sending - on the other hand, this should only happen |
351 | * when the player logs in and picks stuff up. |
325 | * when the player logs in and picks stuff up. |
… | |
… | |
433 | |
407 | |
434 | sl.printf ("replyinfo image_sums %d %d ", start, stop); |
408 | sl.printf ("replyinfo image_sums %d %d ", start, stop); |
435 | |
409 | |
436 | for (int i = start; i <= stop && i < faces.size (); i++) |
410 | for (int i = start; i <= stop && i < faces.size (); i++) |
437 | { |
411 | { |
438 | ns->faces_sent[i] |= NS_FACESENT_FACE; |
412 | ns->faces_sent[i] = true; |
439 | |
413 | |
440 | const facedata *d = face_data (i, ns->faceset); |
414 | const facedata *d = face_data (i, ns->faceset); |
441 | |
415 | |
442 | if (sl.room () < 2 + 4 + 1 + d->data.size () + 1) |
416 | if (sl.room () < 2 + 4 + 1 + d->data.size () + 1) |
443 | break; |
417 | break; |