ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/image.C
(Generate patch)

Comparing deliantra/server/socket/image.C (file contents):
Revision 1.32 by root, Wed Mar 14 15:44:47 2007 UTC vs.
Revision 1.39 by root, Tue Apr 3 00:21:38 2007 UTC

238 * we look at the facecache, and if set, send the image name. 238 * we look at the facecache, and if set, send the image name.
239 */ 239 */
240void 240void
241client::send_face (faceidx facenum) 241client::send_face (faceidx facenum)
242{ 242{
243 if (!facecache)
244 {
245 send_drawinfo (
246 "*** Please enable face caching or use a client that supports it.\n",
247 NDI_RED
248 );
249 return send_image (facenum);
250 }
251
252 // never send face 0. ever. it does not exist. 243 // never send face 0. ever. it does not exist.
253 if (!facenum) 244 if (!facenum)
254 return; 245 return;
255 246
256 const facedata *d = face_data (facenum, faceset); 247 const facedata *d = face_data (facenum, faceset);
263 254
264 if (faces_sent[facenum]) 255 if (faces_sent[facenum])
265 return; 256 return;
266 257
267 faces_sent[facenum] = true; 258 faces_sent[facenum] = true;
259
260 // if for some reason we let a client without face caching connect,
261 // we better support that decision here and implement it.
262 if (!facecache)
263 return send_image (facenum);
264
265 if (fxix)
266 {
267 fxface.push_back (facenum);
268 return;
269 }
268 270
269 packet sl; 271 packet sl;
270 272
271 if (force_face0) 273 if (force_face0)
272 sl << "face " << uint16 (facenum); 274 sl << "face " << uint16 (facenum);
291 293
292 send_packet (sl); 294 send_packet (sl);
293 } 295 }
294} 296}
295 297
298void 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
296void 326void
297client::send_image (faceidx facenum) 327client::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)
305 if (!d) 335 if (!d)
306 { 336 {
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 }
340
341 faces_sent[facenum] = true;
342
343 if (force_image_newmap)
344 force_newmap = true;
310 345
311 packet sl; 346 packet sl;
312 347
313 sl << (image2 ? "image2 " : "image ") 348 sl << (image2 ? "image2 " : "image ")
314 << uint32 (facenum); 349 << uint32 (facenum);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines